Application Development 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: 

please help

Former Member
0 Kudos

Hi all,

my requirement is as follows.-

My internal table has following fields

it_item-sno,

-vbeln,

-posnr,

-matnr,

-balno.

-


S.NO DEL.NO ITEM NO. DESCRIPTION BALE NO.

1 99002252 10 MATERIAL 100

2 99002252 10 MATERIAL 101

3 99002252 10 MATERIAL 102

4 99002252 10 MATERIAL 103

I NEED TO GET THE FOLLOWING OUTPUT.

FOR SAME DEL NOS,ITEM NUMBERS AND DESCRIPTION THE VALUES SHOULD COME ONLY ONCE AND ALL THE BALE NUMBERS SHOULD BE DISPLAYED WHICH IS SHOWN BELOW

S.NO DEL.NO ITEM NO. DESCRIPTION BALE NO.

1 99002252 10 MATERIAL 100

101

102

103

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use control break statements AT NEW for displaying the first four fields.

If you are using ALV sort the accordingly using sort catalogue and pass the sort internal table to the function module.

9 REPLIES 9

Former Member
0 Kudos

Use control break statements AT NEW for displaying the first four fields.

If you are using ALV sort the accordingly using sort catalogue and pass the sort internal table to the function module.

Former Member
0 Kudos

Hi,

If you are using ALV Utility, the merge function will automatically fulfill your requirement. But if you displaying using writing statements

LOOP AT T_DEL.

AT NEW MATNR.

WRITE : T_DEL-VBELN.......

ENDAT.

WRITE : T_DEL-BALENO.

ENDLOOP.

Former Member
0 Kudos

data : counter type i.

loop at itab.

on change of itab-matnr.

counter = counter + 1.

write : /1(5)counter,7(18) itab-matnr.

endon.

write : 26(40) itab-maktx,67(10) itab-baleno.

write : /.

endloop.

regards

shiba dutta

0 Kudos

HI YOUR ANSWER WAS HELPFUL.

I AM WORKING WITH SMARTFORM ,N I CANT USE THE WRITE STATEMENTS.

PLEASE REPLY BACK

REGARDS

AKMAL

0 Kudos

then take the value to another itab or any program symbol<sorry i am familiar with script not with smart form>...

loop at itab.

on change of itab-matnr.

itab1-matnr = itab-matnr.

endon.

itab1-maktx = itab-maktx.

append itab1.

clear itab1.

endloop.

now use itab1 in smart form

regards

shiba dutta

0 Kudos

Hi

the same logic.

sort itab.

loop at itab.

at first.

pass the header element. " 4 fields

endat.

pass the item element.

endloop.

Former Member
0 Kudos

hi akmal,

try this one.

DATA VAR(70) TYPE C.

CLEAR VAR.

LOOP AT IT_ITEM.

CONCATENATE DEL.NO ITEM.NO DES. INTO VAR.

ENDLOOP.

LOOP AT IT_ITEM.

ON CHANGE OF VAR.

WRITE VAR.

ENDON.

WRITE IT_ITEM-BALE.NO.

ENDLOOP.

Hope u get the logic.

feel-free to ask furthur clarifications.

Thanking U

Clemenss
Active Contributor
0 Kudos

Hi akmal,

to let us know what format you mean, please use the above CODE button to switch on the preserving of spaces; check posting with below PREVIEW button before posting.

If I understand you right, the requirement melts down to suppress repeated output of S.No, DEL.No and description.

Before calling ALV, loop over the table and clear S.NO accordingly. and set DEL.NO ITEM NO. DESCRIPTION sorted.

Regards,

Clemens

Former Member
0 Kudos

Hi Clemen, as per ur advice i am sending you the code by pressing the code button.please review it and reply

my requirement is as follows.-

My internal table has following fields

it_item-sno,

-vbeln,

-posnr,

-matnr,

-balno.

-


S.NO DEL.NO ITEM NO. DESCRIPTION BALE NO.

1 99002252 10 MATERIAL 100

2 99002252 10 MATERIAL 101

3 99002252 20 FINISHED 102

4 99002252 10 FINISHED 103

I NEED TO GET THE FOLLOWING OUTPUT.

FOR SAME DEL NOS, ITEM NUMBERS AND DESCRIPTION THE VALUES SHOULD COME ONLY ONCE AND ALL THE BALE NUMBERS SHOULD BE DISPLAYED WHICH IS SHOWN BELOW

S.NO DEL.NO ITEM NO. DESCRIPTION BALE NO.

1 99002252 10 MATERIAL 100

2 101

3 20 FINISHED 102

4 103...