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

Enable 'SAVE' button while using 'REUSE_ALV_GRID_DISPLAY'

Former Member
0 Likes
4,457

Hi,

I have an ALV Grid Display using the FM 'REUSE_ALV_GRID_DISPLAY'. How can I enable the 'SAVE' button? I am using a report program for the grid.

Renjith.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,809

Hi,

You need to do this:

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = W_REPID

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

I_BACKGROUND_ID = 'ALV_BACKGROUND'

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

IS_LAYOUT = W_LAYOUT

IT_FIELDCAT = W_FIELDCATALOG[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

<b> I_SAVE = 'U' /'A'</b>

  • IS_VARIANT =

IT_EVENTS = W_EVENTS[]

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

you can use these two options.

For saving the data you need to write this code:

&----


*& Form USER_COMMAND

&----


  • text

----


FORM USER_COMMAND using OK_CODE type SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

CASE OK_CODE.

WHEN '&DATA_SAVE'.

Code for saving................

ENDCASE.

ENDFORM. "USER_COMMAND

You need to create a PF-STATUS where you need give DATA_SAVE' as the function code for SAVE button.

Regards,

Vinod.

3 REPLIES 3
Read only

Former Member
0 Likes
1,810

Hi,

You need to do this:

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = W_REPID

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

I_BACKGROUND_ID = 'ALV_BACKGROUND'

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

IS_LAYOUT = W_LAYOUT

IT_FIELDCAT = W_FIELDCATALOG[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

<b> I_SAVE = 'U' /'A'</b>

  • IS_VARIANT =

IT_EVENTS = W_EVENTS[]

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

you can use these two options.

For saving the data you need to write this code:

&----


*& Form USER_COMMAND

&----


  • text

----


FORM USER_COMMAND using OK_CODE type SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

CASE OK_CODE.

WHEN '&DATA_SAVE'.

Code for saving................

ENDCASE.

ENDFORM. "USER_COMMAND

You need to create a PF-STATUS where you need give DATA_SAVE' as the function code for SAVE button.

Regards,

Vinod.

Read only

Former Member
0 Likes
1,809

Hi

The SAVE button is not active by default in GRID status, you should create an own status.

But if you mean the button to save a layout variant, you have to set the parameter <b>I_SAVE</b>:

SPACE = Display variants cannot be saved

Defined display variants (such as delivered display variants) can be selected for presentation regardless of this indicator. However, changes cannot be saved.

'X' = Standard save mode

Display variants can be saved as standard display variants.

Saving display variants as user-specific is not possible.

'U' = User-specific save mode

Display variants can only be saved as user-specific.

'A' = Standard and user-specific save mode

Read only

Former Member