Skip to Content
avatar image
Former Member

PI7.1 Help needed

Hi,

I have the mapping like this

IDDAT(E1EDK03) Equals If Then DATUM(E1EDK03) removecontext-copyvalue(0)--targetfield(Underroot1)

001

Here the root1 is under root has the fixed value mapping with values 111,112,113 means if there is any value among these then only the root1 will be created.

Now I check the mapping with the roo1 mapping as

Qualf-equal-equals-createif-root1

113

whreas there is no value 113 in the input payload

I get the follwowing error when I check mapping with copyvalue for the targetfield

Insufficient number of values in argument queue for function CopyValue. Value with index '0' not found

It works well without copyvalue.

What can be done it to wok with and withou copyvalue?

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Feb 07, 2012 at 10:25 AM

    Hi

    Do the mapping without copyValue function

    > IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext---targetfield(Underroot1)

    > 001

    Regards,

    Venkata Ramesh

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 07, 2012 at 10:12 AM

    Hi,

    >>>whreas there is no value 113 in the input payload

    1. maybe you can write a simple UDF for the same and it will check all the things you want ?

    is that an option ?

    2. what I can also suggest is chapter: . 5.14 IDoc Message Mappings page 197

    from:

    http://www.sap-press.com/products/Mastering-IDoc-Business-Scenarios-with-SAP-NetWeaver-PI.html

    Regards,

    Michal Krawczyk

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      By using below code you can take the correct values

      int j = 0;

      try

      {

      for(int i =0; i<segment.length;i++)

      if(segment<i>.equals(""))

      {

      result.addValue(field[j]);

      j++;

      }

      else

      result.addContextChange();

      }

      catch(Exception e)

      {

      result.addValue("");

      }

      This is queue type UDF and it takes 2 input values Segment and field.

      In your case 2 times you have to use this UDF.

      Map like this

      E1EDK03 as first input value

      IDDAT --> MapwithDefault node function --> RemoveContext node function as second input value

      The above UDF output values checks with constants by using Equals function(UDF output Equals 113) this output gives to IfWithoutFunction, if this condition is true then give the same UDF output value instead of IDDAT value you can use the DATUM

      Finally you can map this ifWithoutElse node function output value to Target Field

      Note: some times if IDDAT value comes and there is no value at DATUM so at this time also it gives correct values, if you map without using this that gives wrong value.

      Regards,

      Venkata Ramesh

  • Feb 07, 2012 at 10:11 AM

    Hi,

    Add an ifWithoutElse step. Put this as the if condition:

    IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext--exists()

    and this as the "then" value:

    IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext

    The interpretation is: if the source value exists, then put it into Underroot1. Else, do not create the Underroot1 node.

    Hope this helps,

    Greg

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 09, 2012 at 07:21 AM

    answered

    Add comment
    10|10000 characters needed characters exceeded