Skip to Content
avatar image
Former Member

IDoc Context issue

Hi all,

I am facing problem with IDoc contexts... IDoc(CLFMAS01) has 3 fields ATNAM,ATWRT and ATFVL in same segment.

if no value found during the IDoc creation, the fields creating in Segments, hence PI is not receiving the fields within the IDoc.

Ex:if there is no value for ATWRT, the field is not present in the IDoc segment.

sample IDoc segment values:

-


ATNAM -


ATWRT -


ATFVL

-


NAMVal1 -


WRTVal1 -


FVLVal1

NAMVal2 -


WRTVal2 -


FVLVal2

NAMVal3 -


-


FVLVal3

NAMVal4 -


WRTVal4 -


NAMVal5 -


WRTVal5 -


FVLVal5

NAMVal6 -


-


FVLVal6

-


When I use context at Segment level, the values are showing like these:

-


ATNAM -


ATWRT -


ATFVL

-


NAMVal1 -


WRTVal1 -


FVLVal1

NAMVal2 -


WRTVal2 -


FVLVal2

NAMVal3 -


WRTVal4 -


FVLVal3

NAMVal4 -


WRTVal5 -


FVLVal5

NAMVal5 -


-


FVLVal6

NAMVal6

-


in the above case, If the loop is in 5 iteration, I am getting the ATFVL value as "FVLVal6". But I am supposed to get the values "WRTVal5" and "FVLVal5"

While I am looping the values with in the UDF, I am not getting in proper order.

How can I get the proper order using the context? I tried RemContext and CollapseContext functions.

Any inputs? Thanks for your time...

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 18, 2009 at 04:59 AM

    Hi,

    You need to use the mapWithDefault node function before you do any context manipulation so that the number of contexts will be the same.

    You can try this mapping

    ATNAM --> mapWithDefault --> removeContext --> UDF

    ATWRT --> mapWithDefault --> removeContext --> /

    ATFVL --> mapWithDefault --> removeContext -->/

    Hope this helps,

    Add comment
    10|10000 characters needed characters exceeded