Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhancing the XML data for a Inbound IDOC

johnson_george2
Explorer
0 Kudos

Hi All,

We are receiving the HR data from a third party system through PI.

In the XML file we can see the Lang as PL ie Polish but it is received as P in the segment as SPRSL is char 1.

Which in ECC is Portuguese.

So is there a way to handle the XML data or write a code in ECC where we can change the XML data for PL to L for Polish?

Thanks

Johnson George

4 REPLIES 4

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Johnson,

in most Connectors (e.g. SAP Java Connector or NW RFC Library) there is an API that maps an ISO Language Code (2 Chars) to the corresponding SAP Language Code (1 Char). However, I'm not sure, whether this is also available in SAP PI. Perhaps you should move this question to the Process Integration Forum: http://scn.sap.com/community/pi-and-soa-middleware

(If the question is just about "PL", then the SAP code for it is "L", but I assume you need a general solution?! If the PI system is ABAP based, you can probably use a function module like SCP_LANGUAGE_INFO.)

Best Regards, Ulrich

0 Kudos

There is no built-in conversion in PI. The function module for such conversion is CONVERSION_EXIT_ISOLA_INPUT in the ECC system.


One approach is to map the source two-character field to a different field which can store 2 characters. Then in ECC, add a logic (via a wrapper or an exit) to translate the 2 char into a single char via the above FM, and then populate it back into SPRSL.

0 Kudos

Hmm, but even without such a conversion in PI, it should still be less effort to do the replacement already in PI? (After all: things like this should be what PI and its mapping engine are there for...)

If all else fails, one could simply create a little Hashmap and fill it with the "pairs" that can occur in your scenario (will at most be 256... ), and then in a mapping at runtime lookup the current value from the Hashmap?!

Best Regards, Ulrich

0 Kudos

There is a RFC Lookup functionality on PI, but the conversion FM above is not an RFC-enabled function module so PI can't call it directly. Another alternative is to wrap the FM in an RFC-enabled FM to be called by PI.

There is a functionality in PI to store key-value mappings, but IMHO that feels redundant as the actual data is already in ECC. But, the choice is up to Johnson.