‎2007 Jan 29 10:26 AM
hi experts,
Can anyone explain me about AT USER COMMAND event with one practical ex.
thanks in advance
R.vijai
‎2007 Jan 29 10:33 AM
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
‎2007 Jan 29 10:33 AM
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
‎2007 Jan 29 10:38 AM
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
‎2007 Jan 29 11:40 AM
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