Skip to Content
avatar image
Former Member

How to generate sequence no increased with an increment in o/p file name

Hi all,

I am doing a file to file scenario in which my output file name consists of a sequence number which is increased by fixed increment.i thought of proceeding with variable substitution by writing one udf involving Dynamic Configuration object (the udf describd in Micheal blog).However my problem is that i am unable to generate the sequence number with a fixed increment .plz guide me how to proceed to achieve the desired output filename with sequence number.

For ex:o/p file name:chxx.bcdtspd.00000002.<datetimestamp>.dat

:chxx.bcdtspd.00000003.<dattimestamp>.dat

The scenario is FTP so we cant use addcounter.Plz help as its urgent.

Regards,

Saurabh Sharma

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Jan 17, 2008 at 07:52 AM

    The following blog has your Solution

    /people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapter-specific-message-attributes-via-dynamicconfigurationbean

    Read it and if you need any help get back.

    Regards.

    Jeet.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      What you can do is.

      U have to use the counter which increment everytime ur mapping is executed.

      Steps which needs to be followed.

      1) Maintain one table at R3.

      2) Pass the control to R3 and update the table value with one.

      3) For the second time fetch the counter value from the table and add 1 to it and again update the table with the increment value.

      4) pass the incremented value to XI and use that counter value for ur file name.

      Here u have to always pass 1 value to R3.

      The method is called as lookup.

      Just go through the below weblog:

      Lookup - /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer

      Thnx

      Chirag

      Thnx

      Chirag

  • avatar image
    Former Member
    Jan 17, 2008 at 08:39 AM

    Hi Jeet

    thanks for ur reply that blog was also very useful but my requirement is how to generate the sequence number for every file which i can put in the corresponding output file.once i am able to generate the sequence number i will either put into message payload or header and then with variable substitution i will retrieve it into output file name.Plz help me if u have any idea how to gentate sequence number with any counter

    like once 00000003 then again 00000004 (if increment is one)

    Regards,

    Saurabh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 17, 2008 at 09:11 AM

    Hi Chirag,

    Using counter means u want me to use the standard airthmatic function counter .its value will persist for all the time the map will exceute i.e if first time its giving 00003 then for second time i want 00004 for my 2 output file

    Regards,

    Saurabh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      No u dont have to use the arithmatic counter.

      Have u read all my points. U have to maintain one table at R3 end and u have to pass the value always 1 to Program.

      Now for the first time u will not select any value from table u just update the table value with 1.

      Second time u will again pass the value 1 to R3 and u fetch the value which is 1 from table then u add both the values 1+1=2 and update the table with value 2 also u wil send the 2 value to Xi which u will use.

      Thnx

      Chirag

  • avatar image
    Former Member
    Jan 18, 2008 at 05:34 AM

    Hi Chirag

    Sorry for replying late.Actually we were discussing on the solution provided by u, at present we don't have the access for creating table in R/3 box.Is there any other way to create the sequence number using Global variavle which can persists for every time the mapping is called.please guide me if u have any idea however u deserve point for ur prior solution that i will definately provide u.

    Regards

    Saurabh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      I m not sure whether Global variable hold the value of pervious mapping which is run and can be used in the next time when the scenario is run again.

      I m not sure whether it can be used or not. But u can give a try.....

      Thnx

      Chirag