2006 Nov 24 6:23 AM
Dear All,
I have a main table and an internal table as follows. As you can see the common field is QMNUM. I have to modify this main_table from the Internal table so that my main_table gets all the four entries for the QNUM from the internal table. How to write the loop in this case?
Thanx in advance.
Alok.
MAIN_TABLE
MBLNR QMNUM MJAHR BKTXT MATNR
-
500000793 000200000003 2006 A04567 ANNGRI14
INTERNAL _TABLE
QMNUM FENUM FEGRP FECOD ANZFEHLER
-
000200000003|0001 |L#1FE-03|0001 | 4 |
000200000003|0002 |L#1FE-03|0002 | 3 |
000200000003|0003 |L#1FE-03|0003 | 2 |
000200000003|0004 |L#1FE-03|0004 | 1 |
Dear All,
I have a main table and an internal table as follows. As you can see the common field is QMNUM. I have to modify this main_table from the Internal table so that my main_table gets all the four entries for the QNUM from the internal table. How to write the loop in this case?
Thanx in advance.
Alok.
MAIN_TABLE
MBLNR QMNUM MJAHR BKTXT MATNR
-
500000793 000200000003 2006 A04567 ANNGRI14
INTERNAL _TABLE
QMNUM FENUM FEGRP FECOD ANZFEHLER
-
000200000003|0001 |L#1FE-03|0001 | 4 |
000200000003|0002 |L#1FE-03|0002 | 3 |
000200000003|0003 |L#1FE-03|0003 | 2 |
000200000003|0004 |L#1FE-03|0004 | 1 |
2006 Nov 24 6:26 AM
2006 Nov 24 6:29 AM
hi,
put 1 more field in ur internal table along
with <i>QMNUM</i>.
better to put<i> MBLNR</i>
loop at internal_table into wa.
modify ztable from wa comparing QMNUM MBLNR.
clear wa.
endloop.rgds
anver
2006 Nov 24 7:12 AM
hi ,
declare the additional fields in ur new internal table ITAB AS
MBLNR MJAHR BKTXT MATNR QMNUM FENUM FEGRP FECOD ANZFEHLER
to fetch the entries .
LOOP AT INTERNAL_TABLE.
READ TABLE MAIN_TABLE WITH KEY QMNUM = INTERNAL TABLE-QMNUM.
IF SY-SUBRC EQ 0.
ITAB-MBLNR = MAIN_TABLE-MBLNR.
ITAB-MJAHR = MAIN_TABLE-MJAHR.
ITAB-BKTXT = MAIN_TABLE-BKTXT.
ITAB-MATNR = MAIN_TABLE-MATNR.
ITAB-QMNUM = INTERNAL_TABLE-QMNUM.
ITAB-FENUM = INTERNAL_TABLE-FENUM.
ITAB-FEGRP = INTERNAL_TABLE-FEGRP.
ITAB-FECOD = INTERNAL_TABLE-FECOD.
ITAB-ANZFEHLER = INTERNAL_TABLE- ANZFEHLER.
APPEND ITAB.
CLEAR ITAB.
ENDLOOP.do like this ..
In ur case modify transporting the main table will cause inconsistencies as FENUM is there ,,
so better get the entries into a unified table having all the entries .
regards,
VIjay