<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: At user command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645466#M877895</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;One of the events of Interactive report is At user-command &lt;/P&gt;&lt;P&gt;We can add the push buttons will be added on the application toolbar and we can use menu items by using this user-command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET PF-STATUS 'ZSAMPLE'. " give the pf-status name &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;   hide itab-fieldname.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at user-command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case sy-ucomm.&lt;/P&gt;&lt;P&gt;    when  &amp;#145;EXIT'.&lt;/P&gt;&lt;P&gt;        leave program.&lt;/P&gt;&lt;P&gt;   when 'SELECT'.&lt;/P&gt;&lt;P&gt;        select * from mara into jtab where fname = itab-fname.&lt;/P&gt;&lt;P&gt;Endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This sample code deals with when we click EXIT button  it will exit from the program and when we click select button it will select the data from the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Apr 2008 12:18:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-04T12:18:10Z</dc:date>
    <item>
      <title>At user command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645460#M877889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Where do we use At user command event,what is the role of this command&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 11:49:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645460#M877889</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T11:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: At user command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645461#M877890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The events START-OF-SELECTION, GET, END-OF-SELECTION, TOP-OF-PAGE and END-OF-PAGE&lt;/P&gt;&lt;P&gt;can be used only to create basic lists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create detail lists, use the events AT LINE-SELECTION and AT USER-COMMAND.&lt;/P&gt;&lt;P&gt;Use TOP-OF-PAGE DURING LINE-SELECTION for page headers on detail lists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each detail list event exists only once in the program and is shared by all detail lists. You must therefore&lt;/P&gt;&lt;P&gt;ensure yourself, within the processing block, that the correct list is created. To do this, use a CASE&lt;/P&gt;&lt;P&gt;structure that uses the system field sy-lsind. This system field contains the list index of the list that you&lt;/P&gt;&lt;P&gt;are currently generating.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the user selects a line on an interactive list, all of the global data fields whose values you stored&lt;/P&gt;&lt;P&gt;using the HIDE statement while you were creating the basic list are filled with those values.&lt;/P&gt;&lt;P&gt;The line selection is based on the cursor position when the AT LINE-SELECTION and AT USERCOMMAND&lt;/P&gt;&lt;P&gt;events occur. (system field sy-lilli).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you choose a line using the READ LINE... statement, . the values are placed back in the original fields&lt;/P&gt;&lt;P&gt;according to the line numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

AT USER-COMMAND.

CASE sy-ucomm.
WHEN 'FLGHT'.
SET TITLEBAR 'T_FLGHT'
WITH wa_spfli-carrid.
SET PF-STATUS 'S_FLGHT'.
...
WHEN 'BOOK'.
SET PF-STATUS 'S_BOOK' EXCLUDING 'BOOK'.
SET TITLEBAR 'T_BOOK'.
WITH wa_sflight-carrid wa_sflight-fldate.
...
ENDCASE.
...


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You program AT USER-COMMAND as an interactive event and evaluate the system field sy-ucomm in a&lt;/P&gt;&lt;P&gt;CASE control structure. This field contains the current function code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this helps, Do reward.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Runal Singh on Apr 4, 2008 5:23 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 11:51:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645461#M877890</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T11:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: At user command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645462#M877891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba3ae35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba3ae35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brown.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 11:51:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645462#M877891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T11:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: At user command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645463#M877892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the link below. It gives you detailed description.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba34635c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba34635c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_list_menu_painter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET PF-STATUS 'TEST'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 'Basic list, SY-LSIND =', sy-lsind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LINE-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 'LINE-SELECTION, SY-LSIND =', sy-lsind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT USER-COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE sy-ucomm.&lt;/P&gt;&lt;P&gt;WHEN 'TEST'.&lt;/P&gt;&lt;P&gt;WRITE: 'TEST, SY-LSIND =', sy-lsind.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This program uses a status TEST, defined in the Menu Painter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function key F5 has the function code TEST and the text Test for demo. &lt;/P&gt;&lt;P&gt;Function code TEST is entered in the List menu. &lt;/P&gt;&lt;P&gt;The function codes PICK and TEST are assigned to pushbuttons.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 11:52:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645463#M877892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T11:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: At user command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645464#M877893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;At user-command is used when user wants to use any buttons,&lt;/P&gt;&lt;P&gt;means any menu painter options or applications toolbar options&lt;/P&gt;&lt;P&gt;Just have on look on example bellow.&lt;/P&gt;&lt;P&gt;In a Simple way to at the time of interactive reports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set pf-status &amp;#145;asd&amp;#146;.&lt;/P&gt;&lt;P&gt;Write: &amp;#145;testing data with application toolbar components&amp;#146;.&lt;/P&gt;&lt;P&gt;At user-command.&lt;/P&gt;&lt;P&gt;Case sy-ucomm.&lt;/P&gt;&lt;P&gt;When &amp;#145;close&amp;#146; or &amp;#145;atc2&amp;#146;.&lt;/P&gt;&lt;P&gt;Leave program.&lt;/P&gt;&lt;P&gt;When &amp;#145;atc1&amp;#146;.&lt;/P&gt;&lt;P&gt;Write: &amp;#145;action is on application toolbar and we are in&amp;#146;,sy-lsind,&amp;#146;index report&amp;#146;.&lt;/P&gt;&lt;P&gt;Endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward,if useful.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chandu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 11:54:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645464#M877893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T11:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: At user command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645465#M877894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When a user chooses a function from a list, it triggers that function's function code. This function code, in&lt;/P&gt;&lt;P&gt;turn, triggers a corresponding event.&lt;/P&gt;&lt;P&gt;The system function codes are reserved and do not trigger an interactive event block. The system does&lt;/P&gt;&lt;P&gt;not go to the program, but instead executes a corresponding system function.&lt;/P&gt;&lt;P&gt;All function codes with the exception of "PICK" as well as all codes reserved for system use trigger the&lt;/P&gt;&lt;P&gt;event AT USER-COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You program AT USER-COMMAND as an interactive event and evaluate the system field sy-ucomm in a&lt;/P&gt;&lt;P&gt;CASE control structure. This field contains the current function code.&lt;/P&gt;&lt;P&gt;Data is restored from the hide area to the corresponding global data fields for the line on which the&lt;/P&gt;&lt;P&gt;cursor was positioned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

