Skip to end of metadata
Go to start of metadata

Dynamic Configuration in Java Mapping

import com.sap.aii.mapping.api.*;

import java.io.InputStream;

import java.io.OutputStream;

import java.util.HashMap;

import java.util.Map;

 

public class DynamicConfInJavaMapping

    implements StreamTransformation

{

 

    public DynamicConfInJavaMapping()

    {

    }

 

    public void setParameter(Map map)

    {
        param = map;
        if(param == null)
            param = new HashMap();
    } 

    public void execute(InputStream inputstream, OutputStream outputstream)

    {

 

        try

        {   //The following is for the FileName in the File Adapter
            DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");
            DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
            String MyFileName = dynamicconfiguration.get(key);
 
	    //All other Mapping logic here
 
        }        catch(Throwable throwable)

        {
            throwable.printStackTrace();
        }    }

 

    private Map param;

}


Dynamic Configuration in ABAP Mapping

data: l_dyn_record type MPP_DYNAMIC.

 

l_dyn_record-namespace = 'http://sap.com/xi/XI/System/File'.

l_dyn_record-name = 'FileName'.

l_dyn_record-value = '<file name here>'.

 

CALL METHOD dynamic_configuration->add_record

  EXPORTING

    record = l_dyn_record.