cancel
Showing results for 
Search instead for 
Did you mean: 

Incrementing The constant

Former Member
0 Kudos

Hi,

I am mapping a field with a constant value and that value should be incremented sequentially wheen I execute it.Suppose I am mapping a field NO - with 20000 and for the next time when i execute the scenarion the value of the NO should be 20001 and so on....How could I acheive this.

Regards,

Vijaya Lakshmi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

[;

chk the above thread.

Siddhesh

Answers (3)

Answers (3)

Former Member
0 Kudos

Answered

SudhirT
Active Contributor
0 Kudos

Hi Vijaya,

Do like this,

Create a Ztable in R/3 and initially store values 20000 and onwards in an internal table, Create a UDF in XI with RFC lookup functionality.

Each time XI makes a lookup in R/3 system, increase the variable by one and pass same to XI.

Use this link for RFC lookUp.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1...

Thanks!

samiullah_qureshi
Active Contributor
0 Kudos

Hi,

I think you can do it in XI. But yes you can store it somewhere outside XI, like in file or some database table and fetch data from it by using a UDF.You can write UDF's java code in such a way, that this code will first read the data from file or database. Increment it and send it to target field, also store the new value in file or database in same java code.

Regards,

Sami.

Former Member
0 Kudos

You can store that variable onto a file on the Xi flesystem or as stated before you can opt to store it on a ABAP table. At runtime you can then retrieve and update it using a runtime lookup. Check this blog to read more about it. /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler

There's probably new functionality available in SAP PI 7.x around this topic.

Regards.