example code

END-OF-SELECTION.
SET PF-STATUS 'S_BASE'.
SET TITLEBAR 'T_BASE'.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'FLGHT'.
SET TITLEBAR 'T_FLGHT'
WITH wa_spfli-carrid.
SET PF-STATUS 'S_FLGHT'.
...
WHEN 'BOOK'.
SET PF-STATUS 'S_BOOK' EXCLUDING 'BOOK'.
SET TITLEBAR 'T_BOOK'.
WITH wa_sflight-carrid wa_sflight-fldate.
...
ENDCASE.
...


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User chooses a function&lt;/P&gt;&lt;P&gt;that you defined in the&lt;/P&gt;&lt;P&gt;program&lt;/P&gt;&lt;P&gt;(for example, by choosing&lt;/P&gt;&lt;P&gt;menu entry or pushbutton)&lt;/P&gt;&lt;P&gt;- F code sy-ucomm&lt;/P&gt;&lt;P&gt;- Hide data restored&lt;/P&gt;&lt;P&gt;- AT USER-COMMAND event&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also follow the link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://interviewhelper.blogspot.com/2008/02/sap-r3-interactive-reporting.html" target="test_blank"&gt;http://interviewhelper.blogspot.com/2008/02/sap-r3-interactive-reporting.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do reward if helpful&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: sharad narayan on Apr 4, 2008 1:56 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 11:56:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645465#M877894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T11:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: At user command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645466#M877895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;One of the events of Interactive report is At user-command &lt;/P&gt;&lt;P&gt;We can add the push buttons will be added on the application toolbar and we can use menu items by using this user-command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET PF-STATUS 'ZSAMPLE'. " give the pf-status name &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;   hide itab-fieldname.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at user-command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case sy-ucomm.&lt;/P&gt;&lt;P&gt;    when  &amp;#145;EXIT'.&lt;/P&gt;&lt;P&gt;        leave program.&lt;/P&gt;&lt;P&gt;   when 'SELECT'.&lt;/P&gt;&lt;P&gt;        select * from mara into jtab where fname = itab-fname.&lt;/P&gt;&lt;P&gt;Endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This sample code deals with when we click EXIT button  it will exit from the program and when we click select button it will select the data from the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 12:18:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645466#M877895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T12:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: At user command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645467#M877896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi there..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Executing User Commands (AT USER-COMMAND AND AT LINE-SELECTION) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT USER-COMMAND event is used in interactive reporting. The code between the AT USER-COMMAND and the ENDAT command is executed when the user enters data into the OK code field(the upper-left entry field on the screen where you enter transactions). The data entered into the OK code field is stored in the system field SY-UCOMM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT USER-COMMAND. &lt;/P&gt;&lt;P&gt;  CASE SY-UCOMM. &lt;/P&gt;&lt;P&gt;    WHEN 'DETAIL'. &lt;/P&gt;&lt;P&gt;        SELECT * FROM BSEG WHERE BELNR = BKPF-BELNR. &lt;/P&gt;&lt;P&gt;..... &lt;/P&gt;&lt;P&gt;ENDCASE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The AT LINE-SELECTION comand defines the code thats executed after a user double-clicks a line or presses the F2 function key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LINE-SELECTION. &lt;/P&gt;&lt;P&gt;SELECT * FROM BSEG WHERE GJAHR = BKPF-GJAHR. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do reward if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 12:21:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645467#M877896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T12:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: At user command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645468#M877897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;at user command is the event in interactive report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          whenever the user perform the action on header area or menu area  this event is triggered...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Apr 2008 08:28:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645468#M877897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-06T08:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: At user command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645469#M877898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At user-command is the event used for secondary list.&lt;/P&gt;&lt;P&gt;If some action for example button click is performed on the secondary list,&lt;/P&gt;&lt;P&gt;the controls come to the at user-command in the prog.&lt;/P&gt;&lt;P&gt;So the code which to be executed for that coresponding action is written&lt;/P&gt;&lt;P&gt;inside the at user-command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: bhavana gurajada on Apr 6, 2008 12:45 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Apr 2008 10:45:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645469#M877898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-06T10:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: At user command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645470#M877899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naresh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example for AT USER-COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_list_at_user_command NO STANDARD PAGE HEADING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  WRITE: 'Basic List',&lt;/P&gt;&lt;P&gt;       / 'SY-LSIND:', sy-lsind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOP-OF-PAGE.&lt;/P&gt;&lt;P&gt;  WRITE 'Top-of-Page'.&lt;/P&gt;&lt;P&gt;  ULINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOP-OF-PAGE DURING LINE-SELECTION.&lt;/P&gt;&lt;P&gt;  CASE sy-pfkey.&lt;/P&gt;&lt;P&gt;    WHEN 'TEST'.&lt;/P&gt;&lt;P&gt;      WRITE 'Self-defined GUI for Function Codes'.&lt;/P&gt;&lt;P&gt;      ULINE.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LINE-SELECTION.&lt;/P&gt;&lt;P&gt;  SET PF-STATUS 'TEST' EXCLUDING 'PICK'.&lt;/P&gt;&lt;P&gt;  PERFORM out.&lt;/P&gt;&lt;P&gt;  sy-lsind = sy-lsind - 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT USER-COMMAND.&lt;/P&gt;&lt;P&gt;  CASE sy-ucomm.&lt;/P&gt;&lt;P&gt;    WHEN 'FC1'.&lt;/P&gt;&lt;P&gt;      PERFORM out.&lt;/P&gt;&lt;P&gt;      WRITE / 'Button FUN 1 was pressed'.&lt;/P&gt;&lt;P&gt;    WHEN 'FC2'.&lt;/P&gt;&lt;P&gt;      PERFORM out.&lt;/P&gt;&lt;P&gt;      WRITE / 'Button FUN 2 was pressed'.&lt;/P&gt;&lt;P&gt;    WHEN 'FC3'.&lt;/P&gt;&lt;P&gt;      PERFORM out.&lt;/P&gt;&lt;P&gt;      WRITE / 'Button FUN 3 was pressed'.&lt;/P&gt;&lt;P&gt;    WHEN 'FC4'.&lt;/P&gt;&lt;P&gt;      PERFORM out.&lt;/P&gt;&lt;P&gt;      WRITE / 'Button FUN 4 was pressed'.&lt;/P&gt;&lt;P&gt;    WHEN 'FC5'.&lt;/P&gt;&lt;P&gt;      PERFORM out.&lt;/P&gt;&lt;P&gt;      WRITE / 'Button FUN 5 was pressed'.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;  sy-lsind = sy-lsind - 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM out.&lt;/P&gt;&lt;P&gt;  WRITE: 'Secondary List',&lt;/P&gt;&lt;P&gt;       / 'SY-LSIND:', sy-lsind,&lt;/P&gt;&lt;P&gt;       / 'SY-PFKEY:', sy-pfkey.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you run the program, the system displays the following basic list with a the page header defined in the program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can trigger the AT LINE-SELECTION event by double-clicking a line. The system sets the status TEST and deactivates the function code PICK. The status TEST contains function codes FC1 to FC5. These are assigned to pushbuttons in the application toolbar. The page header of the detail list depends on the status. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, double-clicking a line no longer triggers an event. However, there is now an application toolbar containing five user-defined pushbuttons. You can use these to trigger the AT USER-COMMAND event. The CASE statement contains a different reaction for each pushbutton. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each interactive event, the system decreases the SY-LSIND system field by one, thus canceling out the automatic increase. All detail lists now have the same level as the basic list and thus overwrite it. While the detail list is being created, SY-LSIND still has the value 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phani,&lt;/P&gt;&lt;P&gt;Points If Helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 10:22:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-user-command/m-p/3645470#M877899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-07T10:22:04Z</dc:date>
    </item>
  </channel>
</rss>

