How to bring data from 3 different internal table to one

hii all,
          i have 3 internal table ls_mat,which has around 20 fields,it_stpo,which has 3 fields,and it_mast,i need to bring all these 3 table data in one tabel...how do i do...plzz help...

Hi ,
Does this internal table have any fields in common in all the three.
If yes , then loop ls_mat
Declare a type will all the fields and create a structure and internal table with that type (for ex lx_final and lt_final respectively)
Loop at ls_mat into lx_mat.
1.copy all the fields of lx_mat to respective lx_final.
2.read table it_stpo into lx_stpo with key field = lx_mat-field.
3.Copy all fields of lx_stpo to respective lx_final.
4. read table it_mast into lx_mast with key field = lx_mat-field.
5. copy all fields of lx_mast to respective lx_final.
6. now append lx_final to lt_final.
Endloop.
now you can get all values inside lt_final.
Regards,
sivaganesh

Similar Messages

  • How to insert  data from different internal  table  into a data base table

    hi all,
             I want to insert a particular field in an internal table to a field in a data base table.Note that the fields in the internal table and database table are not of the same name since i need to insert data from different internal tables.can some one tell me how to do this?
    in short i want to do something like the foll:
    INSERT  INTO ZMIS_CODES-CODE VALUE '1'.
    *INSERT INTO ZMIS_CODES-COL1 VALUE DATA_MTD-AUFNR .(zmis_codes is the db table and data_mtd is the int.table)

    REPORT  ZINSERT.
    tables kna1.
    data: itab LIKE KNA1.
    data lv_kUNAG LIKE KNA1-KUNNR.
    lv_kuNAG =  '0000010223'.
    ITAB-kuNNR = lv_kuNAG.
    ITAB-name1 = 'XYZ'.
    INSERT INTO KNA1 VALUES ITAB.
    IF SY-SUBRC = 0.
    WRITE:/ 'SUCCESS'.
    ELSE.
    WRITE:/ 'FAILED'.
    ENDIF.
    Here lv_kunag is ref to kna1 kunnr passed in different name
    In internal table .
    Try and let me know if this logic dint work.

  • How to move data from 2 internal table to 1 internal table

    Can any body send me code that how to move data from 2 internal table into one internal table.
    Moderator message : Read ABAP documentation. Thread locked.
    Edited by: Vinod Kumar on Jun 13, 2011 11:45 AM

    Hi Mohdarif92;
    I don't know your full needs. But general method should be as below code.
    Please check exam below code.
    Best regards.
    data : begin of gt_result.
                ... like mkpf-...
                ... like mkpf-...
                ... like mseg-...
                ... like mseg-...
              end of gt_result
    select *
    into table gt_mkpf
    from mkpf where ...
    select *
    into table mseg
    from mseg where ...
    loop at gt_mkpf.
         loop at gt_mseg where ... = mkpf-...
            move-corresponding gt_mkpf to gt_result.
            move-corresponding gt_mseg to gt_result.
            append gt_result
         endloop.
    endloop.

  • How to join  fields from different internal tables and display into one int

    hai i have one doubt...
    how to join  fields from different internal tables and display into one internal table..
    if anybody know the ans for this qus tell me......

    hii
    you can read data as per condition and then can join in one internal table using READ and APPEND statement..refer to following code.
    SELECT bwkey                         " Valuation Area
             bukrs                         " Company Code
        FROM t001k
        INTO TABLE i_t001k
       WHERE bukrs IN s_bukrs.
      IF sy-subrc EQ 0.
        SELECT bwkey                       " Valuation Area
               werks                       " Plant
          FROM t001w
          INTO TABLE i_t001w
           FOR ALL ENTRIES IN i_t001k
         WHERE bwkey = i_t001k-bwkey
           AND werks IN s_werks.
        IF sy-subrc EQ 0.
          LOOP AT i_output INTO wa_output.
            READ TABLE i_t001w INTO wa_t001w WITH KEY werks = wa_output-werks.
            READ TABLE i_t001k INTO wa_t001k WITH KEY bwkey = wa_t001w-bwkey.
            wa_output-bukrs = wa_t001k-bukrs.
            MODIFY i_output FROM wa_output.
            CLEAR wa_output.
          ENDLOOP.                         " LOOP AT i_output
        ENDIF.                             " IF sy-subrc EQ 0
    regards
    twinkal

  • How to read data from an internal table into a real table?

    Hello experts,
    I'm relatively new to ABAP and I'm trying to figure out how to read data from an internal table into a table that I created.  I'm trying to use the RRW3_GET_QUERY_VIEW_DATA function module to read data from a multiprovider.  I'm trying to read data from the e_cell_data and e_axis_data tables into a table that I've already created.  Please see code below.
    TABLES MULTITAB.
    DATA:
      query_name TYPE RSZCOMPID,
      s_cubename TYPE RSINFOPROV,
      t_cell_data TYPE RRWS_T_CELL,
      t_axis_data TYPE RRWS_THX_AXIS_DATA,
      t_axis_info TYPE RRWS_THX_AXIS_INFO,
      wa_t_cell_data like line of t_cell_data,
      wa_t_axis_data like line of t_axis_data,
      w_corp_tab like line of t_cell_data.
    s_cubename = 'CORP_MPO1'.
    query_name = 'Z_corp_test'.
        CALL FUNCTION 'RRW3_GET_QUERY_VIEW_DATA'
           EXPORTING
             i_infoprovider           = s_cubename
             i_query                  = query_name
            i_t_parameter            = query_string_tab
           IMPORTING
             e_cell_data              = t_cell_data
             e_axis_data              = t_axis_data
             e_axis_info              = t_axis_info.
    If anyone has any information to help me, I would greatly appreciate it.  Thanks.

    Hi,
    <li>Once you call the function module RRW3_GET_QUERY_VIEW_DATA, lets say data is available in the corresponding tables e_cell_data e_axis_data which you have mentioned.
    <li>Modify your internal table defined for other purpose, with data from e_cell_data e_axis_data like below.
    LOOP AT t_cell_data INTO wa_t_cell_data.
      "Get the required data from t_cell_data.
      MOVE-CORRESPONDING wa_t_cell_data TO it_ur_tab.
      "Modify your internal table wih data
      MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
    ENDLOOP.
    LOOP AT t_axis_data INTO wa_t_axis_data.
      "Get the required data from t_cell_data.
      MOVE-CORRESPONDING wa_t_axis_data TO it_ur_tab.
      "Modify your internal table wih data
      MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
    ENDLOOP.
    Thanks
    Venkat.O

  • How to get data  from an internal table in some other program

    I would like to get data from the internal table in the other program. When I using FM "LIST_FROM_MEMORY" to get the data, it doesn't work and the exception is not fount.
    If any special code need in the other program, like write data to memory .
    Many thx .
    From Ross Wang

    Hi
    <li>You need to have interaction if you want to use EXPORT/IMPORT statments.
    <li>The internal tables in both programs must be same
    <li>Program one ..Calling program
    REPORT ZTEST_NOTEPAD.
    DATA: BEGIN OF it_t001 OCCURS 0,
            bukrs TYPE t001-bukrs,
            butxt TYPE t001-butxt,
          END OF it_t001.
    START-OF-SELECTION.
      SUBMIT ztest_notepad1 AND RETURN.
      IMPORT it_t001 FROM MEMORY ID 'ZTEST_T100'.
      LOOP AT it_t001.
        WRITE:/ it_t001.
      ENDLOOP.
    <li>Program two ...Called program
    REPORT ztest_notepad1.
    DATA: BEGIN OF it_t001 OCCURS 0,
            bukrs TYPE t001-bukrs,
            butxt TYPE t001-butxt,
          END OF it_t001.
    START-OF-SELECTION.
      SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE it_t001 UP TO 10 ROWS.
      IF sy-dbcnt > 1.
        EXPORT it_t001 TO MEMORY ID 'ZTEST_T100'.
      ENDIF.
    I hope that it gets you some idea.
    Thanks
    Venkat.O

  • How to download data from an internal table to a text

    Hi All,
    I want to download data  from an internal table to a text file.
    The fields should be pipe(|) separated. I have tried GUI_DOWNLOAD but it is not taking the field separator.
    The sample of the desired data that i require should be this way:-
    13456TR|M|COUP|MATERIAL|KGS
    Thanks in advance.
    Regards
    Satish.

    Hi,
    Try this..
    REPORT  zc1download message-id zc1dwnmsg.
    *& Declaration Section for the Tables *
    TABLES: makt.
    *& Declaration Section for the Internal Tables
    DATA: intab TYPE TABLE OF makt,
          wa_intab LIKE LINE OF intab,
          no_of_rec TYPE i,
          count TYPE i.
    DATA: BEGIN OF f_intab,
            str(255) TYPE c,
          END OF f_intab.
    DATA: t_intab LIKE TABLE OF f_intab,
          w_intab LIKE LINE OF t_intab,
          temp(255) TYPE c.
    FIELD-SYMBOLS: <f> TYPE ANY.
    *& Selection ScreenSection for the file download
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: file TYPE rlgrap-filename MEMORY ID file,
                tab RADIOBUTTON GROUP rad1 DEFAULT 'X',
                others RADIOBUTTON GROUP rad1,
                delimit TYPE c.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      IF file IS INITIAL. " check to ensure file.
        MESSAGE i001.
        EXIT.
      ENDIF.
      IF others = 'X'.    " check to ensure delimiter.
        IF delimit = ' '.
          MESSAGE i002.
          EXIT.
        ENDIF.
      ENDIF.
      SELECT * FROM makt INTO TABLE intab.
      IF tab = 'X'.       " default delimiter tab is used
          CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
            filename                = file
            filetype                = 'DAT'
            mode                    = 'A'
          TABLES
            data_tab                = intab
          EXCEPTIONS
            file_open_error         = 1
            file_write_error        = 2
            invalid_filesize        = 3
            invalid_type            = 4
            no_batch                = 5
            unknown_error           = 6
            invalid_table_width     = 7
            gui_refuse_filetransfer = 8
            customer_error          = 9
            no_authority            = 10
            OTHERS                  = 11.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ELSE.             " If user defind delimiter is to be used
                  Counts the number of fields                *
        DO.
          ASSIGN COMPONENT sy-index OF STRUCTURE wa_intab TO <f>.
          IF sy-subrc <> 0.
            EXIT.
          ELSE.
            count = count + 1.
          ENDIF.
        ENDDO.
        LOOP AT intab INTO wa_intab.
          DO count TIMES. " Adding the delimiter in required places
            ASSIGN COMPONENT sy-index OF STRUCTURE wa_intab TO <f>.
            CONCATENATE temp delimit <f> INTO temp.
          ENDDO.
          SHIFT temp.
          APPEND temp TO t_intab.
          CLEAR temp.
        ENDLOOP.
        CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
            filename                = file
            filetype                = 'ASC'
            mode                    = 'A'
          TABLES
            data_tab                = t_intab
          EXCEPTIONS
            file_open_error         = 1
            file_write_error        = 2
            invalid_filesize        = 3
            invalid_type            = 4
            no_batch                = 5
            unknown_error           = 6
            invalid_table_width     = 7
            gui_refuse_filetransfer = 8
            customer_error          = 9
            no_authority            = 10
            OTHERS                  = 11.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
      WRITE:/ 'The Data has been tranfered to :', file.
    Cheers
    Kathir!~

  • How to select data from an internal table

    material                          norm                    date last modified
    B2-SP HEAT                 50.000               20090420
    BF COKE                                 575.000               20090419
    GROSS COKE                 200.000               20090419
    B2-SP HEAT                 100.000               20090419
    TWT                                 33.000               20090330
    B7-SP HEAT                 2.000               20090310
    B1-SP HEAT                 1.000               20090309
    B7-SP HEAT                 615.000               20090308
    B2-SP HEAT                 585.000               20090308
    B1-SP HEAT                 100.000               20090308
    B3-SP HEAT                 610.000               20090308
    BF COKE                                 68.500               20090308
    GROSS COKE                 72.600               20090308
    B8-SP HEAT                 600.000               20090308
    B9-SP HEAT                 625.000               20090308
    BX-SP HEAT                 615.000               20090308
    B9-SP HEAT                 58.000               20090307
    B1-SP HEAT                 100.000               20090307
    B6-SP HEAT                 350.000               20090306
    B2-SP HEAT                 888.000               20090306
    Like above there r numerous data in a table :
    how will i select data into another internal table where material above is not repeated with latest modified date.please help.

    Hi Sonu,
    The main task is to move the contents of the one internal table to another with some condition.
    First sort and delete the duplicate entries from the First Internal table like below : 
    sort it_tab by material ascending date_modified descending.
    delete adjacent duplicates from it_tab.
    Then move that Internal table contents to another internal table.
    Define another internal table with the same structure as you have first internal table and then
    Second Step :
    it_itab1 = it_itab.
    If you are using seperate Header line and Body then you can do like below :
           it_itab1[] = it_itab[].
    This will fix the issue.
    Please let me know if you need any further explonation.
    Regards,
    Kittu
    Edited by: Kittu on Apr 24, 2009 12:21 PM

  • How to delete data from dynamic internal table

    Hi,
    I have dynamic internal table and I have some slection screen fields , using these selection screen fields
    (select -options), I have to filter the data? assigning will work with READ , but I have select options not the parametre,
    and also delete will not work for dynamic table..
    as we cannot use assigning with delete..
    So how to do this?
    and one more thing is , I cannot filter the data while selection( in select, I cannot filter the data-> as it's not coming directly from table, it's coming from buffer),
    so now after selection of data, I need to filter the data from dynamic table.
    Is there any way to do this?
    Regards,
    Mrunal

    Hi matt,
    I tried with below code as  you said. But I am getting dump. can you help?
    here is my piece of code.
    FIELD-SYMBOLS: <LS_DATA> type any,
                               <LT_DATA> TYPE table,
                                <L_FIELD> type any.
        ASSIGN <l_buffer_entry>-dataptr->* TO <LS_DATA>.
        ASSIGN <l_buffer_entry>-dataptr->* TO <LT_DATA>.
    LOOP AT <LT_DATA> ASSIGNING <LS_DATA>.
    ASSIGN COMPONENT 'BUKRS' OF STRUCTURE <LS_DATA> TO <L_FIELD>.
    IF <L_FIELD> NOT IN SO_BUKRS.
    DELETE <LT_DATA>.
    ENDIF.
    UNASSIGN <L_FIELD>.
    ASSIGN COMPONENT 'BELNR' OF STRUCTURE <LS_DATA> TO <L_FIELD>.
    IF <L_FIELD> NOT IN SO_BELNR.
    DELETE <LT_DATA>.
    ENDIF.
    UNASSIGN <L_FIELD>.
    ENDLOOP.
    and here is the description of my dump:->>>
    You attempted to access an unassigned field symbol
    (data segment 32772).
    This error may occur for any of the following reasons:
    - You address a typed field symbol before it is set using ASSIGN
    - You address a field symbol that points to a line in an internal table
      that has been deleted
    - You address a field symbol that had previously been reset using
      UNASSIGN, or that pointed to a local field that no longer exists
    - You address a global function interface parameter, even
      though the relevant function module is not active,
      that is it is not in the list of active calls. You can get the list
      of active calls from the this short dump.

  • How to append data from an internal table to an external table.

    HI everyone,
    I am trying to update an DB table type 'c'from the data captured in my internal table. can any one tell me as to how to do this.the contents of the DB table needs to be erased completly before i send in new data.
    Regards,
    Vj

    Assuming that you table has 1 character field(?) besides the MANDT field
    MANDT
    FIELD
    you need to update this db table with values from ITAB which I assume has one field of type c.
    To first delete all of the data from DB table.
    * Yes there are other ways of doing this.
    tables: ztable.
    select * from ztable.
    delete ztable.
    endselect.
    Then simply LOOP your internal table and update the table.
    loop at itab.
      ztable-field = itab-field.
      insert ztable.
    endloop.
    Regards,
    Rich Heilman

  • How to fetch data from nested internal table

    Hi,
    Im using FM CRM_PRODUCT_GETDETAIL_API which is returning me work area (ES_PRODUCT_DATA) of type
    COMT_PRODUCT_MAINTAIN_API. This work area contains a table SHORT_TEXTS of type COMT_PR_SHTEXT_MAINTAIN_TAB
    whcih in turn contain a line type DATA of type COMT_PRSHTEXT_X. I need to fetch fields lying inside DATA. Can anybody please
    let me know how to achieve this. I would like to do this by not using nested loop structure.
    Rgds
    Sudhanshu Sharma

    Hi,
    Use field ES_PRODUCT_DATA-short_texts like any other internal table (without header line).
    E.g.:
    field-symbols: <text> type COMT_PRSHTEXT_X.
    loop at ES_PRODUCT_DATA-short_texts assigning <text>.
            write: <text>-short_text
    endloop.
    Regards, Gerd Rother

  • How to pass data from dynamic internal table to standard internal table

    hi experts,
    below is the piece of code which i have used in my requirement but the data is not moved.
    LOOP AT <tab> ASSIGNING <tab1>.
      MOVE-CORRESPONDING <tab1> TO wa.
      append wa TO  gt_outtab.
    ENDLOOP.
    here
    <tab> - dynamic internal table.
    <tab1>-dynamic internal table work area.
    gt_outtab - standard internal table.
    wa- standard internal table work area.
    i am not getting what additional thing i have to write.
    pls help me in this regard.
    thankx in advance.
    soham.p.

    Hello soham p ,
    I am also using the same logic but in my program it is working fine so you declare the fieldsymols like this and try and also check the dynamic internal contain the data or not.
    FIELD-SYMBOLS : <y_i_table>  TYPE STANDARD TABLE,
                                 <y_wa_table> TYPE ANY.
      LOOP AT <y_i_table> ASSIGNING <y_wa_table>.
        MOVE-CORRESPONDING <y_wa_table> TO y_wa_vfscaid.
        APPEND y_wa_vfscaid TO y_i_vfscaid.
        CLEAR y_wa_vfscaid.
      ENDLOOP.

  • How to fetch data from an internal table by comparing the a value in loop

    i have an internale table with two fields like parvw and vtext.
    acc to valuue in parvw in loop we sholud fetch the corresponding value of vtext.
    we should not use loop in loop .
    ex code
    select parvw vtext from tpart into table i_vtext where spras = sy-langu.
        LOOP AT I_OUTPUT.
          CASE I_OUTPUT-tabname.
            WHEN 'VBPA'.
              IF I_OUTPUT-fname = 'KUNNR' OR
                 I_OUTPUT-fname IS INITIAL.
                MOVE I_OUTPUT-tabkey TO vbpa.
               READ TABLE i_vtext WITH table KEY parvw = vbpa-*parvw .
                IF sy-subrc = 0.
                  REPLACE '&' WITH i_vtext-vtext INTO I_OUTPUT-indtext.
                ENDIF.
              ENDIF.
            WHEN 'VBAP'.
              IF I_OUTPUT-fname IS INITIAL.
                REPLACE '&' WITH 'item' INTO I_OUTPUT-indtext.
              ENDIF.
          ENDCASE.
          IF I_OUTPUT-indtext(1) EQ '&'.
            REPLACE '&' WITH I_OUTPUT-ftext(40) INTO I_OUTPUT-indtext.
          ENDIF.

    Loop the main ITAB
    and then use READ TABLE to fetch a row from the 2nd ITAB.
    sort the main itab abd use binary search option in READ to improve the performance
    Narendra

  • How to fetch data from different standard table to own customize table.

    Hi Experts,
    I want to develope an INVENTORY TURN OVER REPORT in SAP R/3.As I dont know much about Inventory.I want some one here to guide me regarding this with example so i can develope Inventory Report in R/3.
    Also guide me which filed from which table i shud use.What is Inventory Turnover in details and how it is calculated.
    Plz reply guys.
    Thanks.
    Edited by: abhishek.chaturvedi on Aug 9, 2010 8:42 AM

    Hi,
    Even iam not sure about it but after looking at your query even i have done some research and got some information for you.
    nventory Turnover is a prominent KPI in a lot of businesses. This post will give you some understanding on the concept. In another post I will give details on how the SAP report MC44 can be used to measure inventory turns and what data is used to calculate this ratio.
    Formula
    Inventory Turnover = Cost of Goods Sold (COGS) / Average Inventory at value
    If you are not familiar with the term Cost of Goods Sold, this is the cost of your revenues.
    Average Inventory is measured in value and not in volume.
    If you divide both elements you know how often you sold youu2019re average inventory.  u201CSo what?u201D you ask. I will explain next.
    Concept and use
    I will present you with two business scenariou2019s to point out the significance of the Inventory Turnover ratio.
    Scenario 1
    You sell one product. You invest 10.000 EUR as starting stock. You run your business for one year and at then end of the year you are completely sold out. Your revenue accumulates to 12.500 EUR.  For simplicity sake your gross profit is 2.500 EUR (12.500 u2013 10.000).
    Revenue = 12.500
    COGS = 10.000
    Average Inventory = 5.000 (10.000 starting stock + 0 end stock / 2 = 5.000 average stock)
    Inventory Turnover = 2 (10.000 / 5.000)
    ROI = 50% > 2.500 (R-C) earned out of 5.000 (A)
    Scenario 2
    Again you sell one product. But this time you invest 5.000 EUR in starting stock. After 6 months you sold your stock and you replenish your stock again for 5.000 EUR. After another 6 months youu2019re sold out. Your revenue is again 12.500 EUR. Your gross profit is 2.500 EUR (12.500 u2013 5000 u2013 5000).
    Revenue = 12.500
    COGS = 10.000
    Average Inventory = 2.500 (5.000 starting stock + 0 end stock / 2 = 2.500 average stock)
    Inventory Turnover = 4 (10.000 / 2.500)
    ROI = 100% > 2.500 (R-C) earned out of 2.500 (A)
    cheers,
    bhavana

  • How to Fetch Data From an Internal table to a field in Modulepool Screen ??

    In my Modulepool Screen i have two fields ,
    Based on the data of the First field ,the second field will display the data.
    For ex-  first field - I choosed the data -" MARUTI",
                then in the second field , all d CARs ( 800,zen,waganor.....)related to MARUTI shd be displayed.
    without using POV module hw to use dis ? and also using POV ,what are the function modules to be used ..
    pls explore in details...
    Thnks to all d contributors for their Time.....

    see if u have a limited values to display in Listbox, den we will go for vrm_set_values.
    but here as per the requirement
    thr is no limited Values in d second dropdown box.
    Let me Clear abt the requirement.
    First field - issue no.
    2nd field- Item no.
    when u select a particular issue no, den in item it shd display the corresponding item nos related to that issueno. And both Fields r Primary keys in d table( customised Table.)
    this is wwht exactly my requirement.
    as i created The search help for issueNo, its displaying all the issueno Dat are in DB.
    But Itemno Field is nt behaving as per That.
    Pls Suggest me.. in details

  • Fetch data from different database tables

    Hi...
    How can i fetch data from different database tables and put it into a internal table and then display it??? Can provide simple short codes as i'm new to ABAP. Thanks.

    Hi,
    Check this sample code..
    TYPE-POOLS: slis.
    DATA: BEGIN OF itab OCCURS 0,
            vbeln TYPE vbeln,
            expand,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
            vbeln TYPE vbeln,
            posnr TYPE posnr,
            matnr TYPE matnr,
            netpr TYPE netpr,
          END OF itab1.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'POSNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'POSNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'MATNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'MATNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'NETPR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'NETPR'.
    s_fieldcatalog-do_sum    = 'X'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    DATA: s_layout TYPE slis_layout_alv.
    s_layout-subtotals_text            = 'SUBTOTAL TEXT'.
    s_layout-key_hotspot = 'X'.
    s_layout-expand_fieldname = 'EXPAND'.
    SELECT vbeln UP TO 100 ROWS
           FROM
           vbak
           INTO TABLE itab.
    IF NOT itab[] IS INITIAL.
      SELECT vbeln posnr matnr netpr
             FROM vbap
             INTO TABLE itab1
             FOR ALL ENTRIES IN itab
             WHERE vbeln = itab-vbeln.
    ENDIF.
    DATA: v_repid TYPE syrepid.
    v_repid = sy-repid.
    DATA: s_keyinfo TYPE slis_keyinfo_alv.
    s_keyinfo-header01 = 'VBELN'.
    s_keyinfo-item01   = 'VBELN'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
         EXPORTING
              i_callback_program = v_repid
              is_layout          = s_layout
              it_fieldcat        = t_fieldcatalog
              i_tabname_header   = 'ITAB'
              i_tabname_item     = 'ITAB1'
              is_keyinfo         = s_keyinfo
         TABLES
              t_outtab_header    = itab
              t_outtab_item      = itab1
         EXCEPTIONS
              program_error      = 1
              OTHERS             = 2.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks
    Naren

Maybe you are looking for

  • Can i sign up as a company with a dba?

    Hi, I developed my first application and want went to set up my paid developer account and i'm given the option to sign up as an individual or company. I don't want my name as individual to be on the developer account and on the app store and i also

  • Statistical condition types not getting displayed in invoice

    We  have configured the tax collected at source (TCS) condition types and make them as statistical in the pricing procedure. Now, the issue is when we are using them the values for these condition types are getting calculated correctly as the total v

  • Locks and/or slow processing

    Hello, Thanks in advance!! Whenever, our system receives a flood of events, we try to update the database by first locking a certain row using "select for update". However, the system seems to lock up (I think it is very slow in processing) for a lon

  • Pd0-ppu017 program unit source must define a  subprogram body  or package

    Hi Iam new to oracle l and trying to teach myself my problem is when I compile any function in program units of forms , the following error message obtained:- pd0-ppu017 program unit source must define a subprogram body or package. for example this r

  • DM for Mac will not sync groups from my address book

    After spending 40 minutes with BB tech support, I was told that the new DM for Mac will not sync the groups in addressbook. They say maybe in the next version of DM.  Blackberry Pearl 8100 Intel Mac OSX 10.6.1