on 10-15-2010 3:45 PM
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
This is not possible
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.