Join 2 internal tables into 1 table

itab 1
field 1
1
2
3
5
itab2
field 1
1
2
3
4
6
The result require is
itab3
filed 1
1
2
3
4
5
6
how to achieve this if any one can give the exact code for this it will be of great help to me.
thanks
naveen

Hi!
This code is working, if you are not sure, itab1 or itab2 conatins all entry from the other table. Maybe its performance is not the best...
LOOP AT itab1.
READ TABLE itab3 WITH KEY key = itab1-key.
IF sy-subrc <> 0.
MOVE-corresponding itab1 TO itab3.
APPEND itab3.
ENDIF.
ENDLOOP.
LOOP AT itab2.
READ TABLE itab3 WITH KEY key = itab1-key.
IF sy-subrc <> 0.
MOVE-corresponding itab2 TO itab3.
APPEND itab3.
ENDIF.
ENDLOOP.
Regards
Tamá

Similar Messages

  • New JNDI name created for each drag and drop of database table into table

    Hi All,
    I'm using Netbeans 5.5 with Visual Web Pack with Mysql as backend. Whenever I drag and drop a database table into table component it creates new JNDI (data source) name for each table. I want to use single JNDI name for all tables. If I change the JNDI name to default name then the design disappears and shows error . Is there any option to set the JNDI name unique for all tables?
    Thanks in advance.

    Hi again,
    Well I've tried using the MouseListener / MouseMotionListener approach but it doesn't quite seem to work, although it does get the events correctly. I think the reason is that it doesn't interact correctly with the Java DnD machinery which is something that V.V hinted at. It's something that I may need to look into if / when I have more time available.
    I have to say though that I haven't had any problems with scrollbars - we're making fairly heavy use of large tables and if you drag over a table with a scroll bar and move to the top or bottom then it scrolls as you would expect and allows you to drop the data where you like. For this situation I've used pretty much the same approach as for the toy example above except that I've implemented separate source and destination TransferHandlers (the source table is read-only, and it really doesn't make sense to allow people to drag from the destination table so I've essentially split the functionality of the example handler down the middle).
    I'm not actually particularly in favour of messing too much with the mechanics of DnD, more because of lack of time than anything else. Guess I'll just have to put up with this for the moment. Doesn't help that DnD is so poorly documented by Sun.
    Thanks for all your help.
    Bart

  • Select * from table into table field-symbol

    Hello,
    I am trying to do a dynamic select into a dynamically defined internal table (field-symbol), but it doesn't work like I expected.
    if I try this code :
    data : p_tabname type string value 'PA9006',
          dref type ref to data .
    FIELD-symbols: <struc> TYPE ANY.
    CREATE DATA dref TYPE table of (p_tabname).
    ASSIGN dref->* TO <struc>.
    SELECT * INTO  TABLE <struc> FROM (p_tabname)  .
    I get the following error :
    <struc> is not an internal table.
    Is there any way I can make this work?
    Points will be assigned for each usefull answer.

    Hi Dries
    Just change your declaration of <struc> to as below it would work,
    field-symbols : <struc> type standard table.
    Reward points if useful.
    ~Ranganath

  • Update value from internal table into table control

    hi friends,
    i have two text field and a button in a screen.if give the value and click the button it should get updated in the table control which is in the next screen.plz
    help me with some sample coding.

    hi Karthik ,
    Here you go with the sample coding of moving internal table values to table control on module pool programs :
    in screen painter flow-logic ............
    process before output.
    module status_3000.
    loop at g_tab_con_01_itab
         into g_tab_con_01_wa
         with control tab_con
         cursor tab_con-current_line.
    module tab_con_move.
    endloop.
    process after input.
    module exit at exit-command.
    module user_command_3000.
    module clear_ok_code.
    loop at g_tab_con_01_itab.
    module read_tab_con.
    endloop.
    in your program .............
    include z_tab_ctrl_top                          .    " global Data
    program  z_tab_ctrl.
    tables : sflight,sbook,zsflight.
    types:begin of t_tab_con_01 ,
            carrid like sflight-carrid,
            connid like sflight-connid,
            sel type c,
           end of t_tab_con_01.
    data: g_tab_con_01_itab type  t_tab_con_01 occurs 0 with header line,
          g_tab_con_01_wa type t_tab_con_01,
          g_tab_con_01_copied ,
          g_tab_con_01_lines like sy-loopc,
          ok_code like sy-ucomm,
          lines type i,
          init ,
          fill type i.
    controls: tab_con type tableview using screen 3000.
    module status_3000 output.
      set pf-status 'ST100'.
      set titlebar 'T100'.
    endmodule. 
    module update_table_control input.
      describe table g_tab_con_01_itab lines tab_con-lines.
    endmodule.  
    module exit input.
      ok_code = sy-ucomm.
      if ok_code eq 'BACK' or ok_code eq 'EXIT' or ok_code eq 'CANCEL'.
        leave program .
      endif.
    endmodule.        
    module clear_ok_code input.
    clear ok_code.
    endmodule.      
    module fill_tab_con output.
    read table g_tab_con_01_itab into zsflight index tab_con-current_line.
    endmodule.                 " fill_tab_con  OUTPUT
    module read_tab_con input.
    *lines = sy-loopc.
    read table g_tab_con_01_itab into g_tab_con_01_wa index tab_con-current_line.
    if sy-subrc eq 0.
    move-corresponding sflight to g_tab_con_01_wa.
    modify g_tab_con_01_itab from g_tab_con_01_wa index tab_con-current_line.
    else.
    move-corresponding sflight to g_tab_con_01_wa.
    append g_tab_con_01_wa to g_tab_con_01_itab.
    endif.
    module tab_con_move output.
    move-corresponding g_tab_con_01_wa to sflight.
    endmodule.                 " tab_con_move  OUTPUT
    module tab_con_get_lines output.
    g_tab_con_01_lines = sy-loopc.
    endmodule.                 " tab_con_get_lines  OUTPUT
    module tab_con_modify input.
    move-corresponding sflight to g_tab_con_01_wa.
      modify g_tab_con_01_itab
          from g_tab_con_01_wa
          index tab_con-current_line.
    endmodule.                 " tab_con_modify  INPUT
    module populate_tab_ctrl input.
    if sy-subrc eq 0.
    endif.
    endmodule.
    Look at the following modules in the above program ....
    fill_tab_con
    tab_con_modify
    tab_con_get_lines
    update_table_control
    This will definately solve your problem or give an idea for solution ....
    reward if helpful,
    Regards,
    Ranjita

  • ALV with table into table

    Hi everybody,
    I have to show a ALV Grid which contains a field that is a table itself.
    This field does not want to appear!
    I'm trying to understand how I could get it, but I don't find neither a proper field of fieldcatalog that I should fill, nor a proper method in cl_gui_alv_grid.
    Thanks and regards
    Christian

    Hi Christian,
    You cannot display an internal table in the ALV Field. That is impossible.
    One solution is you can create another ALV and display when the user double click on the column.
    Thanks,
    Chidanand

  • Join large external external Tables (best practice ?)

    Hi there,
    I have three external tables in a master-detail relation: table A (10000000 rows) is master of table B (20000000 rows), Table B is master of table C (100000000 rows). Can you tell my the best way:
    - directly join the external tables, or
    - copy the external tables into tables, create an index, and join them
    What is more efficient, and why ?
    Thanks for your help and ideas.
    Gerhard.

    In general, if the joins you are doing can benefit from indexes, you will want to copy the data to database tables. If the joins will end up doing full table scans anyway, it will matter far less.
    For data integrity, you will likely also want to be able to enforce foreign key constraints.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Best way to JOIN 3 tables into internal table ?

    Hi friends,
    i have the following issue:
    i need to join information of 3 different tables ( BUT000, BUT020 and ADRC ) concerning Business Partners and i need them into one internal table.
    how would this be achieved with best performance ?
    regards,
    CL

    Hi clemens,
    As per my understanding, u can further improve this  SQL By:
    1. first select only BU000 and BU020 with inner join and then select material details in different different itabs. and process This will surely reduce load on DB and may increase load  on ABAP which u can improve by using BINARY SERARCH!.
    (Important: if u are using two table in join and giviing only PARTNER which is primary key field in both tables in WHERE clasuse ... this should be the only criteria in where clasue then i Dont think it will affect performance .... how many record may be there, this query will be BEST performer... I hope it will fetch 750000 records whithin few seconds)
    2. Generally, U try to give more and more conditions in where clause on PRIMARY KEY fiedls only and not on not KEY fields...
    3. In worst case, fetch data from three differnt tables into three different itabs and then process, this is best and last way to reduce load on DB and will increase load on ABAP which can be manages as above..
    Still u want more info .. send codes to me.. We will try to make it more and more fast....
    Jogdand M B
    null
    Message was edited by:
            Jogdand M B

  • How to join THREE different tables into internal table using one select statement .

    How to join THREE different tables into internal table using one select statement .
    Hi experts,
    I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
    Scenario:
    Database tables:
    SPFLI
    SFLIGHT
    SBOOK.
    Table Fields:
    SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
    SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
    SEATSOCC_C SEATSMAX_F SEATSOCC_F
    SBOOK - CARRID CONNID CLASS
    MY INTERNAL TABLE IS IT_XX.
    Your help much appreciated.
    Thanks in advance.
    Pawan.

    Hi Pawan,
    please check below codes. hope it can help you.
    TYPES: BEGIN OF ty_xx,
            carrid     TYPE spfli-carrid   ,
            connid     TYPE spfli-connid   ,
            countryfr  TYPE spfli-countryfr,
            cityfrom   TYPE spfli-cityfrom  ,
            countryto  TYPE spfli-countryto,
            cityto     TYPE spfli-cityto   ,
            fldate     TYPE sflight-fldate ,
            seatsmax   TYPE sflight-seatsmax ,
            seatsocc   TYPE sflight-seatsocc ,
            seatsmax_b TYPE sflight-seatsmax_b,
            seatsocc_b TYPE sflight-seatsocc_b,
            seatsmax_f TYPE sflight-seatsmax_f,
            seatsocc_f TYPE sflight-seatsocc_f,
            class      TYPE sbook-class,
          END OF ty_xx,
          t_xx TYPE STANDARD TABLE OF ty_xx.
    DATA: it_xx TYPE t_xx.
    SELECT spfli~carrid
           spfli~connid
           spfli~countryfr
           spfli~cityfrom
           spfli~countryto
           spfli~cityto
           sflight~fldate
           sflight~seatsmax
           sflight~seatsocc
           sflight~seatsmax_b
           sflight~seatsocc_b
           sflight~seatsmax_f
           sflight~seatsocc_f
           sbook~class
      INTO TABLE it_xx
      FROM spfli INNER JOIN sflight
      ON spfli~carrid = sflight~carrid
      AND spfli~connid = sflight~connid
      INNER JOIN sbook
      ON spfli~carrid = sbook~carrid
      AND spfli~connid = sbook~connid.
    Thanks,
    Yawa

  • Join 2 internal tables into 1 internal table

    itab 1
    field 1
    1
    2
    3
    5
    itab2
    field 1
    1
    2
    3
    4
    6
    The result require is
    itab3
    filed 1
    1
    2
    3
    4
    5
    6
    how to achieve this if any one can give the exact code for this it will be of great help to me.
    thanks
    naveen

    hi ,
    create the new internal table with all required fields and select the data from those tables through inner-join query as example follows.
    REPORT Z0292_INT_SELECT.
    DATA : BEGIN OF WA,
    PONO TYPE Z0292_PURITEM-PONO,
    ITEM TYPE Z0292_PURITEM-ITEM,
    POD TYPE Z0292_PURHEA-POD,
    VENID TYPE Z0292_PURHEA-VENID,
    END OF WA.
    DATA : ITAB LIKE TABLE OF WA WITH HEADER LINE.
    SELECT APONO AITEM BPOD BVENID
    INTO TABLE ITAB
    FROM Z0292_PURITEM AS A INNER JOIN Z0292_PURHEA AS B
    ON APONO = BPONO.
    LOOP AT ITAB.
    WRITE : / ITAB-PONO,ITAB-ITEM,ITAB-POD,ITAB-VENID.
    ENDLOOP.
    sagun desai  
    Posts: 51
    Questions: 9
    Registered: 2/27/06
    Forum points: 48 
       Re: how to get the data in one internal table? with 3 different tables..  
    Posted: Jul 31, 2007 10:34 AM    in response to: rhymmeanne         Reply      E-mail this post 
    DATA : BEGIN OF IT_A005 OCCURS 0,
    vkorg TYPE a005-vkorg,
    vtweg TYPE a005-vtweg,
    kschl TYPE a005-kschl,
    matnr TYPE a005-matnr,
    kunnr TYPE a005-kunnr,
    datab TYPE a005-datab,
    end of it_a005.
    DATA : begin of IT_MVKE OCCURS 0,
    matnr TYPE MVKE-matnr,
    vkorg TYPE MVKE-vkorg,
    vtweg TYPE MVKE-vtweg,
    kondm TYPE mvke-kondm,
    end of it_mvke.
    DATA : begin of IT_KNVV OCCURS 0,
    kunnr TYPE KNVV-kunnr,
    vkorg TYPE KNVV-vkorg,
    vtweg TYPE KNVV-vtweg,
    kdgrp TYPE knvv-kdgrp,
    konda TYPE knvv-konda,
    end of it_knvv.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
    vkorg TYPE a005-vkorg,
    vtweg TYPE a005-vtweg,
    kschl TYPE a005-kschl,
    kondm TYPE mvke-kondm,
    matnr TYPE a005-matnr,
    kdgrp TYPE knvv-kdgrp,
    konda TYPE knvv-konda,
    kunnr TYPE a005-kunnr,
    datab TYPE a005-datab,
    END OF IT_FINAL.
    SELECT * FROM A005 INTO TABLE IT_A005.
    SELECT * FROM MVKE INTO CORRESPONDING FIELDS
    OF TABLE IT_MVKE
    FOR ALL ENTRIES IN IT_A005
    WHERE MATNR = IT_A005-MATNR
    AND VKORG = IT_A005-VKORG
    AND VTWEG = IT_A005-VTWEG.
    SELECT * FROM KNVV INTO CORRESPONDING FIELDS
    OF TABLE IT_KNVV
    FOR ALL ENTRIES IN IT_A005
    WHERE KUNNR = IT_A005-KUNNR
    AND VKORG = IT_A005-VKORG
    AND VTWEG = IT_A005-VTWEG.
    LOOP AT IT_A005.
    IT_FINAL-vkorg = IT_a005-vkorg.
    IT_FINAL-vtweg = IT_a005-vtweg.
    IT_FINAL-kschl = IT_a005-kschl.
    IT_FINAL-MATNR = IT_a005-matnr.
    IT_FINAL-KUNNR = IT_a005-kunnr.
    IT_FINAL-DATAB = IT_a005-datab.
    READ TABLE IT_MVKE WITH KEY MATNR = IT_A005-MATNR
    AND VKORG = IT_A005-VKORG
    AND VTWEG = IT_A005-VTWEG.
    IT_FINAL-kondm = IT_mvke-kondm.
    READ TABLE IT_KNVV WITH KEY KUNNR = IT_A005-KUNNR
    AND VKORG = IT_A005-VKORG
    AND VTWEG = IT_A005-VTWEG.
    IT_FINAL-kdgrp = IT_knvv-kdgrp.
    IT_FINAL-konda = IT_knvv-konda.
    APPEND IT_FINAL.
    CLEAR : IT_FINAL, IT_MVKE, IT_KNVV.
    ENDLOOP.
    You can try with this code.
    It should work.
    if it ok for you then you can close this issue.
    Cheers,
    Sagun Desai.

  • How to do a SELECT from different tables into an internal table?

    How to do a SELECT from different tables into an internal table?
    I want to select data from MARA, MARC and ZPERSON and populate my ITAB_FINAL
    REPORT  zinternal_table.
    TABLES:
      mara,
      marc,
      zperson.
    TYPES:
    BEGIN OF str_table1,
      v_name LIKE zperson-zname,
      v_matnr LIKE marc-matnr,
      v_emarc LIKE marc-emarc,
      v_werks_d LIKE marc-werks_d,
      v_dstat LIKE marc-dstat,
      END OF str_table,
      i_table1 TYPE STANDARD TABLE OF str_table1.
    DATA:
    BEGIN OF str_table2,
    v_mandt LIKE mara-mandt,
    v_ernam LIKE mara-ernam,
      v_laeda LIKE mara-laeda,
    END OF str_table2,
    itab_final LIKE STANDARD TABLE OF str_table2.

    first find the link between mara , marc and zperson , if u have link to 3 tables then u can jus write a join and populate the table u want ( thats final table with all the fields).
    u defenitely have alink between mara and marc so join them and retrieve all data into one internal table.
    then for all the entries in that internal table retrieve data from zperson into another internal table.
    then loop at one internal table
    read another internal table where key equals in both the tables.
    finally assign fileds if sy-subrc = 0.
    gs_finaltable-matnr = gs_table-matnr
    etc...
    and finally append gs_finaltable to gt_finaltable.
    there u go ur final table has all the data u want.
    regards
    Edited by: BrightSide on Apr 2, 2009 3:49 PM

  • Merge 2 internal tables into one and show first record from common fields

    Hello PPl,
              I have 3 tables kna1 knb1 and knvp i have to join kna1 and knb1 on kunnr and move the data into an internal table it_data then  on the basis of that data in it_data i have to retrieve records FOR ALL ENTRIES from KNVP and move it into it_knvp.
    Then both it_data and it_knvp should be merged in it_alv and from that internal table report has to be displayed.
    [NOTE: i had tried using loop twice but the report got messed up]
    Apart from that for these set of values
    0000000004
    0000000418
    0000000954
    0000001190
    0000001222
    0000001451
    0000001453
    0000001455
    0000001470
    0000001508
    finally knvp is showing records in such a way that for 2 records kunnr is same and so does all the other fields except PARZA and KUNN2 so the req. is to display only the first record among 2.
    Plz help me by providing code for that its urgent......
    Below i m providing my code so far, i hope it will be of some help.
    TREMENDOUS REWARD POINTS GURANTEED!!!!!
    REPORT  zfanz_alv_report_whv.
    TYPE-GROUPS                                                         *
    TYPE-POOLS: slis.
    TYPES                                                               *
    TYPES: BEGIN OF ty_data,
           kunnr TYPE kunnr,
           ort01 TYPE ort01,
           pstlz TYPE pstlz,
           regio TYPE regio,
           bukrs TYPE bukrs,
           zterm TYPE zterm,
           END OF ty_data,
           BEGIN OF ty_knvp,
           vkorg TYPE vkorg,
           vtweg TYPE vtweg,
           spart TYPE spart,
           parvw TYPE parvw,
           parza TYPE parza,
           kunn2 TYPE kunn2,
           lifnr TYPE lifnr,
           END OF ty_knvp,
           BEGIN OF ty_alv,
           kunnr TYPE kunnr,
           ort01 TYPE ort01,
           pstlz TYPE pstlz,
           regio TYPE regio,
           bukrs TYPE bukrs,
           zterm TYPE zterm,
           vkorg TYPE vkorg,
           vtweg TYPE vtweg,
           spart TYPE spart,
           parvw TYPE parvw,
           parza TYPE parza,
           kunn2 TYPE kunn2,
           lifnr TYPE lifnr,
           END OF ty_alv,
           BEGIN OF ty_kna1,
           kunnr TYPE kunnr,
           END OF ty_kna1,
           BEGIN OF ty_knb1,
           bukrs TYPE bukrs,
           END OF ty_knb1.
    *DATA: IT_KNVP TYPE KNVP,
    DATA: it_knvp TYPE STANDARD TABLE OF ty_knvp WITH HEADER LINE.
    DATA: it_data TYPE STANDARD TABLE OF ty_data WITH HEADER LINE.
    Report data to be shown.
    DATA: it_alv TYPE STANDARD TABLE OF ty_alv WITH HEADER LINE.
    Heading of the report.
    DATA: t_heading TYPE slis_t_listheader.
    *DATA: fieldcatalog type standard table of slis_fieldcat_alv with header
    *line.
    DATA: fieldcatalog TYPE  slis_t_fieldcat_alv WITH HEADER LINE.
    *TABLES
    tables:knvp,kna1,knb1.
                     CONSTANTS                                           *
    CONSTANTS: c_kunnr TYPE char5 VALUE 'KUNNR',
    c_ort01 TYPE char5 VALUE 'ORT01',
    c_pstlz TYPE char5 VALUE 'PSTLZ',
    c_regio TYPE char5 VALUE 'REGIO',
    c_bukrs TYPE char5 VALUE 'BUKRS',
    c_zterm TYPE char5 VALUE 'ZTERM',
    c_vkorg TYPE char5 VALUE 'VKORG',
    c_vtweg TYPE char5 VALUE 'VTWEG',
    c_spart TYPE char5 VALUE 'SPART',
    c_parvw TYPE char5 VALUE 'PARVW',
    c_parza TYPE char5 VALUE 'PARZA',
    c_kunn2 TYPE char5 VALUE 'KUNN2',
    c_lifnr TYPE char5 VALUE 'LIFNR'.
    WORKAREA                                                           *
    DATA: wa_data TYPE ty_data,
          wa_knvp TYPE ty_knvp,
          wa_alv TYPE ty_alv,
          wa_fcat  TYPE slis_fieldcat_alv,
          wa_layout TYPE slis_layout_alv.
    ======================= Selection Screen ==========================
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    *DATA: wa_kunnr LIKE kna1-kunnr,
         wa_bukrs LIKE knb1-bukrs,
         wa_vkorg LIKE knvp-vkorg,
         wa_vtweg LIKE knvp-vtweg,
         wa_spart LIKE knvp-spart,
         wa_parvw LIKE knvp-parvw.
    SELECT-OPTIONS                                                      *
    SELECT-OPTIONS s_kunnr FOR kna1-kunnr NO INTERVALS OBLIGATORY
    SELECT-OPTIONS: s_bukrs FOR knb1-bukrs NO-EXTENSION NO INTERVALS,
    s_vkorg FOR knvp-vkorg  NO-EXTENSION NO INTERVALS,
    s_vtweg FOR knvp-vtweg NO-EXTENSION NO INTERVALS,
    s_spart FOR knvp-spart NO-EXTENSION NO INTERVALS,
    s_parvw FOR knvp-parvw NO-EXTENSION NO INTERVALS.
    SELECTION-SCREEN: END OF BLOCK b1.
    AT SELECTION-SCREEN                                            *
    AT SELECTION-SCREEN ON s_kunnr.
      PERFORM validate_data.
    START-OF-SELECTION                                                   *
    START-OF-SELECTION.
      PERFORM get_data.  "fetch data from table and perform join on them
      PERFORM final_table.
      PERFORM build_fieldcatalog.            "populate field catalog
      PERFORM build_layout.
      PERFORM grid_display.                  "display the result in ALV grid
    END-OF-SELECTION                                                     *
    END-OF-SELECTION.
    describe
    SUBROUTINES (FORMS)
    *&      Form  get_data
          Gets the information to be shown in the report.
          Join on tables KNA1, KNB1 and for all enteries in KNVP
    -->  p1        text
    <--  p2        text
    FORM get_data.
      SELECT kna1~kunnr
      kna1~ort01
      kna1~pstlz
      kna1~regio
      knb1~bukrs
      knb1~zterm
      INTO TABLE it_data
      FROM kna1 INNER JOIN knb1
      ON kna1kunnr = knb1kunnr
        WHERE kna1~kunnr IN s_kunnr
       AND knb1~bukrs IN s_bukrs.
      SELECT vkorg
             vtweg
             spart
             parvw
             parza
             kunn2
             lifnr
            INTO TABLE it_knvp FROM knvp
       FOR ALL ENTRIES IN it_data
       WHERE  knvp~kunnr = it_data-kunnr
         AND  vkorg IN s_vkorg
         AND  vtweg IN s_vtweg
         AND  spart IN s_spart
         AND  parvw IN s_parvw.
    ENDFORM. " get_data
    *ENDFORM. " get_data
    *&      Form  FINAL_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM final_table .
      LOOP AT it_data.
        it_alv-kunnr = it_data-kunnr.
        it_alv-ort01 = it_data-ort01.
        it_alv-pstlz = it_data-pstlz.
        it_alv-regio = it_data-regio.
        it_alv-bukrs = it_data-bukrs.
        it_alv-zterm = it_data-zterm.
        APPEND it_alv.
        CLEAR it_alv.
      ENDLOOP.
      LOOP AT it_knvp.
        it_alv-vkorg = it_knvp-vkorg.
        it_alv-vtweg = it_knvp-vtweg.
        it_alv-spart = it_knvp-spart.
        it_alv-parvw = it_knvp-parvw.
        it_alv-parza = it_knvp-parza.
        it_alv-kunn2 = it_knvp-kunn2.
        it_alv-lifnr = it_knvp-lifnr.
        APPEND it_alv.
        CLEAR it_alv.
      ENDLOOP.
    ENDFORM.                    " FINAL_TABLE
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      IF it_alv[] IS NOT INITIAL.
        wa_fcat-fieldname   = c_kunnr.
        wa_fcat-seltext_l   = 'Customer Master'(001).
        wa_fcat-col_pos     = 1.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_ort01.
        wa_fcat-seltext_l   = 'City'(002).
        wa_fcat-col_pos     = 2.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_pstlz.
        wa_fcat-seltext_l   = 'Postal Code'(003).
        wa_fcat-col_pos     = 3.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_regio.
        wa_fcat-seltext_l   = 'Region'(004).
        wa_fcat-col_pos     = 4.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_bukrs.
        wa_fcat-seltext_l   = 'Company Code'(005).
        wa_fcat-col_pos     = 5.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_zterm.
        wa_fcat-seltext_l   = 'Terms of payment'(006).
        wa_fcat-col_pos     = 6.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_vkorg.
        wa_fcat-seltext_l   = 'Sales Organization'(007).
        wa_fcat-col_pos     = 7.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_vtweg.
        wa_fcat-seltext_l   = 'Distribution Channel'(008).
        wa_fcat-col_pos     = 8.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_spart.
        wa_fcat-seltext_l   = 'Division'(009).
        wa_fcat-col_pos     = 9.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_parvw.
        wa_fcat-seltext_l   = 'Partner function'(010).
        wa_fcat-col_pos     = 10.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_kunn2.
        wa_fcat-seltext_l   = 'Customer number of partner'(011).
        wa_fcat-col_pos     = 11.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_lifnr.
        wa_fcat-seltext_l   = 'Account Number of Vendor'(012).
        wa_fcat-col_pos     = 12.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
       wa_fcat-fieldname   = c_parza.
       wa_fcat-seltext_l   = 'Partner counter'(013).
        wa_fcat-col_pos     = 13.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
    *fieldcatalog-fieldname   = c_kunnr.
       fieldcatalog-seltext_l   = 'Customer Master'(001).
       fieldcatalog-col_pos     = 1.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_ort01.
       fieldcatalog-seltext_l   = 'City'(002).
       fieldcatalog-col_pos     = 2.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_pstlz.
       fieldcatalog-seltext_l   = 'Postal Code'(003).
       fieldcatalog-col_pos     = 3.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_regio.
       fieldcatalog-seltext_l   = 'Region'(004).
       fieldcatalog-col_pos     = 4.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_bukrs.
       fieldcatalog-seltext_l   = 'Company Code'(005).
       fieldcatalog-col_pos     = 5.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_zterm.
       fieldcatalog-seltext_l   = 'Terms of payment'(006).
       fieldcatalog-col_pos     = 6.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_vkorg.
       fieldcatalog-seltext_l   = 'Sales Organization'(007).
       fieldcatalog-col_pos     = 7.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_vtweg.
       fieldcatalog-seltext_l   = 'Distribution Channel'(008).
       fieldcatalog-col_pos     = 8.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_spart.
       fieldcatalog-seltext_l   = 'Division'(009).
       fieldcatalog-col_pos     = 9.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_parvw.
       fieldcatalog-seltext_l   = 'Partner function'(010).
       fieldcatalog-col_pos     = 10.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_kunn2.
       fieldcatalog-seltext_l   = 'Customer number of partner'(011).
       fieldcatalog-col_pos     = 11.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_lifnr.
       fieldcatalog-seltext_l   = 'Account Number of Vendor'(012).
       fieldcatalog-col_pos     = 12.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_parza.
       fieldcatalog-seltext_l   = 'Partner counter'(013).
       fieldcatalog-col_pos     = 13.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
      ENDIF.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    form build_layout .
    Set layout field for field attributes(i.e. input/output)
    wa_layout-stylefname = 'FIELD_STYLE'.
      wa_layout-zebra             = 'X'.
    endform.                    " build_layout
    *&      Form  GRID_DISPLAY
          text
    FORM grid_display. "using t_data type ty_tbl_data.
      IF it_alv[] IS NOT INITIAL.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = sy-repid
       IS_LAYOUT                         = wa_layout
         it_fieldcat                       = fieldcatalog[]
        TABLES
          t_outtab                          = it_alv[]
      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.
      ENDIF.
    ENDIF.
    ENDFORM.                    "GRID_DISPLAY
    *&      Form  VALIDATE_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM validate_data .
      DATA : li_kna1 TYPE STANDARD TABLE OF ty_kna1,
             li_knb1 TYPE STANDARD TABLE OF ty_knb1,
             li_knvp TYPE STANDARD TABLE OF ty_knvp.
      SELECT kunnr
      FROM kna1
      INTO TABLE li_kna1
      WHERE kunnr IN s_kunnr.
      IF sy-subrc <> 0.
        MESSAGE 'Invalid Customer Number'(013) TYPE 'E'.
      ENDIF.
      SELECT bukrs
      FROM t001
      INTO TABLE li_knb1
      WHERE bukrs IN s_bukrs.
        IF sy-subrc <> 0.
          MESSAGE 'Invalid Company Code'(014) TYPE 'E'.
        ENDIF.
        SELECT vkorg
        FROM tvko
        INTO TABLE li_knvp
        WHERE vkorg IN s_vkorg.
          IF sy-subrc <> 0.
            MESSAGE 'Invalid Sales Organization'(015) TYPE 'E'.
          ENDIF.
          SELECT vtweg
          FROM tvtw
          INTO TABLE li_knvp
          WHERE vtweg IN s_vtweg.
            IF sy-subrc <> 0.
              MESSAGE 'Invalid Distribution Channel'(016) TYPE 'E'.
            ENDIF.
            SELECT spart
            FROM tspa
            INTO TABLE li_knvp
            WHERE spart IN s_spart.
              IF sy-subrc <> 0.
                MESSAGE 'Invalid Division'(017) TYPE 'E'.
              ENDIF.
              SELECT parvw
              FROM tpar
              INTO TABLE li_knvp
              WHERE parvw IN s_parvw.
                IF sy-subrc <> 0.
                  MESSAGE 'Invalid Partner function'(018) TYPE 'E'.
                ENDIF.
            ENDFORM.                    " VALIDATE_DATA

    *1----
    FORM get_data.
      SELECT kna1~kunnr
      kna1~ort01
      kna1~pstlz
      kna1~regio
      knb1~bukrs
      knb1~zterm
      INTO TABLE it_data
      FROM kna1 INNER JOIN knb1
      ON kna1kunnr = knb1kunnr
        WHERE kna1~kunnr IN s_kunnr
       AND knb1~bukrs IN s_bukrs.
      CHECK it_data[] IS NOT INITIAL.
      SELECT kunnr
             vkorg
             vtweg
             spart
             parvw
             parza
             kunn2
             lifnr
            INTO TABLE it_knvp FROM knvp
       FOR ALL ENTRIES IN it_data
       WHERE  kunnr = it_data-kunnr
         AND  vkorg IN s_vkorg
         AND  vtweg IN s_vtweg
         AND  spart IN s_spart
         AND  parvw IN s_parvw.
      IF sy-subrc EQ 0.
        SORT it_knvp BY kunnr.
      ENDIF.
    ENDFORM. " get_data
    *2----
    FORM final_table .
      LOOP AT it_data INTO wa_data.
        READ TABLE it_knvp
        INTO wa_knvp
        WITH KEY kunnr = wa_data-kunnr
        BINARY SEARCH .
        IF sy-subrc = 0.
          MOVE-CORRESPONDING wa_data TO wa_alv.
          MOVE-CORRESPONDING wa_knvp TO wa_alv.
          APPEND wa_alv TO it_alv.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " FINAL_TABLE
    Edited by: Faisal Khan on Mar 27, 2008 1:59 PM

  • Combine 2 internal tables into a single internal table

    Hi
    I need to replace the following join statement by splitting it into 2 select statements and then combine them into a single internal table
    SELECT  vbak~waerk
    vbapvbeln vbapposnr vbapnetwr vbapbrgew
    vbap~erdat                         "IM152805
    INTO CORRESPONDING FIELDS OF TABLE l_t_orders
    FROM vbak INNER JOIN vbap ON vbakvbeln = vbapvbeln
    FOR ALL entries IN t_mchb
    WHERE vbap~vbeln = t_mchb-vbeln
    AND vbap~posnr = t_mchb-posnr.
    Need to replace the above with separate select statements and then combine the result into a single internal table...
    could anyone please help me...
    thanks in advance

    Hi,
    Check the code below,
    select vbeln waerk
    from vbak into table it_vbak for all entries in t_mchb  where vbeln = t_mchb-vbeln.
    select posnr
         netwr
         brgew
         erdat "IM152805
    INTO TABLE it_vbap
    for all entries in t_mchb
    where vbeln = t_mchb-vbeln
    and posnr = t_mchb-posnr.
    loop at it_vbap into wa_vbap.
    read table it_vbak into wa_vbak where vbeln = wa_vbap-vbeln.
    if sy-subrc = 0.
    l_t_orders-waerk = wa_vbak-waerk.
    l_t_orders-vbeln = wa_vbap-vbeln.
    l_t_orders-posnr = wa_vbap-posnr
    l_t_orders-netwr   = wa_vbap-netwr.
    l_t_orders-brgew   = wa_vbap-brgew.
    l_t_orders-erdat   = wa_vbap-erdat.
    append l_t_orders.
    endif.
    endloop.
    Reward if it is helpful.
    Regards,
    Bhanu

  • Join Internal Table for all entries

    Hi,
       I have put the LIKP data in the internal table and then use the for all entries statement to join the table with LIPS.  Besides, i specifiy an additional condition to filter empty batch.
    But, i found that the empty batch record still exist in the result.  Any idea??
        SELECT *
        FROM LIPS INTO  TABLE I_DELIVERY_INFO
        FOR ALL ENTRIES IN I_DELIVERY
        WHERE
        VBELN = I_DELIVERY-VBELN.
        AND
        CHARG IS NOT NULL.
    Regards,
    Kit

    Hi Kit,
    If you are using LIKP and LIPS then you can directly join them since these tables are HEADER & ITEM table.
    regd ur query you can use CHARG NE ' '.
    Regards
    Gopi

  • Newbie: Joining internal tables

    I would like to join two internal tables, but it looks like I cannot run INNER JOIN / LEFT OUTER JOIN statements on internal tables. Is there an efficient way of achieving the same result or would I be better off creating physical tables and join them that way.
    The tables have roughly 10000 records and about 15 colums each which I think would be better dealt with in memory rather that going back to the database. Any thoughts?
    Here is the code:
    DATA: BEGIN OF WA_USREPORT,
            WA_US_GLOBN TYPE ZCA_PRODUCT-GLOBN,
            WA_US_GLOBT TYPE ZCA_PRODUCT-GLOBT,
            WA_US_DESCR TYPE ZCA_PRODUCT-DESCR,
            WA_US_INTOR TYPE ZCA_PRODUCT-INTOR,
            WA_US_ACT TYPE ZCA_PRODUCT-ACT,
            WA_US_TUOME TYPE ZCA_PRODUCT-TUOME,
            WA_US_USITM TYPE ZCA_USITM-USITM,
            WA_US_USEUMAT TYPE ZCA_USITM-USEUMAT,
            WA_US_GPSUOMC TYPE ZCA_USITM-GPSUOMC,
            WA_US_GPSDENOM TYPE ZCA_USITM-GPSDENOM,
            WA_US_GPSNUMER TYPE ZCA_USITM-GPSNUMER,
            WA_US_USPLANT TYPE ZCA_USITM-USPLANT,
            WA_US_USITMDESC TYPE /BIC/TUSITM-TXTMD,
            WA_US_USDIVSN TYPE /BIC/PUSITM-/BIC/USDIVSN,
            WA_US_USERL TYPE /BIC/PUSITM-/BIC/US_ERL,
            WA_US_USSTKTYP TYPE /BIC/PUSITMSTR-/BIC/USSTKTYP,
            WA_US_USSUPNO TYPE /BIC/PUSITMSTR-/BIC/USSUPNO,
          END OF WA_USREPORT,
          TBL_USREPORT LIKE TABLE OF WA_USREPORT WITH HEADER LINE.
    DATA: BEGIN OF WA_EUREPORT,
            WA_EU_GLOBN TYPE ZCA_PRODUCT-GLOBN,
            WA_EU_GLOBT TYPE ZCA_PRODUCT-GLOBT,
            WA_EU_EUMAT TYPE ZCA_EUMAT-EUMAT,
            WA_EU_USITM TYPE ZCA_EUMAT-USITM,
            WA_EU_GPSUOMC TYPE ZCA_EUMAT-GPSUOMC,
            WA_EU_GPSDENOM TYPE ZCA_EUMAT-GPSDENOM,
            WA_EU_GPSNUMER TYPE ZCA_EUMAT-GPSNUMER,
            WA_EU_EUMATTXT TYPE /BI0/TMATERIAL-TXTMD,
            WA_EU_PRODH1 TYPE /BI0/PMATERIAL-PRODH1,
            WA_EU_PRODH2 TYPE /BI0/PMATERIAL-PRODH2,
            WA_EU_MSTAE TYPE /BI0/PMATERIAL-/BIC/MSTAE,
            WA_EU_VENDOR TYPE /BI0/PMATERIAL-VENDOR,
          END OF WA_EUREPORT,
          TBL_EUREPORT LIKE TABLE OF WA_EUREPORT WITH HEADER LINE.
    DATA: BEGIN OF WA_REPORT,
    from ZCA_Product, ZCA_USITM, USITM and USITMSTR
            WA_US_GLOBN TYPE ZCA_PRODUCT-GLOBN,
            WA_US_GLOBT TYPE ZCA_PRODUCT-GLOBT,
            WA_US_DESCR TYPE ZCA_PRODUCT-DESCR,
            WA_US_INTOR TYPE ZCA_PRODUCT-INTOR,
            WA_US_ACT TYPE ZCA_PRODUCT-ACT,
            WA_US_TUOME TYPE ZCA_PRODUCT-TUOME,
            WA_US_USITM TYPE ZCA_USITM-USITM,
            WA_US_USEUMAT TYPE ZCA_USITM-USEUMAT,
            WA_US_GPSUOMC TYPE ZCA_USITM-GPSUOMC,
            WA_US_GPSDENOM TYPE ZCA_USITM-GPSDENOM,
            WA_US_GPSNUMER TYPE ZCA_USITM-GPSNUMER,
            WA_US_USPLANT TYPE ZCA_USITM-USPLANT,
            WA_US_USITMDESC TYPE /BIC/TUSITM-TXTMD,
            WA_US_USDIVSN TYPE /BIC/PUSITM-/BIC/USDIVSN,
            WA_US_USERL TYPE /BIC/PUSITM-/BIC/US_ERL,
            WA_US_USSTKTYP TYPE /BIC/PUSITMSTR-/BIC/USSTKTYP,
            WA_US_USSUPNO TYPE /BIC/PUSITMSTR-/BIC/USSUPNO,
    from ZCA_Product, ZCA_EUMAT and 0Material
            WA_EU_EUMAT TYPE ZCA_EUMAT-EUMAT,
            WA_EU_USITM TYPE ZCA_EUMAT-USITM,
            WA_EU_GPSUOMC TYPE ZCA_EUMAT-GPSUOMC,
            WA_EU_GPSDENOM TYPE ZCA_EUMAT-GPSDENOM,
            WA_EU_GPSNUMER TYPE ZCA_EUMAT-GPSNUMER,
            WA_EU_EUMATTXT TYPE /BI0/TMATERIAL-TXTMD,
            WA_EU_PRODH1 TYPE /BI0/PMATERIAL-PRODH1,
            WA_EU_PRODH2 TYPE /BI0/PMATERIAL-PRODH2,
            WA_EU_MSTAE TYPE /BI0/PMATERIAL-/BIC/MSTAE,
            WA_EU_VENDOR TYPE /BI0/PMATERIAL-VENDOR,
          END OF WA_REPORT,
          TBL_REPORT LIKE TABLE OF WA_REPORT WITH HEADER LINE.
    SQL Queries                                                         *
    SELECT
      PGLOBN PGLOBT PDESCR PINTOR PACT PTUOME
      UUSITM UUSEUMAT UGPSUOMC UGPSDENOM UGPSNUMER UUSPLANT
      ITMT~TXTMD
      ITMA/BIC/USDIVSN ITMA/BIC/US_ERL
      ITMSTR/BIC/USSTKTYP ITMSTR/BIC/USSUPNO
      FROM ZCA_PRODUCT AS P
        INNER JOIN ZCA_USITM AS U ON PGLOBN = USYNPROD
          INNER JOIN /BIC/TUSITM AS ITMT ON UUSITM = ITMT/BIC/USITM
            INNER JOIN /BIC/PUSITM AS ITMA ON UUSITM = ITMA/BIC/USITM
              LEFT OUTER JOIN /BIC/PUSITMSTR AS ITMSTR ON UUSITM = ITMSTR/BIC/USITMSTR AND ITMSTR/BIC/USBRPLANT = UUSPLANT
      INTO TABLE TBL_USREPORT
      WHERE ITMA~OBJVERS = 'A'
      ORDER BY PGLOBT UUSITM.
    SELECT
      PGLOBN PGLOBT
      EEUMAT EUSITM EGPSUOMC EGPSDENOM E~GPSNUMER
      T~TXTMD
      MPRODH1 MPRODH2 M/BIC/MSTAE MVENDOR
      FROM ZCA_PRODUCT AS P
        INNER JOIN ZCA_EUMAT AS E ON PGLOBN = ESYNPROD
          INNER JOIN /BI0/TMATERIAL AS T ON EEUMAT = TMATERIAL
            INNER JOIN /BI0/PMATERIAL AS M ON EEUMAT = MMATERIAL
      INTO TABLE TBL_EUREPORT
      WHERE M~OBJVERS = 'A'
      ORDER BY PGLOBT EEUMAT.
    TODO: join TBL_USREPORT and TBL_EUREPORT into TBL_REPORT and output as a list
    Thank you for your help,
    Dennis

    Hi,
    Martin :-->I missed the binary search , thanks for pointing out.
    loop at tbl_usreport.
      move-corresponding tbl_usreport to tbl_report.
      append tbl_report.
    endloop.
    sort tbl_report by globn globt.
    loop at tbl_eureport.
      read table tbl_report with key globn = tbl_eureport
                                     globt = tbl_eureport
                                     binary search.
      if sy-subrc eq 0.
       move-corresponding tbl_eureport to tbl_report.
       modify tbl_report index sy-tabix.
      else.
       move-corresponding tbl_eureport to tbl_report.
       append tbl_report.
      endif.
    endloop.
    aRs

  • How can i add two table into one internal table

    I WANT TO ADD THIS TWO DIFFERENT TABLE INTO ONE INTERNAL TABLE PLEASE HELP.
    TABLES: J_1IEXCHDR, J_1IEXCDTL.
    SELECT * FROM J_1IEXCHDR WHERE STATUS = 'P'.
    WRITE: / J_1IEXCHDR-LIFNR,
              J_1IEXCHDR-DOCNO,
              J_1IEXCHDR-EXYEAR,
              J_1IEXCHDR-BUDAT.
    SELECT * FROM J_1IEXCDTL WHERE TRNTYP = J_1IEXCHDR-TRNTYP
                              AND DOCYR  = J_1IEXCHDR-DOCYR
                              AND DOCNO  = J_1IEXCHDR-DOCNO.
       WRITE: / J_1IEXCDTL-EXBAS,
                J_1IEXCDTL-EXBED,
                J_1IEXCDTL-RDOC1,
                J_1IEXCDTL-ECS.
    ENDSELECT.
    ENDSELECT.
    THANKS IN ADVANCED.

    U have to link these 2 tables like this
    <b>SELECT
    J_1IEXCHDR~DOCNO
    FROM J_1IEXCHDR inner join J_1IEXCDTL
    on J_1IEXCHDRDOCYR  = J_1IEXCDTLDOCYR
    WHERE STATUS = 'P'.</b>
    this is sample code only, and u have to check the F.key relationship.
    Regards
    Prabhu

  • How to 'inner join' internal table or cluster table ??

    Hi,
    when i inner join table BSEG it said is a cluster table can't be inner joined .
    i wonder how i can "inner join" bseg with a internal table such as
    data: begin of i_bseg_trans,
            bukrs like bseg-bukrs,
            gjahr like bseg-gjahr,
            belnr like bseg-belnr,
            total_runtimes like i_runtimes-total,
            already_runtimes like i_runtimes-already,
            left_runtimes like i_runtimes-left,
          end of i_bseg_trans.
    and similar things trouble me  when considering several internal tables .
    thanks for any help!!

    Hi,
    but if there's more than 2 tables,  for example
    data: begin of it_bseg occurs 0,
            bukrs like bseg-bukrs,
            else_1 type i,
         end of it_bseg.
    data: begin of t occurs 0,
            bukrs like bseg-bukrs,
          end of t.
    data: begin of r occurs 0,
            bukrs like bseg-bukrs,
            else type c,
          end of r.
    select bukrs from bkdf into table t.
    select bukrs from bkdf into corresponding fields of table it_bseg.
    select bseg~bukrs      "else_1
    from bseg      "it_bseg
      into table r
      for all entries in t
      where bseg~bukrs = t-bukrs.
          " and it_bseg-bukrs = t-bukrs.
    in the select clause i mean whether there's a method similar to the way just drop the " in my code.
    now my solution is to use another loop on it_bseg, but i think when table amount is large this is really a boring solution.

