Blog Archive

Thursday, December 13, 2012

SAP PI ABAP Proxy Outbound settings, Triggering message to SAP PI(When many sap pi systems)

Scenario : SRM ->XI( VIA : Abap Proxy)
First we need to create Rfc destination(H type) to SAP PI.( Action Required in Sender system SRM/ECC)
Use this Rfc destination in *** image as shown below.

Note: 1.Suppose we want to send message to Multiple SAP PI system, then we need Multiple number H type rfc destination in SAP ECC/SRM system.( Like this we are identifying the our target sap pi system)
2. How to identify specific interface in sap pi( Triggering message to particular interface in sap pi). For this we have to specify the Outbound Service interface details as shown in 2nd Image

Tcode: SXMB_ADMIN (or) SXMB_ADM (in ECC system, e.g., XYZ,125)
Maintain the required Outbound interface details as sender ID 

Maintain Integration Engine configuration in ECC system (e.g., PDE 125)


Now test the outbound abap proxy using SPROXY tcode.

Check in SXMB_MONI in ECC system (e.g., PDE  or XYZ)

The trace indicates that it used specific configuration and hence the message going to IDS XI system. Verify the same in IDS moni.

Now let us remove the entry from SXMB_ADM and test it. It should use global configuration and the message should go to IDV

Check in SXMB_MONI in ECC system (e.g., PDE). It indicates that the message goes to IDV using global configuration. Verify the message in IDV moni.

Check in SXMB_MONI in ECC system (e.g., PDE). It indicates that the message goes to IDV using global configuration. Verify the message in IDV moni.

Wednesday, December 5, 2012

IDoc xml to Idoc flat convertion with module : IDOC_ERROR_PARSE_FAILURE: Invalid character encountered within IDocXML for type

idoc xml to flat conversion Error info at AAE as follows

1. Error we faced before change of mapping.( message display tool)

2.Before and after mapping change as follows

Saturday, December 1, 2012

SAP PI Migration Testing IDoc scenarios in New development from existing production

Outbound Scenarios ( SAP ECC/R3 -> SAP XI->XYZ)
Retesting Production(SAP PI) Idoc, Gathered payload from SXMB_MONI.

1. Gather payload from sxmb_moni( idoc payload from sxmb_moni) save this in your local directory. 

2.        Create the XML file port as follows in ECC system. (Transaction WE21)

1.       Copy the XML file for IDoc to local system and change the partner profile parameters.

1.       Go to transaction CG3Z and upload the file to tmp directory.

  Click on Transfer File, go to transaction AL11 to check the uploaded file.

1.       Go to transaction WE16 and enter the details related to file and port.

1.       Click on execute and should get successful message.

1.       Go to transaction WE02, identify the IDoc based on the message type and check the status. It should be in inbound IDoc.

1.       Go to Transaction WE19 with IDoc number retrieved, check the control record and trigger outbound processing.

1.       Log on to PI system to check the message process successfully.

Special settings (when we have condition in Receiver Determination in routing, Idoc field based condition)

Not able to execute remote RFC via SAP PI from SAP ECC system

While executing remote RFC from sender SAP System getting following error due to
 Text: USER XXXX has no Rfc authorization for function for function group MEWP

Solution:  Need add additional authorization for the above use in SAP PI (SAP PI basis needs to fix this issue)

Idoc are not reachable to SAP PI From sender SAP system


Error in processing caused by:$Exception: (123) JCO_ERROR_FUNCTION_NOT_FOUND: Server repository could not create function template for 'ZBAPI_RENTALS_UPDATE_OUT' caused by:$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: User RFC_IDS001 has no RFC authorization for function group SDIF . (raised by system BD4(system id)|xxxxxx(server))

(Note: success status in we02/05 , but error in sm58 log)

solution from Basis:

PI basis need to grant this user(what ever we used in rfc detination) access to  SDIF authorisation group in SAP PI

More information:

Wednesday, October 31, 2012

SecureStorageRuntimeInterface api for XI message mapping

