cancel
Showing results for 
Search instead for 
Did you mean: 

Java Mapping (not UDF) and Adapter-Specific Message Attributes

Former Member
0 Kudos

Hello everybody,

is it possible to create an Adapter-Specific Message Attributes in a java Mapping?

I found in the SAP Help that the API com.sap.aii.mapping.api.DynamicConfiguration allows only to read, change or delete the attributes.

best regards.

Adnane Elgoute

Accepted Solutions (1)

Accepted Solutions (1)

prasannakrishna_mynam
Contributor
0 Kudos

Hi,

try the follwoing code

import com.sap.aii.mapping.api.*;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
 
public class JavaProgram
    implements StreamTransformation
{
 
    public JavaProgram()
    {
    }
 
    public void setParameter(Map map)
    {
        param = map;
        if(param == null)
            param = new HashMap();
    }
 
    public void execute(InputStream inputstream, OutputStream outputstream)
    {
 
        try
        {
            DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");
            DynamicConfigurationKey dynamicconfigurationkey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
            String s = dynamicconfiguration.get(dynamicconfigurationkey);
 
	    //Your logic
 
        }
        catch(Throwable throwable)
        {
            throwable.printStackTrace();
        }
    }
 
    private Map param;
}

Answers (2)

Answers (2)

Shabarish_Nair
Active Contributor
0 Kudos
Former Member
0 Kudos

Hello Everybody,

thats exactly the link where i didnt found out the answer.

best regards

Shabarish_Nair
Active Contributor
0 Kudos

do have a look at this thread -

it actually has a sample code.

former_member732072
Active Participant
0 Kudos

Hi Adnane,

Please have a look at the following link and see if it helps.

http://help.sap.com/saphelp_nw70/helpdata/en/43/09b16006526e72e10000000a422035/content.htm

Best regards.