on 11-17-2009 7:31 PM
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...
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks mark,
My problem is:
If the values are not maintained in Classification master, then IDoc fields are not filling. The empty fields are not passing to PI. Means, I can not have the Fields in IDoc segments.
Comming to technical fields...
The IDoc (CLFMAS) segment (E1AUSPM) has 3 fields:
1) ATNAM
2) AWTRT
3) ATFLV
Some times the AWTRT will not be maintained in SAP ECC. When IDoc is created, the field AWTRT is not present in segment E1AUSPM.
Example:
ATNAMAWTRTATFLV
-a1
f1
-a2
-a3
f3
-a4
-a5
-a6
f6
Note: "novalue" means the field AWTRT is not present in segment.
In my PI Mapping, I am using context at segment level E1AUSPM.
Now I am getting the context as like this:
ATNAMAWTRTATFLV
-a1
f1
-a2
f2
-a3
f3
-a4--
f4
-a5--
f5
-a6--
f6
I want the context to be keep as it is, eventhough the field is not present in IDoc-Segment.
If its possible in PI, can you suggest the code change in SAP ECC? I don't know how to sent empty fields to PI from SAP.
Thanks in Adv...
Hi
For 2 elements Use this UDF (UDF type as context)
public void TDLineCounter(String[] tdlne,String[] tdno,ResultList result,Container container){
int j , cc = 0,cc_count = 0;
for(int i =0;i<tdno.length;i++)
{
if(tdno<i>.equals("ZI03")) // if you have any condition else you can remove this if
{
cc_count = 0;
for (j = 0; j < tdlne.length ; j++)
{
if ( tdlne[j].equals(ResultList.CC) )
cc_count = cc_count + 1;
if ( cc_count == cc)
result.addValue(tdlne[j]);
}
}
if (tdno<i>.equals(ResultList.CC) )
result.addValue(ResultList.CC);
else
cc = cc + 1;
}
}
Regards
Ramesh
Hi Ramesh,
If possible, please elaborate me the solution. already I have a udf for remaining header fields. Now the problem is with the dependent level IDoc fields. can I pass the new UDF (suggested by you) to my existing UDF?
The existing UDF has 11 input fields. the last 3 fields are ATNAM, ATWRT and ATFLV. I need to set context for ATWRT only.
Thanks...
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.