Hi,
I'm facing a chalenge with a customer who wants to get a result set from selection shown, to modify some fields of the result, and to be able to save the "corrected" result for future visualisation.
Is it possible at all? What I imagine was to give him a possibility to manipulate the result in an editable ALV grid, but I have no idea is it possible to save the result for future usage, and, if yes, how could he catch this "saved" result next time he need it?
Any ideas in this direction would be highly appreciated - and even more in case of any little snip of sample-code provided 😉
Many thanks in advance.
Regards,
Ivaylo Mutafchiev
SAP BC/ABAP Consultant
VBS - Varna
BG
Hi,
It possible. Make the field as editable and do the changes and u can update. 'FORM USER_COMMAND ' is a dynamic form
Check the highlighted code
----
C O N S T A N T S *
----
CONSTANTS : C_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND',
&----
*& Form DISPLAY_ALV
&----
ALV grid display
----
FORM DISPLAY_ALV .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IT_EVENTS = IT_EVENT1
<b> I_CALLBACK_USER_COMMAND = C_USER_COMMAND</b>
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM. " DISPLAY_ALV
&----
*& Form user_command
&----
EXIT routine for user_command
----
-->R_UCOMM Checks for sy-ucomm for &IC1
-->RS_SELFIELD structure to store selected row
----
<b>FORM USER_COMMAND USING IV_UCOMM TYPE SY-UCOMM
IV_SELFIELD TYPE SLIS_SELFIELD. "#EC CALLED</b>
DATA REF1 TYPE REF TO CL_GUI_ALV_GRID.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF1.
CALL METHOD REF1->CHECK_CHANGED_DATA.
CASE IV_UCOMM.
WHEN '&DATA_SAVE'.
WHEN OTHERS.
ENDCASE.
ENDFORM. "user_command
Thank you,
Ramu N.
Hi,
As long as he gives the same inputs in the selection screen he would get the same results(Unless the data base data gets changed through some other transaction).
May be he wants a local copy of the report output(Something like export to excel or text file ) which is already available as an option in the alv reports.
Regards,
Ravi
Add a comment