cancel
Showing results for 
Search instead for 
Did you mean: 

Read Filename form Adapter-Specific Message Attributes in Java Mapping

Former Member
0 Kudos

Hi,

I have scenario File to Mail adapter. How can i read filename from Adapter-Specific Message Attributes

in java mapping.

Thank you and Best regards

Fernand

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Fernand,

Are u using DOM or SAX parser?

In any case just put the Dynamic config code in the execute function or the other option is to define it as a private functionand call it in the execute,My personal advice would be the former.

Just put this code in ur java mapping

As fellow sdn ers have mentioned there is no need of the container method,just initialise the set param method and use it in the dynamice config code as follows

public class YourClass implements StreamTransformation

{

private Map map;

public void setParameter(Map param)

{

map = param;

}

public void execute(InputStream in, OutputStream out) throws StreamTransformationException

{

{

DynamicConfiguration conf =(DynamicConfiguration) map.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

// read value

File = conf.get(KEY_FILENAME);

..........................

}

Now just call File in the mapping program,

Should help u out

Regards,

Tauseef

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank You Mohd Tauseef.

Former Member
0 Kudos

hi Fernand Lesmana

Java Mapping of Adapter-Specific Message Attributes

http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm

As you would see in the example shown in the link...you donot require a container object in case of java mapping(that is required when you are using the user defined functions)...

reward points if helpfull

regards

kummari