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

internal table logic

Former Member
0 Likes
529

Dear Friends,

I have an internal table A like below show, i am looping the interal table

A and inside i am reading the internal table B to assign the field value STLKN

based on PLNKN and modifying the internal table A. So for all (PLNKN) 5 values

(STLKN) 1 is assiged. this is ok

now my requirement is for the second 5 (PLNKN)value in internal table B , the value 5(STLKN) should assign by appending new records.

when you see the internal table B contains two 5 PLNKN and

two 7 value in PLNKN and contains different STLKN values.

when i loop internal table A and modify only the first value is assigned.

now remaining value to be appended for the second value 5 PLNKN

if not understandable below i given example.

WARPL ABNUM PLNKN STLKN Internal table A

211--


1
4
--


0

211--


9
4
--


0

211--


3
4
--


0

211--


5
4
--


0

211--


7
4
--


0

211--


4
5
--


1

211--


2
5
--


1

211--


8
5
--


1

211--


10
5
--


1

211--


6
5
--


1

211--


4
6
--


6

211--


8
6
--


6

211--


8
7
--


7

-


example-here need to append----


211--


4
5
--


5 like this

211--


2
5
--


5

211--


8
5
--


5

211--


10
5
--


5

211--


6
5
--


5

-


211--


8
7
--


1

PLLNR----


PLNKN -


STLKN Internal table B

106900--


4--


0

106900--


5--


1

106900--


5--


5

106900--


6--


6

106900--


7--


7

106900--


7--


1

can anyone give the code for this. keep in mind the internal table B contains

more than 2 or 3 values repeated in PLNKN.

Thnaks in advance

karthik

3 REPLIES 3
Read only

Former Member
0 Likes
494

Hi Karthik,

While getting data into internal table you need to get some other field which is also available in the internal table A. If you can specify from which table ur getting this data then i may help you better.

Regards,

Satya.

Read only

0 Likes
494

Dear sathya,

I am getting internal table A records form PLPO table. and internal table B from PLMZ. table.

can you give me the field you mentioned

thanks

karthik

Read only

Former Member
0 Likes
494

Hi Karthick,

The read statement fetches the first record.Now for the below scenario you loop through internal table A and inside it you perform a read on internal table B based on key PLNKN.Now if there are multiple 5's in B it will always pick the first one.So to avoid it you may have to use one more key field while reading from table B in sync with your requirement.

Pls reward if you found useful.

Thanks

Shyam