cancel
Showing results for 
Search instead for 
Did you mean: 

Mail to proxy scenario with condition

Former Member
0 Kudos

Hi Experts,

I am using mail to proxy scenario.

The mail box is having differnt files suppose:

BOOKING_REF_DELIVERYNO_WB.pdf

BOOKING_REF_SALESORDER_WB.PDF

BOOKING_REF_CUSDECNO_WB.PDF

DELIVERYNO_WB.pdf

SALESORDER_WB.PDF

CUSDECNO_WB.PDF

BOOKING_REF_WB.pdf

-


BOOKING_REF_DELIVERYNO_BOLCOPY.PDF

BOOKING_REF_SALESORDER_BOLCOPY.PDF

BOOKING_REF_CUSDECNO_BOLCOPY.PDF

BOOKING_REF_BOLCOPY.PDF

DELIEVERYNO_BOLCOPY.PDF

CUSDECNO_BOLCOPY.PDF

SALESORDER_BOLCOPY.PDF

-


BOOKING_REF_AWB.PDF*

DELIVERYNO_AWB.PDF

SALESORDER_AWB.PDF

CUSDECNO_AWB.PDF

-


Depending upon the file name in the mail box, the file needs to be attached via proxy with particular code:(x for case 1, y for case 2 , z for case 3)..for attachment abap code wrtiiten for proxy.

how to compare the file name from the mail?

DO i need to write a UDF..mapped with filename field of the sender XSD?How to do that?

Please suggest.

Thanks,

Sushama

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

in your target msg structure, create a field for filename........in msg mapping, fill this field by a UDF and getting source filename by using DynamicConfiguration.....then in proxy implementation, just see the filename and use the code which needs to be invoked using if then else statements.........

Former Member
0 Kudos

Hi Rajeev,

Thanks for the inputs.

Target structure is having the file name fileld.

Please elaborate how to check the file name in dynamic configuration.

Thanks,

Sushama

former_member207622
Contributor
0 Kudos

Hi Sushama ,

Please folow this link to get the dynamic configuration code ,which you have to use to create UDf and map it to target file name field

In run time the filename from source will be passed to that field

IN proxy you can put conditions on fieldname to check which code to invoke

regards

Ninad

Former Member
0 Kudos

Hi,

create a UDF and use below code:

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

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

String strFileName = conf.get(key);

return strFileName;

and map this UDF to target field for filename........

Former Member
0 Kudos

Hi Ninad,

Thanks.

String file = ( TableName );

conf.put(key, file);

not sure why table name is used?

please suggest..

Reg,

Sushama

former_member207622
Contributor
0 Kudos

You can use the other UDF

public String Get_Input_File_Name(Container container) throws StreamTransformationException

{

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

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

String SourceFileName = conf.get(key);

return SourceFileName;

}

the previous one was for XI 3.0 , may be some differnt requiement I am not sure.

http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm

regards

Ninad

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos
I am using mail to proxy scenario.

how to compare the file name from the mail?

What is the scenario exactly? Is it FILE to PROXY or MAIL to PROXY?

I have no idea if ASMA parameter of FILE Adapter (FileName) going to help in case of MAIL to PROXY Scenario.

Depending upon the file name in the mail box, the file needs to be attached via proxy with particular code:(x for case 1, y for case 2 , z for case 3)..for attachment abap code wrtiiten for proxy.
DO i need to write a UDF..mapped with filename field of the sender XSD?How to do that?

Check Stefan's reply and Salil's code from this thread:

Regards,

Abhishek.