‎2007 Sep 01 9:43 AM
i have a intab1 which has data in the follwing format
matnr quant
72210008 100
52210005 50
52220009 80
and in another intab2 i want to display it in this format
matnrfg matnrsf quant
72210008 100
72210008 52210005 50
72210008 52220009 80
where 72210008 is header level item and 52210005 and 52220009 are it's down level item .
how can i do it ,can anybody help please.points will be rewarded
please thanx in advance
‎2007 Sep 01 10:49 AM
Hi Sarabjit,
There should be some way to identify that which of them is the header item..
Like you must have some field in the internal table telling that this is the header item record..
LOOP AT tab.
IF header EQ 'X'.
CLEAR tab2-matnr1.
tab2-matnr1 = tab-matnr.
tab2-qty = tab-qty.
APPEND tab2.
ELSE.
tab2-matnr2 = tab-matnr.
tab2-qty = tab-qty.
APPEND itab.
ENDIF.
ENDLOOP.
I remember one of my requirements.. i feel the qty for the header item will be in field BMENG while the qty of sub items will be in MENGE..
What do you say?
Thanks and Best Regards,
Vikas Bittera.
‎2007 Sep 01 9:51 AM
hi
good
so you want to repeat the 722 value in the last two line,
save the 722 in a field,and when the second line coming to the internal table from the database ,you append this field in the second line.
thanks
mrutyun^
‎2007 Sep 01 10:49 AM
Hi Sarabjit,
There should be some way to identify that which of them is the header item..
Like you must have some field in the internal table telling that this is the header item record..
LOOP AT tab.
IF header EQ 'X'.
CLEAR tab2-matnr1.
tab2-matnr1 = tab-matnr.
tab2-qty = tab-qty.
APPEND tab2.
ELSE.
tab2-matnr2 = tab-matnr.
tab2-qty = tab-qty.
APPEND itab.
ENDIF.
ENDLOOP.
I remember one of my requirements.. i feel the qty for the header item will be in field BMENG while the qty of sub items will be in MENGE..
What do you say?
Thanks and Best Regards,
Vikas Bittera.