cancel
Showing results for 
Search instead for 
Did you mean: 

SUBSTITUTIONS IN S/4HANA CLOUD

rodleo92
Participant
0 Kudos

Hello!!

We need to create a substitution to replace the value reported in the "Functional Area" field of the Order request.

The derivation is based on the ledger account and the completion of the Cost Center. For example:

  • For the GL account 62300009 and Cost Center ending in 0, the functional area is XX.
  • For the GL account 62300009 and Cost Center ending in 1, the functional area is YY.
  • For the GL account 62300009 and Cost Center ending in 2, the functional area is ZZ.

Is there any way to add in the logic of the substitution that the termination of the Cost Center is reviewed?

I've tried using *0, but it doesn't work. From SAP they recommended to use the logic [[:digit:]]*0, but what operator should I use? equal to, coincidences,...? None of them work.

Thanks a lot,

Regards.

Accepted Solutions (1)

Accepted Solutions (1)

Javier_del-Peso
Product and Topic Expert
Product and Topic Expert

Hi Alberto,

Check out the matches operator. Find the syntax rules in this link

Matches Operator - SAP Help Portal

Hope it helps,

Regards,

Javier del Peso

rodleo92
Participant
0 Kudos

Hi Javier,

I was just looking at that page yesterday. However, I still have the question of how to make the system only check the last number of the Cost Center.

I tried putting *0, *.0, [[:digit:]]*0 , etc. and none worked.

Any ideas?

Thanks a lot,

Regards.

Answers (4)

Answers (4)

rodleo92
Participant
0 Kudos

Hi Javier,

Thank you very much for your help. However, our intention is to check only the last digit of the Cost Center, that is, if the Cost Center ID is "XX45364750", we want to check that the Cost Center ends in "0". With the range you mentioned, I understand that it checks "XX4536475", which is useless.

Is there any other alternative?

Thanks,

Regards.

rodleo92
Participant

Hi Javier,

Finally we have solved it in the following way:

  • Ended in 0: “.*0”
  • Ended in 1: “.*1”
  • Ended in 2 or 3: “.*[23]

Thank you very much for your assistance.

Regards.

rodleo92
Participant
0 Kudos

Hi Javier,

Thank you very much for your comments again.

I have tried it and it does not work either, since it checks the entire interval from 0 to 9999999999. In our case we want only the last digit of the cost center to be checked. With the range 0 - 9999999999 all would enter, even those ending in 1, 2, etc.

Thank you very much for your help.

All the best.

Javier_del-Peso
Product and Topic Expert
Product and Topic Expert
0 Kudos

Alberto,

Range is to be defined with nine "9", not ten as it seems you have done. The idea is to limit the range to the number of digits you want to check so the first nine positions of the CC.

Try again and let us know. Regards,

Javier del Peso

Javier_del-Peso
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Alberto,

Not exactly, I will suggest you try with [0-999999999]. The numbers in the brackets represents a range so the expression will check any number between the given range. [0-9] will only check 1 single digit between 0 and 9.

Regards,

Javier del Peso

Javier_del-Peso
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Alberto,

See this in the help for Ranges in a Self-Defined Set for Single Characters :

I think the right expression would be [0-9999999] for the digits range that you want to check depending on the length of you CC. Replace the number of "9" digits for the actual ones that include your digits excluding the last one.

Regards,

Javier del Peso

rodleo92
Participant
0 Kudos

Hi Javier,

Thank you for your comments. However, I did not understand you correctly.

The length of the Cost Center is 10 digits, of which only the last digit would have to be checked. What would the expression [0-9] look like?

Thank you,

Regards.