cancel
Showing results for 
Search instead for 
Did you mean: 

Control records

former_member193376
Active Contributor
0 Kudos

Hi Guys

Scenario: SOAP to IDOC

PI 7.3

Description : in my control records i am mentioning the port, mes type, idoc type etc etc...

Issue: When i move to quality or production, the port and partner profile will change, is there anyway i can set in dynamically so that i wont have to change it before transporting to quality or prod?

Thanks

SG

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

First you have to remember two points while working on IDoc receiver scenarios

1)Never use Apply control record values from payload option in IDoc communication channel,because it will take the control records values from mapping level,so when even you move object to quality development environment values will come.

2)Dont you take sender/receiver from payload option in IDoc receive option because reason same mentioned above.

to avoid this disable EDI_DC 40 segment at mapping level and don't use above options executed scenario end to end , in this case it will take values from run time.

if you have any issue's let us know..

Regards,

Raj

former_member193376
Active Contributor
0 Kudos

Hi Rajshekar

Can you please elaborate a little more on your statment " it will take the values at runtime"

Thanks

SG

Former Member
0 Kudos

hi,

are you using parties in your flow ?

if not then I'm afraid his solution might not work.

former_member193376
Active Contributor
0 Kudos

No , am not using parties....am using business systems on both ends..

Former Member
0 Kudos

then the best thing is to fill in the control record in the mapping either using value mappings or the UDFs presented before and in the receiver communication channel tick the boxes take control record values from payload.

Answers (6)

Answers (6)

udo_martens
Active Contributor
0 Kudos

Hi SG,

the SAP standard is here to use parties and make use of the party entries in IDoc receiver channel / tab identifiers. If SAP is checks your solution they will complain regarding EDI_DC40-mappings.

From my point of view a mapping makes sense in some cases. It is often more clear to understand and changes of value mapping groups do not take longer time than changes of parties. You should create a UDF fetching your transport layer (as mentioned above in the thread) and store the field values in value mapping groups (for a easy change).

If you go for mapping you have to set the fields:

SNDPOR, SNDPRN, SNDPRT, RCVPOR, RCVPRN, RCVPRT (if required: SNDPFC, RCVPFC)

All other fields are not relevant.

Check on "Take sender / receiver from payload", otherwise the adapter overwrites the values.

Regards,

Udo

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

What i am trying to say is, if you Hard code values at mapping level, then you have to write UDF to check which system based on that you have to pass value.

But this is not a right idea as per my exp

Solution :

Disable EDI_DC40 record in mapping level, and dont use apply control record values,take sender from payload and receiver option. in this case control the information is taken from the configuration in the Integration Directory.

this is the right approch.

Regards,

Raj

former_member193376
Active Contributor
0 Kudos

Hi Raj

Yes your right about the hardcoded values as a udf is required which can be done, but not recommended.

*Description* : we are using the IDoc_AAE (SAP 7.30) on the receiver side. we are testing this SOAP to IDOC scenario from the WSNavigator

*Issue*: when we use the hardcoded values from EDII_DC40 it works fine, but in the Receiver IDOC channel, if we uncheck "APPLY CONTROLS FROM PAYLOAD" its not working, its giving an error and its not taking the port and partner profiles from Integration directory.

*ERROR* : Web service returned error. Fault Code: "(http://schemas.xmlsoap.org/soap/envelope/)Server" Fault String: "Server Error"

HTTP/1.1 500 Internal Server Error

server: SAP NetWeaver Application Server 7.20 / AS Java 7.30

content-type: text/xml; charset=utf-8

date: Tue, 01 Mar 2011 09:45:48 GMT

transfer-encoding: chunked

133c

<?xml version='1.0'?>

<!-- see the documentation -->

<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>

<SOAP:Body>

<SOAP:Fault>

<faultcode>SOAP:Server</faultcode>

<faultstring>Server Error</faultstring>

<detail>

<s:SystemError xmlns:s='http://sap.com/xi/WebService/xi2.0'>

<context>XIAdapter</context>

<code>ADAPTER.JAVA_EXCEPTION</code>

