Transfer data from XI message interafce to internal table

my code is like this..
TYPES: BEGIN OF xxx,
        vbeln            TYPE vbrk-vbeln,
      END OF xxx.
Data yyy TYPE TABLE OF xxx.
i have an XI mesage interface where i have an internal table which holds 10 numbers(itab). i want those to be transferref to my internal table in the proxy class. how do i do that. i am done upto this part..
LOOP AT itab into cstr
where cstr is a string to hold the individual values of itab for transfer
ENDLOOP

resolved

Similar Messages

  • How to extract data from info cube into an internal table using ABAP code

    HI
    Can Anyone plz suggest me
    How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
    Thankx in advance
    regds
    AJAY

    HI Dinesh,
    Thankq for ur reply
    but i ahve already tried to use the function module.
    When I try to Use the function module RSDRI_INFOPOV_READ
    I get an information message "ERROR GENERATION TEST FRAME".
    can U plz tell me what could be the problem
    Bye
    AJAY

  • Join data from a file with an internal table

    Hi to everybody!!
    I need help, I don't know how to join two differents data, one of them is internal...
    This select fill my itab
        SELECT PERNR PERID VORNA NACHN  FROM PA0002 APPENDING TABLE itab_tabla
            WHERE
            PA0002~BEGDA <= SY-DATUM AND
            PA0002~ENDDA >= SY-DATUM AND
            PERID  = G_PERID.
         ENDLOOP.
    Now I have to insert inside the table more data that pass from a file...but I don't know how to join this... can anybody help me?
    Thanks a lot
    Regards,
    Rebeca

    HI,
    you will need to upload the file by Using the FM GUI_UPLOAD.
    this will take the data from the file to an internal table that you will have to declare.
    once you get the data in to your table,you can merge both the tables in to another final table or in the 1st internal table if all the fields are there and modify the table.so the table will have the records of both the tables.
    after you get the data in your second table"
    loop at itab2.
    move: <field 1> to itab1.
              <field 2> to itab1.
    modify itab1.
    endloop.

  • How to Copy data from field symbol to Dynamic Internal Table

    Hi,
    I want to copy the data between two dynamic Internal tables . Following is the code were I have data in the field symbol wanted to transfer it to the other Internal table :
    REPORT  ztest.
    DATA:
           gd_dref          TYPE REF TO data,
           gd_dref1          TYPE REF TO data.
    FIELD-SYMBOLS:  <fs1>   TYPE any,
                               <fs_wa> TYPE any,
                                <field>    TYPE any,                  
                                <fs_wa1> TYPE ANY TABLE.  * Contains data from p_src
    *Copy data from p_src to p_dest*
    PARAMETERS: p_src LIKE dd02l-tabname .    * Name of Dynamic Internal table *
                             p_dest LIKE dd02l-tabname .  * Name of Dynamic Internal table*
    *DATA : lt_csks LIKE p_dest WITH HEADER LINE.
    START-OF-SELECTION.
      CREATE DATA gd_dref TYPE (p_src).
      CREATE DATA gd_dref1 TYPE TABLE OF (p_src).
       ASSIGN gd_dref->* TO <fs_wa>.
       ASSIGN gd_dref1->* TO <fs_wa1>.
       SELECT * FROM (p_src) INTO TABLE <fs_wa1>.
    *Write out data from FIELD SYMBOLS TO Table.
       loop at <fs_wa1> into <fs_wa>.
         do.
           assign component  sy-index
              of structure <fs_wa> to <field>.
           if sy-subrc <> 0.
           exit.
           endif.
           if sy-index = 1.
             write:/ <field>.
           else.
           write: / <field>.
           endif.
         enddo.
       endloop.
    *Need Logic To Copy the Data to p_dest table from <fs_wa1>.
    *p_dest is a table having a similar structure to table p_src .
    *Need Logic To Copy the Data to p_dest table from <fs_wa1>.
    EXIT.
    Thanks in Advance.

    try this...
    I have extended your source code and just used vbak/vbap as an example as they have some common fields like vbeln/erdat etc which corresponds with your requirement of 'similar structure' i.e. shared/common fields in both.
    Cheers...
    report  ztest.
    data:
      gd_dref type ref to data,
      gd_dref1 type ref to data,
      gd_dref_str type ref to data,
      gd_dref_tab type ref to data.
    field-symbols:
      <fs1> type any,
      <fs_wa> type any,
      <fs1_dest_str> type any,
      <fs_dest_tab> type any table,
      <field> type any,
      <fs_wa1> type any table.
    * contains data from p_src
    *Copy data from p_src to p_dest*
    parameters: p_src like dd02l-tabname default 'vbak',
    * name of dynamic internal table *
                p_dest like dd02l-tabname default 'vbap'.
    * name of dynamic internal table*
    *data : lt_csks like p_dest with header line.
    start-of-selection.
      create data gd_dref type (p_src).
      create data gd_dref1 type table of (p_src).
      assign gd_dref->* to <fs_wa>.
      assign gd_dref1->* to <fs_wa1>.
      select * from (p_src) into corresponding fields of table <fs_wa1>
      up to 3 rows
      where vbeln ne space.
      create data gd_dref_str type (p_dest).
      create data gd_dref_tab type standard table of (p_dest).
      assign gd_dref_str->* to <fs1_dest_str>.
      assign gd_dref_tab->* to <fs_dest_tab>.
    *write out data from field symbols to table.
      loop at <fs_wa1> into <fs_wa>.
        " break-point here - can see vbeln/waers/create date/ etc move over to new structure
        " the 'common' fields of your structures - the same will happen. if they not the same name you will have to do an
        " explicit move i.e. if fieldname = xyz ....move fieldxyz to new field123....after the move-corre
        break-point.
        move-corresponding <fs_wa> to <fs1_dest_str>.
        insert <fs1_dest_str> into table <fs_dest_tab>.
    **    do.
    **      assign component  sy-index
    **         of structure <fs_wa> to <field>.
    **      if sy-subrc <> 0.
    **        exit.
    **      endif.
    **      if sy-index = 1.
    **        write:/ <field>.
    **      else.
    **        write: / <field>.
    **      endif.
    **    enddo.
      endloop.
      " write out some dest data from the dest table build from previous loop
      loop at <fs_dest_tab> assigning <fs1_dest_str>.
        do.
          assign component sy-index of structure <fs_wa> to <field>.
          if sy-subrc <> 0.
            exit.
          endif.
          if sy-index = 1.
            write:/ <field>.
          else.
            write: / <field>.
          endif.
        enddo.
      endloop.

  • How to fetch data from bseg based  on 2 internal tables in 1 select query?

    hi,
    i have bukrs and belnr in one internal table and bukrs and vbeln in another internal table..now if i select from bseg twice using for all entries for fields bukrs vbeln and bukrs belnr twice in 2 select statements its fine..but since bseg is a huge table i want to use select only once..but the problem is that none of the belnrs in the one internal table will have vbeln in another internal table....ie if vbeln is selected from bseg based on belnr in 1 internal table non eof those vbeln will be equal to vbeln on another internal tables..in this scenario even if i take all data from two internal tables into 1 single internal table and then use for all entries on vbeln and belnr of that table ..but i think this will not work because and AND operator will not work because no record will satisfy both vbeln and belnr conditions..even if i use OR operator if the 1st condition satisfies the select clause will not enter into the second clause and all the records will not be fetched...Please help how should i tackle this..

    Hi vijaya,
    no simple select statement solution so far.
    As BSEG is a huge table you should try to get the full key values into another internal table first.
    SAP avoids direct selections from BSEG.
    Pleas consider the use of one of the secondary index tables first:
          BSAD : Accounting: Secondary Index for Customers (Cleared Items)
          BSAK : Accounting: Secondary Index for Vendors (Cleared Items)
          BSAS : Accounting: Secondary Index for G/L Accounts (Cleared Item
          BSEC : One-Time Account Data Document Segment
          BSEG : Accounting Document Segment
          BSID : Accounting: Secondary Index for Customers
          BSIK : Accounting: Secondary Index for Vendors
          BSIS : Accounting: Secondary Index for G/L Accounts
    you may include
          BKPF : Accounting Document Header
    for restrictions about time and document type.
    The last step is a FOR ALL ENTRIES selection from BSEG providing the full key values.
    Although you may have even more selects, the overall performance will be much better.
    Regards,
    Clemens

  • Read data from xml files and  populate internal table

    Hi.
    How to read data from xml files into internal tables?
    Can u tell me the classes and methods to read xml data..
    Can u  explain it with a sample program...

    <pre>DATA itab_accontextdir TYPE TABLE OF ACCONTEXTDIR.
    DATA struct_accontextdir LIKE LINE OF itab_accontextdir.
    DATA l_o_error TYPE REF TO cx_root.
    DATA: filename type string ,
                 xmldata type xstring .
    DATA: mr      TYPE REF TO if_mr_api.
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
    WRITE xmldata.
    TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.
    LOOP AT itab_accontextdir INTO struct_accontextdir.
        WRITE: / struct_accontextdir-context_id,
               struct_accontextdir-context_name,
               struct_accontextdir-context_type.
        NEW-LINE.
        ENDLOOP.</pre>
    <br/>
    Description:   
    In the above code snippet I am storing the data in an xml file(you know xml is used to store and transport data ) called 'xml_accontextdir.xml' that is uploaded into the MIME repository at path 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'.
    The below API is used to read a file in MIME repo and convert it into a string that is stored in ' xmldata'. (This is just a raw data that is got by appending the each line of  xml file).
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
        Once the 'xmldata' string is available we use the tranformation to parse the xml string that we have got from the above API and convert it into the internal table.
    <pre>TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.</pre>
    Here the trasnsformation 'id ' is used to conververt the source xml 'xmldata' to resulting internal table itab_accontextdir, that have same structure as our xml file 'xml_accontextdir.xml'.  In the RESULT root of the xml file has to be specified. (In my the root is 'shiva'). 
    Things to be taken care:
    One of the major problem that occurs when reading the xml file is 'format not compatible with the internal table' that you are reading into internal table.  Iin order to get rid of this issue use one more tranformation to convert the data from the internal table into the xml file.    
    <pre>TRY.
          CALL TRANSFORMATION id
            SOURCE shiv = t_internal_tab
            RESULT XML xml.
        CATCH cx_root INTO l_o_error.
      ENDTRY.
      WRITE xml.
      NEW-LINE.</pre>
    <br/>
    This is the same transformation that we used above but the differnce is that the SOURCE and RESULT parameters are changed the source is now the internal table and result is *xml *string. Use xml browser that is available with the ABAP workbench to read the xml string displayed with proper indentation. In this way we get the format of xml file to be used that is compatable with the given internal table. 
    Thank you, Hope this will help you!!!
    Edited by: Shiva Prasad L on Jun 15, 2009 7:30 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 11:56 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 12:06 PM

  • Data from field symbol into an internal table or workarea

    Hi Experts,
    I have field symbol in which i get the data. I want to get this data into an internal table of type any or into an work area. How is this possible.
    My declaration for field symbol is as follow:
    FIELD-SYMBOLS: <l_t_data> TYPE any.
    DATA l_r_data TYPE REF TO data.
        CREATE DATA l_r_data type STANDARD TABLE OF (l_local_tab).
        ASSIGN l_r_data->* TO <l_t_data>.
    I get the data in this field symbol <l_t_data>. by passing into a funtion module. and I get the data into it. Now i have to assign the values of this field symbol to any internal table or to a work are how do i do it. Please help.
    Regards,
    Prashant.

    Not exactly sure what you need here, but.....
    FIELD-SYMBOLS: <l_t_data> TYPE TABLE.   "<<-- Change this
    FIELD-SYMBOLS: <l_s_data> TYPE ANY.      "<<---Add This
    DATA l_r_data TYPE REF TO data.
    CREATE DATA l_r_data type STANDARD TABLE OF (l_local_tab).
    ASSIGN l_r_data->* TO <l_t_data>.
    Loop at <l_t_data> assigning <l_s_data>.
    * Do what ever using <l_s_data>
    Endloop.
    Regards,
    Rich Heilman
    Edited by: Rich Heilman on Feb 28, 2008 2:42 PM

  • HOW TO TRANSFER DATA FROM CHAR TYPE TO NON CHAR TYPE

    HI EXPORTS,
             THIS IS SASIDHAR, I HAD UPLOADED DATA FROM FLAT FILE INTO DYNAMICAL INTERNAL TABLE NAME <T_UPLOAD>. THIS INTERNAL TABLE FIELDS ARE CONVERTED INTO CHAR TYPE FIELDS. NOW I HAVE TO TRANSFER THIS DATA INTO ANOTHER INTERNAL TABLE  <DYN_TABLE> WHICH CONTAINS BOTH CHARACTER AND NON CHARACTER FIELDS. PLEASE ANY ONE GUIDE ME REGARDING THIS ISSUE.
    THANKS AND REGARDS
    SASIDHAR.V

    there is no specific CASTING operation in ABAP, so just do following:
    non-char-field = char-field.
    as long as it is possible ABAP does implicit casting and you dont have to care about anything.

  • Transfer data from MS Excel to Oracle table

    Hello,
    hope someone can help: What is the easiest way to transfer data from Excel sheet to a Oracle table and how ?
    An example of a row to transfer is given below
    Date Time Value 1 Value 2
    2004-02-02     03:47:39     9,62     3,62     
    Thanks in advance
    Regards
    Roar

    From Microsoft access , import data from Excel to an Access table.
    Format that Access Table properly in Design mode.
    Create a table as per your specification in oracle Database.
    Then export to oracle from access using approppriate ODBC driver.
    --Sayan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Get data in editable ALV back to internal table without data_changed ev?

    Hi,
       I have an editable ALV using classes to whch I have users the option to edit directly on the screen or upload data from an excel. The event data_changed gets triggered when users edit the table on the screen.
    However when EXCEL is uploaded, I refresh the table display. So, I need a way to get the data from the ALV into a internal table to check which rows were update using the excel and save them into the db table.
    Prakash

    Hi!
    For more information, inspect programs suiting the mask "BCALVEDIT*" and the thread with header "How to make a row of ALV editable " (I know this is some more steps further from your demand but it may be useful) at URL " How to make a row of ALV editable " .
    If you want to study more BC412 "EnjoySAP Controls" may help you.
    *--Serdar

  • How do i transfer data from one internal tabe to another.

    Hi All,
             How do i transfer data from one internal tabe to another.
             Can i do it ebven if he tables are different in structure.
    Please Advice.
    Thanks in advance.

    Hi Saket Tiwari,
    I hope the earlier post by kashyap is good enough an answer. anywas in addition to it let me give a detailed
    explanation of how you can populate an internal table.
    1) Append data line by line.
         Syntax :  APPEND [<wa> TO / INITIAL LINE TO] <itab>.
    this appends new line to internal table <itab>.
    2) Using COLLECT statement.
                 COLLECT is another form of statement used for populating the internal tables.  Generally COLLECT is used while inserting lines into an internal table with unique standard key. The syntax for COLLECT statement is as shown
         Syntax : COLLECT [<wa> INTO] <itab>.
    3) Using INSERT statement
         Syntax  INSERT [<wa> INTO / INITIAL LINE INTO] <itab> [index <idx>].
    INSERT statement adds a line/work area to the internal table. You can specify the position at which the new line is to be added by using the INDEX clause with the INSERT statement.
    Now coming to your request..
    To append part or all of an internal table
         Syntax
                  APPEND LINES OF <itab1> [FROM <n1>] [TO <n2>] TO <itab2>.
    *     Note:
    Without the FROM and TO options, this statement appends the entire table <itab1> to <itab2>.*
    b) To insert part or all of an internal table into another internal table
         Syntax
              INSERT LINES OF <itab1> [FROM <n1>] [TO <n2>]
              INTO <itab2> [INDEX <idx>].
    c) Using Move statement.
    To copy entire contents of one table into another in one execution
         Syntax MOVE  <itab1> To <itab2>.
                   OR
              <itab1> = <itab2>.
    but u hav to be careful because he contents of itab2 will eb overwritten on the execution of this statement.
    These copy the contents of ITAB1 to ITAB2. Incase of internal tables with header line we have to use [] inorder to distinguish from work area. So, to copy contents of internal tables with header line  the syntax becomes,
    ITAB1[] = ITAB2[].
    Coming to the letter part of your question, Yes, we can copy values between tables having different structures.
    for this we use    
                                MOVE-CORRESPONDING <itab1> TO <itab2>
        this executes the statement for their header lines. Searches for the sub-fields which occur both in itab1 and itab2 and then generates, for all relevant field pairs which correspond to the
            sub-fields ni , statements of the form MOVE itab1-ni TO itab2-ni. The other fields remain unchanged.
    I hope the information provided has been of your help.
    Reward if useful.
    Regards,
    Jose

  • How to transfer data from a dynamic internal table

    Hi All
    I want to transfer data from a dynamic internal table<dyn_table>
    to a non dynamic internal table itab which should have the same structure as <dyn_table>.
    How can this be done?
    Regards,
    Harshit Rungta

    As stated earlier this can be done only through field symbols...
    You cannot create an non dynamic internal table with ANY structure...using DATA statement
    If the strucutre is defined well and good...you can create an non-dynamic internal table...
    If you do not know the structure then the internal table has to be dynamic...and to be generated using field symbols
    DATA: lv_ref TYPE REF TO data.
    FIELD-SYMBOLS: <fs_dyn_table> TYPE STANDARD TABLE.
    * You create a dynamic internal table...
    CREATE DATA lv_ref LIKE (your_dynamic_internal_table).
    ASSIGN lv_ref->* TO <fs_dyn_table>.
    Now...do the transfer.
    <fs_dyn_table> = "your_dynamic_internal_Table
    Hope it helps!

  • How to Transfer Data from editable ALV grid control to internal table?

    Hi,
    Can anyone give me a simple example by which I can transfer data from editable alv grid control back to the internal table. The ALV has been created by OO approach.
    I would appreciate if the solution is provided without handling any events.
    Regards,
    Auro

    Hello Auro
    You simply need to call method <b>go_grid->check_changed_data</b> at PAI of the dynpro displaying the ALV grid. If data have been changed on the editable ALV grid then this method will raise event DATA_CHANGED. If you do not want or need to handle this event (e.g. for validating the edited values) then you do not define any event handler method.
    Regards
      Uwe

  • HOW TO TRANSFER DATA FROM ONE INTERNAL TABLE TO ANOTHER

    FOR PERTICULAR OBJECT ID ONE INT TABLE JTAB CONTAINS ONE RECORD(ROW) AND ANOTHER INT TABLE KTAB CONTAINS 3 RECORDS(ROWS). THEN HOW I SHOULD TRANSFER DATA FROM KTAB TO JTAB? WHAT R THE VARIOUS WAYS TO DO THAT. PLS HELP ME OUT. THANKS IN ADVANCE

    Try something like
    If you want one record per ktab :
    LOOP AT jtab.
      MOVE-CORRESPONDING jtab TO itab.
      LOOP AT ktab WHERE id = jtab-id.
        MOVE-CORRESPONDING ktab TO itab.
        APPEND itab.
      ENDLOOP.
    ENDLOOP.
    or
    LOOP AT ktab.
      READ TABLE jtab WITH KEY id = ktab-id. " binary implicit if sorted type
      MOVE-CORRESPONDING jtab TO itab.
      MOVE-CORRESPONDING ktab TO itab.
      APPEND itab.
    ENDLOOP. 
    If you want to sum ktab ratio into itab for each jtab
    LOOP AT jtab.
      MOVE-CORRESPONDING jtab TO itab.
      LOOP AT ktab WHERE id = jtab-id.
        ADD-CORRESPONDING ktab TO itab.
        APPEND itab.
      ENDLOOP.
    ENDLOOP.
    Use sorted type table when LOOP AT WHERE, else SORT table is enough.
    Regards

  • Transfer data from ALV to Z table

    Hi,
    I need to confirm the exact procedure to transfer data from ALV into z table.I am entering few values at runtime in the ALV & need to populate the z table with the same.
    I created a z table,it has been assigned a internal table & work area.A loop is there on the internal table passed to fieldcatalog.
    LOOP AT GIT_EKPO INTO GS_EKPO.
        LS_ZPS005-EBELN = GS_EKPO-EBELN.
        LS_ZPS005-EBELP = GS_EKPO-EBELP.
        LS_ZPS005-ERECDAT = GS_EKPO-ERDAT. "this field is not passing value into z table
        LS_ZPS005-LINEID = SY-TABIX.
        LS_ZPS005-POQTY = GS_EKPO-POQTY.
        LS_ZPS005-EREQTY = GS_EKPO-EREQTY. "this field is not passing value into z table
    ENDLOOP.
      INSERT INTO ZPS005 VALUES LS_ZPS005.
    When I assign the values from Internal table into internal table of z table,the values in fields populated at runtime does not come.
    Please help me with your suggestions on the same.
    Thanks.

    Hi,
    I tried the procedure,but do I need to include this before method set_table_for_first_display?
    You can have a look at the whole code.Please let me know of a possible solution.Looking forward to an early reply.
    Thanks.
    TABLES: EKKO,
            EKPO,
            ZPS005.
    INITIALIZATION.
    PERFORM CREATE_FIELD_CATLOG.
                               Types Declaration                          *
    *Structure for EKPO table
      TYPES: BEGIN OF TYPE_EKPO,
              EBELN TYPE EKPO-EBELN, "PURCHSE ORDER NUMBER
              EBELP TYPE EKPO-EBELP, "Item Number of Purchasing Document
              POQTY TYPE EKPO-MENGE, "Purchase Order Quantity
              ERDAT TYPE SY-DATUM, "Date on Which Record Was Created
             LINEID TYPE ZPS005-LINEID, "Unique identification of document line
              EREQTY TYPE ZPS005-EREQTY, "Erection Quantity
         END OF TYPE_EKPO.
                                        Data                              *
               Data Declaration for Internal Table & Work Area            *
    *INTERNAL TABLE FOR EKPO TABLE
      DATA:LIT_EKPO TYPE TABLE OF EKPO,
           LS_EKPO TYPE EKPO.
    *SECOND INTERNAL TABLE FOR EKPO TABLE
      DATA: GIT_EKPO TYPE TABLE OF TYPE_EKPO.
      DATA: GS_EKPO TYPE TYPE_EKPO.
    *INTERNAL TABLE FOR FIELD CATALOG
      DATA: LIT_FIELDCAT TYPE lvc_t_fcat,
            LS_FIELDCAT LIKE LINE OF LIT_FIELDCAT. "WORK AREA FOR FIELD CATALOG
    *INTERNAL TABLE FOR Z TABLE ZPS005
      DATA: LIT_ZPS005 TYPE TABLE OF ZPS005,
            LS_ZPS005 TYPE ZPS005.
                            ALV GRID Data Declaration                     *
      DATA: V_CONTAINER TYPE REF TO cl_gui_custom_CONTAINER.
      data: grid TYPE REF TO cl_gui_alv_grid.
      data: ok_code type sy-ucomm.
      DATA: V_LAYOUT TYPE lvc_s_layo.  " FOR LAYOUT
      DATA: V_LINE TYPE I,
            LINEID TYPE I.
      DATA: V_INDEX TYPE SY-TABIX.
                                   PARAMETER                              *
      parameter : p_ebeln like ekko-ebeln.
                                  START OF SELECTION                      *
    START-OF-SELECTION.
                                   SELECTION OF DATA                      *
      CALL FUNCTION 'ME_PURCHASE_DOCUMENT_DATA_READ'
        EXPORTING
          I_EBELN                    = P_EBELN
          I_TCODE                    = 'ME23'
      I_NO_COMMIT                = ' '
          I_TRTYP                    = 'A'
      I_NO_MESSAGING             =
      I_NO_MESSAGE_REQ           =
      I_NO_AUTHORITY_CHECK       =
      I_VORGA                    =
    IMPORTING
      E_EKKO                     =
       TABLES
         T_EKPO                     = LIT_EKPO
      T_EKET                     =
      T_EKKN                     =
      T_KOMV                     =
       EXCEPTIONS
         NO_EBLNR                   = 1
         EBLNR_NOT_FOUND            = 2
         NO_TCODE                   = 3
         TCODE_NOT_ALLOWED          = 4
         NO_TRTYP                   = 5
         INVALID_CALL_OF_FB         = 6
         OTHERS                     = 7
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT LIT_EKPO INTO LS_EKPO.
        MOVE : LS_EKPO-EBELN TO GS_EKPO-EBELN,
               LS_EKPO-EBELP TO GS_EKPO-EBELP,
               LS_EKPO-MENGE TO GS_EKPO-POQTY.
        APPEND GS_EKPO TO GIT_EKPO.
      ENDLOOP.
    End-of-selection.
      perform field_catalog.
      call screen 100.
                                   END-OF-SELECTION                       *
                                MODULES FOR ALV DISPLAY                   *
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'PF-STAT'.
      SET TITLEBAR 'TITLE'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    **&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CASE OK_CODE.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
       WHEN 'SWITCH'.
         PERFORM switch_edit_mode.
        WHEN 'SAVE'.
          PERFORM FILL_TABLE.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    **&      Module  layout_0100  OUTPUT
          text
    MODULE layout_0100 OUTPUT.
      V_LAYOUT-grid_title = 'Purchase Order Erection Details'.
    ENDMODULE.                 " layout_0100  OUTPUT
    **&      Module  data_retrivaL  OUTPUT
          text
    MODULE data_retrivaL OUTPUT.
      IF V_CONTAINER IS INITIAL.
        CREATE OBJECT V_CONTAINER
          EXPORTING container_name = 'GRID'.
        CREATE OBJECT grid
        EXPORTING i_parent = V_CONTAINER.
      ENDIF.
      CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IS_LAYOUT                     = V_LAYOUT
        CHANGING
          IT_OUTTAB                     = GIT_EKPO
          IT_FIELDCATALOG               = LIT_FIELDCAT
        EXCEPTIONS
          INVALID_PARAMETER_COMBINATION = 1
          PROGRAM_ERROR                 = 2
          TOO_MANY_LINES                = 3
          others                        = 4.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " data_retrivaL  OUTPUT
    *&      Module  field_catalog  OUTPUT
          text
    FORM field_catalog.
      CLEAR LS_fieldcat.
      LS_fieldcat-fieldname = 'EBELN'.
      LS_fieldcat-ref_table = 'GIT_EKPO'.
      LS_FIELDCAT-coltext  = 'PURCHSE ORDER NUMBER'.
      LS_FIELDCAT-col_pos   = 0.
      LS_FIELDCAT-EDIT = ' '.
    ls_FIELDCAT-style = cl_gui_alv_grid=>mc_style_disabled.
    INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
      APPEND LS_fieldcat TO LIT_fieldcat.
      CLEAR LS_fieldcat.
      LS_fieldcat-fieldname = 'EBELP'.
      LS_fieldcat-ref_table = 'GIT_EKPO'.
      LS_FIELDCAT-coltext  = 'ITEM NUMBER'.
      LS_FIELDCAT-col_pos   = 1.
      LS_FIELDCAT-EDIT = ' '.
    ls_FIELDCAT-style = cl_gui_alv_grid=>mc_style_disabled.
    INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
      APPEND LS_fieldcat TO LIT_fieldcat.
      CLEAR LS_fieldcat.
      LS_fieldcat-fieldname = 'POQTY'.
      LS_fieldcat-ref_table = 'GIT_EKPO'.
      LS_FIELDCAT-coltext  = 'PURCHASE ORDER QUANTITY'.
      LS_FIELDCAT-col_pos   = 2.
      LS_FIELDCAT-EDIT = ' '.
    ls_FIELDCAT-style = cl_gui_alv_grid=>mc_style_disabled.
    INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
      APPEND LS_fieldcat TO LIT_fieldcat.
      CLEAR LS_fieldcat.
      LS_fieldcat-fieldname = 'ERDAT'.
      LS_fieldcat-ref_table = 'GIT_EKPO'.
      LS_FIELDCAT-coltext  = 'DATE OF ERECTION'.
      LS_FIELDCAT-col_pos   = 3.
      LS_FIELDCAT-EDIT = 'X'.
    ls_fieldcat-style = cl_gui_alv_grid=>mc_style_enabled.
    INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
      APPEND LS_fieldcat TO LIT_fieldcat.
      CLEAR LS_fieldcat.
      LS_fieldcat-fieldname = 'EREQTY'.
      LS_fieldcat-ref_table = 'GIT_EKPO'.
      LS_FIELDCAT-coltext  = 'ERECTION QUANTITY'.
      LS_FIELDCAT-col_pos   = 4.
      LS_FIELDCAT-EDIT = 'X'.
    ls_fieldcat-style = cl_gui_alv_grid=>mc_style_enabled.
    INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
      APPEND LS_fieldcat TO LIT_fieldcat.
    ENDFORM.                 " field_catalog  OUTPUT
    *&      Form  SWITCH_EDIT_MODE
          text
    -->  p1        text
    <--  p2        text
    *FORM switch_edit_mode.
    IF GRID->is_ready_for_input( ) eq 0.
    set edit enabled cells ready for input
       CALL METHOD GRID->set_ready_for_input
         EXPORTING
           i_ready_for_input = 1.
    ELSE.
    lock edit enabled cells against input
       CALL METHOD GRID->set_ready_for_input
         EXPORTING
           i_ready_for_input = 0.
    ENDIF.
    *ENDFORM.                               " SWITCH_EDIT_MODE
    *&      Form  FILL_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_TABLE .
      LOOP AT GIT_EKPO INTO GS_EKPO.
        LS_ZPS005-EBELN = GS_EKPO-EBELN.
        LS_ZPS005-EBELP = GS_EKPO-EBELP.
        LS_ZPS005-POQTY = GS_EKPO-POQTY.
        LS_ZPS005-ERECDAT = GS_EKPO-ERDAT.
        LS_ZPS005-EREQTY = GS_EKPO-EREQTY.
      ENDLOOP.
      MODIFY ZPS005 FROM LS_ZPS005.
    ENDFORM.                    " FILL_TABLE

