At user-command with input on

Hi,
       In the below code i am using an option input on ,where the user has to give the inputs manually.
After giving the input,if i give save the values which are fetched from itab are saved in ztable.
wa_new-idrum1 which is given by user is not saving in ztable.
Suggest some ideas.
Regards,
Bathri.
  LOOP AT IT_NEW INTO WA_NEW.
    SKIP.
    WRITE : / SY-TABIX,
              WA_NEW-MATNR,
              WA_NEW-MENGE LEFT-JUSTIFIED,
              40 WA_NEW-IDRUM1 LEFT-JUSTIFIED INPUT ON.
  ENDLOOP.
  SET PF-STATUS 'ZWORK'.
AT USER-COMMAND.
  CASE SY-UCOMM.
    WHEN 'SAVE'.
      LOOP AT IT_NEW INTO WA_NEW.
        MOVE : WA_NEW-MATNR TO ZWORK-MATNR,
               WA_NEW-MENGE TO ZWORK-MENGE,
               WA_NEW-IDRUM1 TO ZWORK-IDRUM1.
        MODIFY ZWORK.
      ENDLOOP.
  ENDCASE.

Cause the internal table is not modified at list when user enter the values no update of ztable done. To correct try something like following
DATA: BEGIN OF IT_NEW OCCURS 100,
        MATNR  TYPE MATNR,
        MENGE  TYPE MENGE_D,
        IDRUM1 TYPE CHAR20,
       END OF IT_NEW.
DATA WA_NEW LIKE LINE OF IT_NEW.
DATA MENGE TYPE CHAR20.
START-OF-SELECTION.
  SELECT  * FROM MSEG UP TO 60 ROWS
    APPENDING CORRESPONDING FIELDS OF TABLE IT_NEW.
  LOOP AT IT_NEW INTO WA_NEW.
    SKIP.
    WRITE : / SY-TABIX,
              WA_NEW-MATNR,
              WA_NEW-MENGE LEFT-JUSTIFIED,
              40 WA_NEW-IDRUM1 LEFT-JUSTIFIED INPUT ON.
  ENDLOOP.
  SET PF-STATUS 'ZWORK'.
AT USER-COMMAND.
  CASE SY-UCOMM.
    WHEN 'SAVE'.
      DO.
        CLEAR: ZWORK,MENGE.
        READ LINE SY-INDEX
        FIELD VALUE WA_NEW-MATNR  INTO ZWORK-MATNR
                    WA_NEW-MENGE  INTO MENGE
                    WA_NEW-IDRUM1 INTO ZWORK-IDRUM1.
        IF SY-SUBRC NE '0'.
          EXIT.
        ENDIF.
        DO.
          REPLACE '.' WITH '' INTO MENGE.
          IF SY-SUBRC NE '0'.
            EXIT.
          ENDIF.
        ENDDO.
        REPLACE ',' WITH '.' INTO MENGE.
        CONDENSE MENGE NO-GAPS.
        ZWORK-MENGE = MENGE.
        IF ZWORK-MATNR IS NOT INITIAL.
          MODIFY ZWORK.
        ENDIF.
      ENDDO.
  ENDCASE.

