cancel
Showing results for 
Search instead for 
Did you mean: 

Target Filename generation - receiver proxy.

Former Member
0 Kudos

Hi,

I need to create target filename same as source filename. When receiver communication channel is proxy. Communication channel.

Thanks,

Venu.

Accepted Solutions (0)

Answers (2)

Answers (2)

moorthy
Active Contributor
0 Kudos

Hi,

Is your Receiver is Proxy ? Is it ABAP proxy ?

You can write a logic inside the proxy code to create a file with same name as in the source file.

Because in proxy , you are not generating file immeadiately, you are just calling a proxy method from XI with data, and your logic to process the data will be inside the proxy method. So you can handle this over there.

But why can't you use file adapter ?

Using Adapter Speicific Identifiers, you can achieve this.

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

Regards,

Moorthy

Former Member
0 Kudos

Hi Venu,

Can you pls elaborate your scenario??

R u trying to pick a file and post the data using a inbound proxy into your R/3 system. Then whats the role you are planning to have for the file name.

Cheers

JK

Former Member
0 Kudos

sorry for confusion.

I'm passing the data to sap through proxy .there i'm doing some validations.

I'm creating file with the data passed to sap.

Here the filename should be the same as the sender filename.

Former Member
0 Kudos

Venu,

So the flow will be like,

Step1: file->proxy(with some validation)

Step2: based on the validation from the step1 trigger an outbound proxy and create the file.

For this you need to use the module in your sender file adapter and then pass it as an extra field in the payload...this field you'll be maintaining in your source and target structure of your step1.

Now this file name will be available in your inbound proxy, do the validation and send it in the outbound proxy structure(which again will have the node to hold the file name).

In the step2 as the last part in the receiver file adapter use variable substitution.

This will hold good if you are using XI throughout. If you are not using step 2 still you can use module to get the file name and pass it to the proxy data and in ABAP code, you can use OPEN DATASET command(check for its syntax) and create the file in the R/3 server application layer.

cheers

JK

former_member206604
Active Contributor
0 Kudos

Hi,

You can use Adapter specific message parameters to access the File name and use Variable substitution for saving the file.

Thanks,

Prakash

bhavesh_kantilal
Active Contributor
0 Kudos

Venu,

To get the Source File name and and appned the date to it, you can use Adapter Specific Identtifers -- File Name in the Sender and receiver file adapter and in the message mapping, set the file name using this code,

String newfilename="";

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

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

// Get Sourcefilename

String oldfilename=conf.get(key);

//append sourcedateL

String nwfilename=oldfilename;

conf.put(key, newfilename);

Regards,

Bhavesh

Regards,

Bhavesh

former_member206604
Active Contributor
0 Kudos

Hi,

Refer this blog by Michal

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

Thanks,

Prakash