cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic File Name with PayloadSwapBean

Former Member
0 Kudos

I’ve  created an abap proxy with a small schema containing PO and PO_Line with an attachment that is a zipped PDF file (.zip).


I have configured a File adapter with the payloadswapbean to place the attached .zip file in an FTP folder.  Now I need to dynamically name the .zip file using the proxy payload values.


<PONUM>_ <POLine>.zip


Variable Substitution takes place after the payload has been swapped so I am not able to use that.  How can I take my proxy XML payload and dynamically create the file name?  I have tried DynamicConfigurationBean but it seems to come back null when trying to read the XI FileName:


Write http://sap.com/xi/XI/System/XI FileName I have flagged the Adapter Specific Message Attributes for FileName.


What options do I have?

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

Hi George,

You can use Dynamic Configuration UDF code to set ASMA FileName parameter for FTP in message mapping program. Search SDN for UDF code

Use the below UDF between source proxy field having filename and target top most node


try{
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);


DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

conf.put(KEY_FILENAME, var1); //var1 from proxy payload field


}

catch(Exception e){//Do some action if required}

return "1";

Regards,

Praveen Gujjeti

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Praveen / Abhradeep! Used the UDF to set the ASMA filename and it worked just fine.  This was the first time our shop used this function.

abhradeepbasu
Participant
0 Kudos

Hi George,

Don't go for Variable substitution.

Use Dynamic configuration as suggested by Praveen and make sure you are calling the module in right sequence of manner.

/A.B