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

Use SET PF_STATUS which is in the FM reuse_alv_grid_display to set the button

1772


Table events aNd table maintains generation

991


What is the difference of update types in call transaction method ? : abap bdc

635


What is the difference between scrolling a table horizontally and vertically?

579


Advantages and disadvantages of different types of bdc's?

577






Hi, I have a requirement for locking the fax field in user master records. As you know user can edit the details using the System>profile>own data (SU3), it is causing some security threat to our model. What i want is users should not be able to change the fax field under communications when they get into su3.I have heard of user Exist functionality but don't know how to implement it. Can you suggest something, it will be greatly appreciated.

1463


What are subroutines? : abap modularization

628


What does an exec sql statement do in abap?

544


How many default tab strips are there? How to insert more tabs in it?

608


What are the names of the function modules that will be generated upon activation of a lock object?

552


What is a sequence of event-triggered in report?

634


What is bdc programming? : abap bdc

579


Can we include customizing include or an append structure with pooled or cluster tables?

670


how can you display data say "your name"in sap script without print program or driver program??

1725


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)

2067