on 2007 Oct 30 8:47 AM
Hi Experts,
In my scenario. i am sending file which contain multiple header with multiple item lines. in item line. in mapping counter to Assigned to item_number. at every context change at header i need to reset the counter to 10. for this i have to write Adv UFD.
plz can any one provide Logic or UFD.
thanks in Advance,
Venu
hi,
>> at every context change at header i need to reset the counter to 10
the logic:
create a UDF cache = queue.
give header as input.
the context change is represented by ResultList.CC start a for loop. check if the input vector's current value is equal to ResultList.CC , then assign the desired value to counter.
[reward if helpful]
regards,
latika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
venu,
1) the code is clearly in error as java is case sensitive. maintain proper case.
2) Also, it shud be a<i> not a[index]
as far as the logic is concerned it will only give u number of items in last header coz the counter's value will be over-written. there fore if u want number of items in each header add the counter to result by using result.addValue()
still if u face problem, kindly post the error also.
regards,
latika.
*Dont forget to mark helpful answers*
for more info...
I am sending the sender and destination sample data
source ...........................
Header_data1
item_data
item_data
item_data
Header_data2
item_data
item_data
item_data
item_data
destination......................
<IDOC1>
<Header>
.........
........
.......
<item1>
........
incr_no = 10
.......
.......
.......
<item2>
........
incr_no = 20
.......
.......
.......
<item3>
........
incr_no = 30
.......
.......
.......
</IDOC1>
<IDOC2>
<Header>
.........
........
.......
<item1>
........
incr_no = 10 (now I am getting 40)
.......
.......
.......
<item2>
........
incr_no = 20(now I am getting 50)
.......
.......
.......
<item3>
........
incr_no = 30(now I am getting 60)
.......
.......
.......
<item4>
........
incr_no = 40(now I am getting 70)
.......
.......
.......
</IDOC2>
Now, with standard function counter, I am getting 40,50,60,70 in the second IDOC "incr_no"
help !!!
Hi Venu,
when I understand your problem correct you won't have to write a UDF as a standard function exists which should cover your problem: index (within category statistic).
Properties:
Initial Value: 10
Increment: 10
Count indices in: context
You'll have to ensure that you give the input queue with correct context changes. In your case it should look like that:
item_data (set context to Header_data) --> Standard Function index --> output field in IDoc structure.
Input queue of item_data should look like that your mapping editor:
item_data
item_data
item_data
[Context Change]
item_data
item_data
I suggest you to see the following link to learn more about mapping:
Mapping functionality in XI
SAP Exchange Infrastructure - Graphical_Mapping
SAP Exchange Infrastructure - Graphical Mapping Exercise
SAP Exchange Infrastructure - Graphical Mapping - Advanced
SAP Exchange Infrastructure: Mapping Patterns - Understand Context Handling in Message Mapping - Webinar Powerpoint
SAP NetWeaver Exchange Infrastructure Mapping Troubleshooting - Webinar Powerpoint
Mapping Lookups a RFC API
XI 3.0 New Mapping Features
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
8 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.