Skip to Content
0
Former Member
Oct 06, 2013 at 09:39 AM

how to modify column value based on next column values...

20 Views

Hi gurus,

I have the internal table lt_final as shown below.

BKPF(Accounting doc BSEG(Cost center) Flag 0000000259

0000000259 N100000002
0000000957

0000000957 N100000002
0000000957 N100000002
0000000958

0000000958

0000000958

0000000959

0000000959 N100000002
0000000959 N100000002

For first row 259 (accounting Document ) Cost Center is initial.but second row is having Cost Center value(N100000002 ) so if any one the item is having cost center value all accounting Documents (259 documents) FLAG will be set to 'X'.similarly 957 are having 3 items in which two are having cost center value so all 957 FLAG will be set to 'X'.

But in 958 none of the Item is having cost center so all 958 items will be set to null( no value)

output should be look like this

BKPF(Accounting doc BSEG(Cost center) Flag 0000000259
X 0000000259 N100000002 X 0000000957
X 0000000957 N100000002 X 0000000957 N100000002 X 0000000958

0000000958

0000000958

0000000959
X 0000000959 N100000002 X 0000000959 N100000002 X

i have tried so many logic's but couldn't able to fetch exact results.

kindly help on this ....

Thanks in advance.

Regards,

Ramu