cancel
Showing results for 
Search instead for 
Did you mean: 

0KEM Substitution

sameer_gupte2
Explorer
0 Kudos
937

Hi,

We want to substitute the profit center in a sales order based on the product hierarchy. Our product hierarchy is 6 digits long and we only want the substitution to check the first 4 digits.

Suppose we have 2 product hierarchies: 123456 and 223456. Our substitution logic is as follows:

Step 1: if PCASUB-PRODH = 1234, PRCTR = ABC

Step 2: if PCASUB-PRODH = 2234, PRCTR = DEF

However, in the sales order, we have the entire product hierarchy filled (e.g. 123456). Our substitution logic is not working in this case. We have tried putting a * after the first 4 digits of the product hierarchy in the substitution rule: if PCASUB-PRODH = 1234*, PRCTR = ABC. This does not work.

We have also tried with the operator LIKE in the substitution rule: if PCASUB-PRODH LIKE 1234*, PRCTR = ABC. This also does not work.

Is it possible to make a substitution work for this without an user exit?

Best Regards,

Sameer S Gupte

View Entire Topic
iklovski
Active Contributor

Hi,

You can take part of the field only in your checks, e.g. PCASUB-PRODH :1-4: = '1234'. If this doesn't work, you have to create user-exit in substitution. Boolean rules allowed by the system without ABAP are quite limited in substitution transaction logic.

Regards,
Eli

sameer_gupte2
Explorer
0 Kudos

Hi,

I could not understand the syntax. How do we maintain PCASUB-PRODH :1-4 in the substitution rule?

Best Regards,

Sameer S Gupte

iklovski
Active Contributor
0 Kudos

Just as I put it... You enter next to the field in condition :1-4:, which means first 4 characters.

sameer_gupte2
Explorer
0 Kudos

Hi,

We did not see your answer in time. We solved this by creating sets and filling the sets with product hierarchy values with 4 & more digits in the sets. For e.g. in one set we put the following values: 1234, 12345 & 123456 and in another set we put the values 2234, 22345 & 223456. The substitution works with this logic.

Best Regards,

Sameer S Gupte