cancel
Showing results for 
Search instead for 
Did you mean: 

Validation in mapping

Former Member
0 Kudos

Hi all,

I am trying to do a validation in my mapping..i have a source IDOC which has :

header1 1

node1

node2

header 2 1

node3

node4

lineitem 0..unbounded

node5

node6

The line item may occur 1 to many.

in the above, the header nodes and line item nodes may or may not appear.so i have to check whether if any one of the node is missing in the incoming IDOC or not. if any one node is missing i have to PASS a HARDCODE value NO to a field in target, when all nodes are present i have to hardcode the target field to YES.IS this possible by our GUI fns..?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Aarthi,

You can use <b>Creatif</b>nodefunction in Graphical mapping for the same.

Regards,

Dhana

former_member187339
Active Contributor
0 Kudos

Hi,

You might have asked this in your earlier thread..

Anyway try this:

1)node1(context header1)-EXISTS(node function) AND

node2 (context header1)---EXISTS(node function)

2)node3 (context header2)---EXISTS(node function) AND

node4 (context header2)---EXISTS(node function)

3)node5 (context lineitem)---EXISTS(node function) AND

node6 (context lineitem)---EXISTS(node function)

4) (1) AND (2)

5) (4) AND (3)--removeContext- sort(caseinsensitive, desending)

6) Give output of 5 to IF, THEN (YES) and ELSE (NO), OUTPUT = target field

Hope you got the idea

And close the earlier thread...

Regards

Suraj

Message was edited by: S.R. Suraj

Former Member
0 Kudos

Hi,

I think this is not a very big problem. You can use

"exists" in (node functions) and use "if" in (boolean) to achieve this.

the mapping may be somethin like this

node --> exists --> if

constant(yes)--> then ---> targetNode.

constant(no)--> else

hope this helps

regards,

P.Venkat

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

I think going for JAVA or XSLT mapping would make your validation and mapping easy. I am not sure if this complex requirement can be handled using your graphical mapping.

For info on XSLT Mapping, check these links,

http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm

http://www.w3.org/TR/xslt20/

For info on Java Mapping,

http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm

Regards,

bhavesh