2008 Jun 24 11:24 AM
Hi experts,
i am new to abap can any body tell me when we use AT USER-COMMAND and give a sample code for that.
point will be rewarded.
thanks.
2008 Jun 24 11:36 AM
Hi,
AT USER-COMMAND is a list Event.This Event is triggered when user make an action on the Application Toolber Or Menubar.
Here is the 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.
This program uses a status TEST, defined in the Menu Painter.
Function key F5 has the function code TEST and the text Test for demo.
Function code TEST is entered in the List menu.
The function codes PICK and TEST are assigned to pushbuttons.
The user can trigger the AT USER-COMMAND event either by pressing F5 , or by choosing List -> Test for demo, or by choosing the pushbutton 'Test for demo'.The user can trigger the AT LINE-SELECTION event by selecting a line.
Hopr This Will help You.
Regards,
Sujit
Hi experts,
i am new to abap can any body tell me when we use AT USER-COMMAND and give a sample code for that.
point will be rewarded.
thanks.
2008 Jun 24 11:25 AM
hi,
type "at user-command" in abap editor and press F1. u'll get the help file. it will give u better insights.
regards,
madhu
2008 Jun 24 11:36 AM
Hi,
AT USER-COMMAND is a list Event.This Event is triggered when user make an action on the Application Toolber Or Menubar.
Here is the 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.
This program uses a status TEST, defined in the Menu Painter.
Function key F5 has the function code TEST and the text Test for demo.
Function code TEST is entered in the List menu.
The function codes PICK and TEST are assigned to pushbuttons.
The user can trigger the AT USER-COMMAND event either by pressing F5 , or by choosing List -> Test for demo, or by choosing the pushbutton 'Test for demo'.The user can trigger the AT LINE-SELECTION event by selecting a line.
Hopr This Will help You.
Regards,
Sujit
2008 Jun 24 11:45 AM
Hi Bala,
At User-Command, is list event. When ever user performs some action on the list, i.e, presses a button, double clicks on a line on the list, we can specify what should be the resulting output.
At User-Command is written under AT Line-Selection event.
Hope this Helps you.
Any queries, get back to me.
Award points if helpful.
Regards,
Chandra Sekhar
2008 Jun 24 12:15 PM
hi
WE use AT USER-COMMAND while dealing with the interactive lists. You first have to set a PF-STATUS in ur code.
AT USER-COMMAND only works with Push Buttons Defined In PF-STATUS.
data:
val type i value 10.
start-of-selection.
set pf-status 'MAIN'.
AT USER-COMMAND.
case sy-ucomm.
when 'READ'.
write:/ 'The Value is ', i.
endcase.READ is the Function code of a button defined in PF-STATUS MAIN.
reward points if useful.
Sumit Agarwal
2008 Jun 24 12:15 PM
Hi Buddy,
At-user command is used to catch the users input on the screen.
i.e. if at the screen user have some list output and he wants that after hitting double click or enter at any one record he should get the 2ndry information about that record then he define the concerned logic to display the secondry information in the event at-user command.
suppose u have written a program to display HR related information for a class of students using lists and u want that when u double click on any one record u should get the details about the students academic qualification; you have to code everything for the 2ndry information under at user command event.
basically this event is used to code interactive reports.
also u have got ample amount of study material in previous replies.
hope this serves your problem.
2008 Jun 24 12:22 PM
Hello,
pls chk this.
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba34635c111d1829f0000e829fbfe/content.htm
Thanks,
Keerthi.