cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Filename to File receiver

sowmya_krishna
Explorer
0 Kudos

Hi,

I have requirement where the receiver filename is configured as Dynamic File name.

  As my sender CC is File, I am using ASMA to get the source filename & need to concatenate the _FEEDBACK(Constant) to the receiver File name.

I have follwed the below blog

http://scn.sap.com/people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapt...

My Query is when getting the filename through ASMA , it is considering the extension of the file .txt  for example FIDSAP.txt which is not required.

After concatenation , i am getting the file name as FIDSAP.txt_FEEDBACK.txt

Please guide is there anyway to carry out substring the value, while assigning file name to receiver.

Thanks

Sowmya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

It seems that u r using DC in ur mapping via a UDF, so just use a simple substring/split function and get the value which is before ".txt" and then add whatever contsant u want to add...

In case u still have any issues then paste ur UDF here, will edit the same

Thanks

Amit Srivastava

sowmya_krishna
Explorer
0 Kudos

Hi Amit,

There is no ESR configured. Its only ID configured with one sender & 2 receiver. The first receiver will be getting the same file name as sender which achieved through enabling ASMA at both the sides. But for second receiver the sender filename should be concatenated with _FEEDBACK, here enabling ASMA is picking the filename FIDSAPGMT.txt with extension & at the receiver side getting the filename as FIDSAPGMT.txt_FEEDBACK.txt which is not correct.

It should be FIDSAPGMT_FEEDBACK.txt

.Is there anyway to give i can read specifc length of the file name & assign to standard SAP dynamic  module.

Former Member
0 Kudos

Hello,

In case of pass through scenarios these are the alertnatives which can be used:

Adapter module :

http://wiki.sdn.sap.com/wiki/display/Snippets/Dynamic+file+name+in+a+File+to+File+pass+through+scena...

Java mapping:

http://wiki.sdn.sap.com/wiki/display/XI/Dynamic+file+name+for+pass-through+scenario

Thanks

Amit Sriavstava

sowmya_krishna
Explorer
0 Kudos

Hi Amit,

Thanks for the immediate reply.

We are using PI7.31, Is it not possible to achieve through standard modules.Could you explain what is the purpose of the below parameters under DynamicConfigurationBean.

dc.nameLength

dc.valueLength

Thanks

Sowmya

Former Member
0 Kudos

Hello,

As far as i know, there is no other alternative to dynamically create file name in a pass through scenario (that's the reason i published this wiki )

BTW you don't have to change much in the above mentioned code...and it is quite easy to implement.

Description from SAP note:

https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=974481

a) dc.nameLength:


Example 1: removing all attributes with name longer than 20 characters

  name: dc.nameLength

  value: 20

When the original message contains any attribute whose name is longer than 20 characters, those attributes are removed.

b) dc.valueLength: Values that exceed this value are deleted.

Thanks

Amit Srivastava

sowmya_krishna
Explorer
0 Kudos

Hi Amit,

We have achieved the requirement using java mapping fo which we need to configure ESR. Thannks for the reply. If have details on renaming file through OS commands for windows server , please share.

Answers (2)

Answers (2)

Bhargavakrishna
Active Contributor
0 Kudos

Hi Sowmya,

Refer this link for the same query..

http://scn.sap.com/message/5854463

Regards

Bhargava krishna

iaki_vila
Active Contributor
0 Kudos

Hi Sowmya,

You can use dynamic configuration in the message mapping or rename with SO command. Check this thread http://scn.sap.com/thread/1609007

Regards.