cancel
Showing results for 
Search instead for 
Did you mean: 

PO/PI Message Mapping

08-12-2022 11:32 PM
samye228 Explorer
4646 views 5 comments
SAP Managed Tags
Subscribe

Hello,

I am very new to PO/PI and am trying to understand the functions that are graphically displayed in the Message Mappings objects. The following mapping for the cust_Legacy_Job_Code shows various functions used to get the required DESCRIPTION in the target message.

How do I understand what these functions are doing?

I've googled the various functions available but have no understanding how this is working. I can follow the part that if there is no value from mapWithDefault that a constant of 49 is used. I'm not sure why the adjustLength needs to be there and why the mapWithDefault is done again. Thank you.

Regards,

Carol

Accepted Solutions (0)

Answers (4)

Answers (4)

juan_vasquez2
Active Participant

Hi Carol

You should read from left to right

- mapWithDefault: when the element is not present in xml, then assign a default value: it's used to avoid null exceptions in this case

- adjustLength: it's a UDF (user defined funcion) to do something with text, like truncate length to 49 chars, like an example (in tabs upper you can see functions, and source code in java

- 49 constant: like an argument to function adjustLength

- second mapWithdefault: i think not need here, because no null value be possible.

i hope it can help

regards

samye228
Explorer

Thanks Ryan. I was thinking there was some redundancy but unsure how to read the functions.

anupam_ghosh2
Active Contributor

Hi samye228,

Please consult this blog /article from SAP which shows detailed explanation of standard functions used in SAP PI.

Regards

Anupam

samye228
Explorer
0 Likes

Hi Anupam,

Thank you for the link, it was not intuitive for me to find this. I'm not sure why you refer to the constant 49 as a UDF. I understood UDF to mean User Defined Function. Does PO/PI consider a string of functions that produce a value a UDF?

My real issue is trying to figure out how this "UDF" is read and what operands are executed first. Would you happen to know of any videos that would be helpful?

Thank you,

Carol

Ryan-Crosby
Active Contributor

Hi Carol,

He was just sharing that 49 is an input value to the UDF named adjustLength. The overall processing of the sample you have shown goes like so:

  1. Ensure if no value is supplied for name_defaultValue that an empty string is created as the source
  2. Execute adjustLength UDF with value from step #1 and the constant value "49"
  3. Once again ensure that a blank value is created in the event that step #1-2 does not generate any content - based on steps #1-2 this step appears to be useless because the first mapWithDefault will already ensure that content is generated
  4. Pass the value to the target XML node in the target structure

Regards,

Ryan Crosby