Skip to Content
0

Passthrough Scenario in SAP PI

Apr 05, 2017 at 12:27 PM

206

avatar image

Hi Experts ,

I am having one requirement , just simple pass through scenario need to pick the files from application server to FTP server .

Here the actual problem is I am getting file name :

SBI<Space>Bank<space> Payment_20170316_RXEZ.sta in this file name I am having white spaces , I want to replace this white spaces with underscore and the file output should be SBI_Bank_Payment_20170316_RXEZ.sta .

Can anybody suggest how we can resolve this issue.

Thanks in advance .

Shiva.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Iñaki Vila Apr 07, 2017 at 05:59 AM
1

Hi Shiva,

Why not to use a linux command on the application server before to take the file and rename it?, check this thread http://stackoverflow.com/questions/1806868/linux-replacing-spaces-in-the-file-names

Regards

Show 3 Share
10 |10000 characters needed characters left characters exceeded

In addition to Inaki's answer: you should perform this action in receiver adapter using option "Execute OS command after message processing" because OS command before message processing in sender adapter is actually executed after the source file is picked up by adapter and before it's sent to messaging system.

Regards, Evgeniy.

0

Hi Inaki Vila ,

Thanks for your inputs but business department wants to do this functionality through PI.

Thanks,

Shiva

0

Hi Shiva,

The funcitionality in my recommendation or the Eugeniy one is in PI, in PI you can execute a OS command, in the PI OS.

Regards.

1
Pavan Dogiparthy Apr 05, 2017 at 06:55 PM
0

Hi Shiva,

Please refer below blog use change mode give the older value as SBI<Space>Bank<space> and new value as SBI_Bank_

and also make sure deploy the sda file in the server to use the dynamic attribute change bean.

https://blogs.sap.com/2015/02/05/dynamicattributechangebean-the-no-mapping-solution-to-changing-dynamic-configuration-dynamically/

Regards

Pavan Kumar D

Show 7 Share
10 |10000 characters needed characters left characters exceeded

Hi Pavan ,

Thanks for your replay .

Can you tell me how to maintain SDA file in server step by step ..

Thanks

Venkatesh

0

Ask your basis team to do that

Regards

pavan

0

I already contacted , we have limited BASIS team members , they don't have Idea about it .

Apart from this module configuration , is any approaches are available Pavan ??

Thanks ,

Shiva

0

Hi Shiva,

You can try to use one to one mapping with the below UDF to achieve the result. (Assuming your scenario is File to File)

UDF : (Type: Single Values, No Input parameters required, It returns the File Name as output).

Map the UDF output to header field(or any desired field) of target structure in MM.

UDF Code

String File_Name = new String();
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey object = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
File_Name = conf.get(object);
File_Name = File_Name.replaceAll(" +", "_");
conf.put(object,File_Name);

return (File_Name);

Please ensure the ASMA property in checked in the sender and receiver channels.

Regards

Baski

0

Hi Shiva!

You don't need to deploy any SDA files on your server. You should only deploy module's .ear file on java server and you can do it using NWDS.

Regards, Evgeniy.

1

Hi Evgeniy

Can you tell how to add this modules's .ear file on java server through NWDS , any references links for me ??

Thanks ,

Shiva

0

Hi Baski ,

Thanks for your inputs , but this is simple file pass through scenario , no UDF preferred.

Thanks

Shiva

0
Evgeniy Kolmakov Apr 07, 2017 at 01:15 PM
0
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Evgeniy ,

Thanks for your response , I will check with my BASIS team , if it will works I will accept your suggestion.

Thanks ,

Shiva

0