<text><![CDATA[

com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.idoc.exception.IDOCAdapterException: com.sap.aii.af.idoc.exception.IDOCAdapterException: The Configuration for Sender/Receiver Partner Number/Port is incorrect. Enter proper values in Sender/Receiver Component

question : Do i need to do any more settings in the configuration in the Integration Directory other than unchecking the apply control records from payload, apply sender, receiver from payload?

Thanks

SG

rajasekhar_reddy14
Active Contributor
0 Kudos

I never tried using AAE (PI7.3).

Former Member
0 Kudos

can you maybe post the edi_dc40 content of your message here ?

Former Member
0 Kudos

Hi SG ,

Your IDOC is getting failed on PI server itself .So first ensure that the RFC destination you have put in the IDOC communication channel is available in PI server .Go to sm59 and perform a connection test also .

Regards,

Saurabh

Former Member
0 Kudos

Hi,

if your problem didnot solved yet..

check the below blog which informs about the creation of control record value if you don't apply control record values from payload...

/people/rajeshkumar.pasupula/blog/2009/03/16/unable-to-convert-the-sender-service-to-an-ale-logical-system

but this is not for 7.3.. concept will be same i think...

HTH

Rajesh

former_member193376
Active Contributor
0 Kudos

Hi Saurabh

The connection is fine because if i use the control records from payload, it works fine. if i disable EDI_dc40, it gives me the error.

Rajesh,

Thanks, but the blog is not helpfull for 7.3. Appreciate your help.

Thanks

SG

Former Member
0 Kudos

Former Member
0 Kudos

Hi,

You can use ValueMappings..which can ease out this instead of udf ..also if any changes done in future its easy to add/modify the same..

HTH

Rajesh

former_member193376
Active Contributor
0 Kudos

Will try it and update the thread, So i have to use the UDF for all the fields which value will be changing in qual or prod. Correct me if i am wrong.

Thanks

SG

former_member193376
Active Contributor
0 Kudos

Hi Biswajit

Are you sure this code will work, cause i am getting an error.

Thanks

SG

Former Member
0 Kudos

Hi,

One solution would be value mapping in the mapping, that is maintained per system:

check this link [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00ee347e-aabb-2a10-b298-d15a1ebf43c5?quicklink=index&overridelayout=true]

[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e07dd2ae-f783-2c10-9aa6-ca69f67dd20f?quicklink=index&overridelayout=true]

aditionally you can use an udf to return the system where you are Dev/Q/P



// Get SAP system name
String sapSystemName = (String) System.getProperty("SAPSYSTEMNAME");

// Production:
if  ("PRA".equals(sapSystemName) )  return "P"; 
if  ("PR1".equals(sapSystemName) )  return "P"; 
if  ("PR2".equals(sapSystemName) )  return "P"; 

// Quality
if  ("QAA".equals(sapSystemName) )  return "Q"; 
if  ("QA1".equals(sapSystemName) )  return "Q"; 

// Development
if  ("DEV".equals(sapSystemName) )  return "D"; 

// Prototype (indicated as developent)
if  ("SNA".equals(sapSystemName) )  return  "D"; 
if  ("SN1".equals(sapSystemName) )  return  "D"; 

// Runtime environment type unkown -> raise exception
throw new StreamTransformationException("Unknown runtime environment type for system " + sapSystemName);

Note: you need to adapt the UDF to your own sys IDs

Former Member
0 Kudos

Hi,

You just need to write the following simple UDF:

/* Here the only input to this UDF is a constant string which is the control record fieldname present within EDI_DC segment of an IDOC like "IDOCTYPE",

"MSGTYPE" and it will fetch its corresponding values from cache*/


public String getCRField(String name, Container container) throws StreamTransformationException{
 //write your code here
 String content = "";  
  //Fetch the value from cache directly
  content = (String)contents.get(name);
  if (content == null) {
   content = "";
  } 
  importanttrace.addInfo("Mapping Field With Name: " + name + " Value: " + content);
  return content;
  }

Map the output of this UDF to the required field in the target IDoc field.

Hope it helps you buddy!!!

Note: USE THE SAME UDF IN BOTH QUALITY AND PRODUCTION FOR ALL THE FIELDS

Thanks

Biswajit

Edited by: 007biswa on Feb 25, 2011 10:49 PM