Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

int table problem

Former Member
0 Likes
395

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
377

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.

2 REPLIES 2
Read only

Former Member
0 Likes
377

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^

Read only

Former Member
0 Likes
378

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.