At user-command & At Line-selection

Hi,
I am using ECC5 ver. of ABAP.
Can I use AT USER-COMMAND and AT LINE-SELECTION
in the same report?
I have used it but only At user command works, not At line selection.
When I remove Set pf-Status, At line selection works.
Here is my code.
REPORT PF&ATLINE.
AT LINE-SELECTION.
  MESSAGE 'Line Selected' TYPE 'I'.
AT USER-COMMAND.
  IF sy-ucomm = 'PUSH'.
    MESSAGE 'Button Pushed' type 'I'.
  elseif sy-ucomm = 'EXIT'.
    LEAVE PROGRAM.
  ENDIF.
START-OF-SELECTION.
  SET PF-STATUS 'ZRND3'.
  DO 10 TIMES.
    WRITE:/01 SY-INDEX HOTSPOT.
  ENDDO.
END-OF-SELECTION.

Hi Rajiv,
Setting the PICK function code to F2 will definitely solve it..
and it triggers the at user-command and at line-selection event as per user interaction...
If it is not working properly... then there might me something wrong in your code...
can you place the code... so that we can know the exact problem
regards
padma

Similar Messages

  • AT USER-COMMAND IN NORMAL REPORT

    Please do not have your subject in ALL CAPITALS
    Hi Experts,
    Please advice,
    I am having three fields in output first one  is directly fetched from table and other two are variables.
    ITAB-MENGE = fetched data.
    ITAB-UCOMM =   user command.
    AT SELECTION-SCREEN OUTPUT
    when the user press ENTER
    ITAB-SUM = ITAB-MENGE + ITAB-UCOMM.
    For eq:
    Suppose if:
    ITAB-MENGE = 100
    and if the user enters the value in ITAB-UCOMM = 200
    and when the user press enter the sum should display on the other field ITAB-SUM
    Note: I am using normal write statement ( not ALV ) & I am not using any parameters in selection screen all these has to fired on output screen
    Thanks
    R.Karthik
    Edited by: Karthik R on Feb 28, 2009 3:34 PM
    Edited by: Matt on Mar 1, 2009 7:18 PM

    Hi,
    Refer code:-
    REPORT  Z19TG7_1 NO STANDARD PAGE HEADING.
    TABLES : LFA1.
    TYPES : BEGIN OF VENDOR,
            LIFNR LIKE LFA1-LIFNR,
            NAME1 LIKE LFA1-NAME1,
            END OF VENDOR,
            BEGIN OF VENDOR1,
            LIFNR LIKE LFA1-LIFNR,
            NAME1 LIKE LFA1-NAME1,
            ORT01 LIKE LFA1-ORT01,
            LAND1 LIKE LFA1-LAND1,
            BUKRS LIKE LFB1-BUKRS,
            END OF VENDOR1.
    DATA : VENDOR_TAB TYPE STANDARD TABLE OF VENDOR INITIAL SIZE 20 WITH HEADER LINE,
           VENDOR1_TAB TYPE STANDARD TABLE OF VENDOR1 INITIAL SIZE 20 WITH HEADER LINE,
           CB.
    *       WAS_USED.
    TOP-OF-PAGE DURING LINE-SELECTION.
      WRITE SY-LSIND.
    START-OF-SELECTION.
      SET PF-STATUS 'Z19TG7_1_PF'.
      SELECT LIFNR NAME1
      FROM LFA1
      INTO TABLE VENDOR_TAB.
    AT USER-COMMAND.
      CASE SY-UCOMM.
        WHEN 'VL'.
          IF SY-LSIND = 1.
            SET PF-STATUS SPACE.
            DO.
              CLEAR CB.
              READ LINE SY-INDEX FIELD VALUE CB.
              IF SY-SUBRC <> 0.
                EXIT.
              ELSE.
                CHECK CB = 'X'.
                MODIFY CURRENT LINE : FIELD VALUE CB FROM SPACE.
                SELECT A~LIFNR A~NAME1 A~ORT01 A~LAND1 B~BUKRS
                FROM LFA1 AS A
                LEFT OUTER JOIN LFB1 AS B
                ON A~LIFNR = B~LIFNR
                INTO TABLE VENDOR1_TAB
                WHERE A~LIFNR = VENDOR_TAB-LIFNR.
                LOOP AT VENDOR1_TAB.
                  WRITE : / 'Vendor ID:' NO-GAP, VENDOR1_TAB-LIFNR,
                          / 'Vendor Name :' NO-GAP, VENDOR1_TAB-NAME1,
                          / 'City :' NO-GAP, VENDOR1_TAB-ORT01,
                          / 'Land :' NO-GAP, VENDOR1_TAB-LAND1,
                          / 'Country Code :' NO-GAP, VENDOR1_TAB-BUKRS.
                  ULINE.
                ENDLOOP.
              ENDIF.
            ENDDO.
          ENDIF.
      ENDCASE.
    END-OF-SELECTION.
      WRITE : /1 'CB', 5 TEXT-001, 18 TEXT-002.
      ULINE.
      LOOP AT VENDOR_TAB.
        WRITE : /1 CB AS CHECKBOX, 5 VENDOR_TAB-LIFNR, 18 VENDOR_TAB-NAME1.
        HIDE : VENDOR_TAB-LIFNR.
      ENDLOOP.
      ULINE.
    Hope this helps you.
    Regards,
    Tarun

  • Re: alv line selection

    Hi,
           Iam using user command routine to select the selected field value from the alv-list. My requirement is
    to get the all the selected line values. How it is possible.
    rgds
    p.kp

    Hi paluri,
    requirement is
    to get the all the selected line values. How it is possible.
    FOR THAT WE HAVE TO USE
    CHECKBOXES
    so that the user can select the rows.
    1. To get a taste of it,
       just copy paste this program.
    2. It will display alv (t001)
      and DOUBLE-CLICK ON any row.
       It will TICK ALL THE CHECKBOXES.
    3.
    REPORT abc.
    TYPE-POOLS : slis.
    Data
    DATA : BEGIN OF itab OCCURS 0.
            INCLUDE STRUCTURE t001.
    DATA : flag tyPE c,
           END OF itab.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvly TYPE slis_layout_alv.
    Select Data
    SELECT * FROM t001 INTO TABLE itab.
    *------- Field Catalogue
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_internal_tabname     = 'ITAB'
        i_inclname             = sy-repid
      CHANGING
        ct_fieldcat            = alvfc
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    Display
    alvly-box_fieldname = 'FLAG'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        it_fieldcat             = alvfc
        i_callback_program      = sy-repid "<-------Important
        i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important
        is_layout               = alvly
      TABLES
        t_outtab                = itab
      EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.
    CALL BACK FORM
    FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
    slis_selfield.
      LOOP AT itab.
        itab-flag = 'X'.
        MODIFY itab.
      ENDLOOP.
    IMPORTANT.
    WHATROW-REFRESH = 'X'.
    ENDFORM. "ITAB_user_command
    regards,
    amit m.

  • About User command & SET Parameter

    Hi All,
    What is the User Command? What it means? And how to handle in normal and ALV Report..?
    What is happening when I write the statement like below.
    SET PARAMETER ID 'TAB' FIELD 'ZPCA' ? What is the purpose of set parameter in the program..?
    Akshitha.

    Hi,
    see this prog..
    sy-ucomm is for doing the functions what the user wishes to do at that particular event. You use it in menus and other place . this mainly in using <pfstatus>
    USER COMMAND will perform actions on radiobutton click, or wen puhbutton is cliketced
    in this if the user clicks a push button, see bold letters..in the prog
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(15) lb1.
    PARAMETERS : a(10).
    SELECTION-SCREEN COMMENT 40(15) lb2.
    PARAMETERS : b(10).
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN PUSHBUTTON 10(10) lb3 USER-COMMAND pb1.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN PUSHBUTTON /10(10) lb5 USER-COMMAND pb3.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN PUSHBUTTON /10(10) lb4 USER-COMMAND pb2.
    *SELECTION-SCREEN BEGIN OF SCREEN 200 AS WINDOW TITLE T2.
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    PARAMETERS : ch1 AS CHECKBOX, ch2 AS CHECKBOX, ch3 AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2.
    PARAMETERS : rb1 RADIOBUTTON GROUP a,
                 rb2 RADIOBUTTON GROUP a,
                 rb3 RADIOBUTTON GROUP a.
    SELECTION-SCREEN END OF BLOCK b2.
    *SELECTION-SCREEN END OF SCREEN 200.
    INITIALIZATION.
      lb1 = 'ENTER A VALUE'.
      lb2 = 'ENTER B VALUE'.
      lb3 = 'DISPLAY'.
      lb4 = 'EXIT'.
      lb5 = 'CALL NEXT'.
    AT SELECTION-SCREEN.
      CASE sy-ucomm.
        WHEN 'PB1'.
          LEAVE TO LIST-PROCESSING.
          WRITE : a, b.
          IF ch1 = 'X'.
            LEAVE TO LIST-PROCESSING.
            WRITE 'FIRST CHECKBOX IS SELECTED'.
          ENDIF.
          IF ch2 = 'X'.
            WRITE :/ 'SECOND CHECKBOX IS SELECTED'.
          ENDIF.
          IF ch3 = 'X'.
            WRITE :/ 'THIRD CHECKBOX IS SELECTED'.
          ENDIF.
          IF rb1 = 'X'.
            WRITE :/ 'FIRST RADIOBUTTON'.
          ELSEIF rb2 = 'X'.
            WRITE :/ 'SECOND RADIOBUTTON'.
          ELSEIF rb3 = 'X'.
            WRITE :/ 'THIRD RADIOBUTTON'.
          ENDIF.
        WHEN 'PB2'.
          LEAVE PROGRAM.
        WHEN 'PB3'.
          CALL SELECTION-SCREEN 200.
      ENDCASE.
    SET parameter :
    this is used to pass a value from one report a memory n from there we can use in the same report or the other report..
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another.  Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens
    Hope this helps u,
    Regards,
    Arunsri
    Edited by: Arunsri on Mar 11, 2008 11:52 AM

  • How to use AT LINE-SELECTION and AT USER-COMMAND in one report????

    Dear all,
    I have a problem in reports I want to use AT USER-COMMAND.and AT LINE-SELECTION.both in the one report.
    But as soon as I use SET PF-STATUS my AT LINE-SELECTION event stop workingand only AT USER-COMMAND is working.
    How can I use both of them in one report for your reference I am giving my test program below.
    REPORT ZTEST111 .
    SET PF-STATUS '100'.
    DO 10 TIMES.
    WRITE:/ SY-INDEX.
    HIDE SY-INDEX.
    ENDDO.
    START-OF-SELECTION.
    AT LINE-SELECTION.
    MESSAGE I002(SY) WITH SY-INDEX.
    AT USER-COMMAND.
    MESSAGE I002(SY) WITH 'USER COMMAND'.
    END-OF-SELECTION.
    Thanks in advance
    Sachin Gautam

    hi
    Syntax
    AT USER-COMMAND.
    Effect
    This statement defines an event block whose event is triggered by the ABAP runtime environment if, during the display of a screen list, a function with a self-defined function code was chosen.
    Note
    Self-defined function codes are all those that include character combinations, except for the following:
    The function codes PICK and PF## ("##" stands for 01 to 24) do not cause the event AT USER-COMMAND, but the events AT LINE-SELECTION and AT PF##.
    All function codes that start with the character "%" are interpreted as system functions and do not cause the event AT USER-COMMAND. The system functions for lists are listed in the following table 1.
    The function codes in the following table 2, likewise, do not cause the event AT USER-COMMAND, but are handled by the list processor.
    Table 1
    Function code Function
    %CTX Call a context menu
    %EX Exit
    %PC Save to file
    %PRI Print
    %SC Search for ...
    %SC+ Find next
    %SL Search in office
    %ST Save to report tree
    Table 2
    Function code Function
    BACK Back
    P- Scroll to previous page
    P-- Scroll to first page
    P+ Scroll to next page
    P++ Scroll to last page
    PFILE name Store list lines in a text file named abap.lst in standard character representation in the standard directory of the application server. If a name is entered using name, this is converted to lowercase letters and used as the file name.
    PL- Scroll to first line of the page
    PL-n Scroll n lines back
    PL+ Scroll to last line of the page
    PL+n Scroll n lines up
    PNOP No effect
    PP- Scroll back one page
    PP-n Scroll n pages back
    PP+ Scroll one page forward
    PP+n Scroll n pages forwad
    PPn Scroll to beginning of page n
    PRI, PRINT Print
    PS-- Scroll to first column
    PS++ Scroll to last column
    PS- Scroll one column to the left
    PS-n Scroll n columns to the left
    PS+ Scroll one column to the right
    PS+n Scroll n columns to the right
    PSn Scroll to column n
    PZn Scroll to line n
    RW Cancel

  • How to use both At USER-COMMAND and AT LINE-SELECTION in one abap program

    I am trying out a program where I need to use both line selection and user command events in one program. Suggest me how to do it.

    USE the okcode 'PICK'. (I mean add a 'PICK' in the GUI staus or the menu.) When ever u use both the events u have to use PICK to trigger the at line selection.
    U just need to add the PICK in the GUI status and ofcourse write code in the program.
    AT LINE-SELECTION.
    CASE sy-ucomm.
    WHEN 'PICK'.
    write:/ 'HELLO WORLD'.
    ENDCASE.

  • AT LINE SELECTION AN AT USER-COMMAND IN ONE REPORT

    hiiii friends.....
    hw  can i go for both at line selection an at user comond in one report....
    ie if double click on basic list it should shw sm output an when i choose menu optoin it should perform sm other output......

    You need to crate a PF-Status and in the PF-staus you need to include some essentials buttons and the button for your list on the USER-COMMAND.
    Say,
    BACK
    EXIT
    CANC
    PICK ... should be assigned to F2 .. to work with LINE-SELECTION.
    NEW_LIST ... for USER-COMMAND
    In your report:
    START-OF-SELECTION.
      SET PF-STATUS 'Z_OWN'.
    AT LINE-SELECTION.
      WRITE : 'I AM LINE SELECTION'.
    AT USER-COMMAND.
      CASE SY-UCOMM.
        WHEN 'NEW_LIST'.
           WRITE / 'I AM CALLED FROM USER COMMAND'.
      ENDCASE.
    Regards,
    Naimesh Patel

  • At line-selection & at user-command event issue

    hi
    i am working on a interactive report,with at line & at user command event,on list 3 i have used a pf status,to trigger the at user command event,till that i was working with at line selection,which are working fine,but on list 3,i am able to see my pf status,but at user command event is not working properly,its still working like at line selection event,if i clk on record,it take to for nxt action,which i want to do through the action button of pf status.
    In debugging i checked that it coming to at user command,but the action in sy-user is 'PICK' & its doing the operation.
    WHEN '3'.
          IF itab4[] IS NOT INITIAL.
            SET PF-STATUS 'Z203'.
            LOOP AT itab4.
              AT FIRST.
                WRITE:/1 'Material' ,18 'Name'.
              ENDAT.
              WRITE:/1 itab4-matnr,8 itab4-maktx.
              HIDE:itab4-matnr.
            ENDLOOP.
          ELSE.
            WRITE:/ 'No Data Found'.
          ENDIF.
      ENDCASE.
      BREAK-POINT.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'CALL'.
          PERFORM bdc_mm02.
      ENDCASE.
    pls tel me how to use at line selection & at user command in same report to make both events working efficiently.
    regds
    vipin

    Check whether you have assigned Function Key F2 to your function code 'CALL'. If so change that function key. The function key F2 is always linked to function code 'PICK'.
    Regards
    Sathar

  • At line-selection and user command

    hi,
    is it possible to use both at line selecion and at user command at a time.

    Hi Kiran,
      Yes, it is possible to use both at line selecion and at
      user command at a time.
    AT LINE-SELECTION.
    Event in interactive reporting
    This event is processed whenever the user chooses a valid line in the list (i.e. a line generated by statements such as WRITE,ULINE, or SKIP) with the cursor and presses the function key which has the function PICK in the interface definition. This should normally be the function key F2, because it has the same effect as double-clicking the mouse, or clicking once in the case of a hotspot.
    The processing for the event AT LINE-SELECTION usually generates further list output (the details list) which completely covers the current list display. If you want the current list display to remain visible (to aid user orientation), you can do this with the key word WINDOW.
    AT USER-COMMAND.
    Event in interactive reporting
    This event is executed whenever the user presses a function key in the list or makes an entry in the command field.
    DATA: NUMBER1 TYPE I VALUE 20,
          NUMBER2 TYPE I VALUE  5,
          RESULT  TYPE I.
    START-OF-SELECTION.
      WRITE: / NUMBER1, '?', NUMBER2.
    AT USER-COMMAND.
      CASE SY-UCOMM.
        WHEN 'ADD'.
          RESULT = NUMBER1 + NUMBER2.
        WHEN 'SUBT'.
          RESULT = NUMBER1 - NUMBER2.
        WHEN 'MULT'.
          RESULT = NUMBER1 * NUMBER2.
        WHEN 'DIVI'.
          RESULT = NUMBER1 / NUMBER2.
        WHEN OTHERS.
          WRITE 'Unknown function code'.
          EXIT.
      ENDCASE.
      WRITE: / 'Result:', RESULT.
    After entry of a function code, the appropriate processing is performed under the event AT USER-COMMAND and the result is displayed in the details list.
    Reward points if helpful,
    Rgds,
    Sumana

  • At line-selection & At user-command

    Hi friends,
    I have a small doubt. Can we user AT LINE-SELECTION & AT USER-COMMAND in one report..plz gimme an example.
    Thanks is advance,
    regards,
    Ram

    hi, try these with example i have given.
    Write the set pf-status under start-of-selection,
    In the set pf-status under the function keys give
    F2 Pick Choose.
    u can validate the at line-selection by taking..
    At line-selection.
    case sy-lsind.
    when 1.
    message....
    when 2.
    message....
    endcase.
    similarly, for At user-command.
    case sy-ucomm.
    when 'back'.
    message...
    when...
    endcase.
    Syntax
    AT USER-COMMAND.
    Effect
    This statement defines an event block whose event is triggered by the ABAP runtime environment if, during the display of a screen list, a function with a self-defined function code was chosen.
    Note
    Self-defined function codes are all those that include character combinations, except for the following:
    The function codes PICK and PF## ("##" stands for 01 to 24) do not cause the event AT USER-COMMAND, but the events AT LINE-SELECTION and AT PF##.
    All function codes that start with the character "%" are interpreted as system functions and do not cause the event AT USER-COMMAND. The system functions for lists are listed in the following table 1.
    The function codes in the following table 2, likewise, do not cause the event AT USER-COMMAND, but are handled by the list processor.
    Table 1
    Function code Function
    %CTX Call a context menu
    %EX Exit
    %PC Save to file
    %PRI Print
    %SC Search for ...
    %SC+ Find next
    %SL Search in office
    %ST Save to report tree
    Table 2
    Function code Function
    BACK Back
    P- Scroll to previous page
    P-- Scroll to first page
    P+ Scroll to next page
    P++ Scroll to last page
    PFILE name Store list lines in a text file named abap.lst in standard character representation in the standard directory of the application server. If a name is entered using name, this is converted to lowercase letters and used as the file name.
    PL- Scroll to first line of the page
    PL-n Scroll n lines back
    PL+ Scroll to last line of the page
    PL+n Scroll n lines up
    PNOP No effect
    PP- Scroll back one page
    PP-n Scroll n pages back
    PP+ Scroll one page forward
    PP+n Scroll n pages forwad
    PPn Scroll to beginning of page n
    PRI, PRINT Print
    PS-- Scroll to first column
    PS++ Scroll to last column
    PS- Scroll one column to the left
    PS-n Scroll n columns to the left
    PS+ Scroll one column to the right
    PS+n Scroll n columns to the right
    PSn Scroll to column n
    PZn Scroll to line n
    RW Cancel
    here is an example handling both the commands in a program.
    EXAMPLE:
    START-OF-SELECTION.
    WRITE: 'Basic List',
    / 'SY-LSIND:', sy-lsind.
    TOP-OF-PAGE.
    WRITE 'Top-of-Page'.
    ULINE.
    TOP-OF-PAGE DURING LINE-SELECTION.
    CASE sy-pfkey.
    WHEN 'TEST'.
    WRITE 'Self-defined GUI for Function Codes'.
    ULINE.
    ENDCASE.
    AT LINE-SELECTION.
    SET PF-STATUS 'TEST' EXCLUDING 'PICK'.
    PERFORM out.
    sy-lsind = sy-lsind - 1.
    AT USER-COMMAND.
    CASE sy-ucomm.
    WHEN 'FC1'.
    PERFORM out.
    WRITE / 'Button FUN 1 was pressed'.
    WHEN 'FC2'.
    PERFORM out.
    WRITE / 'Button FUN 2 was pressed'.
    WHEN 'FC3'.
    PERFORM out.
    WRITE / 'Button FUN 3 was pressed'.
    WHEN 'FC4'.
    PERFORM out.
    WRITE / 'Button FUN 4 was pressed'.
    WHEN 'FC5'.
    PERFORM out.
    WRITE / 'Button FUN 5 was pressed'.
    ENDCASE.
    sy-lsind = sy-lsind - 1.
    FORM out.
    WRITE: 'Secondary List',
    / 'SY-LSIND:', sy-lsind,
    / 'SY-PFKEY:', sy-pfkey.
    ENDFORM.
    Hope this may be helpful.
    Sri.
    pls:award points.

  • ITS URGENT QUES ON AT LINE-SELECTION AND AT USER-COMMAND

    ITS URGENT...WHEN I SELECT MULTIPUL VALUES IN BASIC LIST ,I HAVE TO GET THOSE SELECTED MULTIPUL VALUES IN SECONDARY LIST THAT CAN BE AFTER(AT LINE-SELECTION OR AT USER-COMMAND)............?

    hey
    this code modify's simlarly u can read n  display secondary window
        DO .
    Reading the internal table whose data is displayed into wrk area.....
          READ LINE SY-INDEX FIELD VALUE INT_DISPLAY-SHIPMENT_ID INTO WF_SHIPMENT_ID.
    Reading the check box value
          READ LINE SY-INDEX FIELD VALUE WG_CHK.
    If all the records are read and there is no code left to read
          IF SY-SUBRC <> 0 .
            EXIT.
          ENDIF.
    To highlight the line which is selected by the user
          IF WG_CHK = WL_X.
            MODIFY CURRENT LINE
            LINE FORMAT COLOR COL_NEGATIVE INVERSE
            FIELD VALUE WG_CHK FROM WL_SPACE.
            MODIFY CURRENT LINE
            LINE FORMAT INPUT OFF.
    Also append the record read into new internal table which u will display in secondary window.......
          ENDIF.
        ENDDO.
    AT USER-COMMAND. or AT LINE SELECTION . u can write this code.........
    DISPLAYING A POP-UP WINDOW .
          WINDOW STARTING AT 10 50
                 ENDING AT 120 70.
    and then write the table into which u have stored the read entry which user had selected
    reward points if useful

  • Refresh Report and At Line-Selection and At User-Command

    Hi All
    I have 2 querries
    1) I want to use At Line-selection and At user-command in the same report. But At line-selection is not getting triggered why? When I remove Set pf-status 'xxx' and at user command , then at line selection works . I want to user both at a time.
    2) I am giving user ability to edit the report shown and when he comes back by exiting the editing I want to refresh the report which is shown already to him to give effect of his editing.
    Thanks in anticipation
    pM.

    i just tried, and no problem at all.
    In the <b>Recommended Function Key Settings</b>  for  F2 key add command "PICK"
    Regards
    Raja
    since you are new to the forum, have a look at this weblog.
    /people/mark.finnern/blog/2004/08/10/spread-the-love

  • Using both at line-selection and at user-command

    hellow friends ,
    to use both  at line-selection and at user-command in the same report.

    Hello,
    U can do it like this.
    AT LINE-SELECTION.
      PERFORM at_line_selection.
    AT USER-COMMAND.
      PERFORM at_user_command.
    FORM AT_LINE_SELECTION.
      DATA: LV_CURSOR_FIELD(30).
      DATA: LV_MATNR TYPE MATNR.
      CLEAR H_UCOMM.
      GET CURSOR FIELD LV_CURSOR_FIELD.
      CASE LV_CURSOR_FIELD.
        WHEN 'PSPNR'.
          PERFORM LAGER_AN_PSP USING WA_MATNR-M1-RSNUM
                                     WA_MATNR-M1-RSPOS.
        WHEN 'PSPNR2'.
          H_UCOMM = 'PSPNR2'.
          IF NOT PSPNR2 IS INITIAL AND IT_VKBEL-VBELN CN '0123456789'.
            PERFORM LAGER_AN_PSP_VKBEL USING IT_VKBEL
                                             0
                                             PSPNR2
                                             H_MAKTX
                                             ' '.     "keine Blindbuchung
          ENDIF.
    ENDCASE.
    CASE SY-UCOMM.
        WHEN 'BACK_NEW'.
          PERFORM NEU_START USING 'X'.
        WHEN 'EXIT'.
          PERFORM NEU_START USING 'X'.
        WHEN 'CANC'.
          PERFORM NEU_START USING 'X'.
        WHEN 'CHECK'.
          PERFORM NEU_START USING SPACE.
    ENDCASE.
    Vasanth

  • Set PF Status and At-Line Selection & At User-Command

    Hi All
    I've used set PF status, at user command and at-line selection in my program. initially when i click on the material number it was not drilling further that is it was not taking to secondary list. i commented the PF status and tried. then it was working fine. Later, after checking on couple of doc i added F.code PICK in my PF status and uncommented the set-PF status in my program it was working fine. Now my question is why this kind of behaviour. When i uncomment the PF status  and run the program without the f.code PICK in my PF status(se41)  it was not working but after inlcuding the F.code in my PF it is working. Any good explanation?
    thks   
    Prabhu

    hi,
    generally fuction code is useful for the system to find on which button or in which area the user has clicked in. based on the function code the system executes the satatements that are in user command.  in your case i think u didnt gave any functionality in user-command. when at-user command is a event in interactive reporting which is triggered based on the button u had clicked.
    at line-selection event uses two system variables
       1. sy-lsind [ current list index number ]
       2. sy-lisel  [ contains the current area in which user ckicked ].
       3. sy-ucomm [ function code of clicked button ].
    using these 3 vars we can drill down to 21 lists [ including 1st list ]
    if helpful reward some points.
    with regards,
    suresh.

  • Need clarification on AT LINE SELECTION & AT USER COMMAND

    Hi all,
    can we use AT LINE SELECTION and AT USER COMMAND events in the same report? If yes what r the precautions that we have to take?
    Thanks in advance
    venkat

    Hi Venkat,
    I had written this code while I was learning Menu Painter. It will help help you.
    *& Report  YTEST_MENUPAINTER                                           *
    REPORT  ztest.
    *Consider  a scenario when the user asks for Material Details(Table : MARA )
    *displayed in one List and based on the Material selected he wants the corresponding
    *Storage Location Data for that Material (Table : MARD ).
    TABLES : mara.
    TYPES :  BEGIN OF tp_mara,
             matnr TYPE mara-matnr,
             mtart TYPE mara-mtart,
             mbrsh TYPE mara-mbrsh,
             matkl TYPE mara-matkl,
             END OF tp_mara.
    TYPES : BEGIN OF tp_marc,
            matnr TYPE marc-matnr,
            werks TYPE marc-werks,
            pstat TYPE marc-pstat,
            ekgrp TYPE marc-ekgrp,
            dispr TYPE marc-dispr,
            END OF tp_marc.
    TYPES : BEGIN OF tp_mard,
            matnr TYPE mard-matnr,
            werks TYPE mard-werks,
            lgort TYPE mard-lgort,
            lfgja TYPE mard-lfgja,
            labst TYPE mard-labst,
            umlme TYPE mard-umlme,
            END OF tp_mard.
    DATA : t_mara TYPE STANDARD TABLE OF tp_mara,
           t_marc TYPE STANDARD TABLE OF tp_marc,
           t_mard TYPE STANDARD TABLE OF tp_mard,
           wa_mara TYPE tp_mara,
           wa_marc TYPE tp_marc,
           wa_mard TYPE tp_mard.
    DATA : w_werks TYPE werks .
    DATA : itab TYPE TABLE OF sy-ucomm.
    START-OF-SELECTION.
    *Collecting the material details form Table MARA
      SELECT matnr
             mtart
             mbrsh
             matkl
             FROM mara
             INTO TABLE t_mara
             UP TO 200 ROWS.
    END-OF-SELECTION.
      SET PF-STATUS 'DETAIL'.
    *Now I am Dispalying the Material Details in the Primary List
      CLEAR wa_mara.
      LOOP AT t_mara INTO wa_mara.
        IF sy-tabix EQ 1.
          FORMAT INTENSIFIED ON.
          FORMAT COLOR COL_KEY.
          WRITE : /5(16)  'Material Number'.
          FORMAT COLOR COL_NORMAL.
          WRITE :          24(15) 'Material Type',
                   40(18) 'Industry Sector',
                   58(18) 'Material Group' .
        ENDIF.
        FORMAT INTENSIFIED OFF.
        FORMAT COLOR COL_KEY.
        WRITE : /5(16)   wa_mara-matnr.
        FORMAT COLOR COL_NORMAL.
        WRITE :  24(15)  wa_mara-mtart,
                 40(18)  wa_mara-mbrsh,
                 58(18)  wa_mara-matkl.
    *You can assume some sort of buffer is created in the memory  and the values of
    * wa_mara-matnr are put into it when you use the HIDE command
        HIDE wa_mara-matnr.
      ENDLOOP.
    *Now when user Double clicks a line (AT LINE-SELECTION event is trigerred) and
    *the line contents of the line selected and the contents buffered using
    *command  interact and the value for the hidden variable is got into the variable
    *refrenced using the HIDE command i.e..  wa_mara-matnr in our case
    AT LINE-SELECTION.
      IF sy-lsind = 1.
        FORMAT INTENSIFIED ON.
        WRITE:     'Plant Data for Material  '  COLOR COL_NORMAL,
                    35   wa_mara-matnr COLOR COL_TOTAL.
        REFRESH t_marc.
    * Now I have the value of the Material in my hidden variable wa_mara-matnr
    * Based on this I am selecting the Storage Location Data
        SELECT matnr
               werks
               pstat
               ekgrp
               dispr
               FROM marc
               INTO TABLE t_marc
               WHERE matnr = wa_mara-matnr.
        CLEAR wa_marc.
        FORMAT INTENSIFIED OFF.
        FORMAT COLOR COL_NORMAL.
        LOOP AT t_marc INTO wa_marc.
          IF sy-tabix EQ 1.
            FORMAT INTENSIFIED ON.
            FORMAT COLOR COL_NORMAL.
            WRITE :  /24(6)  'Plant',
                     30(22) 'Maintenance status',
                     52(20) 'Purchasing Group',
                     72(27)  'Material: MRP profile'.
          ENDIF.
          WRITE : /24(6)   wa_marc-werks,
                   30(22)  wa_marc-pstat,
                   52(20)  wa_marc-ekgrp,
                   72(27) wa_marc-dispr.
          CLEAR wa_marc.
        ENDLOOP.
        SKIP 5.
        FORMAT INTENSIFIED ON.
        WRITE:     'Storage Data for Material  '  COLOR COL_NORMAL,
                  35     wa_mara-matnr COLOR COL_TOTAL.
        REFRESH t_mard.
        SELECT matnr
               werks
               lgort
               lfgja
               labst
               umlme
               FROM mard
               INTO TABLE t_mard
               WHERE matnr = wa_mara-matnr.
        CLEAR wa_mard.
        FORMAT COLOR COL_NORMAL.
    * Display the Storage Location Data in the Secondary List
        LOOP AT t_mard INTO wa_mard.
          IF sy-tabix EQ 1.
            FORMAT INTENSIFIED ON.
            FORMAT COLOR COL_NORMAL.
            WRITE :  /24(6)  'Plant',
                     30(20) 'Storage Location',
                     50(12) 'Fiscal Year',
                     62(15) 'Valuated stock',
                     77(20)    'Stock in transfer'.
          ENDIF.
          WRITE : /24(6)  wa_mard-werks,
                   30(20) wa_mard-lgort,
                   50(12)  wa_mard-lfgja,
                   62(15) wa_mard-labst,
                   77(20) wa_mard-labst.
        ENDLOOP.
      ENDIF.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'PLANT'.
          REFRESH itab. CLEAR itab.
          APPEND 'PLANT' TO itab.
          APPEND 'STORAGE' TO itab.
          SET PF-STATUS 'DETAIL' EXCLUDING itab .
          FORMAT INTENSIFIED ON.
          WRITE:     'Plant Data for Material  '  COLOR COL_NORMAL,
                      35   wa_mara-matnr COLOR COL_TOTAL.
          REFRESH t_marc.
          SELECT matnr
                 werks
                 pstat
                 ekgrp
                 dispr
                 FROM marc
                 INTO TABLE t_marc
                 WHERE matnr = wa_mara-matnr.
          CLEAR wa_marc.
          FORMAT INTENSIFIED OFF.
          FORMAT COLOR COL_NORMAL.
          LOOP AT t_marc INTO wa_marc.
            IF sy-tabix EQ 1.
              FORMAT INTENSIFIED ON.
              FORMAT COLOR COL_NORMAL.
              WRITE : /24(6)  'Plant',
                       30(22) 'Maintenance status',
                       52(20) 'Purchasing Group',
                       72(27)  'Material: MRP profile'.
            ENDIF.
            WRITE : /24(6)   wa_marc-werks,
                     30(22)  wa_marc-pstat,
                     52(20)  wa_marc-ekgrp,
                     72(27) wa_marc-dispr.
            CLEAR wa_marc.
          ENDLOOP.
        WHEN 'STORAGE'.
          REFRESH itab. CLEAR itab.
          APPEND 'PLANT' TO itab.
          APPEND 'STORAGE' TO itab.
          SET PF-STATUS 'DETAIL' EXCLUDING itab .
          FORMAT INTENSIFIED ON.
          WRITE:     'Storage Data for Material  '  COLOR COL_NORMAL,
                    35     wa_mara-matnr COLOR COL_TOTAL.
          REFRESH t_mard.
          SELECT matnr
                 werks
                 lgort
                 lfgja
                 labst
                 umlme
                 FROM mard
                 INTO TABLE t_mard
                 WHERE matnr = wa_mara-matnr.
          CLEAR wa_mard.
          FORMAT COLOR COL_NORMAL.
          LOOP AT t_mard INTO wa_mard.
            IF sy-tabix EQ 1.
              FORMAT INTENSIFIED ON.
              FORMAT COLOR COL_NORMAL.
              WRITE : /24(6)  'Plant',
                       30(20) 'Storage Location',
                       50(12) 'Fiscal Year',
                       62(15) 'Valuated stock',
                       77(20)    'Stock in transfer'.
            ENDIF.
            WRITE : /24(6)  wa_mard-werks,
                     30(20) wa_mard-lgort,
                     50(12)  wa_mard-lfgja,
                     62(15) wa_mard-labst,
                     77(20) wa_mard-labst.
          ENDLOOP.
      ENDCASE.
    My SE41 settings are.
                                                                                    Application toolbar                 Test for Material Detail Display                                                                               
    Items  1 -  7            STORAGE    PLANT                                                                               
    STORAG     PLANT                                                                               
    Items  8 - 14                                                                               
    Items 15 - 21                                                                               
    Items 22 - 28                                                                               
    Items 29 - 35                                                                               
    Function keys                       Test for Material Detail Display                                                                               
    Standard Toolbar                                                                               
    SAVE       BACK       EXIT       CANCEL     PRINT      FIND       FIND NEXT                                                                               
    Recommended function key settings                                                                
    F2                             PICK       Choose                                                
    F9                             <..>       Select                                                
    Shift-F2                       <..>       Delete                                                
    Shift-F4                       <..>       Save without check                                    
    Shift-F5                       <..>       Other <object>                                                                               
    Freely assigned function keys                                        
    F5                             STORAGE    STORAGE                   
    F6                             PLANT      PLANT                     
    F7                                                                  
    F8                                                                  
    Shift-F1                                                            
    Hope this will help you.
    Regards,
    Arun Sambargi.
    Message was edited by: Arun Sambargi

