cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Record No dynamically at Receiver side

Former Member
0 Kudos

Hi All,

I am using XSLT mapping for file2file scenario(xml to flatfile).I have "Record ID" field in target side.I want to get the Record ID for each record as 1,2,3,.....There is no source field for "Record ID".

Please help me .

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Radhika,

Here is a soln for XSLT. but you need to alter a little to use it.


<xsl:value-of select="count(preceding-sibling::*[@col]) + 1"/>

http://www.stylusstudio.com/xsllist/200110/post50330.html

Check the above link you would get how you can create your XSLT.

Let me know how it was helpfull.

Regards,

Saravanan.R

Edited by: Saravanan R on Apr 25, 2008 11:48 AM

Former Member
0 Kudos

Hi Radhika,

This can be easily handeled in graphical mapping. Why dont you try that option.

In Graphical Mapping,

Java Section,

1. Declare a global variable.(ex: int i;)

2. Initialilize it.(i=0;)

Write a udf without any input and it should be like this.

i++;

return i+"";

Map the output to your recordtype.

Regards,

Saravanan.R

Former Member
0 Kudos

Hi Radhika,

What is the logic behind RecordID's value?

Is it a random generated number?

For that you can use XSLT with Java Enhancements and make use of Java standard functions to generate randomn number.

Please go through this link:

/people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners

http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/frameset.htm

Thanks,

Varun

Former Member
0 Kudos

Hi Varun,

There is no fileld in sender side to map with recordid.I have to get record id field value automatically for each record in receiver side.

I want to generate record number in ascending order(1,2,3, ...)

Thanks for ur quick reply.If u have any idea please suggest.