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

AT USER COMMAND event in interactive reports

Former Member
0 Likes
3,256

hi experts,

Can anyone explain me about AT USER COMMAND event with one practical ex.

thanks in advance

R.vijai

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,195

Hi Vijay,

lets suppose,

internal table itab contain some data.

LOOP AT ITAB.

write: itab.

Hide itab-field1.

ENDLOOP.

the above loop display basic list.

after

AT USER-COMMAND.

slect the infromation based on the hide field in above loop.

and display it.

this is the secondary list.

regards.

sunil

3 REPLIES 3
Read only

Former Member
0 Likes
1,196

Hi Vijay,

lets suppose,

internal table itab contain some data.

LOOP AT ITAB.

write: itab.

Hide itab-field1.

ENDLOOP.

the above loop display basic list.

after

AT USER-COMMAND.

slect the infromation based on the hide field in above loop.

and display it.

this is the secondary list.

regards.

sunil

Read only

0 Likes
1,195

hi,

look in abap-docu too.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'SAVE'.

perform save_data.

WHEN 'DELE'.

perfrom delete_data...

...

ENDCASE.

A.

Message was edited by:

Andreas Mann

Read only

Former Member
0 Likes
1,195

Hi vijaya kumar,

If the user chooses a function code during list processing that is neither processed by the system, or PICK or PF<nn>, the system triggers the event AT USER-COMMAND. For this event, you must define your own GUI status for a list. To react to your own function codes in a program, you must define the following event block:

AT USER-COMMAND.

<statements>.

In this event block, you can use an IF or CASE structure to tell the function codes apart. They are available in the system field SY-UCOMM. There are further system fields that are filled in list events, such as SY-LSIND and SY-PFKEY, that allow you to make further case distinctions.

REPORT Test_program.

START-OF-SELECTION.

SET PF-STATUS 'TEST'.

WRITE: 'Basic list, SY-LSIND =', sy-lsind.

AT LINE-SELECTION.

WRITE: 'LINE-SELECTION, SY-LSIND =', sy-lsind.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'TEST'.

WRITE: 'TEST, SY-LSIND =', sy-lsind.

ENDCASE.

With this code double click on 'TEST' and define your own PF status and give user command as TEST and check out this useful programe.

All the very best to you.

Regards,

Mohan Vamsi Krishna.A