Maybe you are looking for

  • Cannot deploy BPEL process with SSO to BPELConsole activated

    I cannot deploy BPEL process with SSO to BPELConsole activated. Here is the error I get from JDeveloper (sorry for the french error message): Problème détecté lors de la connexion au serveur "ssdvoiagu.dev.local.csst.qc.ca" sur le port "7781" : java.

  • Problem With router related to mIRC?

    Hi Everyone,                     I am having problem with my router (model = WRT54G2 and version = 1) related to mirc, the problem is that whenever i recieve or try to send someone a code something like this I'm a QUEER?DCC SEND "gay???g?" 0 0 0 i ge

  • Special stock indicator in the OD (goods movement  data tab)

    Hello SAP Experts, I would like to ask on how the special stock type indicator field (LIPS-SOBKZ) in the outbound deliveries, under the goods movement data tab, can be populated? For example, with stock type indicator E. Are there any configs or mast

  • Color picker show only gamut colors

    hello all, in photshop, you can go to View -> Show Gamut Warning and then in the color picker the colors out of gamut will be greyed out. is there any similar setting in illustrator too? thanks for answers.

  • URGENT : : "Unable to change every document" during mass changes in FBL3N

    when i try to perform mass changes for GL accounts, there is a message stating "Unable to change every document". i am unable to process further. please help. regards, rupesh.