cancel
Showing results for 
Search instead for 
Did you mean: 

create filename with sequence No. in communication channel

Former Member
0 Kudos

Hi Guys,

               I have a requirement to create a file name with increasing sequence No. at the end instead of time stamp.

Have you come across such requirement ?

Thanks

Sam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

      I find a way to send the sequence No. via IDOC.

But where we write Dynamic configuration UDF ?

is any other way to pass the sequence No. from Enterprise Builder to Integration Builder ?

Thanks

Sam

Former Member
0 Kudos

In message mapping u will write the DC code and store value dynamically in ASMA.

Refer below link (wite ur DC code + in receiver file adapter chk "file name " under ASMA)

http://wiki.sdn.sap.com/wiki/display/XI/Combining+three+different+aspects+of+PI+in+one+shot

chk this wiki also (section ASMA and Dynamic configuration)

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=272171407

Former Member
0 Kudos

I find a way to send the sequence No. via IDOC. 

But where we write Dynamic configuration UDF ?

u have to write Dynamic configuration UDF  in message mapping in ESr

is any other way to pass the sequence No. from Enterprise Builder to Integration Builder ?

in receiver file adapter, you have to enable ASMA and File name .

ex: urefer last example in below link

http://wiki.sdn.sap.com/wiki/display/XI/Combining+three+different+aspects+of+PI+in+one+shot

Former Member
0 Kudos

create a UDF in graphical msg mapping and in UDF take input of Seq number and write DC code for filename generation appending Seq number to filename.

then map the output of UDF to header node of target msg type - so in mapping:

Seq number source field -> UDF -> Header node of target msg type.

in configuration, in receiver file comm channel, enable Adapter specific msg attibutes and tick filename option.

former_member184681
Active Contributor
0 Kudos

Hi Sam,

Of course there is a way to do it, that is what Dynamic Configuration and Adapter-Specific Message Attributes (ASMA) are for. Please check my Wiki here for an overview of possible methods to dynamically assign the file receiver name:

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=272171407

I think you will find options #2 and #3 particularly interesting ("Variable Substitution" and "Adapter-Specific Message Attributes and Dynamic Configuration"). Also, the examples in this Wiki include the source code for the Dynamic Conf UDF.

Hope this helps,
Greg

Former Member
0 Kudos

Thanx for the replies.

I have few more questions when I look at this screen shot.

is that KUNNR is refered as variablePart in the code?

What's the resulting Number field, does it shd be part of the target structure ?

What's the node in between UDF and Number ?

former_member184681
Active Contributor
0 Kudos

Dear Sam,

>>> is that KUNNR is refered as variablePart in the code?
Whatever you put as an inbound parameter for the setFileName function, will be available inside the UDF as the variablePart.

>>> What's the resulting Number field, does it shd be part of the target structure ?
Actually it depends on requirement. It can be, but it doesn't have to. In my example scenario it was transfered do some target field, but in your case you can do it as you wish.

>>> What's the node in between UDF and Number ?
That is also an UDF that I required to meet my requirement.

All in all - do not focus on the things other than setFileName function of my example in Wiki, they do not really matter. Simply adjust the UDF to your scenario if required, and you're done

Hope this helps,
Greg

Former Member
0 Kudos

Thanks Mate.. just one more question.. I define this UDF and call this function with input and with out any output field, still it will generate the file name that I can use in Comp. Controller using ASMA for file name ?!

former_member184681
Active Contributor
0 Kudos

Yes it will it is the code included inside the UDF that sets the ASMA, not an output parameter.

Former Member
0 Kudos

yes because you are using DC code for setting the filename attribute dynamically in the message header..

Thanks

Amit

Former Member
0 Kudos

Thats great.. I call this UDF in my mapping just for the sake of initiate the it.

in the file name field in Com. Channel, I use the name 'filename'. is that right ?!

former_member184681
Active Contributor
0 Kudos

Actually it doesn't really matter what you type as File name in CC, it will be replaced by the value from ASMA anyway . Just make sure to mark enable ASMA for the File Name in the Advanced tab, otherwise your UDF execution will have no result on the file name.

Hope this helps,
Greg

Former Member
0 Kudos

tick the option of Adapter specific msg attributes and tick filename option in it.

in UDF, using dyanamic configuration code, set filename as you want. Call this UDF in your msg mapping.

Then in comm channel, the filename you specify in filename field becomes of no use, as the filename is determined by UDF code, but you need to specify a filename in filename field to activate your comm channel as filename field is a mandatory field in file comm channel configuration.

Answers (3)

Answers (3)

rajasekhar_reddy14
Active Contributor
0 Kudos
deepak_shah
Contributor
0 Kudos

Hi,

There is file construction mode in receiver channel called Add counter, if you are using NFS mode. Check help link below:

http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6830e67f2a6d12e10000000a1553f6/content.htm

Also follow these links:

http://scn.sap.com/thread/1477397

http://scn.sap.com/thread/1193038

http://scn.sap.com/thread/1587923

-Deepak

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Use some database table for the number sequence. Do lookup during mapping time to find the sequence and update it. Since pi does not do persistence, this is one possible solution. Plus using dynamic configuration you can create the file number sequence using the look up method mentioned above.