‎2010 Jan 18 7:10 AM
Hi,
In my senario, i get the data from 2 different table and kept in 2 internal tables and did the some calculations on those. later i want to club that 2 internal tables and keep as 1 internal table, for that which statement is applicable.
Thanks
‎2010 Jan 18 7:16 AM
Hi,
Which are the two tables from which you are getting the data. Try using inner joins if those two tables have any common key.
Then pass this data to one internal table.
Regards,
Raj
‎2010 Jan 18 7:16 AM
hi
Based on the Primary key ,You can loop the internal table and append into final table.
Using read statement u can calli the another internal table.
‎2010 Jan 18 7:16 AM
HI,
You can use either INNER JOIN or FOR ALL ENTRIES Technique.
Regards:
ManojReddy
‎2010 Jan 18 7:48 AM
hi ,
Performance wise FOR ALL ENTRIES is better .If possible try to use FOR ALL ENTRIES instead of join.
regards
Gaurav
‎2010 Jan 18 8:02 AM
Hi
You can check this code for reference. Iam transfering data from different internal tables to one final internal table i.e. it_disp1
LOOP AT IT_EKKO INTO WA_EKKO.
WA_DISP1-EBELN = WA_EKKO-EBELN.
WA_DISP1-BUKRS = WA_EKKO-BUKRS.
WA_DISP1-BSTYP = WA_EKKO-BSTYP.
WA_DISP1-BSART = WA_EKKO-BSART.
WA_DISP1-LIFNR = WA_EKKO-LIFNR.
WA_DISP1-WERKS = WA_EKKO-WERKS.
WA_DISP1-EKGRP = WA_EKKO-EKGRP.
WA_DISP1-KUNNR = WA_EKKO-KUNNR.
READ TABLE IT_T001 INTO WA_T001 WITH KEY BUKRS = WA_EKKO-BUKRS
BINARY SEARCH.
IF SY-SUBRC = 0.
WA_DISP1-BUTXT = WA_T001-BUTXT.
ENDIF.
READ TABLE IT_LFA1 INTO WA_LFA1 WITH KEY LIFNR = WA_EKKO-LIFNR
BINARY SEARCH.
IF SY-SUBRC = 0.
WA_DISP1-NAME1V = WA_LFA1-NAME1V.
CONCATENATE WA_DISP1-NAME1V WA_LFA1-NAME2V INTO WA_DISP1-NAME1V SEPARATED BY SPACE.
ENDIF.
READ TABLE IT_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_EKKO-KUNNR
BINARY SEARCH.
IF SY-SUBRC = 0.
WA_DISP1-NAME1C = WA_KNA1-NAME1C.
CONCATENATE WA_DISP1-NAME1C WA_KNA1-NAME2C INTO WA_DISP1-NAME1C SEPARATED BY SPACE.
ENDIF.
READ TABLE IT_T001W INTO WA_T001W WITH KEY WERKS = WA_EKKO-WERKS
BINARY SEARCH.
IF SY-SUBRC = 0.
WA_DISP1-NAME1P = WA_T001W-NAME1P.
ENDIF.
APPEND WA_DISP1 TO IT_DISP1.
CLEAR: WA_EKKO, WA_DISP1, WA_T001, WA_LFA1, WA_T001W, WA_KNA1, WA_EKPO.
ENDLOOP.Regards
Anshul