Maybe you are looking for

  • Quick battery depletion, surprise shut down, and more

    Power info: System Power Settings: AC Power: System Sleep Timer (Minutes): 0 Disk Sleep Timer (Minutes): 10 Display Sleep Timer (Minutes): 20 Automatic Restart On Power Loss: No Wake On AC Change: No Wake On Clamshell Open: Yes Wake On LAN: Yes Displ

  • Error in Starting J2EE server

    Hi, This is what I get when I start j2ee -verbose. I am using JDK1.3 and J2EESDK1.3.1 Any Help.. Thanx J2EE server listen port: 9999 Naming service started:9999 Exception in thread "main" java.lang.NoSuchMethodError at com.sun.corba.ee.internal.corba

  • ICloud not listed in Edit smpt in Mail preferences

    Hi all-I have been having issues with Mail lately. I am running Mavericks (latest version) and Mail is 7.3. First it keeps asking me for my password. I have lost count the number of times I have reentered it! But it keeps on asking. I enter the passw

  • ORA-28183 when connect proxy user with password from java

    1. Create user on database 10.2.0.1.0 create user scott identified by tiger; create user jeff identified by secnt; grant connect, resource to scott; grant create session to jeff; alter user jeff grant connect through scott authenticated using passwor

  • Downgraded automatically from 4 to 2!!!!!

    Hi, Well I have a strange problem. I have a Powerbook G4 and recently was asked to upgrade my iPhoto through the software update. I think I had version 4 and I was asked to upgrade to 5 - it's been a while since I updated... Anyway after importing so