cancel
Showing results for 
Search instead for 
Did you mean: 

RFC to File Scenario

raviteja_satuluri
Contributor
0 Kudos

Hi Experts,

We have one Requirement that is RFC to File Scenario.

This is a straightforward interface which gets data from SAP and sends it to Target server .

File Name will be in the following format PARENT-<Actual Shipment Number >-Dyy-mm-dd-Hhh-mm-ss.txt

Where Actual shipment Number can be obtained from X field , D is date in YMD, and H is time in HMS.

Y will be in the following format “D3B1R2166271” where 3B1R2 is the Z Field  and 166271 is the shipment Number.

So each file name will be unique.

This will be done through dynamic meta object.

       

If Y is like D3B1R266271 output file name will be PARENT_66271_D11-05-12-H14-40-00.txt.

Please help on this

Regards,

Kamal.

Accepted Solutions (1)

Accepted Solutions (1)

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Kamal,

Use the below udf code. The input parameters to the udf are Y(of the format D3B1R266271) & currentdate DATE function as below. Map the output of the udf to the Root node of the target message.

'D'yy-MM-dd-'H'hh-mm-ss

udf code:

DynamicConfiguration dc = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

String fname = "PARENT_" + shipnum[0].substring(6) + "_" + date[0] + ".txt";

dc.put(dck,fname);

result.addValue(fname);

Try end to end testing and let me know if you face any issues.

Regards

raviteja_satuluri
Contributor
0 Kudos

Hi Vishnu,

Thanks for your quick reply.

I will Test and approach you if any issues.

Thanks and Regards,

Kamal S.

Answers (1)

Answers (1)

former_member186851
Active Contributor
0 Kudos

Hello Kamal,

Use dyanmic file name UDF and enable adapter specific attributes->filename in the receiver channel

http://wiki.scn.sap.com/wiki/display/XI/Dynamic+file+name+and+directory+in+Receiver+File+Adapter+-+s...

give constant ' parent' + X field + date(in the required format)as input to this UDF.

let me know if you face any difficulities