How do you generate Interactive report using ALV's?

Answer Posted / nag

READ TABLE IST_EVENTS INTO WA_EVENT WITH KEY NAME =
'USER_COMMAND'.
*IF SY-SUBRC EQ 0.
*WA_EVENT-FORM = 'USER_COMMAND'.
*MODIFY IST_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE
NAME = WA_EVENT-NAME.
*ENDIF.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = C_PF "'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_GRID_TITLE = G_TITLE
IS_LAYOUT = IST_LAYOUT
IT_FIELDCAT = IST_FIELDCAT[]
IT_SORT = IST_SORT
I_SAVE = 'A'
IT_EVENTS = IST_EVENTS
IS_PRINT = IST_PRNT
IMPORTING
E_EXIT_CAUSED_BY_CALLER = G_EXIT
ES_EXIT_CAUSED_BY_USER = IST_EXIT
TABLES
T_OUTTAB = IST_FINAL "sodtl
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.

FORM USER_COMMAND USING R_UCOMM TYPE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

your code....
ENDFORM.


*for second click

READ TABLE IST_EVENTS INTO WA_EVENT WITH KEY NAME =
'USER_COMMAND1'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'USER_COMMAND1'.
MODIFY IST_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME
= WA_EVENT-NAME.
ENDIF.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = C_PF "'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND1'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_GRID_TITLE = G_TITLE
IS_LAYOUT = IST_LAYOUT
IT_FIELDCAT = IST_FIELDCAT[]
I_SAVE = 'A'
TABLES
T_OUTTAB = IST_FINAL1.

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is its? : abap hr

634


What is roles and responsibilities of sap hr consultants? : sap abap hr

590


If i wont like to change the standard print program where i copied standard script to customer namespace,in this case is it possible to retreive the data if u connect the script with standard program.if yes how?if no why? Is it possible to print the logo in first page only,where the form consists of 10 pages.How can u do this? How can u set a table format where it cosists of fields like cust no, custname, amount ...in a script? How do u know that the particular BADI is suitable for the existed report.How do u findout this?When do u opt for BADI OR USEREXIT?did functional people tell u to adopt BADI or USEREXIT? What is the difference between SY-INDEX & SY-TABIX ? I have a report with fields Status,time & date. the contents it consists are Status Time Date AAA 01:20:15 05-06-10 AAA 11:02:32 O3-06-10 AAA 23:11:00 05-06-10 AAA 09:14:46 05-06-10 HOW DO U WRITE A CODE TO DISLAY A ROW WHICH WAS RECENTLY EXECUTED?( for this question it should display AAA 23:11:00 05-06-10 AS Output)

2074


What are the differences between table and structure in data dictionary?

609


What are the different types of work process?

598






Which function modules can be used to transfer the data using bdc programming? : abap bdc

614


What are the differences between session method and call transaction method? : abap bdc

563


I created a field and entered the field type, when I double clicked the field type to define the domain; it is asking for an ACCESS KEY, I am not changing any SAP defined tables, working on a user defined table.

1359


Explain the concept of clusters in payroll

2136


How to use messages in lists?

613


How do you use tab sets in layout sets?

668


What are the system fields you have worked with? Explain?

677


How can end-of-selection be used?

641


Explain the components of selection table?

648


What are the types of subroutines? : abap modularization

595