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: 

ALV standard user command, add code

Former Member
0 Kudos

Dear All,

I need to add some extra functionality into standard user commands of the ALV Dispaly.

For eg. if I need to give a confirmation message popup before downloading the data into an excel file using the standard fuction, and after download wish to update a database table.

Can this be done? If yes, How?

Regards

Vijai

1 ACCEPTED SOLUTION

former_member225631
Active Contributor
0 Kudos

You can use following function module

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = 'SAVE'

TEXT_QUESTION = 'You want to Update ? '

TEXT_BUTTON_1 = 'Yes'

TEXT_BUTTON_2 = 'No'

DEFAULT_BUTTON = '2'

DISPLAY_CANCEL_BUTTON = ' '

IMPORTING

ANSWER = answer.

4 REPLIES 4

former_member225631
Active Contributor
0 Kudos

You can use following function module

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = 'SAVE'

TEXT_QUESTION = 'You want to Update ? '

TEXT_BUTTON_1 = 'Yes'

TEXT_BUTTON_2 = 'No'

DEFAULT_BUTTON = '2'

DISPLAY_CANCEL_BUTTON = ' '

IMPORTING

ANSWER = answer.

0 Kudos

Thanks Balaji for the answer.

My question is a little different. If I need to do this under a standard user command which also has its own standard functionality. then where to add my code.

Regards

Vijai

Former Member
0 Kudos

copy the standard GUI- STATUS to zguistatus

write form as below

FORM zguistatus USING p_extab TYPE slis_t_extab.

SET PF-STATUS 'zguistatus'.

ENDFORM.

call zguistatus to ALV FM as below

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = g_repid

i_callback_pf_status_set = 'ZGUISTATUS'

i_callback_user_command = 'USER_COMMAND'

i_callback_top_of_page = 'TOP_PAGE'

is_layout = gs_layout

it_fieldcat = gt_fieldcat[]

it_events = gt_events[]

TABLES

t_outtab = final_tab[]

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

in user command form as below handle SY-UCOMM for download

FORM user_command USING pv_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE sy-ucomm.

WHEN 'DOWNLOAD'.

since ur req is diff

add a diff icon to the gui status

and when that icon is clicked

call GUI_DOWNLOAD.

and then UODATE TABLE Logic

tc

saji

.

0 Kudos

Hi

Solved myself. Created my own code for standard user command.

Regards

Vijai