In my one of the support project, I have found one udf in message mapping,

they are using SecureStorageRuntimeInterface

After analyzing this code, i have identified, this is used to store the required parameters( when we execute message mapping , by required parameters, it stores internally and uses these values at run time). No need to send these values again at run time.

In our migration project, we disabled this logic, used Message mapping parameterized 

Sample code: for this UDF

public String SecureStorageObjectHandler(String ObjectID, String ObjectValue, String Action, Container container) throws StreamTransformationException{
Object o;
String myObjectRet = "Init";
AbstractTrace trace = container.getTrace();
try {
javax.naming.Context ctx = new javax.naming.InitialContext();
o = (Object) ctx.lookup("tc~sec~securestorage~service");
SecureStorageRuntimeInterface secStore = (SecureStorageRuntimeInterface) o;
//Continue with implementation
RemoteSecureStorageClientContextInterface myContext = secStore.getSecureStorageClientContext();
trace.addInfo("Check Action");
if (Action.equals("SET")) {
trace.addInfo("Store Object");
//Store an object
myContext.storeObject(ObjectValue, ObjectID); 
myObjectRet = ObjectValue +"/"+ ObjectID;
trace.addInfo(ObjectValue +"/"+ ObjectID);
else {
myObjectRet = "Retreive Object";
//Retrieve an object
String myObject = (String) myContext.retrieveObject(ObjectID);
myObjectRet = myObject; 
} catch (RemoteException e1) {
// TODO Auto-generated catch block
throw  new RuntimeException( "RemoteException " + e1.getMessage());

} catch (ObjectStorageException e1) {
// TODO Auto-generated catch block
throw  new RuntimeException( "ObjectStorageException " + e1.getMessage());

} catch (ObjectRetrievalException e1) {
// TODO Auto-generated catch block
throw  new RuntimeException( "ObjectRetrievalException " + e1.getMessage());

} catch (NamingException e1) {
// TODO Auto-generated catch block
throw  new RuntimeException( "NamingException " + e1.getMessage());


return myObjectRet;


Tuesday, September 25, 2012

Difference between removes context and collapse context , UseOneAsMany Node fucntion

Understanding behavior of UserOneAsMany Nodefucntion

Difference between removes context and collapse context

Changing the context of field causes disappear of suppress values

we can see the suppress values for same values, when do not change context of the field 

 The below diagram shows, there is no difference in-between removescontext and Collapse context

Below examples show exact functionality of Collapse context

understanding this some more example

Understanding statistic standard functions with message mapping variables

Understanding Behavior of statistical functions with graphical variables

Observe the sequence of some input values and with some suppress values and how Index generated values  for target.

Observe the sequence of some input values and with some suppress values and how count generated values for target

Observer the input values with some suppress value.

Tuesday, September 18, 2012

SAP PI mapping, Create target node when sender field is suppress

Create target node( receiver xml structure). when ever source field is suppress.


use the Node function mapwithDefault to check the existence of suppress or not.
assign some default value and check that value in the with same constant(same value mentioned in mapwithDefault).

For more information on complex mappings refer,

Monday, August 6, 2012

XI Production error due to service patch difference in Quality and production.

Problem: code executes properly in production and but not in quality  systems.
Solution: end of the page.


Because of some reasons, Our production maintains low service patch than Quality.

By using java code in mapping, We are trying to get run time parameters of XI system.

this runtime behavior is different with different service patch of Quality and production.  Initially we have done lot of analysis to find the reason.

Before mapping in Quality/production

After mapping in Quality(mapping executed at runtime)

After mapping in Production.( mapping executed at runtime)

Jave code used in message mapping( UDF)

Using UDF in message mapping.

Runtime values of soap envlope in Quality and production

Service patch difference in Quality and Production.

SAP solutions on this.

SAP note number: 1552537

Solution: For testing purpose, we have modified java code in quality. but not transported this change into production.

Planned to move this change , when ever service patch upgrade in production.

;-)  P. Deviprasad.