cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching the business system name during graphical mapping

Former Member
0 Kudos

Hi,

After the receiver determination is done and in interface determination, while executing the interface mapping, i need the business system name for which the

mapping is under progress. This i need during mapping.

Also, i need the configuration scenario name during mapping.

Is there any XI internal variable/system variables which hold these values so that using user defined function they can be accessed and used in graphical mapping ?

In appreciate your input in this regard.

Regards

Ganesh

Accepted Solutions (0)

Answers (8)

Answers (8)

Former Member
0 Kudos

Thanks for the replies, though they haven't taken care my reqmt. I don't want to use a constant for scenario and i want to dynamically get it from some XI internal variable.

Do XI store the scenario name some where internally ? If so, please let me know as to how to retrieve the same while mapping.

Thanks again for suggestions.

Regards

Ganesh

Former Member
0 Kudos

Ganesh,

>>Do XI store the scenario name some where internally ?

No....

One option is you get the sender,sender interface and receiver, receiver interface name using the code I have show above. The using some conditions if sender and sender interface corresponds to a receiver and receiver interface return the scenario name as a constant.

Here you will have to hard code the scenario name in UDF>

bhavesh_kantilal
Active Contributor
0 Kudos

Ganesh,

Configuration Scenarios are just a means to club your scenarios for easy "readability".

You cannot get the configuration scneario name in the runtime.

Likepointed by JaiShankar, you can posibly use the combination of Sender Interface, Sender Service, Sender Namespace and likewise for Receiver and then decide the File Directory.

But, yes, some hardcoding will be needed here.

Maybe you can use KEY - VALUE concepts and maintain the directory value in a value mapping table in the integration directory and access the same using some predefined key in your mapping using the above combinations.

Regards

Bhavesh

Former Member
0 Kudos

Hi,

For the configuration name you can map it with a constant and for the sender,receiver services and interfaces you nee to use the UDF as one mentioned below.

Imports com.racs.gpt.*;

public String getMapValue(String a,String b,Container container)

{

//String a denotes incoming data string |data1|data2|data3|...|dataN.

//String b = lookupID.

//container contains runtime parameters.

AbstractTrace trace;

String headerField;

java.util.Map map;

String result;

trace = container.getTrace();

// get constant map

map = container.getTransformationParameters();

CrossReferenceAPI maprule1 = new CrossReferenceAPI();

result = maprule1.getData(a,b,map);

trace.addWarning("result = " + result);

if (result.equals("$NULL$"))

{

trace.addWarning("XREF Error. Mapped data for " + a + " not found");

ErrorHandler errHandler = new ErrorHandler();

int lookupID = Integer.parseInt(b);

errHandler.logSQLError(map, lookupID, a, "");

result = "?";

}

return result;

}

Regards

Madhu

Former Member
0 Kudos

Let me elaborate my requirement.

We have multiple config scenarios accessing the same receiver file channel and one of the subfolder name in the file system is the config scenario name. So, while building the target directory dynamically during mapping, i need to get the scenario name at runtime.

In help.sap.com, i am not seeing any XI variable which holds the scenario name.

I appreciate any help in this regard

Regards

Ganesh

Former Member
0 Kudos

Hi Ganesh,

you are saying you have multiple configuration scenarios accessing the same file channel........see in the file adapter you will have to specify the target directory... so i will suggest you to just copy the file adapter in your every scenario......there you can specify the target directory explicitly........moreover, for multiple conf scenarios in ID you will have multiple scenarios in IR - so just do a one-to-one mapping for scenario in IR to scenario in ID.......then in your mapping you can use a constant for your configuration scenario.

Thanks,

Rajeev Gupta

Former Member
0 Kudos

Hi,

Thanks for all the input. I am able to get the receiver business service name from the receiver function provided under constants in graphical mapping. But is there any XI variable which holds the Config Scenario name so that i can take it from that in mapping ?

Regards

Ganesh

Former Member
0 Kudos

Hi Ganesh,

Just create a constant with your configuraration scenario name......after all your configuration scenario name is not going to change dynamically..........

Thanks,

Rajeev Gupta

Former Member
0 Kudos

Hi,

Check sender/receiver functions under constants. They will give the Sender/receiver business Service/System during Runtime.

Regards,

Sudharshan

prabhu_s2
Active Contributor
0 Kudos

just create a udf and point to the target field. The udf takes no input. the code attached in this thread (by jai) shud solve ur purpose.

former_member187339
Active Contributor
0 Kudos

Hi Ganesh,

You need Business System and Configuration scenario names!! You will be knowing this right whenever you are designing a scenario??? So hardcode them...

For other variables look at the folliwing link

http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/78/b4ea10263c404599ec6edabf59aa6c/frameset.htm

Regards

Suraj

Former Member
0 Kudos

You can use the code in a UDF and map the result to the target node.

String Sender = "";

String key = "SenderService";

// get runtime constant map

map = container.getTransformationParameters();

// get value of header field by using variable key

Sender = (String) map.get(key);

return Sender;

P.S: This UDF does not have any input parameters.

I am assuming you are not using BPM.

Regards,

Jai Shankar

Message was edited by:

Jai Shankar