cancel
Showing results for 
Search instead for 
Did you mean: 

MappingException: Mapping failed in runtimeRuntime Exception when executing application mapping program

Former Member
0 Kudos

Hi,

do any one help me out in the following error:-

too few values in the first queue in the function  useOneasmany . It must have the same number of context as the second queue.

PFA for your reference while facing at message monitoring.

This is IDOC_AAE to JDBC scenario.

Accepted Solutions (0)

Answers (7)

Answers (7)

Hrishikesh0873
Discoverer
0 Kudos

See the payload also. Sometimes for some special character restriction this error comes; at least in my case.

juan_vasquez2
Active Participant
0 Kudos

You can chage the context of a element, in the source structure

right click.

take care about context change in your queue

in the third parameter take care if you need elements in the same context or different.

can you sand a picture of your mapping? with queue?

you need same elements in parameters 2, and 3, like the following image  3 elements (with different context changes, or equals)

the restult follow context change or third parameter.

Former Member
0 Kudos

Still, I am facing the same error and tried all the possibilities..

Actually, they have used useoneasmany-->splitbycontextd..

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Valli,

Can you please share us the screen shot of the mapping and also the test values for which you are getting the error.

This would help us to resolve the issue sooner...

Regards

Vishnu

Former Member
0 Kudos

Hi Vishnu,

Please find the screenshot and the payload information..

<?xml version="1.0"?>

-<COND_A04>

-<IDOC BEGIN="1">

-<EDI_DC40 SEGMENT="1">

<TABNAM>EDI_DC40</TABNAM>

<MANDT>300</MANDT>

<DOCNUM>0000000001150422</DOCNUM>

<DOCREL>740</DOCREL>

<STATUS>30</STATUS>

<DIRECT>1</DIRECT>

<OUTMOD>2</OUTMOD>

<IDOCTYP>COND_A04</IDOCTYP>

<MESTYP>COND_A</MESTYP>

<SNDPOR>XXXX</SNDPOR>

<SNDPRT>LS</SNDPRT>

<SNDPRN>XXXX</SNDPRN>

<RCVPOR>XXXX</RCVPOR>

<RCVPRT>LS</RCVPRT>

<RCVPRN>XXXX</RCVPRN>

<CREDAT>20150616</CREDAT>

<CRETIM>174243</CRETIM>

<SERIAL>XXXXX</SERIAL>

</EDI_DC40>

-<E1KOMG SEGMENT="1">

<KVEWE>A</KVEWE>

<KOTABNR>016</KOTABNR>

<KAPPL>M</KAPPL>

<KSCHL>XXXX</KSCHL>

<VAKEY>XXXX</VAKEY>

<MATNR>000000007000009582</MATNR>

<EKORG>1500</EKORG>

<WERKS>1501</WERKS>

<EVRTN>4900000668</EVRTN>

<EVRTP>00040</EVRTP>

<POSNR>000000</POSNR>

<ANZSN>0000000000</ANZSN>

<BSTYP>K</BSTYP>

<BSART>ZI</BSART>

<EKGRP>114</EKGRP>

<VAKEY_LONG>490000066800040</VAKEY_LONG>

<PSTYP>0</PSTYP>

-<E1KONH SEGMENT="1">

<KNUMH>0000159404</KNUMH>

<DATAB>20150616</DATAB>

<DATBI>99991231</DATBI>

-<E1KONP SEGMENT="1">

<KSCHL>P000</KSCHL>

<STFKZ>A</STFKZ>

<KSTBM>0.000</KSTBM>

<KSTBW>0.00</KSTBW>

<KRECH>C</KRECH>

<KBETR>1.00</KBETR>

<KONWA>USD</KONWA>

<KPEIN>1</KPEIN>

<KMEIN>EA</KMEIN>

<KUMZA>1</KUMZA>

<KUMNE>1</KUMNE>

<MEINS>EA</MEINS>

<MXWRT>0.00</MXWRT>

<GKWRT>0.00</GKWRT>

<KZNEP>X</KZNEP>

<ZAEHK_IND>01</ZAEHK_IND>

<KBRUE>0.00</KBRUE>

<VALTG>00</VALTG>

<VALDT>00000000</VALDT>

<ANZAUF>00</ANZAUF>

<MIKBAS>0.000</MIKBAS>

<MXKBAS>0.000</MXKBAS>

<KOMXWRT>0.00</KOMXWRT>

<KLF_STG>0000</KLF_STG>

<KLF_KAL>0000</KLF_KAL>

</E1KONP>

</E1KONH>

</E1KOMG>

</IDOC>

</COND_A04>

Former Member
0 Kudos

Hi mate,

     But What's the rule? because you have one E1KOMG at EDI level and other E1KOMG inside EDI level, which should be mapped?

