cancel
Showing results for 
Search instead for 
Did you mean: 

UDF development

malathi2608
Explorer
0 Kudos

Hi Experts,

we have a requirement in which we have to count Each record in a message and map the respective count to the output field. The count has to continue for the next message. We are working in PO 7.5 version.

example structure:

message 1:

<Root>

<Record>------------------------------------------------>count1

<field1>...</field1>

<field2>...</field2>

</Record>

<Record>----------------------------------------------->count2

<field1>...</field1>

<field2>...</field2>

</Record>

<Root>

message:2

<Root>

<Record>------------------------------------------------>count3

<field1>...</field1>

<field2>...</field2>

</Record>

<Record>----------------------------------------------->count4

<field1>...</field1>

<field2>...</field2>

</Record>

<Root>

The problem is count has to be continued for each Record in a Message Regardless of date and time. whenever message hits the interface the count has to be continued. i want to Know the Possible solution. if i go with developing UDF, the counter value has to be stored to reuse it. Kindly Help me with this.

Many Thanks,

Malathi

Accepted Solutions (0)

Answers (1)

Answers (1)

sugata_bagchi2
Active Contributor
0 Kudos

Hi Malathi,

As far as I understood your requirement - you need to store the count, this can be achived if you can create a Ztable in ECC and do a lookup to get the value from the last run.

You can split this interface to call two receivers - ECC and your actual receiver.

Everytime the interface is called, in a separate mapping you count the record and call a proxy to update the ZTable to store the total count.

So your scenario will be -

1. External system calls the interface

2. split the incoming message into two receivers - ECC and actual receiver.

3. use two separate mappings - ECC mapping and mapping for actual receiver. use maintain order at runtime and keep the ECC mapping at first in the order.

4. in the ECC mapping count the record from the message at runtime,

using RFC Lookup by using - RFC_READ_TABLE to get the count value from last run. then add this two values

and update the Ztable via proxy.

5. in the second mapping call the Ztable using RFC Lookup by using - RFC_READ_TABLE to get the current count value.

Another option is -

in the ECC mapping count the record from the message at runtime in the map,

using RFC Lookup by using - RFC_READ_TABLE to get the count value from last run. then add this two values

and update the Ztable via proxy. At this point update the value to some Dynamic attribute.

Call the Dynamic attribute in the second mapping to get the value. This will prevent the use of 2nd RFC lookup.

Thanks

Sugat