2014 Aug 13 1:32 PM
Dear experts,
I Created a ALV report by using ALV_GRID_DISPLAY functional module ,i need to enable the SAVE button ,my reqirement is to trigger some event in save button, then if i created own PF status existing icon are hidden, mention in below screen shot.
suggest me
Thanks
sivashankar k
2014 Aug 13 1:36 PM
Hello Siva,
Copy any pf status from any report using se41 the activate it and use it in Programe,BDY can you post the code?
Thanks
SAm
2014 Aug 13 1:40 PM
Hi,
Using a custom status is not required.
Instead, mention a subroutine for import parameter in the function call to 'REUSE_ALV_GRID_DISPLAY'.
Import parameter is:
I_CALLBACK_USER_COMMAND = 'USR_CMD'.
Write the subroutine in your program.
In the mentioned subroutine check the SY-UCOMM for the function code of SAVE button and under it write the required custom logic.
FORM USR_CMD.
CASE SY-UCOMM.
WHEN 'function code for SAVE button'
"custom logic
ENDCASE.
ENDFORM.
To find the function code at SAVE button, put a break point in this subroutine, then run the program and click on the save button.
When the debugger opens check the value of field SY-UCOMM.
Regards,
Ashish
2014 Aug 13 2:09 PM
Hi ashish,
i have tried your suggestion but its not working, could you please explain me brefily with some example code of this function module
2014 Aug 14 5:37 AM
Hi,
In the program, ALV must be getting called using function module 'REUSE_ALV_GRID_DISPLAY'.
So,
When this function module is called it has some importing and exporting parameters like this :
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM REPID
I_CALLBACK_USER_COMMAND = 'USR_CMD' "add this exporting parameter
TABLES
T_OUTTAB = ITAB.
Then in the program add a FORM - ENDFORM subroutine with the same name as provided in exporting parameter.
FORM USR_CMD.
CASE SY-UCOMM.
WHEN 'function code for save button'
"custom logic
ENDCASE.
ENDFORM.
Regards,
Ashish
2014 Aug 13 2:22 PM
Hello,
In Process After Input module of the screen with ALV code something like this:
DATA ok_code TYPE sy-ucomm.
ok_code = sy-ucomm.
CASE ok_code.
WHEN 'E'. " back button
" Do something
WHEN 'ENDE' OR 'ECAN'. " end or cancel
" Do something else
WHEN 'SPOS'. " SAVE button
" Implement your desired functionality
ENDCASE.
Cheers!
2014 Aug 13 2:40 PM
Hi michale,
i have tried same code which you replied , screen is selection screen not a custom screen ,
Thanks
siva
2014 Aug 13 2:49 PM
Ok, this shouldn't be a problem.
Just put the code in AT SELECTION-SCREEN event.
It should look like that:
DATA ok_code TYPE sy-ucomm.
AT SELECTION-SCREEN.
ok_code = sy-ucomm.
CASE ok_code.
WHEN 'SPOS'. " SAVE button
" Implement your desired functionality
ENDCASE.
2014 Aug 14 5:42 AM
Hi sivashankar,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
............
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'MENU'.
ENDFORM.
""Handle use action
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'SAVE'.
..........
ENDCASE.
ENDFORM.
PF STATUS : MENU (copied STANDARD(gui status) from SAPLKKBL, do changes as per requirement)
Regards
Sreekanth
2014 Aug 14 5:48 AM
2014 Aug 14 5:55 AM
Hi Siva,
hope it may be helpfull.
Program Name: SAPLSLVC_FULLSCREEN
Status: STANDARD_FULLSCREEN
Make the copy to z in SE 41
Regards,
Venkat
2014 Aug 14 6:10 AM
Hi Siva,
You want To Save Lay out ? or You want to Perform Some Specific Action Using Save Button in Report?
2014 Aug 14 6:21 AM
hi,
First of all u create u own pf status and assign in alv report and on click save &DATA_SAVE ok code generated as standard and use user command and check ucomm eq 'save' or &DATA_SAVE do as ur custom Task.And u can take help from alv change and save programs,
ALV with edit and save functionality - Code Gallery - SCN Wiki