cancel
Showing results for 
Search instead for 
Did you mean: 

Stateful mapping value

Former Member
0 Kudos

Hi there,

I would like to have a sequence number in all my messages that are sent - and this "forever".

An idea would be to have a DB connected and to do lookups etc.

But isn't there a more convenient way of doing this?

Thanks,

Helge

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Helge,

As you told one option would be to go for a DB lookup. You can use the concept of sequence to create unique sequence number.

Apart from this option, i think another solution would be to go for a look up from a Properties file.

You can create a user defined function that looks up into this properties file and then uses this value availabe in it and also updates/increments the value.

XI need a common variable that it can look into everytime it needs to set the sequence number and either the DB option or this properties file look up using an User Defined Function can work good.

hope this helps,

Regards,

Bhavesh

Answers (3)

Answers (3)

moorthy
Active Contributor
0 Kudos

If you want to generate unique sequence number , it is better to go with the concepts of Number Range Objects of SAP. You can write an User defined function in your mapping, which connects to Inetgration Server( XI - ABAP stack) via JCO call ( by Calling Function Module) and retrieve the unique number everytime. So first you need to create a Number Range Object and RFC module in the XI Server. RFC will get the unique number based on the reuirements. Then call this RFC via JCO from the Mapping.

And one more thing , you can always go for MessageId to get the Uniqueness.

Hope this helps..

Regards,

Moorthy

Former Member
0 Kudos

Hi,

probably you could put the functionality into an adapter module which you would include in each sender or receiver adapter.

Without knowing the background i'm just curious why you would want to do that? the message id given by XI is unique and identifies each message, it is even sent out with each IDoc, so you can later track the XI message from the IDoc.

regards

Christine

Former Member
0 Kudos

Implementation Considerations

Java mapping programs are not permitted to be stateful. You are therefore not permitted to perform actions such as writing data to a database table during a Java mapping. The Integration Server cannot track such side effects. Therefore, if an attempt is made to resend a message that has not been received by the receiver, the data may inadvertently be written to the database twice in a Java mapping.

Note also that you cannot call java.lang.System.exit() or java.lang.System.setProperties() within a Java mapping and that you cannot use a Class Loader in the classes of an imported archive

(It is also apply to user-defined functions in message mappings)

Former Member
0 Kudos

Try to use Java-Proxy instead of Java mapping (and user-defined functions)

Vadim