Skip to Content
0
Former Member
Mar 09, 2009 at 09:23 AM

Coding Help for Start Routine

16 Views

Hi Code Gurus,

I need some help with coding a start routine which selects only the desired records. The data in questions is plant-specific material master data which we extract from R/3.

After extracting the plant-material -data into PSA, the records look something like this:

PLANT / MATERIAL / MAP / VENDOR / FIXED VENDOR INDICATOR / VENDOR SOURCE LIST #

One record could look like this:

X100 / 12345 / 0,5 u20AC / 54321 / X / 1

As we extract data from Vendor source list, the above record indicates that this vendor is fixed and the first vendor in the source list (the last entry is the row number)

One plant-material combination could look like this as well:

X100 / 12345 / 0,5 u20AC / 54321 / / 1

X100 / 12345 / 0,5 u20AC / 67890 / / 2

As the source list can include several vendors. In the above example, the source list for that plant-material -combination includes two vendors (rows 1 and 2) with neither one marked as fixed.

The idea is to reduce the number of records we transfer to the next DSO by using the following logic:

Only take that plant-material-vendor -combinations in which:

1. Vendor is fixed (marked with X). Or if no X is present

2. Take the first row (row number 1) for that plant-material -combination

In the above examples, in the first one we would take:

X100 / 12345 / 0,5 u20AC / 54321 / X / 1

as it is marked as fixed.

In the other example, we would take:

X100 / 12345 / 0,5 u20AC / 54321 / / 1

as it is the first vendor in the source list and no fixed vendors are marked.

Could you help me with some example code with which we could achieve this logic in practise? The end result would be then only one line per each plant-material combination in the DSO.

Thank you in advance!

-Anssi