cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in Mapping _

Former Member
0 Kudos

Hi XI experts ,

I have source :

<ReferenceCoded>

<ReferenceTypeCoded>Other</ReferenceTypeCoded>

<ReferenceTypeCodedOther>Percent</ReferenceTypeCodedOther>

<PrimaryReference>

<Reference>

<RefNum>60,00</RefNum>

</Reference>

</PrimaryReference>

<SupportingReference>

<Reference>

<RefNum>0001</RefNum>

This <ReferenceCoded> is : 0 to unbounded .

The ReferenceCodedOther has value :Percent <ReferenceTypeCodedOther>Percent</ReferenceTypeCodedOther> has the Cost centre precentage data .

If this node has only once , then dont pass constant (2) to -> DISTR_PERC (field of BAPI)

If this node occurs more than once , then pass constant (2) to -> DISTR_PERC

Appreciate your input .

Thanks,

Vara

Checked few blogs , tried with counter ( Count of Percent cosntant occuring in : ReferenceCodedOther ) , it hasn't worked .

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

You try using this mapping


RefTypeCodedOther -> equalsS -> ifWithoutElse -> removeContext -> count -> greater -> ifWithoutElse -> DISTR_PERC 
Constant: Percent -> /          /                             Constant: 2 -> /   Constant: 2 -> /
RefTypeCodedOther -----------> /

The above logic passes the values which are equal to Percent and then counts its occurrence.

Hope this helps,

Mark

Answers (3)

Answers (3)

Former Member
0 Kudos

I think it can be easilt handled with standard functions only.

ReferenceTypeCodedOther-> RemoveContext>count (statistics function) >1 --> ifwoithoutelse (pass 2 as constant in then branch)->DISTR_PERC

Just check the contexts of the fields properly and play around with removeContext, Collapsecontext etc...

It should work...else let us know the error~~

Former Member
0 Kudos

Hi Marc , Puneeth and All ,

Yes this worked !! Thank you so much .

I used logic as below:

Since there are couple of node of : ReferenecTypeCodedOther repeating , I used :Removecontext

ReferenceTypeCodeOther| Remove Context | EQUALS |Constant :Pecent| IF WITHOUT ELSE (Then) |ReferenceTypeCodeOther|Remove Context| -


>The output of this is fed to |Count| Greater|Constant(1) |If then else| then Constant 2| -> remove context | DISTRIB

Else Cosntant(Null --pass nothing) -> DISTRIB

- Remove context supress the value .

Thank you once again to everyone who helped in providing the instant solution

Best Regards,

Vara

Former Member
0 Kudos

You can try index function (statistic) with increment 1.

Former Member
0 Kudos

Hi,

Try using an udf that always returns a suppress for when you don't want anything to be populated.

And the solution with count should still work.

[http://help.sap.com/javadocs/pi/SP3/xpi/index.html?com/sap/aii/mappingtool/tf7/rt/ResultList.html]