Regards.

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Valli,

I could not find VKORG field in the payload.

And you are trying to repeat this field using UseOneAsMany function.

Can you check on this.

Regards

Vishnu

Former Member
0 Kudos

Actually, some times in VKORG "Sale organisation" details come and some times, these details will not come.

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Valli,

Then this is the issue.

Due to the absence of VKORG element, XI is not able to perform UseOneAsMany function, that's why it is saying few values in the context error.

Just FYI, you can give some dummy values for VKORG element accordingly in the source data and test it in the MM test tab and check the outcome.

Regards

Vishnu

Former Member
0 Kudos

Maybe you can use the function if Exist, then you can map it in other case, don't map or map a default value.

PriyankaAnagani
Active Contributor
0 Kudos

Please try this

VKORG---->FirstInput to UseOneAsMany
E1KONP->Remove Context->Second Input to UseOneAsMany
E1KONP->SplitByEachValue-->Third Input to UseOneAsMany

Regards,

Priyanka

Former Member
0 Kudos

Yep when i checked the payload information of the success one and failure one, the following information i observed:-

Success message:

Here, VKORG(Sales Organization) values is available..so messages comming with VKORG is successful.

Failure message:

Here, the values of VKORG is not available, instead of that they are updating EKORG(Pruchasing Organisation) information. Which i have not even mapped in PI level..

Because of the above reason, its showing mapping failed error..

My requirement:

I require to map the fields in such a way that when ever we get "VKORG" or the "EKORG" field values, the values should get passed to "Company Code" field.

Do any one help me out to resolve this requirement..Any modification need to make, suggest me.

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Valli,

Then you can do like below to take VKORG OR EKORG which ever present in the message, and map to the first argument of the UseOneAsMany node function.

VKORG-->EXISTS node function-->IF boolean function

then part of boolean function is VKORG

Else part of boolean function is EKORG

Try the above logic and let me know if you still facing the issue.

Regards

Vishnu

Former Member
0 Kudos

Hi Vishnu,

I tried the same logic, but when i pass VKORG value, i got the output..But when, i pass EKORG value making VKORG with no value..I have not received the output//

Mapping as below:

VKORG-->EXIST-->IF

VKORG-->THEN

EKORG-->ELSE

and mapped to the first argument UseOneAsMany

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Valli,

Can you let me know whether VKORG exist in the message and with no value.. or do you mean VKORG doesn't exist?

If former is the case, then that's why you would not gotten any value in the output, since we are just checking whether VKORG exist or not.

Can you let me know whether you need to check whether VKORG has any value or not in the condition?

Regards

Vishnu

Former Member
0 Kudos

I dont want to check whether VKORG value is there or not.

Actually, my requirement is some times VKORG value exist and sometimes EKORG value exist..

But both the values doesnt exist at the same time.

Suppose, if VKORG value has been passed..then it should get updated into CompanyCode and if EKORG value has been passed..then it should get updated into CompanyCode.

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Valli,

When you mean, when, i pass EKORG value making VKORG with no value..I have not received the output.

Did you get any error? if not, then VKORG has present with no value. When this is the case, then in the logic, instead of just passing VKORG to the THEN part of IF, first pass VKORG to STRING LENGTH function and use ARITHMETIC GREAT function(the second argument of this function is a CONSTANT with value 0), and then pass this to the THEN part. Now test and check.

Try this.

Regards

Vishnu

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Valli,

In Order for the function UseOneAsMany to work, the prerequisites are:

1. The number of context changes for the first argument and the second argument should be same.

2. The number of values should be same for the second argument and the third argument.

Can you please check these and let us know the outcome.

Regards

Vishnu

Former Member
0 Kudos

Hi Valli,

    

   Have you solved it? The main goals in this forums are to find answer or share knowledge. If you have found the solution,  share it. If some of the answers have helped you, then assign the Correct or Helpful points and close the thread.

Thanks and regards.

former_member183816
Active Participant
0 Kudos

          Source Queue                    Target Queue

          ======                              =======

          value1                                 value1

          ======                              =======

          value2                                  value2

          ======                              =======

          value3                                   value3

          ======                              =======

                                                            ?         Producing Error

                                                    =======

                                                            ?          Producing Error

                                                    =======

This is happening in your case, Target has more context or requiring more values to map in same context than source, so you are getting this error.

Try to dig on context change, queues in SAP PI mappings. You will learn about your mistakes,

What is Context and Context Change - Process Integration - SCN Wiki

Former Member
0 Kudos

Hi mate,

    It's a context problem with the Useone asMany function, check it. Yes it hosul hace the same or be at the same level, try to modifiy the context level or the Removecontext function.

Regards