Similar Messages

  • User command in ALV grid

    Hi
    I am displaying the output of a report in the ALV grid.
    I have used REUSE_ALV_LIST_DISPLAY in my code as follows.
    FORM DISPLAY_ALV_LIST.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
      I_CALLBACK_PROGRAM = SYREPID
      IS_LAYOUT = FIELDLAYOUT
      I_CALLBACK_USER_COMMAND  = 'USER-COMMAND'
      IT_FIELDCAT = FIELDCATALOG[]
      I_SAVE = 'X'
      IT_EVENTS = EVENTSTAB[]
      TABLES
      T_OUTTAB = ITAB_1
      EXCEPTIONS
      PROGRAM_ERROR = 1
      OTHERS = 2.
    ENDFORM. " DISPLAY_ALV_LIST
    When I try to call a transaction at the user command with sy-ucomm = &IC1 sys gives a message 'Not valid'.
    FORM USER-COMMAND USING UCOMM LIKE SY-UCOMM
                           SELFIELD TYPE SLIS_SELFIELD.
      READ TABLE ITAB_1 INDEX SELFIELD-TABINDEX.
      CHECK SY-SUBRC = 0.
      CASE UCOMM.
        WHEN '&IC1'.
          CASE SELFIELD-SEL_TAB_FIELD.
            WHEN 'ITAB_1-VBELN'.
              SET PARAMETER ID 'VF' FIELD ITAB_1-VBELN.
              CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
            WHEN 'ITAB_1-MATNR'.
              SET PARAMETER ID 'MAT' FIELD ITAB_1-MATNR.
              CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
          ENDCASE.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    Kindly let me know what am I missing in the above code. As this FORM USER-COMMAND is at all called during the user-command.
    Regds
    Priya

    the Code what u are given is WRONG , check this one.
    put like this , it will solve ur probs.
      check r_ucomm = '&IC1'.             "User Double Clicked on Some field
      check not rs_selfield-value is initial.
      case rs_selfield-fieldname.
        when 'AUFNR'.
          if rad4 ne 'X'.
            read table  itab_order index rs_selfield-tabindex.
          else.
            read table  itab_order2 index rs_selfield-tabindex.
            itab_order-aufnr = itab_order2-aufnr.
          endif.
          if sy-subrc eq 0.
            set parameter id 'ANR' field  itab_order-aufnr.
            set parameter id 'VGN' field '10'.
            call transaction 'CO14' and skip first screen.
          endif.                            " IF SY-SUBRC EQ 0
      endcase.
    Regards
    Prabhu
    Message was edited by: Prabhu Peram

  • User command is not getting triggered in interactive ALV with LIST display

    Hi experts,
    I have developed an interactive ALV report with LIST display. Here, the issue is, when i double click a record in the primary ALV list, the control must go to the USER COMMAND event which i have written in my report. But the user command event is not getting triggered at all when i double click any record.
    It gives the following information instead.
    "Choose a valid function".
    (My user command name and its respective form name are same.)
    Here is my code..
    START-OF-SELECTION.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_structure_name         = p_table
          i_callback_user_command  = 'TST1'
          i_callback_pf_status_set = 'SET_PF_STATUS'
        TABLES
          t_outtab                 = <dyn_table>
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
      ENDIF.
    FORM tst1 USING r_ucomm LIKE sy-ucomm
                    rs_selfield TYPE slis_selfield.
    * Local data declaration
      DATA: li_tab TYPE REF TO data,
            l_line TYPE REF TO data.
    * Local field-symbols
      FIELD-SYMBOLS:<l_tab> TYPE table,
                    <l_wa>  TYPE ANY.
    * Create table
      CREATE DATA li_tab TYPE STANDARD TABLE OF (p_table).
      ASSIGN li_tab->* TO <l_tab>.
    * Create workarea
      CREATE DATA l_line LIKE LINE OF <l_tab>.
      ASSIGN l_line->* TO <l_wa>.  CASE r_ucomm.
    *   When a record is selected
        WHEN '&IC1'.
    *     Read the selected record
          READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX
          rs_selfield-tabindex.      IF sy-subrc = 0.
    *       Store the record in an internal table
            APPEND <dyn_wa> TO <l_tab>.
    *       Fetch the field catalog info
            CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
              EXPORTING
                i_program_name         = 'Z_DEMO_PDF_JG'
                i_structure_name       = p_table
              CHANGING
                ct_fieldcat            = i_fieldcat
              EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
    Please advice what is the msitake i have done here..

    Read the following code:
    pass the  i_callback_user_command = g_user_command to the ALV function module and write the FORM user_command USING ucomm    LIKE sy-ucomm
                            selfield TYPE slis_selfield.
    as shown below.
    thanx
    Data for ALV display
    DATA  : gt_fieldcat TYPE slis_t_fieldcat_alv,
            gt_events           TYPE slis_t_event,
            g_variant LIKE disvariant,
            g_user_command      TYPE slis_formname VALUE 'USER_COMMAND',
            g_status            TYPE slis_formname VALUE 'SET_PF_STATUS',
            gt_list_top_of_page TYPE slis_t_listheader,
            g_repid LIKE sy-repid,
            gf_pos TYPE i
    Data for ALV display
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
               EXPORTING
              i_callback_program      = g_repid
                 i_callback_program      = sy-repid
                 it_fieldcat             = gt_fieldcat[]
           it_events               = gt_events[]
              i_callback_user_command = g_user_command
                 i_save                  = 'A'
                 is_variant              = g_variant
               TABLES
                 t_outtab                = it_print.
    FORM user_command USING ucomm    LIKE sy-ucomm
                            selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN '&IC1'.
          CASE selfield-sel_tab_field.
            WHEN '1-KUNNR'.
              READ TABLE it_print INTO wa_print INDEX selfield-tabindex.
              IF sy-subrc = 0.
                SET PARAMETER ID 'BPA' FIELD wa_print-kunnr.
                CALL TRANSACTION 'BP'.
              ENDIF.
            WHEN '1-MATNR'.
              READ TABLE it_print INTO wa_print INDEX selfield-tabindex.
              IF sy-subrc = 0.
                SET PARAMETER ID 'JP_ISS' FIELD wa_print-matnr.
                CALL TRANSACTION 'JP29' AND SKIP FIRST SCREEN..
               GET PARAMETER ID 'WRK' FIELD wa_zprint-werks.
               SET PARAMETER ID 'VKO' FIELD wa_zprint-vkorg.
               SET PARAMETER ID 'VTW' FIELD wa_zprint-vtweg.
               CALL TRANSACTION 'JP29' AND SKIP FIRST SCREEN.
              ENDIF.
    Endcase.
    Endform.

  • Problem with User Command in alv report

    Hi
    I have developed a ALV grid report with drill down capability to transaction code for user command. I am having a trouble with this.
    CASE ucomm.
        WHEN '&IC1'.
          CLEAR: wa_import.
          IF selfield-fieldname EQ 'ANLN1'.
            READ TABLE t_import INTO wa_import INDEX selfield-tabindex.
            SET PARAMETER ID 'BUK' FIELD wa_import-bukrs.
            SET PARAMETER ID 'ANl' FIELD wa_import-anln1.
            CALL TRANSACTION 'AW01N'.
          ENDIF.
    here my parameter ids are showing the values but when i call the transaction i am not getting the actual asset numbers.
    Can someone help me out this
    Thanks

    Hi,
    add the AND SKIP FIRST SCREEN...addition..
    CALL TRANSACTION 'AW01N' AND SKIP FIRST SCREEN.
    Thanks
    Naren

  • I have a problem with ALV Grid User Command?

    Hi Experts,
    I have a problem with ALV GRID User Command.
    I am calling TCODE IW33 (Order Display) from the ALV output at first time by selecting an order. But, User command is calling IW33 Initial screen with blank value of order. Even I checked in debugging the value what I selected is passing properly, but once that screen (IW33 Initial) displays, value doesn't appear. Then, Manually, I  created another session and gone to TCODE IW33 and displayed an order. After that I came out from that order. Then again run my ALV program and selected another order, now order is displaying, but not what I selected current order instead of displaying previous order what I just displayed manually. If I selected any other order, system will display the same order what I dislayed manually.
    Here is my code.
    FORM user_command_alv  USING u_ucomm TYPE sy-ucomm
                           us_self_field TYPE slis_selfield.
    CASE u_ucomm.
    WHEN '&IC1'.
    READ TABLE it_final INDEX us_self_field-tabindex INTO wa_final.
            WHEN 'ORDER'.
              IF NOT wa_final-order IS INITIAL.
                SET PARAMETER ID 'COK' FIELD wa_final-order.
                CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.
              ENDIF.
    endform.
    PARAMETER ID 'COK'  also the standard one.
    Could you please help me out, Where I did wrong?
    If I select any order, that order only should display.
    Thanks in advance.
    Regards,
    Sarayu.
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:33 PM

    hi,
    Please check it once the Paramater ID is 'ANR' for IW33 order number.
    Hope this may help.
    Regards,
    Sravanthi

  • Problems with the imadmin purge user command

    I am using iMS 5.2 hot fix 1.05, iDA1.2sp1 and iDS 5.1
    When I try to use the imadmin purge user command I get the following errors:
    [email protected]: purging user
    [email protected]: purge user failed
    Failed connection refused.
    If I don't use the -g 0 option then it reports success, but the user account is still in LDAP...
    I found a reference to the imadmin user purge command not working when you have iDA 1.2patch1 and iMS 5.1 patch 1 unless you make a change to your resource.properties file but i have tried the file both way and I get the same error with the purge user command.
    I can use the imadmin delete user or imadmin modify user without any problem. I am just having trouble with the imadmin purge user command.
    Any ideas?

    This problem is documented in bug id 4671472. I have attempted the recommeded fix, but the problem persists. If anyone else has been having a similar problem and has any solution let me know. Thanks.
    Peter

  • Hey,i forgot my login password,so i changed the password by using terminal command(reset password).now i have new user name with new password,but i can't find  my data which i have saved on mac.please help me out in this matter.

    hey,i forgot my login password,so i changed the password by using terminal command(reset password).now i have new user name with new password,
    but i can't find  my data which i have saved on mac.the storage is showing data used and free space on the disk
    please help me out in this matter.

    How did you change your user name?
    resetpassword wouldn't have done it. If you managed to create a new user, then your data is still in the old account.

  • PROBLEM WITH USER COMMAND AT SIMPLE REPORT

    HII FRNDS
    MY PROBLEM IS
    WHEN I AM BRANCHING TO A LIST REPORT FROM MY ALV REPORT BY USING LEAVE TO LIST-PROCESSING . THEN IN MY LIST REPORT I AM HAVING 2 MORE CUSTOMIZED BUTTON . BUT THE THING IS THAT I AM NOT ABLE TO MAKE THAT BUTTON  FUNCTION .
    CAN ANY BODY HELP ME WITH HOW TO MAKE THAT BUTTON WORK IN THE SIMPLE REPORT . I HAVE USED AT USER COMMAND IN THE BEGINING OF REPORT BUT STILL ITS NOT WORKING .
    THANKING YOU
    ROHIT

    HII FRNDS THIS IS THE CODE
    CASE R_UCOMM.
        WHEN 'DISPLAY1'.
          LOC_INDEX = 1 .
          SET PF-STATUS 'STATUS' EXCLUDING 'DISPLAY1'.
          LOOP AT INT_OUTPUT INTO WA_OUTPUT
                             WHERE CHECKBOX = WC_MARKED.
            APPEND WA_OUTPUT TO INT_DISPLAY .
          ENDLOOP.
          LEAVE TO LIST-PROCESSING .
          PERFORM F9100_DISPLAY_DETAILS USING LOC_INDEX.
    ENDCASE.
    AT USER-COMMAND .
    CASE SY-UCOMM.
    WHEN 'BACK'.
    BREAK-POINT.
           PERFORM F9100_DISPLAY_DETAILS USING LOC_INDEX.
      ENDCASE.
    THE PERFORM F9100 DISPLAYES THE LIST REPORT . THERE ARE NO SPELLING ERRORS FRNDS .

  • Input user password with AR?

    Hi,
    I've read http://www.adobe.com/products/acrobat/acrrfaq.html and other sources regarding commenting PDFs with the Acrobat Reader.
    There are tools out there to encrypt a pdf-file and set a user password. If I do this the document security shows, that it is possible to add comments to the document (with the user password).
    But how do I enter the user password with AR? If a master password is set, a popup windows appears after opening the document, but what is the user password good for?
    There is a plugin in my AR9.0 which is for commenting PDFs.
    greetings from germany
    Stefan K.

    Hi,
    thanks Bernd,
    "There are a permission password and a open password."
    ok
    "Owners of the open password can open the PDF document."
    ok
    "Owners of the permission password can change the security settings."
    ok, but
    - changing the permissions requires Adobe Acrobat, right? not the AReader?
    - why are the document properties different in the document properties screen in AR?
    see: http://users.minet.uni-jena.de/~zsk/pdfs/StundenplanAR813.png
    this suggests that the permission password (user password?) is for protecting the document properties, which are listet there - not - for protecting the change of the security settings.
    - why are the document properties(*) different when opening the same document via Adobe Acrobat?
    see: http://users.minet.uni-jena.de/~zsk/pdfs/StundenplanA812std.png
    (*) this looks like the so called document properties are not properties of the document but properties of the adobe appl. I use to open it.
    this is all really confusing.
    Here is my questiong again: Is it possible to add comments to a document via AR if it has a user password? -> (why does the document security window in StundenplanAR813.png show a Commenting: Allowed?? and why does a Addon in AR exisist that is called Comments??)
    greetings
    Stefan K.

  • How to change Analyzer user password with Administration API?

    Hi,<BR>I would like to change Analyzer user password with Administration API. Can someone post some sample commands to do the task?<BR><BR>I would just like to write an application to change end user's Analyzer password.<BR>As I see I would need to do the following:<BR>1. login with admin userid/password<BR>2. execute some method to change password for required userid. I think the input parameter should be userid (of the user I would like to change password) and new password (the new password for the user).<BR>3. logout<BR><BR>Can someone post some sample code (commands to execute)?<BR><BR>Thanks,<BR>grofaty<BR><BR>My system:<BR>Analyzer Server 7.0.1.<BR>Essbase server 7.1<BR>Windows XP SP2<BR>

    <blockquote>quote:<br><hr><i>Originally posted by: <b>knightrich</b></i><BR>Hello Mr. Jordan.<BR><BR>I would like to exchange some thoughts about "housekeeping" Analyzer reports in preparation for migration from Analyzer 7.0.0.0.01472 to 9.x:<BR><BR>...<BR><BR>Did you solved such a problem or do you have an idea if it could be solved with the Admin API methods?<BR> ...<BR>Migration from 7.00 to 9.x: As we heard last week the "Migration Wizard for Reports" in 9.3 should be able to migrate reports. Do you have experience or more detailed information about that Wizard?<BR><BR>Many thanks in advance<BR><BR>knigthrich<hr></blockquote><BR><BR>knighrich, <BR>I'd like to be more help, but I have no experience with System 9. I did substantial cleanup when we migrated from Analyzer 6 to Analyzer 7.1, and even more cleanup when moving up to 7.2, but our installation is smaller in scale than yours and we didn't need to automate report cleanup.<BR><BR>You might be able to get the ownership information you need through the back door, doing a direct query on the database, but simpler might be an export users, at least from 7.0. (This facility probably doesn't exist in system 9; it was dropped in 7.2 in favor of an undocumented API) The export file is an xml file that could easily be parsed to identify reports that have the administrator as user and then a second pass to delete those with otuer ownership as well. As previously suggested, you might be able to get this by a well crafted SQL query against the repository.<BR><BR>Procedurally, we have both public reports that have the blessing of management and are widely available, owned by a "public owner", and private reports developed by indivdual users and shared or not. Our team maintains the public reports, but not the private reports. We may be asked to make a previously private report public and take over maintenance of it. <BR><BR>I hope that you can find a solution that meets your needs. Certainly a call to customer support to identify a poorly documented feature would be in order.<BR>

  • AT USER COMMAND is not getting triggerd

    Hi Techie's
    I have two fields on the selection screen
    1) Name:   ___________
    2) Id:         ___________
    I have some buttons say on the Application toolbar say::
    Save            Delete            Modify           Exit
    I have created these buttons in the INITIALIZATION event.
    I am using AT Selection Screen OUTPUT for some logic purpose.
    Later I am writing AT USER COMMAND and pressing  SAVE The function code for SAVE is "SAV".
    But the drama is that AT USER COMMAND is not getting triggered at all.
    It goes first to Initialization--->At selection Screen OUTPUT>Then screen appears> I give the values and press the SAVE button--
    again it goes to the At Selection screen OUTPUT.
    Not even getting the hang of it. Please help if anybody know the story of it.
    ITS SO URGENT.

    At user command is for list processing, you need something like this:
    Pushbuttons in the Application Toolbar
    In the application toolbar of the standard GUI status of the selection screen, five pushbuttons are predefined with the function codes FC01 to FC05, but are inactive by default. You can activate them during the definition of the selection screen as follows:
    SELECTION-SCREEN FUNCTION KEY i.
    The numbering i must be between 1 and 5. The individual function texts must be assigned to the functxt_0i components of structure sscrfields before the selection screen is called. You must declare this structure as an interface work area using the TABLES statement.
    If the user chooses one of these buttons, the runtime environment triggers the AT SELECTION-SCREEN event and the function code FC0i is placed into the component ucomm of the structure sscrfields.
    After the AT SELECTION-SCREEN event has been processed, the system displays the selection screen again. The only way to exit the selection screen and carry on processing the program is to choose Execute (F8). Consequently, the pushbuttons on the application toolbar are more suitable for controlling dynamic modifications of the selection screen than for controlling the program flow.
    REPORT demo_sel_screen_function_key.
    TABLES sscrfields.
    PARAMETERS: p_carrid TYPE s_carr_id,
                p_cityfr TYPE s_from_cit.
    SELECTION-SCREEN: FUNCTION KEY 1,
                      FUNCTION KEY 2.
    INITIALIZATION.
      sscrfields-functxt_01 = 'LH'.
      sscrfields-functxt_02 = 'UA'.
    AT SELECTION-SCREEN.
      CASE sscrfields-ucomm.
          WHEN'FC01'.
          p_carrid = 'LH'.
          p_cityfr = 'Frankfurt'.
        WHEN 'FC02'.
          p_carrid = 'UA'.
          p_cityfr = 'Chicago'.
      ENDCASE.
    START-OF-SELECTION.
      WRITE / 'START-OF-SELECTION'.
    This defines a standard selection screen with two parameters. In the application toolbar, two pushbuttons are assigned the texts LH and UA and activated.
    When the user clicks one of the buttons, the AT SELECTION-SCREEN event is triggered and there the input fields are preassigned correspondingly.

  • How to set user command in module pool program

    hello expert,
    like in report: PARAMETERS: RB_SING RADIOBUTTON GROUP RAD3 DEFAULT 'X' USER-COMMAND C1.
    in module pool program, hw to set user-command in screen.
    srinivas

    PBO.
    Call subscreen <SUBSCREEN NAME> Including sy-repid(PROGRAM NAME) G_DYNNR(SCREEN NUMBER'.
    PAI
    module user_command.
    Call subscreen <subscreen name>
    Module user_command.
    case sy-ucomm.
    when 'BUT1'.
    g_dynnr = 200.
    when 'BUT2'.
    g_dynnr = 300.
    Endcase.
    end module
    REPORT demo_dynpro_tabstrip_server.
    CONTROLS mytabstrip TYPE TABSTRIP.
    DATA: ok_code TYPE sy-ucomm,
    save_ok TYPE sy-ucomm.
    DATA number TYPE sy-dynnr.
    mytabstrip-activetab = 'PUSH2'.
    number = '0120'.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    MODULE cancel INPUT.
    LEAVE PROGRAM.
    ENDMODULE.
    MODULE user_command INPUT.
    save_ok = ok_code.
    CLEAR ok_code.
    IF save_ok = 'OK'.
    MESSAGE i888(sabapdocu) WITH 'MYTABSTRIP-ACTIVETAB ='
    mytabstrip-activetab.
    ELSE.
    mytabstrip-activetab = save_ok.
    CASE save_ok.
    WHEN 'PUSH1'.
    number = '0110'.
    WHEN 'PUSH2'.
    number = '0120'.
    WHEN 'PUSH3'.
    number = '0130'.
    ENDCASE.
    ENDIF.
    ENDMODULE.
    flow logic of the screen 100
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    CALL SUBSCREEN SUB INCLUDING SY-REPID NUMBER.
    PROCESS AFTER INPUT.
    MODULE CANCEL AT EXIT-COMMAND.
    CALL SUBSCREEN SUB.
    MODULE USER_COMMAND.
    flow logic of the screen 110
    PROCESS BEFORE OUTPUT.
    PROCESS AFTER INPUT.
    flow logic of the screen 120
    PROCESS BEFORE OUTPUT.
    PROCESS AFTER INPUT.
    flow logic of the screen 130
    PROCESS BEFORE OUTPUT.
    PROCESS AFTER INPUT.
    REGARDS
    VASU

  • User command

    in radio button at the end we used user command usr..
    why we are using this.eg,         
    SELECTION-SCREEN BEGIN OF BLOCK RB WITH FRAME TITLE text.
                 PARAMETERS : Import RADIOBUTTON GROUP RB user-command usr,
                              Export RADIOBUTTON GROUP RB DEFAULT 'X'.

    USER COMMAND will perform actions on radiobutton click
    <b>chk this example first using USER-COMMAND USR</b>
    REPORT ABC MESSAGE-ID ZZ.
    PARAMETERS : IMPORT RADIOBUTTON GROUP RB USER-COMMAND USR,
    EXPORT RADIOBUTTON GROUP RB DEFAULT 'X'.
    PARAMETERS : P_MATNR LIKE MARA-MATNR.
    AT SELECTION-SCREEN OUTPUT.
      IF IMPORT EQ 'X'.
        LOOP AT SCREEN.
          IF SCREEN-NAME EQ 'P_MATNR'.
            SCREEN-INPUT = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF EXPORT EQ 'X'.
        LOOP AT SCREEN.
          IF SCREEN-NAME EQ 'P_MATNR'.
            SCREEN-INPUT = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    <b>and then removing user-command , notice the difference</b>
    REPORT ABC MESSAGE-ID ZZ.
    PARAMETERS : IMPORT RADIOBUTTON GROUP RB
    EXPORT RADIOBUTTON GROUP RB DEFAULT 'X'.
    PARAMETERS : P_MATNR LIKE MARA-MATNR.
    AT SELECTION-SCREEN OUTPUT.
      IF IMPORT EQ 'X'.
        LOOP AT SCREEN.
          IF SCREEN-NAME EQ 'P_MATNR'.
            SCREEN-INPUT = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF EXPORT EQ 'X'.
        LOOP AT SCREEN.
          IF SCREEN-NAME EQ 'P_MATNR'.
            SCREEN-INPUT = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.

  • Objects not created after the AT USER-COMMAND

    Hi experts, gud evening. I'm new to ooabap. in my prog. after the at user-command the objects are not getting created. so i've created even before that. even then i couldn't get that created. so pls help me where the prob. is
    Prog :
    REPORT  yrj_my_oops.
          CLASS cl_vbak DEFINITION
    CLASS cl_vbak DEFINITION.
      PUBLIC SECTION.
        METHODS : load_data IMPORTING value(im_kunnr) TYPE vbak-kunnr,
                  display_head,
                  write_data.
      PROTECTED SECTION.
      PRIVATE SECTION.
        DATA : it_vbak TYPE TABLE OF vbak,
               wa_vbak TYPE vbak.
    ENDCLASS.                    "cl_vbak DEFINITION
    DATA : w_vbeln TYPE vbak-vbeln.
          CLASS cl_vbap DEFINITION
    CLASS cl_vbap DEFINITION.
      PUBLIC SECTION.
        METHODS : load_data IMPORTING value(im_vbeln) TYPE vbak-vbeln,
                  write_data.
      PROTECTED SECTION.
      PRIVATE SECTION.
        DATA : it_vbap TYPE TABLE OF vbap,
               wa_vbap TYPE vbap.
    ENDCLASS.                    "cl_vbap DEFINITION
          CLASS cl_vbap IMPLEMENTATION
    CLASS cl_vbap IMPLEMENTATION.
      METHOD load_data.
        SELECT * FROM vbap INTO TABLE it_vbap WHERE vbeln = w_vbeln.
      ENDMETHOD.                    "load_data
      METHOD write_data.
        LOOP AT it_vbap INTO wa_vbap.
          WRITE : /5 wa_vbap-posnr,
                  20 wa_vbap-matnr,
                  35 wa_vbap-arktx,
                  70 wa_vbap-netpr.
        ENDLOOP.
      ENDMETHOD.                    "write_data
    ENDCLASS.                    "cl_vbap IMPLEMENTATION
          CLASS cl_vbak IMPLEMENTATION
    CLASS cl_vbak IMPLEMENTATION.
      METHOD  load_data.
        SELECT * FROM vbak INTO TABLE it_vbak WHERE kunnr EQ im_kunnr.
      ENDMETHOD.                    "load_data
      METHOD display_head.
        WRITE : /5 'Order No.',
                15 'Order Date',
                30 'Net Value'.
      ENDMETHOD.                    "display_head
      METHOD write_data.
        LOOP AT it_vbak INTO wa_vbak.
          WRITE : /5 wa_vbak-vbeln,
                  15 wa_vbak-audat,
                  30 wa_vbak-netwr.
        ENDLOOP.
      ENDMETHOD.                    "write_data
    ENDCLASS.                    "cl_vbak IMPLEMENTATION
    PARAMETERS : p_kunnr TYPE vbak-kunnr.
    DATA   : o_vbak TYPE REF TO cl_vbak,
             o_vbap TYPE REF TO cl_vbap.
    START-OF-SELECTION.
      SET PF-STATUS : 'YRJ_MY_OOPS'.
      CREATE OBJECT o_vbak.
      CREATE OBJECT o_vbap.
      CALL METHOD o_vbak->load_data
        EXPORTING
          im_kunnr = p_kunnr.
      CALL METHOD o_vbak->display_head.
      CALL METHOD o_vbak->write_data.
    AT USER-COMMAND.
      w_vbeln = sy-lisel+4(10).
      CASE sy-ucomm.
        WHEN 'BACK' or 'EXIT'.
          LEAVE LIST-PROCESSING.
        WHEN 'ITEM'.
         CREATE OBJECT o_vbap.
          CALL METHOD o_vbap->load_data
            EXPORTING
              im_vbeln = w_vbeln.
          CALL METHOD o_vbap->write_data.
         WHEN OTHERS.
      ENDCASE.

    Hi,
    I dont see any problem with you code. I ran your code in my system and worked fine. Except for one thing that is you need to do a conversion exit on the w_vbeln before selecting data from VBAP in method load data. This is because when you ouput the data, the VBELN is converted to external format and thus needs to be converted to internal format if you want to do further selects based on it.
    CLASS cl_vbap IMPLEMENTATION.
      METHOD load_data.
    " Add this , so it converts the VBELN to internal format.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = w_vbeln
          IMPORTING
            output = w_vbeln.
        SELECT * FROM vbap INTO TABLE it_vbap WHERE vbeln = w_vbeln.
      ENDMETHOD. "load_data
      METHOD write_data.
        LOOP AT it_vbap INTO wa_vbap.
          WRITE : /5 wa_vbap-posnr,
          20 wa_vbap-matnr,
          35 wa_vbap-arktx,
          70 wa_vbap-netpr.
        ENDLOOP.
      ENDMETHOD. "write_data
    regards,
    Advait

  • Sync AD user credentials with a SQL database

    Hi folks!
    I need some help to how Sync the user and password from my Active Directory, to a SQL Database.
    Actualy, my enviroment have a database with users and password added, my custom applications uses it like a passport, but now I want to use Active Directory to control these users, but I can't use windows authentication in my old apps. I was reading about
    Forefront Identity Manager to do this, but I need a free solution.
    The Sharepoint database sync user credentials with AD? Any ideas how I can do this?
    Thanks in advance!
    MCTS Exchange 2010. @pedrongjr

    Looks like you need a linked SERVER to AD
    create table #t (email varchar(100),sAMAccountName varchar(100),EmployeeID varchar(100))
    insert into  #t Exec master..spQueryAD 'SELECT EmployeeID, SamAccountName, mail
     FROM ''LDAP://dc=companyname,dc=com'' WHERE objectCategory=''person'' and objectclass=''user''', 0
    USE [master]
    GO
    /****** Object:  StoredProcedure [dbo].[spQueryAD]    Script Date: 17/03/2014 13:56:45 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER procedure [dbo].[spQueryAD] (@LDAP_Query varchar(255)='', @Verbose bit=0)
    as
    --verify proper usage and display help if not used properly
    if @LDAP_Query ='' --argument was not passed
        BEGIN
        Print ''
        Print 'spQueryAD is a stored procedure to query active directory without the default 1000 record LDAP query limit'
        Print ''
        Print 'usage -- Exec spQueryAD ''_LDAP_Query_'', Verbose_Output(0 or 1, optional)'
        Print ''
        Print 'example: Exec spQueryAD ''SELECT EmployeeID, SamAccountName FROM ''''LDAP://dc=domain,dc=com'''' WHERE objectCategory=''''person'''' and objectclass=''''user'''''', 1'
        Print ''
        Print 'spQueryAD returns records corresponding to fields specified in LDAP query.'
        Print 'Use INSERT INTO statement to capture results in temp table.'
        Return --'spQueryAD aborted'
        END
    --declare variables
    DECLARE @ADOconn INT -- ADO Connection object
          , @ADOcomm INT -- ADO Command object
          , @ADOcommprop INT -- ADO Command object properties pointer
          , @ADOcommpropVal INT -- ADO Command object properties value pointer
          , @ADOrs INT -- ADO RecordSet object
          , @OLEreturn INT -- OLE return value
          , @src varchar(255) -- OLE Error Source
          , @desc varchar(255) -- OLE Error Description
          , @PageSize INT -- variable for paging size Setting
          , @StatusStr char(255) -- variable for current status message for verbose output
    SET @PageSize = 1000 -- IF not SET LDAP query will return max of 1000 rows
    --Create the ADO connection object
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Create ADO connection...'
        Print @StatusStr
        END
    EXEC @OLEreturn = sp_OACreate 'ADODB.Connection', @ADOconn OUT
    IF @OLEreturn <> 0 
        BEGIN -- Return OLE error
              EXEC sp_OAGetErrorInfo @ADOconn , @src OUT, @desc OUT
              SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
              RETURN
        END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --SET the provider property to ADsDSOObject to point to Active Directory
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Set ADO connection to use Active Directory driver...'
        Print @StatusStr
        END
    EXEC @OLEreturn = sp_OASETProperty @ADOconn , 'Provider', 'ADsDSOObject'
    IF @OLEreturn <> 0 
        BEGIN -- Return OLE error
              EXEC sp_OAGetErrorInfo @ADOconn , @src OUT, @desc OUT
              SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
              RETURN
        END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --Open the ADO connection
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Open the ADO connection...'
        Print @StatusStr
        END
    EXEC @OLEreturn = sp_OAMethod @ADOconn , 'Open'
    IF @OLEreturn <> 0 
        BEGIN -- Return OLE error
              EXEC sp_OAGetErrorInfo @ADOconn , @src OUT, @desc OUT
              SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
              RETURN
        END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --Create the ADO command object
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Create ADO command object...'
        Print @StatusStr
        END
    EXEC @OLEreturn = sp_OACreate 'ADODB.Command', @ADOcomm OUT
    IF @OLEreturn <> 0 
        BEGIN -- Return OLE error
              EXEC sp_OAGetErrorInfo @ADOcomm , @src OUT, @desc OUT
              SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
              RETURN
        END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --SET the ADO command object to use the connection object created first
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Set ADO command object to use Active Directory connection...'
        Print @StatusStr
        END
    EXEC @OLEreturn = sp_OASETProperty @ADOcomm, 'ActiveConnection', 'Provider=''ADsDSOObject'''
    IF @OLEreturn <> 0 
        BEGIN -- Return OLE error
              EXEC sp_OAGetErrorInfo @ADOcomm , @src OUT, @desc OUT
              SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
              RETURN
        END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --Get a pointer to the properties SET of the ADO Command Object
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Retrieve ADO command properties...'
        Print @StatusStr
        END
    EXEC @OLEreturn = sp_OAGetProperty @ADOcomm, 'Properties', @ADOcommprop out
    IF @OLEreturn <> 0 
        BEGIN -- Return OLE error
              EXEC sp_OAGetErrorInfo @ADOcomm , @src OUT, @desc OUT
              SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
              RETURN
        END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --SET the PageSize property
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Set ''PageSize'' property...'
        Print @StatusStr
        END
    IF (@PageSize IS NOT null) -- If PageSize is SET then SET the value
    BEGIN
        EXEC @OLEreturn = sp_OAMethod @ADOcommprop, 'Item', @ADOcommpropVal out, 'Page Size'
        IF @OLEreturn <> 0 
            BEGIN -- Return OLE error
                  EXEC sp_OAGetErrorInfo @ADOcommprop , @src OUT, @desc OUT
                  SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
                  RETURN
            END
        EXEC @OLEreturn = sp_OASETProperty @ADOcommpropVal, 'Value','1000'
        IF @OLEreturn <> 0 
            BEGIN -- Return OLE error
                  EXEC sp_OAGetErrorInfo @ADOcommpropVal , @src OUT, @desc OUT
                  SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
                  RETURN
            END
    END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --SET the SearchScope property to ADS_SCOPE_SUBTREE to search the entire subtree 
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Set ''SearchScope'' property...'
        Print @StatusStr
        END
    BEGIN
        EXEC @OLEreturn = sp_OAMethod @ADOcommprop, 'Item', @ADOcommpropVal out, 'SearchScope'
        IF @OLEreturn <> 0 
            BEGIN -- Return OLE error
                  EXEC sp_OAGetErrorInfo @ADOcommprop , @src OUT, @desc OUT
                  SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
                  RETURN
            END
        EXEC @OLEreturn = sp_OASETProperty @ADOcommpropVal, 'Value','2' --ADS_SCOPE_SUBTREE
        IF @OLEreturn <> 0 
            BEGIN -- Return OLE error
                  EXEC sp_OAGetErrorInfo @ADOcommpropVal , @src OUT, @desc OUT
                  SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
              RETURN
        END
    END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --SET the Asynchronous property to True
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Set ''Asynchronous'' property...'
        Print @StatusStr
        END
    BEGIN
        EXEC @OLEreturn = sp_OAMethod @ADOcommprop, 'Item', @ADOcommpropVal out, 'Asynchronous'
        IF @OLEreturn <> 0 
            BEGIN -- Return OLE error
                  EXEC sp_OAGetErrorInfo @ADOcommprop , @src OUT, @desc OUT
                  SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
                  RETURN
            END
        EXEC @OLEreturn = sp_OASETProperty @ADOcommpropVal, 'Value',True
        IF @OLEreturn <> 0 
            BEGIN -- Return OLE error
                  EXEC sp_OAGetErrorInfo @ADOcommpropVal , @src OUT, @desc OUT
                  SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
                  RETURN
        END
    END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --Create the ADO Recordset to hold the results of the LDAP query
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Create the temporary ADO recordset for query output...'
        Print @StatusStr
        END
    EXEC @OLEreturn = sp_OACreate 'ADODB.RecordSET',@ADOrs out
    IF @OLEreturn <> 0 
        BEGIN -- Return OLE error
              EXEC sp_OAGetErrorInfo @ADOrs , @src OUT, @desc OUT
              SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
              RETURN
        END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --Pass the LDAP query to the ADO command object
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Input the LDAP query...'
        Print @StatusStr
        END
    EXEC @OLEreturn = sp_OASETProperty @ADOcomm, 'CommandText', @LDAP_Query 
    IF @OLEreturn <> 0 
        BEGIN -- Return OLE error
              EXEC sp_OAGetErrorInfo @ADOcomm , @src OUT, @desc OUT
              SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
              RETURN
        END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --Run the LDAP query and output the results to the ADO Recordset
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Execute the LDAP query...'
        Print @StatusStr
        END
    Exec @OLEreturn = sp_OAMethod @ADOcomm, 'Execute' ,@ADOrs OUT
    IF @OLEreturn <> 0 
        BEGIN -- Return OLE error
              EXEC sp_OAGetErrorInfo @ADOcomm , @src OUT, @desc OUT
              SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
              RETURN
        END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    --Return the rows found
    IF @Verbose=1
        BEGIN
        Set @StatusStr = 'Retrieve the LDAP query results...'
        Print @StatusStr
        END
    EXEC @OLEreturn = sp_OAgetproperty @ADOrs, 'getrows'
        IF @OLEreturn <> 0 
        BEGIN -- Return OLE error
              EXEC sp_OAGetErrorInfo @ADOrs , @src OUT, @desc OUT
              SELECT Error=CONVERT(varbinary(4),@OLEreturn), Source=@src, Description=@desc
              RETURN
        END
    IF @Verbose=1 Print Space(len(@StatusStr)) + 'done.'
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • Cross-reference failure when converted to PDF

    One of my clients uses FrameMaker 7.1 to author their product documents, and convert everything to PDF before releasing it. I often see problems where cross-references within the document work in FrameMaker, but do not work as links in PDF, even thou

  • ABAP with BAPI'S ?

    Hello Friends, I am basically a J2ee developer and very new to ABAP Programming language, and need to do some BAPI call through ABAP. I am having a following problem, and I am very thankful to some one who can help me out ! The problem is: For exampl

  • I cannot bring up a gallery, sent as an on-line, on another computer.  Ok on my computer

    I have up loaded a gallery of viedos and photos to my URL page, which I can bring up on my computer, but cannot be seen on another computer.  How do I upload a gallery to my photshop.com web page, which can be seen by people I send the URL?

  • ST06 Screen values are not showing as ecpected

    Hi Experts, ST06 Screen values are not showing as expected like avg CPU idle time and min Swap space, page out and page in values etc. All fileds are showing "Zero Values" since last week and i just found tht today. I Went  to SM 36, All Configured s

  • HT1491 where do I find music to download

    Question, as a new user I am battling to find music to purchase on here