Skip to Content
0
Former Member
Dec 11, 2009 at 10:57 AM

internal table process

16 Views

Hi All,

Would like to ask the logic.

I have an internal table below. I not sure if need to have another 2 new internal table for the processing below.

Appreciate of the example of coding.

material / cost center / cost

KA1234 / 90045 / 500

KA1234 / 90045 / 120

KA5678 / 70067 / 1000

KA5678 / 70067 / 1500

KA5678 / 70067 / 200

XA1234 / 90045 / 400

XA5678 / 70067 / 2000

I need to sort and group where both material and cost center the same and cost add up.

material / cost-center / cost

KA1234 / 90045 / 620

KA5678 / 70067 / 2700

XA1234 / 90045 / 400

XA5678 / 70067 / 2000

Next, when the last 4 digit of the material & also cost center the same between KA and XA, the difference of the cost is

cost in XA - cost in KA = Y then move the difference which is Y into a variable.

I take material 1234 as example

400 - 620 = (220), then add (220) into a new variable.

Thanks

Rgds