cancel
Showing results for 
Search instead for 
Did you mean: 

Context Problem in Mapping

nisarkhan_n
Active Contributor
0 Kudos

Hi All

this is my IDOC Structure (I have only posted the required structure)

<?xml version="1.0" encoding="UTF-8"?>

<ZCO_CCM>

<IDOC BEGIN="1">

<EDI_DC40 SEGMENT="1">

</EDI_DC40>

<Z1PARNT SEGMENT="1">

<LVROM>Z</LVROM>

<Z1CSKS SEGMENT="1">

Not coming<b><HIGHERDEP> </HIGHERDEP></b> <STDHIERARCHY>0001-1</STDHIERARCHY>

</Z1CSKS>

</Z1PARNT>

<Z1PARNT SEGMENT="1">

<LVROM>Z</LVROM>

<Z1CSKS SEGMENT="1">

<b><HIGHERDEP>0450</HIGHERDEP></b>

<STDHIERARCHY>0001-1</STDHIERARCHY>

</Z1CSKS>

</Z1PARNT>

</IDOC>

</ZCO_CCM>

I am genereating the flat file, the tagret field should be creted only when the value in the field <HIGHERDEP>0450</HIGHERDEP> is present.

I am checking IF> HIGHERDEP->EXIST(Function)---->THEN->MAP Z1PARNT to tagert Root node ( With Node and ALSO TRIED with UDF which supress the node) the context of the field HIGHERDEP is Z1PART (one structure above)

while testing this mapping,

2 Times Z1PARNT Repeated ( 1st novalue, 2nd with value,in field HIGHERDEP)

on target i should 1 rows (with value in field) which i am not getting any row,

if i change the context of field HIGHERDEP to IDOC, on target side it is creating the row for the the Node Z1PART in which field HIGHERDEP is not coming.

any clue on this?

Accepted Solutions (0)

Answers (1)

Answers (1)

nisarkhan_n
Active Contributor
0 Kudos

any inputs?

former_member192892
Active Contributor
0 Kudos

Khan,

The node function exists works only when there is no node coming at all in the source structure.

In your case a blank value is coming and hence the node exists will return true...

Instead of this you shoud check string equals with space value

former_member192892
Active Contributor
0 Kudos

Khan,

The node exists function returns false when there is no node coming in the input.

In your case when source node has blank value it'll return true both times.

You need to check text equals with a blank constant in your case

Former Member
0 Kudos

even i am facing similar issue

Message was edited by:

Khan Khan

nisarkhan_n
Active Contributor
0 Kudos

thanks for the reply....

i have taken care that now.......

Actaully i am taking the vaule of the field HIGHERDEP and doing the D/B lookup, i have to create the target node only if the valid value exist in the table (R/3)

if the value of the HIGHERDEP is blank or if it doesn't exist i am sending the value 000 as the input to the D/B table and getting the return value as inValid value.

so if the value from the lookup is valid ihave to crete the node else i have to supress....the problem is if the 1st value of field is invalid and rest are valid it is not creating the node?

can u suggest some how can i take care of this in UDF so that i suppress the target node for the invalid value from D/B Lookup and create node for the valid entries

Former Member
0 Kudos

Hi,

In mapping that you have performed, check the queue at target root node. It could be possible that all values for this node are appearing in one context in queue. If that is the case then it would accept only first one. For example, as in this case you mentioned, the first value is suppressed because of invalid input value of HIGHERDEP, this could cause entire target node to suppress if all values under this, though they are valid, are appearing in same context.

If this is the cause, then use node functions RemoveContext and SplitByValue (for each value) in mapping of root node at target.

So your mapping would look somewhat like this..

HIGHERDEP -> Other Tags for conditional Checking -> RemoveContext -> SplitByValue (For Each) -> Root Node of target.

Provide additional details if my understanding has not been correct.

Bhavish