cancel
Showing results for 
Search instead for 
Did you mean: 

Create a Target based on Condition

baskar_ramasamy
Participant
0 Kudos

Hi Experts,

I have a scenario like, based on a filed value the target node should be created /not created.

ex:

if i have a field value(UDF) "true" , target should be created with respective fields mapped to that target.

if i have a field value(UDF) "false" , target should NOT be created.

Above mentioned is my mapping to Target.

Target gets created if the UDF value is "true"

But if value is false, getting error message as target message not created, please check your xsd.

How to achieve this scenario.

Thanks,

Baskar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please apply the condition to targer Header node instead of MT node and see if it works.

The mapping fails because MT_T node is mandatory node with 1..1 cardinality so if you don't create this node, mapping will fail.

So please apply the condition to Header node with 0..n cardinality.

Also apply removecontext to tSalutaion source node.

Regards,

Beena.

baskar_ramasamy
Participant
0 Kudos

Thanks Beena,

i have done validation for header as you said, issue resolved.

Answers (1)

Answers (1)

baskar_ramasamy
Participant
0 Kudos

Additional Info:Error message popup

        Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD

See error logs for details    

Former Member
0 Kudos

Hi Baskar,

Just try display queue on each function ;you will get to know the problem easily .Seems  issue with context handling..

Regards

Venkat

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

The root node has an occurrence of 1..1 meaning it does not need any mapping. You can use your logic in the header instead. If you will be creating a file, you might want to look on the strictXml2PlainBean for empty file handling

http://help.sap.com/saphelp_nwpi711/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/frameset.htm

Hope this helps,

Mark

baskar_ramasamy
Participant
0 Kudos

Thanks Venkat. it is working now.