cancel
Showing results for 
Search instead for 
Did you mean: 

Replicate the value from request to response

Former Member
0 Kudos

I have the following scenario,

.NET<>PI<>ECC

the request is a HTTP request which will have material number, PI will get that and fetch the related details through a BAPI from ECC and returns the response back, but the BAPI doesn't returns the material number, how can i pass the material number came in the request to the response as i could not map directly. The mapping is as follows

Request-->BAPI

BAPI.Response-->Response

Let me know how to do it.

Thanks,

Prabu

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

This is not possible

Former Member
0 Kudos

There should be some way out.

I am working on PI 7.11

Any suggestions will be appreciated and rewarded

Thanks,

Prabu

stefan_grube
Active Contributor
0 Kudos

Write an ABAP proxy wrapper for your BAPI, then you can send the mat number back in response.

Former Member
0 Kudos

Hello Prabu,

Out of the box there's no option to store data between synchronous request/responses so far.

However it's not impossible but will require additional development effort.

I think in general there are 3 opts for that:

1.) Go for the option Stefan advised in writing an ABAP Proxy or z rfc around the BAPI to hold the data and reply

it back in the response. However this sometimes is not an option as PI Developers sometimes don't have the option to change

integrated systems.

2.) Store the data inside the request mapping into an own storage mechanism (e.g. custom database table, jms queue) and read it back out in the response mapping to add it to your response message. You could use the unique message id and ref to message id to correlate the data exactly, However a little dirty right?

3.) Use an Adapter Module at your RFC adapter that stores the data in supplement data of adapter module API between the request/response.

This mechanism is usable to exchange data between modules in the adapter module chain e.g. of your receiving RFC adapter. For that you d' store data with a module placed in the module chain before the SAP module that executes the RFC and read the data back out in a module placed behind it in the module chain.

As far as i know that was at least possible in 7.0 and i got it working one time.

With best regards

Sebastian

Former Member
0 Kudos

Thanks for your brief suggestions.

The 3rd option sounds good than the other two.

Could you please explain how to do this as there are how-to s only for using the variable in the filename (ASMA) .

Thanks,

Prabu

Former Member
0 Kudos

Hello Prabu,

I' ve just looked up how i did this back then, its possible the way i described on the third option.

However there's a way smarter option with usage of Dynamic Configuration Attributes, which saves you from

developing any custom adapter module.

Write one user defined function that sets a dynamic attribute in the request mapping.

Write another user defined fucntion that reads the dynamic attribute in the response mapping.

This enables you to save a value existing in your request message and use it later in your response message

with the response mapping.

It works for the traditional "XI" Configuration (strangly not in an Integrated Configuration).

Code for setting a dyn config (Here i used XHeaderName of SOAP)

public String setDynConfig(String var1, 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/SOAP", "XHeaderName1" );
 

if ( conf != null){
  conf.put(key, var1);
}
}
catch (Exception ex)
{
	;
}
return var1;
}

Code for reading a dyn config (Here i used XHeaderName of SOAP)

public String readDynamicConfig(Container container) throws StreamTransformationException{
String var1 = "default";
try
{
// set to dynamic config:
DynamicConfiguration conf = (DynamicConfiguration) container .getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP", "XHeaderName1" );
 

if ( conf != null){
var1 =  conf.get(key);
}
}
catch (Exception ex)
{
	;
}
}

With best regards

Sebastian

Former Member
0 Kudos

Thank you Sebastian, it worked.

Prabu

Answers (0)