Skip to Content

How to call one field from 1st MM to 2nd Mapping

Hi All,

One of my interface , I am using 2 message mapping under one OM.
First Mapping: PROXY Structure & Web service Request
Second Mapping : Web service Response and IDOC Structure

eg : PROXY Structure
A
B
C
D( this field we are not mapping with web service request)

WebService Request Structure
1A
2B
3C
IDOC Structure
AA
BB
CC
DD

in First Mapping : (Proxy structure and Web service Request)
A---->1A
B---->2B
C---->3C

In Second Mapping (Response from webservice to IDOC structure)

1A(Res)----->AA
2B(Res)----->BB
3C(Res)---->CC
D------------>DD (Now i want to create a IDOC Field DD based PROXY field D..

as per my requirement I wanted to map one PROXY field (say D) to one of IDOC Structure(say DD)

Could anyone suggest me on this ?

Note : In Realtime D is basically a Date which user entered in SAP Screen so same date i want to use in IDOC structure to post the VALID_FROM Date in PMX system.

Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 23 at 06:02 PM

    Hi Prabhat!

    If you're implementing synchronous scenario, you could use UDFs for setting/getting DC attribute in respective mapping, which stores element value and DynamicConfigurationBean in receiver channel to get DC attribute value into variable before request and set back after it.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks for the response..

      Only for webservice call , it is Synch...
      PROXY Request --------->Web service Request(we will get the data from Web service )

      Web service Response ------> IDOC Structure

      Can we achieve for above scenario.. if yes.. Could you please share the sample UDF's for setting/getting DC attribute.

      Thanks,

  • May 24 at 01:01 PM

    Hi Prabhat Singh,

    You can use below udf in "Request Map" to set value in DC var, (this udf requires one input)

    public String set_DynmCnfg(String inputStr, Container container) throws StreamTransformationException{
    try
    {
    	// set to dynamic config:
    	DynamicConfiguration conf = (DynamicConfiguration) container .getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    	DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/", "RequestData_DC" );
    	 if ( conf != null){
    	  conf.put(key, inputStr);
    	}
    }
    catch (Exception ex)
    {
         ;
    }
    return inputStr;
    
    }

    and use below udf in "Response Map" to get value from DC var

    public String get_DynmCnfg(Container container) throws StreamTransformationException{
    String result= "";
    try
    {
    	// Get to dynamic config:
    	DynamicConfiguration conf = (DynamicConfiguration) container .getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    	DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/", "RequestData_DC" );
    	 if ( conf != null){
    	 result= conf.get(key);
    	}
    }
    catch (Exception ex)
    {
         ;
    }
    return result;
    }

    And do not forget to check ASMA option in Sender/Receiver channels under Advanced settings

    Thanks & Regards,

    Dilip

    Add comment
    10|10000 characters needed characters exceeded