cancel
Showing results for 
Search instead for 
Did you mean: 

CI-DS Replace commands

0 Kudos
401

Hi experts!

I'd like to replace many products to one specific value via CI-DS.

MATERIAL1 --> PRODUCT_A

MATERIAL2 --> PRODUCT_A

MATERIAL3 --> PRODUCT_A

MATERIAL4 --> PRODUCT_A

I have the option to replace using replace_substr(MapIn.PRDID,'MATERIAL1','PRODUCT_A') but I don't know how to use it for many products at once.

Is there a CI-DS command to replace it all at once?

Best regards,

Victor Leao

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi peter.casper !

I think your proposed solution is the best way to make it!

Anyways, considering the simplicity of my requirement, I decided to use the replace_substr as mentioned in the KBA 2007254 - How to Resolve Special Character Errors when loading data to SAP Sales and Operations Planning.

replace_substr(

replace_substr(

replace_substr(table.PRDID,'MATERIAL1','PRODUCT_A'),

'MATERIAL2', 'PRODUCT_A' ),

'MATERIAL3', 'PRODUCT_A' ),

It's not the best, but it fits the simple requirement.

Thanks a lot!

Best regards!

Victor Leao

Answers (2)

Answers (2)

peter_casper
Contributor

Hi Victor Leao,

are you striving for a static replacement, i.e. a more or less fixed list of material numbers to be replaced, or would you like to be more flexible in regards to mapping/replacement functionality?

Anyways I would recommend to create a lookup table w/ MATNR | SUBST_MATNR which should be connected via left outer join to your root table. Now you can apply the following logic for MATNR:

IFTHENELSE(LookupTable.SUBST_MATNR) != NULL, LookupTable.SUBST_MATNR, RootTable.MATERIAL)

BR, Peter

0 Kudos

Hello peter.casper !

In fact, I'm striving for a static replacement. The material list is not supposed to change.

Thank you so much for your attention!

Victor