cancel
Showing results for 
Search instead for 
Did you mean: 

Message Map - multiple segments - user defined function

Former Member
0 Kudos

I am working with XI 3.0 SP10. And I am trying to get the following mapping to work. The IDoc will post into a 46B system.

Header maps to header and comments map to comments.

<MAFRequest> ~~~~~~~~~~~~~~ <IDOC BEGIN="1">

<MAFHeader> ~~~~~~~~~~~~~~ <Z1ZEMAFIDOC_HDR SEGMENT="1">

<docType>H</docType> ~~~~ <RECORD_TYPE>H</RECORD_TYPE>

<notifNbr>1234</notifNbr> ~ <NOTIF_NBR>1234</NOTIF_NBR>

</MAFHeader> ~~~~~~~~~~~~~~ </Z1ZEMAFIDOC_HDR>

<MAFComment> ~~~~~~~~~~~~~~ <Z1BPQCLINE SEGMENT="1">

<docType>C</docType>

<docTypeIDX>1</docTypeIDX>

<comment>Comment 1</comment> ~ <LINE>Comment 1</LINE>

</MAFComment> ~~~~~~~~~~~~~~~~~~~~~~~~~ </Z1BPQCLINE>

<MAFComment> ~~~~~~~~~~~~~~~~~~~~~~~~~~ <Z1BPQCLINE SEGMENT="1">

<docType>C</docType>

<docTypeIDX>2</docTypeIDX>

<comment>Comment 2</comment> ~ <LINE>Comment 2</LINE>

</MAFComment> ~~~~~~~~~~~~~~~~~~~~~~~~~ </Z1BPQCLINE>

</MAFRequest> ~~~~~~~~~~~~~~~~~~~~~~~~~~ </IDOC>

My input comment line is a 2000 character string and my output comment line is 132 character string. Since I want to split the input string at a logical point I have written an advanced user-defined function to perform the

parsing.

I want to pass into my function docTypeIDX and comment which works for the parsing, but it will only call the function once, so only the first comment segment is processed.

If I map the 0..unbounded MAFComment to Z1BPQCLINE SEGMENT 0..99999 I get all three comments lines but my parsing will only provide the first output segment.

Any thoughts,

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi Andrew,

Maybe try something like this:

<comment> -> <yourfunction> -> <removeContexts> -> <exists> -> <Z1BPQCLINE SEGMENT="1">

<comment> -> <yourfunction> -> <splitByValue> -> <LINE>

this way you will create as many Z1BPQCLINE segments as the output LINE segments

Hope it will help,

Regards,

Michal

Message was edited by: Michal Krawczyk

Former Member
0 Kudos

Thanks, i needed to remove the <exist>, but it worked after that.

MichalKrawczyk
Active Contributor
0 Kudos

Hi Andrew

great to hear:)

Regards,

michal

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Andrew,

Can tou please send me the advance user-defined function to perform parsing.

Becoz i have the similar requirement, as to parse the long strings.

please send me user defined (java) function to parse the long string (split).

Regards,

kpatil