cancel
Showing results for 
Search instead for 
Did you mean: 

To retain the same file name in target(File) that coming from source system(AS2).

0 Kudos

Hi All,

I have a requirement to send the two file from the third party system(GXS) to SAP ECC via SAP PI(version - 7.4). We are using AS2 adapter at the sender side to pick the file and using File Adapter to place the file in ECC.

Its a pass through scenarion(No ESR part is used).

Requirement:

We are going to get 2 files ->Example:  one from Axis and another one from ICICI -> each bank file will have a file name ->

We have to post the file at the target system with the same name as source file name, the source file name could come dynamically(with diff time stamp).

Please let me know, Is it possible to achieve the above requirement(we have to retain the file name in target that coming from source system) with Sender AS2 adapter, If yes then please suggest the best approach.

Regards,

Pradeep Bawlia

Accepted Solutions (1)

Accepted Solutions (1)

gagandeep_batra
Active Contributor
0 Kudos
0 Kudos

Hi Gagan,

I don't find any information related to our requirement in the above given link by you.

Former Member
0 Kudos

Hi Pradeep,

  I guess the "File Name Preservation with MDN" will work for your requirement. As stated in that link it preserves the filename of the AS2 document.

You need to enable ASMA parameters in the receiver file channel. If that doesn't work, then you might have to go for Dynamic Configuration UDF in message mapping.

Hope this helps.

Regards

Charan

0 Kudos

Hi Charan,

I checked with above parameter in AS2 sender channel but its not working...

and i could not use the Dynamic configuration UDF in MM because its a pass through scenario - no mapping.

Please suggest, is it possible to acheive the above functionality with AS2 adapter at sender side(AS2 B2B addons provided by SAP).

0 Kudos

Hi Guys,

The above requirement is solved now.

Solution - I used java mapping for extracting the same source file name and assignning the same to the target system.

Code:

public class ExtractFileName_ASMA extends AbstractTransformation{


public void transform(TransformationInput in, TransformationOutput out) throws StreamTransformationException  


   {


DynamicConfiguration conf=in.getDynamicConfiguration();


DynamicConfigurationKey key_AS2FileNmae = DynamicConfigurationKey.create("http://sap.com/xi/XI/AS2/AS2", "AS2Filename");


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


String As2FileName=conf.get(key_AS2FileNmae);


conf.put(key_FileNmae, As2FileName);


try{


byte b[]=new byte[in.getInputPayload().getInputStream().available()];


in.getInputPayload().getInputStream().read(b);


out.getOutputPayload().getOutputStream().write(b);


}


catch(Exception e)


{


}

2. Another solution we can use the graphical mapping and need to use the dynamic config UDF at mapping level to acheive this requirement but here is one drawback - we need to do content conversion is this case.

In case of Java mapping, no need to play with source file.

WITHOUT USING ESR, WE CAN NOT ACHEIVE THIS REQUIREMENT.

Regards,

Pradeep Bawlia

Answers (1)

Answers (1)

Harish
Active Contributor
0 Kudos

Hi Pradeep,

check the below wiki

AttribMapper - Assign AS2 Filename Dynamically - Process Integration - SCN Wiki

you can use the ASMA parameter in AS2 and receiver File adapter.

regards,

Harish

0 Kudos


Hi Harish,

Thanks for giving the solution, but there is little difference....as per the given link(AttribMapper - Assign AS2 Filename Dynamically - Process Integration - SCN Wiki),  AS2 adapter is used of Seeburger.

But In my case we are using AS2 B2B addons provided by SAP. We have Dynamic configuration option also but want to confirm, as per the wiki - one module paramtere is used to generate the file name in sender AS2.

Please suggest do we need that module parameter in our case also if yes then what it would be for AS2 B2B addons provided by SAP?