cancel
Showing results for 
Search instead for 
Did you mean: 

Message map help

Former Member
0 Kudos

Hello every one,

I have a requirement where message should get stuck in Integration Engine, if some fields are missing from source side.

To mait more clear, its a Idoc to file scenario.

I have a node on the source side like this E1EDP01, under it there is a sub element E1EDP02, under it there are subelements QUALF, ZEILE, my actual requirement is the target side feild called LINUM should be mapped to ZEILE when QUALF= "001", if the field ZEILE is missing in the source side then the map should fail and get stuck in PI.

Regards

Sridhar

Accepted Solutions (0)

Answers (3)

Answers (3)

iaki_vila
Active Contributor
0 Kudos

Hi sridhar,

Are you really saying that if one field is not present you want that your scenario fail with an exception or similar?

I was thinking now that you could follow two ways:

1. In message mapping use the function exists in the mapping in this way: ZEILE - exists - if Then: you map Zeile; else: you create an UDF function that throws an exception. I dont like so much this option.

2. You put ZEILE in an context object and later in the configuration you use this context object in order to obtain the Receiver Determination, using Condition in a configured receivers. In this option i think it's not possible to ask  if the node exits only about values, If ZEILE is a numeric field you could put ContextObject_ZEILE >= 0 for example.

Regards.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

You could also use the mapping logic for LINUM and map it to the root message.

Regards,

Mark

Former Member
0 Kudos

Hello Mark,

I had tried this, its working for the first context, but not for the second one for example.

If i am getting  two E1EDP01 elemets from source side, then the message is failing if  ZEILE when QUALF= "001", only for the first element, but it is processing sucessfully if second E1EDP01 has got ZEILE when QUALF= "001".

Former Member
0 Kudos

in target side, make LINUM as a mandatory field, then if ZEILE is not in source msg, LINUM will throw mapping error in IE.

in msg mapping, edit the mapping for LINUM field as:

if QUALF - equalS - constant 001 -

                                                      AND - if then (in then put ZEILE) - LINUM

                               ZEILE - exists -

Former Member
0 Kudos

Hello Rajeev,

I have tried this, if  ZEILE when QUALF= "001", doesnot exist it is differing to  ZEILE when QUALF= "002".

Former Member
0 Kudos

try this:

by right clicking on QUALF and ZIELE, change the context to E1EDP01.

then create a UDF taking the queue values of QUALF and ZIELE, then check if for QUALF=001 you always have a ZIELE by using code like:

for (i=0; i<=qualf.length; i++)

{ if (qualf[i].equals("001"))

{if ziele[i].equals("#")

throw Exception;}

}

in graphical mapping use below:

                                       QUALF   -                                        

                                                        UDF - root tag of msg type of target msg

ZIELE - mapbydefault(put value as #) -

Map the UDF output to the topmost node of target msg type, means the root node of target msg type or the name of the target msg type.

Also use mapbydefault node function after ZIELE, by doubleclicking it and put value # in it. then take it to UDF. also change the context of QUALF and ZIELE as said above. then see if it works.

Former Member
0 Kudos

Hello Rajiv,

Thanks for your help. but i am very new to PI and have no idea about UDF. can you please tell me any alternative way or can you clearly explain where i can put the below code in UDF.

Regards

Sridhar