Maybe you are looking for

  • Free goods in delivery proble

    Hi sap guru's here is one delivery issue--- in sales order we determined under grouping for free goods determination problem is--- free goods are appearing in sales order but not displaying in delivery type all other materials are displaying except f

  • Installing Leopard & FCS 3

    My Mac came with Tiger installed and Leopard install disks when I bought it in 2007. This week I decided to install Leopard, delete FCP 6 and install Final Cut Studio 3 and Photoshop Elements 9. My applications are on HD 1. Except for deleting everyt

  • User validity date is not refelcting in Childsystem

    Hi Experts, I have changed the  validity of a user in  CuA  system . But the validity is not reflecting in child system. on checking SCUL I found the error as " User type 75 is not actiive". I didnot find any issues in distributing roles and profiles

  • Get DS data as JS var

    Hi guys! I think this one is pretty simple: is there a way to fetch data from a spry dataset and pass it as a javascript variable? I'm trying something along these lines : var ds1 = new Spry.Data.XMLDataSet("config.xml", "config/pagesize"); var data

  • Error when trying to copy Library

    Get this error message when attempting to copy an Aperture library: "The Finder can't complete the operation because some data in "2012" can't be read or written. (Error code -36)" Other libraries duplicate easily, so not a RAM or system issue. Have