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

moving zero to values

Former Member
0 Likes
1,128

Hi,

in it_final.

LIFNR MATNR EBELN MENGE

RAU4 MAT1 450001 120.0

RAU3 MAT1 450002 10.0

RAU3 MAT1 450002 10.0

IN THE MENGE FOR ONE LIFNR ONLY ONE MENGE SHOULD BE DISPLAYED.

LIFNR MATNR EBELN MENGE

RAU4 MAT1 450001 120.0

RAU3 MAT1 450002 10.0

RAU3 MAT1 450002 0.0

LIKE THIS .I HAVE ALL VALUES IN IT_FINAL.

HOW TO MOVE '0.0' TO MENGE.

Bathri..

9 REPLIES 9
Read only

former_member302911
Active Participant
0 Likes
1,075

Hi,

READ table it_final index 3.

clear it_final-menge.

modify it_final.

Angelo.

Read only

0 Likes
1,075

Hi,

In this case so many lifnr are there.Line items are different.

We cant specify index.

Bathri

Read only

0 Likes
1,075

Hi Bathri,

You can use a loop . (Refer Below Pseudo Code).

Loop at it_final into wa_final.

l_index = l_index + 1.

If lifnr = = "***" " (*** is the lifnr for which menge is 0.0)

wa_final-menge = '0.0'.

Modify it_final from wa_final index l_index.

Endif.

Endloop.

Regards,

Vimal.

Edited by: Vimal V on Jul 13, 2009 3:49 PM

Read only

guilherme_frisoni
Contributor
0 Likes
1,075

Hi,

do you really need this lines?

If no, you can do a DELETE ADJACENTS to remove identical lines.

If you need this lines, you will have to do some LOOP comparing lines using AT NEW, for example.

When your loop is not inside a AT NEW, so you clear MENGE.

Like this:


sort it_final.
loop at it_final.
at new ebeln.
continue.
endat.
clear menge.
modify it_final.
endloop.

Regards,

Frisoni

Read only

0 Likes
1,075

Hi,

This is not working.

Bathri

Read only

0 Likes
1,075

Hi Bathrinath,

Try this code,


sort it_final.
clear gv_lifnr
Loop at it_final
if it_final-lifnr  = gv_lifnr
it_final-menge = '0.0'
modify it_final.
else.
continue.
endif.
gv_lifnr = it_final-lifnr
endloop.

Regards,

Lakshman

Read only

Former Member
0 Likes
1,075

Hi,

sort it_final.

loop at it_final.

at new lifnr.

continue.

endat.

clear menge.

modify it_final.

endloop.

Read only

0 Likes
1,075

Hi,

I believe that you want to summarize your data here for combination mentioned.

try using COLLECT statement in loop-endloop.

Regards,

Nirmal

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,075

loop at itab into wa.

at new matnr.

continue.

endat.

clear wa-menge.

modify itab from wa index sy-tabix transorting menge.

endat.