Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Message Mapping Help

Hello Friends ...

Please help me out in this logic.

If i am having the sender and receiver structure as follows.

Source Structure

<src1>

#####<src2> (1 to unbounded)

##########<src3>

##########<src4>

##########<src5>

##########<src6>

#############<src7> (1 to unbounded)

#################<field1>

#################<field2>

In source Structure src3, src4, src5, src6 are of same level and fld1 and fld2 are also of same level and under "src7" node.

Receiver structure

<rcv1>

#####<rcv2>

##########<rcv3>

##########<rcv4>

here i am facing the problem -


the <field1> in receiver structure can have the values of "Y" or "N" under different <src7> nodes. but in the receiver structure the <rcv2> needs to be created only when the <field1> value is "Y". I mean

If the source structure is as below

<src1>

#####<src2> (1 to unbounded)

##########<src3>

##########<src4>

##########<src5>

##########<src6>

#############<src7>

#################<field1> "N"

#################<field2>

#############<src7>

#################<field1> "Y"

#################<field2>

#############<src7>

#################<field1> "N"

#################<field2>

#############<src7>

#################<field1> "N"

#################<field2>

#####<src2> (1 to unbounded)

##########<src3>

##########<src4>

##########<src5>

##########<src6>

#############<src7>

#################<field1> "N"

#################<field2>

#############<src7>

#################<field1> "N"

#################<field2>

#############<src7>

#################<field1> "N"

#################<field2>

#####<src2> (1 to unbounded)

##########<src3>

##########<src4>

##########<src5>

##########<src6>

#############<src7>

#################<field1> "N"

#################<field2>

#############<src7>

#################<field1> "N"

#################<field2>

#############<src7>

#################<field1> "Y"

#################<field2>

#############<src7>

#################<field1> "N"

#################<field2>

#############<src7>

#################<field1> "Y"

#################<field2>

Then The receiver structure needs to be like this

<rcv1>

#####<rcv2>

##########<rcv3> "Y"

##########<rcv4>

#####<rcv2>

##########<rcv3> "Y"

##########<rcv3> "Y"

##########<rcv4>

The <rcv2> needs to be created only when <src2> exists and the <field1> value in that perticular context is "Y"

As here the value of <field1> is "Y" in two instances of <src2>. I mean first instance of <src2> is having the <field1> value as "y" and third instance of <src2> is having the <field1> value as "y" but second instance of <src2> is not having atleast one value of <field1> value as "y" so we need to get the <rcv2> only two times for those intances of <src2> having <field1> value as "y" .

Please help me out in achieving this .

Thanks

Ramana.

replied

Hi Ramana,

You are stuck with context Assignment.

if <feild1> is "Y" and <src2> exists

<feild1> ->equals->[CONSTANT "Y"] and <src2> -> exists -> IfWithoutElse[Keeps=true]-><rcv2>

in this you will have to fulfil 2 condition one is <Feild1> shld be "Y" and <src2> shld exists.

keep the context of <feild1> and <src2>( right click on <feild1>) to Message level (not <src7> level) and then chck if value "y" is coming & "and" (BOOLEAN) this with <src2> exists.

Thanks,

Sunil Singh

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question