cancel
Showing results for 
Search instead for 
Did you mean: 

Restet the counter when there is context change

Former Member
0 Kudos

Hi Experts,

I am doing File to IDOC Scenario.the file Source Structure is of the form like one header with multiple item lines. There is field in item called item_num. for this field i applied counter this field will get incremented for each item. My problem is, suppose if i send 2 header with multiple item lines then i want to reset the counter if there is context change at header.if i didnt reset counter it will be increment from the previous itemline.

If some one knows the solution plz Reply

Thanks in advance,

Venu

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Venu,

In a message you can always send one header two headers will require two separate messages .

You can write a UDF which will be used to generate the same number for separate messages and incremented each time in one message

Regards

Former Member
0 Kudos

@ amit,

can you please tell me how do I have to write UDF to resolve this?

thanks,

venu

santhosh_kumarv
Active Contributor
0 Kudos

Hi Venu,

Can u provide a piece of data and the output u are getting..

Regards

San

Former Member
0 Kudos

000|quoteid1|abdcd|100010|endcust1|2\21\2007

001|05SC1604RCABF|130|custpart1|4|USD|quoteid1|21|

001|05SC1604RCAB-WF|

001|05SC1604RCAB-WF|150|custpart1|5|USD|quoteid1|14|reqnum4|2\21\2007|

000|quoteid1|abdcd|100010|endcust1|2\21\2007

001|05SC1604RCABF|130|custpart1|4|USD|quoteid1|21|

001|05SC1604RCAB-WF|

001|05SC1604RCAB-WF|150|custpart1|5|USD|quoteid1|14|reqnum4|2\21\2007|

000|quoteid1|abdcd|100010|endcust1|2\21\2007

001|05SC1604RCABF|130|custpart1|4|USD|quoteid1|21|

001|05SC1604RCAB-WF|

001|05SC1604RCAB-WF|150|custpart1|5|USD|quoteid1|14|reqnum4|2\21\2007|

000|quoteid1|abdcd|100010|endcust1|2\21\2007

001|05SC1604RCABF|130|custpart1|4|USD|quoteid1|21|

001|05SC1604RCAB-WF|

001|05SC1604RCAB-WF|150|custpart1|5|USD|quoteid1|14|reqnum4|2\21\2007|

This Is the format of the data

If it starts with 000  its header

Same way if it starts with 001 its item data

In the above sample data, there are 4 headers with 3 items each

I was using an “counter” its working but for the next header data, its continuing the counter, I would like to increment the counter in such a way that counter reset for each header data

Please let me know the UDF I need to write, if required.

Thanks

venu

Former Member
0 Kudos

Is there a way I can achieve the same using standard functions?

Is there any standard function that intimate me of the context change in the Queue?

help!!!!!

Venu