cancel
Showing results for 
Search instead for 
Did you mean: 

Adapter Module Question

Former Member
0 Kudos

Hi,

I would like to know if we can access the value of the "Source Directory" that we define in the sender communication channel within an adapter module on the same side

Helpful answers will be rewarded.

Thanks

krishna

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I have found a solution to this based on the info given in the following blog on Dynamic Configuration.

/people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules

The previous idea was to get from the data from the hash table but actually the info like "Directory", "FtpHost" etc are set as dynamic cinfiguration parameters in the cm channel. This info can be viewed within sxmb_moni.

So, actually , we have to invoke the getMessageProperty() method of the message to access the dynamic configuration info like

sourceDirectory = msg.getMessageProperty("http://sap.com/xi/XI/System/File","Directory");

to retrieve the Directory value.

Thanks and Regards.

Krishna

Former Member
0 Kudos

Hi bhavesh.

Thanks for pointing out the related OSS note.

But as mentioned in another similar thread, the hastable has only 2 entries ,namely, FileName and File Completed. I also verified the same.

So, how can i get hold of the "Source Directory Name" .

An exact answer will be rewarded 10 points.

Thanks and REgards

krishna

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

To access the Adapter Specific Message Attributes inside the Adapter Module ( FileName , File Directory etc ), you need to refer in the note : 819761

It Provides you the sample code as well.

public ModuleData process(ModuleContext mc, ModuleData md) throws

ModuleException

{

[...]

Hashtable mp = (Hashtable)

md.getSupplementalData("module.parameters");

String fileName = null;

if (mp != null)

fileName = (String) mp.get("FileName");

[...]

}

Regards

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

use this code for the directory,

public ModuleData process(ModuleContext mc, ModuleData md) throws

ModuleException

{

[...]

Hashtable mp = (Hashtable)

md.getSupplementalData("module.parameters");

String fileDirectory = null;

if (mp != null)

fileDirectory = (String) mp.get("Directory");

[...]

}

This will work for the directory,

You need to give the technical name of the Adapter Specific Identifiers.

The list of technical names are at the ned of this link,

http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm

Regards

Bhavesh