0% found this document useful (0 votes)
23 views3 pages

Alv 7

The document outlines standard transaction codes for displaying vendor, customer, material details, purchase orders, sales orders, and accounting documents in a system. It provides syntax for calling transaction codes and setting parameter IDs, along with a sample report that displays purchase document numbers, document dates, and vendor numbers using ALV. Additionally, it describes the process for handling user commands to display details through specific transactions based on user interaction.

Uploaded by

kuderu harshitha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views3 pages

Alv 7

The document outlines standard transaction codes for displaying vendor, customer, material details, purchase orders, sales orders, and accounting documents in a system. It provides syntax for calling transaction codes and setting parameter IDs, along with a sample report that displays purchase document numbers, document dates, and vendor numbers using ALV. Additionally, it describes the process for handling user commands to display details through specific transactions based on user interaction.

Uploaded by

kuderu harshitha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Some of the standard transaction codes:

1.XK03------>Display vendor
2.XD03------>Display customer
3.MM03----->Display material details
4.ME23N---->Display purchase order
5.VA03------>Display sales order
6.FB03------>Display accounting document

Note : 1--->create,2--->change,3--->display

Syntax of call the transaction code

CALL TRANSACTION '<TCODE>'.

Ex:
Call tranaction 'XK03'.

Note : Before calling the transaction we must set the value

Syntax of set the value:

SET PARAMETER ID '<ID NAME>' FIELD '<VALUE>'.

Steps to identify the parameter id


 Execute the transaction code (ex : XK03)
 Place the cursor on input field
 click on F1
 Click on technical information
 Identify the parameter id ( LIF)

Ex :
PARAMETER P_LIFNR TYPE LFA1-LIFNR.
SET PARAMETER ID 'LIF' FIELD P_LIFNR.
CALL TRANSACTION 'XK03'.

Object : Based on the given pur.doc numbers to display the pur.doc numbers,document dates and vendor
numbers by using alv. If the user click on any pur.doc number only to display pur.doc details through
ME23N transaction, if the user click on any vendor to display vendor details through XK03 transaction.

REPORT ZSPRAO_O_ALV7.

TYPE-POOLS SLIS.
TABLES EKKO.
SELECT-OPTIONS S_EBELN FOR EKKO-EBELN.
*Declare the data internal table
TYPES : BEGIN OF TY_EKKO,
EBELN TYPE EKKO-EBELN,
BEDAT TYPE EKKO-BEDAT,
LIFNR TYPE EKKO-LIFNR,
END OF TY_EKKO.
DATA IT_EKKO TYPE TABLE OF TY_EKKO.

*Declare the fieldcatalog


DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT.

*Declare the event internal table


DATA : IT_EVENT TYPE SLIS_T_EVENT,
WA_EVENT LIKE LINE OF IT_EVENT.

DATA V1 TYPE EKKO-EBELN.

AT SELECTION-SCREEN.
SELECT SINGLE EBELN FROM EKKO INTO V1 WHERE EBELN IN S_EBELN.
IF SY-SUBRC <> 0.
MESSAGE E000(ZSP_7PM_MSG1) WITH 'INVALID PUR.DOC'.
ENDIF.

START-OF-SELECTION.
*Filling the data internal table
SELECT EBELN BEDAT LIFNR FROM EKKO INTO TABLE IT_EKKO
WHERE EBELN IN S_EBELN.

*Filling the fieldcatalog


WA_FCAT-FIELDNAME = 'EBELN'.
WA_FCAT-COL_POS = '1'.
WA_FCAT-SELTEXT_M = 'Pur.doc'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.

WA_FCAT-FIELDNAME = 'BEDAT'.
WA_FCAT-COL_POS = '2'.
*WA_FCAT-SELTEXT_M = 'Doc.date'.
WA_FCAT-REF_FIELDNAME = 'BEDAT'.
WA_FCAT-REF_TABNAME = 'EKKO'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.

WA_FCAT-FIELDNAME = 'LIFNR'.
WA_FCAT-COL_POS = '3'.
WA_FCAT-SELTEXT_M = 'Vendor'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.

*Filling the event internal table


WA_EVENT-NAME = 'USER_COMMAND'.
WA_EVENT-FORM = 'UC'.
*PERFORM UC USING SY-UCOMM SLIS_SELFIELD
APPEND WA_EVENT TO IT_EVENT.
*Display the output
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZSPRAO_O_ALV7'
IT_FIELDCAT = IT_FCAT
IT_EVENTS = IT_EVENT
TABLES
T_OUTTAB = IT_EKKO.

FORM UC USING A LIKE SY-UCOMM B TYPE SLIS_SELFIELD.

IF B-FIELDNAME = 'EBELN'.

SET PARAMETER ID 'BES' FIELD B-VALUE.


CALL TRANSACTION 'ME23N'.

ELSEIF B-FIELDNAME = 'LIFNR'.

SET PARAMETER ID 'LIF' FIELD B-VALUE.


CALL TRANSACTION 'XK03' AND SKIP FIRST SCREEN.

ENDIF.
ENDFORM.

Differences between Grid and List display

You might also like