Application Development and Automation 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: 
Read only

How to enable the Save button in ALV_GRID_DISPLAY function module

Former Member
0 Likes
7,166

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

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

12 REPLIES 12
Read only

Former Member
0 Likes
4,761

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

Read only

Former Member
0 Likes
4,761

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

Read only

0 Likes
4,761

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 

Read only

0 Likes
4,762

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

    

Read only

Former Member
0 Likes
4,762

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!

Read only

0 Likes
4,762

Hi michale,

         i have tried same code which you replied , screen is selection screen not a custom screen ,

Thanks

siva

Read only

0 Likes
4,762

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.

Read only

former_member202818
Active Contributor
0 Likes
4,762

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

Read only

Former Member
0 Likes
4,762

Hi ,

Make Any Column Editable And

i_save                  = 'X'.

Read only

VenkatRamesh_V
Active Contributor
0 Likes
4,762

Hi Siva,

hope it may be helpfull.

Program Name: SAPLSLVC_FULLSCREEN

Status:             STANDARD_FULLSCREEN

Make the copy to z  in SE 41



Regards,

Venkat

Read only

Former Member
0 Likes
4,762

Hi Siva,

     You want To Save Lay out ? or You want to Perform Some Specific Action Using Save Button in      Report?

Read only

SwadhinGhatuary
Active Contributor
0 Likes
4,762

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