cancel
Showing results for 
Search instead for 
Did you mean: 

How can I handle the EDI_DC40 segment in transport process? Urgent!!

Former Member
0 Kudos

Hi,

my scenrio: File -> PI -> IDoc.

In IDoc Receiver CC the indicators: Apply Control Record Values from Payload, is actived.

Im Mapping the segment EDI_DC40 is also filled. The fields SNDPRN and RCVPRN are mapped via a UDF to get file name.

So far so good.

During transport I meet problem.

The segment EDI_DC40 is set with ALE information of test systems. After transport the segment EDI_DC40 in productive system has also the same ALE information of test systems and the design objects in product system are not allowed to be changed.

It is not good!

How can I deal with this case? At first I change ALE data to productive Systems, then transport them? After transport I change them back to test systems? It is so troublesome.

Anyone has good suggestions?

Thanks and Regards

Rene

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello Rene,

You can simply get the system name from system properties by using udf and use that as a key field to identify.

-


String SIDNum = '""

String SIDNum = System.getProperty("SAPSYSTEMNAME");

String RecvPort = null ;

if (SIDNum.compareTo("ABC") == 0)

RecvPort ="SAPABC";

else if (SIDNum.compareTo("BCD") == 0)

RecvPort ="SAPBCD";

.

.

.

.

return RecvPort;

-


like this you can achive the details without depending on source information.

rgds

Mahesh

Edited by: Umamahesh Chintam on Oct 5, 2011 12:15 PM

Answers (5)

Answers (5)

Former Member
0 Kudos

hi, everyone,

thank you for your contribution!

I solved this problem with a UDF as below:

String SIDNum = System.getProperty("SAPSYSTEMNAME");

String senderPort = null;

if (SIDNum.compareTo("DEV")==0)

senderPort = "XIDEV";

if (SIDNum.compareTo("PROD")==0)

senderPort="XIPROD";

return senderPort;

However this is not end. I'd like to share my experiences here:

1. centrol function libery for UDF would be availble from PI7.1.

2. Actually there is a stand function in Constant: sender and receiver. It works also fine without UDF.

Regards

Rene

Former Member
0 Kudos

Hi,

my colleague told me that it maybe a alternative solution by using import parameters.

In message mapping there is a tab "Signature". There you can define import parameter and use those import parameters in the mapping.

Then in operating mapping you can put those parameter in the binding of the mapping programs. you assign valures to the parameters in teh interface determination ditor in the integration directory.

I have not tried. Perhaps it is also a helpful information for you.

Regards

Rene

anupam_ghosh2
Active Contributor
0 Kudos

Hi Rene,

I never tried this signature tab feature. But you are going to set this parameter values then , I think you need to set them separately for test and for production, since they will vary with environment. But if you use the method given by Mahesh, myself or the filename with "prod" attachment (as suggested by you), the EDIDC parameters will be set dynamically. You need not alter or set any values separately for test or production env.

Here is the UDF in case you are determining the value from source directory

 
public String getDirName(Container container){ 
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); 

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory"); 

String ourSourceDirName = conf.get(key); 

String sndprn; 
// say source dir is    /usr/test/inbound
if(ourSourceDirName.indexOf("test")>=0) 
{ 
      sndprn="XYZ"; 
} 

// say source dir is    /usr/prod/inbound

else if(ourSourceDirName.indexOf("prod")>=0) 
{ 
      sndprn="ABC"; 
} 


return sndprn; 
} 

Map this UDF to "SNDPRN" field of target XML.

Ensure the following events

1. Sender Communication Channel has ASMA properties and Directory ticked

2. UDF has no input as variable

I am just sharing my thoughts, and also I am not aware of signature tab(i am working in PI 7.0).

regards

Anupam

Edited by: anupamsap on Oct 5, 2011 2:36 PM

Former Member
0 Kudos

hi Rene,

Can you please type in what has been used in your udf?

Probably you just need to adjust the udf to accept different systems based on the criteria that you are using.

like for example :-

-


String Receiver="";

java.util.Map map;

map = container.getTransformationParameters();

// get value of header field by using variable key

Receiver = (String) map.get(StreamTransformationConstants.RECEIVER_SERVICE);

if (Receiver.equals("DEV system name")){

SNDPRN ="X1DCLT40";

RCVPRN = "S0D010";

}

else if (Receiver.equals("PROD system name"))

{

SNDPRN ="X1PCLT90";

RCVPRN = "S0P010";

}

-


Edited by: NinuPSankar on Oct 5, 2011 11:28 AM

Former Member
0 Kudos

Hi, Ninu,

thank u for your answer! 2 point for u!

But what is this Receiver_Service?

This UDF can give several fields values at same time?

Regards

Rene

anupam_ghosh2
Active Contributor
0 Kudos

Hi Rene,

Generally the values of SNDPRN,SNDPRT, RCVPRN and RCVPRT are same for both test and production systems. In your case you say they are different. In many cases the values of the above mentioned fields are obtained by value mapping or hardcoded in the scenario. I was not able to understand this statement "The fields SNDPRN and RCVPRN are mapped via a UDF to get file name". Are you determining these field values using an UDF? Then you need to identify, the server whether its test or development by the name of source directory from where file is being picked up. U need to set the ASMA properties to directory and use the directory name to determine values of the above mentioned fields.

Anyways if you have authorization to alter Mapping in production enviornment. The you can certainly alter the values after the transfer is over, by this way you do not disturb a scenario which is running successfully in test enviornment. In case you do not ahve authorization in production to do any changes, then alter the values in test env and then proceed with transfer. Once transfer is complete you can reset the values in test env.

regards

Anupam

Former Member
0 Kudos

Hi, Anupam,

thank you for your hints too! also 2 points for you.

I just ask customer to give more feature in source files, i.e. "prod" character chain in file name to identify productive data, so that I can put the corresponding ALE value to sender and receiver in EDI_DC40 segment.

Regards

Rene

Former Member
0 Kudos

Hi,

use either value mapping or pass the receiver value(via receiver constant function) to the rcvpor..so that receiver system value will be substituted in the receiver port and soon...

HTH

Rajesh