Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to save a result, shown in an editable-ALV, for future use?

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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.

0 Kudos

Hi,

thanks, but that was not what I was looking for. I now how to get the "fixed" result from the screen back to the program. To clarify, I don't use 'REUSE_ALV_GRID_DISPLAY', but call a screen with custom container where in its PBO I instanciated a class "cl_gui_alv_grid" and pass to its inscance result-set from the database using method:

CALL METHOD grid->set_table_for_first_display.

After that I handled user-response using localy defined event-handler.

I have been told there is a way to save the "fixed" internal table in some kind of version within SAP environment, but not at presentation server. Further the user is allowed to retrieve result from standard selection or from previously saved "version". That's what I'm looking for.

Thanks again.

Regards,

Ivaylo

Message was edited by: Ivaylo Mutafchiev

former_member181962
Active Contributor
0 Kudos

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

0 Kudos

Hi,

I think i I mentioned that the customer needs to "fix" the result (shown for example in an ALV) and just after that to save it. So next time he start the program with the same paramethers at selection screen he will obtain "non-fixed" result and will need to fix it again.

Regards,

Ivaylo