cancel
Showing results for 
Search instead for 
Did you mean: 

Value Mapping Api's

Former Member
0 Kudos

Hi All,

I want to update the entries in the value mapping table from the mapping. Does anybody knows about some apis which can help.

Regards,

Sudip

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

This blog shows how to access value mapping tables in the Integration Directory.

Not sure if you can write data into the Value Mapping table from the ID, but this can point you to the starting point and help you explore further,

/people/sukumar.natarajan/blog/2006/10/23/accessing-value-mapping-defined-in-directory-using-java-functions

Regards

Bhavesh

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can either create an advanced user function or a simple user function for this.

Lets say that you want to create sequences in increments of 10.

Then your java code would look like:

Int inc = 10;

Integer seqNo = (Integer) container.getParameter("seqNo");

if (seqNo == null) { seqNo = new Integer(inc);}

else {

int number = seqNo.intValue() + inc;

seqNo = new Integer(number);

}

container.setParameter("seqNo", seqNo);

return seqNo.toString();

the sequence number is stored in a container object.

Its retrieved everytime and incremented and updated.

There is another way using the advanced function to create all the numbers at once and use them. But, I think this should do the job for you.

Regards,

sukumar.

Former Member
0 Kudos

Hi sukumar,

This is not what I wanted.I want sequence no to be generated not just within the mapping but across multiple exection of the same mapping.i.e. i need some kind of persistence ,so that when the next time the mapping is called we get the next number , something like no range object.

Regards,

Sudip.

bhavesh_kantilal
Active Contributor
0 Kudos

Sudip,

There are no relation between the different instances of mapping program's execution.

You might need to use a ZTABLE etc to stored this number and then lookup the number in your mapping etc.There is no standard way to do this.

Regards

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

My actual requirement is I need to populate a particular field in the target structure each time a particular mapping is called.So basically i need some kind of persistance in Xi between mapping call.Do you see some other way of acheiving the same.

Regard,

Sudip

bhavesh_kantilal
Active Contributor
0 Kudos

Sudip,

Is this some table maintained in XI / R3.

If yes, you can use a RFC lookup API. Write an RFC that will take the data and then push it to the table.

You can use the RFC Lookup API to call that RFC from the mapping.

But, the issue with this approach would be that it is not recommeneded to write to a table using the LookUp API. There might be inconsistencies in case the mapping program errorrs out as then a restart of the message might lead to the duplication of the data etc.

or, use a BPM to do this.

Regards

Bhavesh