We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE: [sap-abap] Loop for Serialization

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from robphelan on Jun 5 at 9:45 AM
So, let's say you have a table with 10 records.

Records 1 - 5 have ID ABC
Records 6 - 10 have ID DEF

So you want your table to look like:

ABC 1
ABC 2
ABC 3
ABC 4
ABC 5
DEF 1
DEF 2
DEF 3
DEF 4
DEF 5


If so, try this pseudo code.

Sort itab by record id.

Counter = 0.
Loop at itab assigning <tab>.
New_id = <tab>-id.

At new <tab>-id.
Counter = 0.
Add 1 to counter.
<tab>-serial = counter.
Old_id = <tab>-id.
Continue.
Endat.


If new_id = old_id.
Add 1 to counter.
<tab>-serial = counter.
Endif.

Old_id = <tab>-id.

Endloop.

---------------Original Message---------------
From: Danit
Sent: Friday, June 05, 2015 6:08 AM
Subject: Loop for Serialization

How can I give serial number to each row for the same id ?
I have a table with id numbers . each id has a few rows . how can I give sirial number to each row . for each id I need a new serialization

Thanks

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2015 Ziff Davis, LLC. and message author.
Ziff Davis, LLC. 28 E 28th Street New York, NY 10016
robphelan  

16 achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Have a technical question? Need to find IT solutions? Ask your peers in the Toolbox for IT community.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language