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

logic QA

Former Member
0 Likes
485

i have itab-kdauf 12345 bwart-651 menge 10

itab-kdauf 12345 bwart-652 menge 8

.....

i want to make it in 1 line and to make 651-652

how???????

1 ACCEPTED SOLUTION
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
458

Hi,

In this example code,v1 is the variable which should be long enough for combining values.

sort itab by kdauf.

loop at itab into wa.

v1 = wa-bwart.

loop at itab into wa1 where kdauf = wa-kdauf.

concatenate v1 wa1-bwart into v1.

endloop.

wa-kdauf = v1.

modify itab from wa transporting bwart where kdauf = wa-kdauf and bwart = wa-bwart.

delete itab where kdauf = wa-kdauf and bwart = wa1-bwart.

endloop.

3 REPLIES 3
Read only

Former Member
0 Likes
458

Hi Liat,

If you want to combine both the field contents, use concatenate

Read only

Former Member
0 Likes
458

Hi,

Try this logic,

sort itab by kdauf.
data: flag type c.
Loop at itab.

At new kdauf.
 Write:/ (5) itab-kdauf,(20) itab-bwart, (80) itab-menge
flag = 'X'.
Endat.

if flag is initial.
write:/ (30) '-',itab-bwart
endif.
clear flag.

Endlooop.

Regards

Sudheer

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
459

Hi,

In this example code,v1 is the variable which should be long enough for combining values.

sort itab by kdauf.

loop at itab into wa.

v1 = wa-bwart.

loop at itab into wa1 where kdauf = wa-kdauf.

concatenate v1 wa1-bwart into v1.

endloop.

wa-kdauf = v1.

modify itab from wa transporting bwart where kdauf = wa-kdauf and bwart = wa-bwart.

delete itab where kdauf = wa-kdauf and bwart = wa1-bwart.

endloop.