cancel
Showing results for 
Search instead for 
Did you mean: 

how to read Dynamic File name

Former Member
0 Kudos

Hi,

my scenario is File to Idoc with lookups. for this i have to read source file name.for this i clicked on ADAPTER-SPECIFIC MESSAGE ATTRIBUTS, in side that i checked setADAPTER-SPECIFIC MESSAGE ATTRIBUTS and File name Check boxes. i wrote a UDF to get the file name it is giving error pls find the code below.

//write your code here

// public String getFileName(Container container){

//write your code here

String fileName="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

try{

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

String valueOld = conf.get(key);

return valueOld;

/*

DynamicConfiguration config =(DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey keyfilename = DynamicConfigurationKey.create("http:/'/sap.com/xi/XI/System/File","FileName");

fileName =(String)config.get(keyfilename);

if (fileName != null)

{

return fileName;

}

else

{

return"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz";

}

*/

}

catch(Exception e){

fileName = "Dummy File name";

return fileName;

}

can you pls help me

Thanks

Sivaram

Accepted Solutions (0)

Answers (5)

Answers (5)

GabrielSagaya
Active Contributor
0 Kudos

replace

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

as

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

Former Member
0 Kudos

hi sivaram,let me know the error u r getting when u r testing u r scenario......

Former Member
0 Kudos

<SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_COINCostTransfers_: RuntimeException in Message-Mapping transformatio~</SAP:Stack>

Former Member
0 Kudos

<SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_COINCostTransfers_: RuntimeException in Message-Mapping transformatio~</SAP:Stack>

Former Member
0 Kudos

Hi,

What error u r getting.

ur scenario will work only when u test the scenario end to end u can not test the scenario with test message tab.

Have u used the same weblog and link:

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping

Chirag

nisarkhan_n
Active Contributor
0 Kudos

paste the error details.....

Former Member
0 Kudos

what is the error that u are getting

regadrds

krishna

Former Member
0 Kudos

it goes to try catch block. in display que it is showing dummyfilename.

GabrielSagaya
Active Contributor
0 Kudos

have you added com.sap.aii.map.api.*; in the import location???

Former Member
0 Kudos

<SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_COINCostTransfers_: RuntimeException in Message-Mapping transformatio~</SAP:Stack>

Former Member
0 Kudos

no i didn't.

i have to add that package??

iam getting this error in moni

<SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_COINCostTransfers_: RuntimeException in Message-Mapping transformatio~</SAP:Stack>

Former Member
0 Kudos

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Request Message Mapping

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_MM_COINCostTransfers_</SAP:P1>

<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>

<SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>

<SAP:P4 />

<SAP:AdditionalText />

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_COINCostTransfers_: RuntimeException in Message-Mapping transformatio~</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>