cancel
Showing results for 
Search instead for 
Did you mean: 

Generating IDOC number along with file name dyanmically

former_member601528
Participant
0 Kudos

Hi All,

I have a IDoc to File scenario and the output file requirement is bit tricky.

output file should be " Name_IDocNumber_TimeStamp.txt "

Can any one tell me the logic code to write the UDF and how to handle it in message mapping for this type of requirement.And can any one share me the related documentation on this requirement, and please tell me, how to define the parameters in the UDF.

Thanks,

Aravind


Accepted Solutions (0)

Answers (3)

Answers (3)

former_member601528
Participant
0 Kudos

Hi All,

I used the variable substitution method and i got the result. thanks to all

zameerf
Contributor
0 Kudos

Hi,

In addition, you have to map the above UDF output to the root node of the target message.

Regards,

Zameer

rajasekhar_reddy14
Active Contributor
0 Kudos

This is not tricky requirement,

Use below dynmic configuration UDF and var1 is input to UDF,var1=IDoc number.

In File receiver chanel, ASMA propoerties enable File Name.

Date currentDate = new Date();
      DateFormat df = new SimpleDateFormat("yyMMddHHmmss");
      String date = df.format(currentDate);
         String FileName= "FileName_" +var1+"_"+date;

/* Using Dynamic Configuration */


DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
conf.put(key, FileName);

Thank you,

Raj