cancel
Showing results for 
Search instead for 
Did you mean: 

Using CopyValue function with error

Former Member
0 Kudos

Hi All,

I have a requirement to send the three values coming in the one source field to three different target fields.

E.g: Source field is "src1" and having the values 1,2 ,3 These values should be sent to the target fields such as

first target field "Trg1" should get the value as "1" and the second target field "Trg2" should get the value as "2".

third target field should getv value as "3"

I have used copyvalue function. it is working fine but if any value from "src 1" is blank.

I will have the runtime error as follow

Runtime exception occurred during application mapping com/sap/xi/tf/_MM_MT_WORKORDER_TO_ORDCHG_ORDERSO5_; com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-fieldmapping /ns0:MT_WORKORDER/StatementName2/TEST/acc

Will appreciate your advise on how to resolve this.

Regards,

FNG

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi Ninad,

Thank you for your guidance !

I have managed to resolve the error.

What I did is as follows source1 -> copyvalue (0) -> then

source1 -> copyvalue (0) -> exist -> if --> target1

constant (blank) -> else

Former Member
0 Kudos

The parent node for the source1 is coming as 0 to 99999

Source1 is coming as 0 to 1.

The scenario is an IDOC to JDBC. I

I am using a standard IDOC type.

former_member207622
Contributor
0 Kudos

iparent node ---exists --- if -


then - ( source 1- length not equal zero ---( another if ) then ---( source1 -- use copyvalue here ) else ( pass a blank constant )

try this hope it works

regards

Ninad

Former Member
0 Kudos

The parent node is existed.

Could your advise how should it be done with the parent node ?

former_member207622
Contributor
0 Kudos

what is the occurence of the source1 field , can you make it mandatory ( ie 1-1 ), Check its context , see proper values are coming in queue

Can you tell me the occurence of the node under which source1 field comes , because you need to put first condition there

regards

ninad

Edited by: Ninad Sane on Nov 15, 2010 9:32 AM

vkaushik82
Active Participant
0 Kudos

Is your target field manadatory?

try to but blank(may be 1 space) in mapbydefault .... by this target 1 will populate with blank.

Former Member
0 Kudos

I have mapped as follows

sourc1 -> mapWithDefault [NIL} -> copyvalue [0] -> targt 1

sourc1 -> mapWithDefault [NIL} -> copyvalue [1] -> targt 2

sourc1 -> mapWithDefault [NIL} -> copyvalue [2] -> targt 2

No substring function used.

But still having error

Runtime exception occurred during application mapping com/sap/xi/tf/_MM_MT_WORKORDER_TO_ORDCHG_ORDERSO5_; com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-fieldmapping /ns0:MT_WORKORDER/StatementName2/TEST/acc

I noticed from the source xml structure in the inbound payload, when sourc1 is blank, the tag is not created.

so question is how to create sourc1 tag if the sourc1 is come as blank ?

Former Member
0 Kudos

does that parent node exist in the source XML

if the parent node exists then mapwithdefulat should work at the field level

Former Member
0 Kudos

Hi Francesco

I have tried using MapWithDefault, but still having error.

Could you advise how the MapWIthDefault should be used with CopyValue, just to check I am doing correctly

in the mapping.

Regads

FNG

rajasekhar_reddy14
Active Contributor
0 Kudos

What is the value you have maaped ??you have to pass some defavult value , this default value will be populated in target side when there is no element created in source.

Regards,

Raj

Former Member
0 Kudos

src1>mapwithdefault>copyvalue

but do u use a substring function for the target fields. if so the mapping will fail as the source is blank

Former Member
0 Kudos

Hi Francesco

Thanks for your suggestion, I will try it out.

Regards

Freddy Ng

Former Member
0 Kudos

Hi,

try to use the copyValue with additionally the MapWithDefault function.

Regards

Francesco