cancel
Showing results for 
Search instead for 
Did you mean: 

Regd .Function to be used in UDF to know current system details

Former Member
0 Kudos

Hi experts,

My requirment is like :

I have a source as a Business service(i m picking file from its FTP location) , i need to change the control record values as per the Environment.

Is there any function which i can use in my UDF to get the name of the current environment(Like FXD,FXT,FXU) and other control segment details like sender port etc.

Regards,

Anika

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

FYI~~

import: com.sap.mw.jco


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

if(sysName.equals("XXX"))
{
your logic here
}

Edited by: Shabarish Vijayakumar on Mar 12, 2009 7:05 PM

Edited by: Shabarish Vijayakumar on Mar 12, 2009 7:06 PM

Answers (3)

Answers (3)

Former Member
0 Kudos

HI all,

Thanks for the replies.

I need the following details also to fill the control record of the IDOC.

MANDT - Client#

DOCREL - SAP Release for IDoc

SNDPOR - Sender port (SAP System, external subsystem)

SNDPRT - Partner type of sender

SNDPFC - Partner Function of Sender

SNDPRN - Partner Number of Sender

RCVPOR - Receiver port

RCVPRT - Partner Type of receiver

RCVPFC - Partner function of recipient

RCVPRN - Partner number of recipient.

Any pointers where i can get the functions for getting these values.

Regards,

Anika

Shabarish_Nair
Active Contributor
0 Kudos

these are the mapping runtime constants u can access - http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm

But in your case if you have to fill all that you have mentioned, its better to use predefined fix value or value mapping table and then pass the values.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

also have a look at my blog to see which values from the control

record are filled and how:

/people/michal.krawczyk2/blog/2005/09/01/xi-idoc-adapter--edidc40--demystified

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi shabarish/michale

I would like to go with value mapping as suggested by shabarish.I need to change the values of the control segments based on the system(its like if we move from the dev system to testing system , the values mentioned in the control segment should change accodingly...ie. all values should have testing system details)

If i go for value mapping can i acheive this.Please let me know if you are familiar with similar requirement.As i can see in the value mapping in ID ..its similar to fixed value mapping wherein we specify whch value to be replced by the corresponding value.

can you please tell me wht is the main difference between fixed value and value mapping.

what i know is value mapping is created in ID..and it can be edited even if we move to testing system.but i am not understanding how it is actually makes a differece.

Regards,

Anika

Former Member
0 Kudos

Hi

Same topic discussed here

Regards

Vishnu

Former Member
0 Kudos

hi all,

thanks alot for all your pointers and support.I have solved my doubt.the requirement was like,certain feilds should be made available to change when we have to move from dev,to testing and then to production.What i did was,i used value mapping and mapped with some constant.All that is needed was the feild values like sndprt,client# etc should be available to change based on the environment.

With this i am closing the thread..thanks to sdn,its a great forum

regards,

siddhesh_pathak4
Contributor
0 Kudos

Check with this,

System.getProperty("systemname")

MichalKrawczyk
Active Contributor
0 Kudos

hi,

use this code in your UDF:

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

Regards,

Michal Krawczyk