cancel
Showing results for 
Search instead for 
Did you mean: 

UDF GET FILE NAME DYNAMIC CONFIGURATION END TO END EXCPETION

former_member435556
Participant
0 Kudos

Hi Expert.

Recently We did a upgrade from PI 7.0 TO PI 7.5(DUAL STACK SPLIT) after upgrade we having exception to get a in UDF filename using Dynamic configuration, before upgrade same code was working perfectly fine. we are using File to File Scenario.

I have already ticked ASMA on CC channels

Error is shown below while running the scenario end to end.

Urgent is Required.

String fname = "";

 Method will be called after mapping

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
if (conf != null)
 {
   fname = conf.get(key1);
   conf.put(key1,fname);
}
return fname;
<?xml version="1.0" encoding="UTF-8" standalone="true"?>

<!-- Request Message Mapping -->
-<SAP:Error xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P1>com/sap/xi/tf/_MP_*_</SAP:P1>
<SAP:P2>com.sap.aii.mappingtool.tf7.MessageMappingExceptio</SAP:P2>
<SAP:P3>n: Runtime exception when processing target-field</SAP:P3>
<SAP:P4>mapping /ns1:*_*_*_*/FNAME; root mess~</SAP:P4>
<SAP:AdditionalText/>
<SAP:Stack>A runtime exception was raised in the application mapping com/sap/xi/tf/_MP_*_; com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-fieldmapping /ns1:*_*_ACK_*/FNAME; root mess~ </SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>

SXMB_MONI ERROR.

TRACE.

<Trace type="T" level="1"> *** END APPLICATION TRACE *** </Trace>
<Trace type="T" level="1">RuntimeException during appliction Java mapping com/sap/xi/tf/_MP_SCB_ Thrown: com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping /ns1:*_*_ACK_TRANS/FNAME; root message: Exception:[java.lang.IllegalArgumentException: Values in a DynamicConfiguration must not be null. ] in class com.sap.xi.tf._MP_SCB_ method getFileName[com.sap.aii.mappingtool.tf7.rt.Context@57aaee0]

Accepted Solutions (1)

Accepted Solutions (1)

former_member207703
Active Participant

Hi,

1. I really not able to understand what is use of this UDF as you are setting same file name as you received from sender adapter.

2. Is it file to file scenario?

3. There is no use to check dynamic config is null or not:- if(conf !=null)

4. Check you enable ASMA in sender file channel.

5. DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName"); - There is no use of + in this line make it DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

Share screen shot of dynamic configuration log.

Regards,

Anoop Rai

former_member435556
Participant
0 Kudos

Dear Anoop,

Thanks for reviewing my code.

1. Same code is running perfectly fine before upgrade.

2. Its a File to RFC Scenario.

3.I also tried the code with if(conf! = null ) check, basically i putt it because it was giving exception in message mapping testing.

4. Yes i enable ASMA in Sender channel.

5. I already Tried to make DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName"); but same error happen in end to end scenario

sxmb_moni dynamic configuration log:

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<!-- Request Message Mapping -->
-<SAP:DynamicConfiguration xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">
<SAP:Record name="FileName" namespace="http://sap.com/xi/XI/System">GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.390712.CSV-BANSTA.rpt</SAP:Record>
<SAP:Record name="Directory" namespace="http://sap.com/xi/XI/System">/documents/payments/in/rpt/</SAP:Record>
<SAP:Record name="senderAgreementGUID" namespace="http://sap.com/xi/XI/Message/30/general">d45cd5ff909139748226d00a73287a14</SAP:Record>
</SAP:DynamicConfiguration>.



Sxmb_moni error Msg Trace:



<Trace type="T" level="2">Loaded class com.sap.xi.tf._MP_SCB_$MT$InnerParamsList </Trace>


<Trace type="T" level="2">Call method execute of the application Java mapping com.sap.xi.tf._MP_SCB_ </Trace>


<Trace type="T" level="1"> *** START APPLICATION TRACE *** </Trace>


<Trace type="T" level="3">Document start </Trace>


<Trace type="T" level="3">Start tag [ns1:YPTCL_BPS_ACK_TRANS] </Trace>


<Trace type="T" level="3">Add raw attribute [ xmlns:ns1="urn:sap-com:document:sap:rfc:functions"] </Trace>


<Trace type="T" level="3">Exception occured during processing /ns1:YPTCL_BPS_ACK_TRANS/FNAME </Trace>


<Trace type="T" level="1"> *** END APPLICATION TRACE *** </Trace>


<Trace type="T" level="1">RuntimeException during appliction Java mapping com/sap/xi/tf/_MP_SCB_ Thrown: com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping /ns1:YPTCL_BPS_ACK_TRANS/FNAME; root message: Exception:[java.lang.IllegalArgumentException: Values in a DynamicConfiguration must not be null. ] in class com.sap.xi.tf._MP_SCB_ method getFileName[com.sap.aii.mappingtool.tf7.rt.Context@57aaee0] at com.sap.aii.mappingtool.tf7.AMappingProgram.processNode(AMappingProgram.java:514) at com.sap.aii.mappingtool.tf7.AMappingProgram.processNode(AMappingProgram.java:454) at com.sap.aii.mappingtool.tf7.AMappingProgram.start(AMappingProgram.java:560) at com.sap.aii.mappingtool.tf7.Transformer.start(Transformer.java:152) at com.sap.aii.mappingtool.tf7.AMappingProgram.transform(AMappingProgram.java:698) at com.sap.aii.ib.server.mapping.execution.JavaMapping.executeStep(JavaMapping.java:112).
please guide me where i am doing wrong.
former_member207703
Active Participant
0 Kudos

Hi,

As per your DC Log,

<SAP:Record name="FileName" namespace="http://sap.com/xi/XI/System">GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.390712.CSV-BANSTA.rpt</SAP:Record> 

Here namespace is "http://sap.com/xi/XI/System". Due to that change namespace in DCKey:-

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

Actually, static create method of DynamicConfigurationKey parameters are - String namespace_of_parameter and String name_of_parameter. Also, as per your error log, it throws IllegalArgumentException because it enable to find any such combination of namespace and name.

For better:- remove if condition and conf.put(key1,fname); as there is no use of it.

Regards,

Anoop Rai

former_member190293
Active Contributor
0 Kudos

Hi David!

Don't you use SFTP adapter in your sender channel?

If so, it's worth mention that SFTP adapter uses different namespace for its ASMA parameters by default, than File adapter does. So you either should change namespace in channel settings or, as Anoop has alreday suggested, change namespace in your UDF.

Regards, Evgeniy.

former_member435556
Participant
0 Kudos

Hi Anoop,

Thanks you so much for sharing the input, i have changed the Namespace in dynamic configuration code as you said above. but same exception occurred while running end to end.

here is changes :- name sapce changed From xi to xI.

String fname = "";

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = 
DynamicConfigurationKey.create("http:/"+"/sap.com/xI/XI/System/File","FileName");

   fname = conf.get(key1);
   conf.put(key1,fname);
return fname;

kindly guide me.

Regards

former_member435556
Participant
0 Kudos

Hi Anoop,

Thanks you so much for sharing the input, i have changed the Namespace in dynamic configuration code as you said above. but same exception occurred while running end to end.

here is changes :- name sapce changed From xi to xI.

String fname = "";

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = 
DynamicConfigurationKey.create("http:/"+"/sap.com/xI/XI/System/File","FileName");

   fname = conf.get(key1);
   conf.put(key1,fname);
return fname;

kindly guide me.

Regards

former_member190293
Active Contributor
0 Kudos

Hi David!

Your log shows that namespace for FileName attribute is "http://sap.com/xi/XI/System". You should use the same namespace in your UDF.

Regards, Evgeniy.

former_member207703
Active Participant
0 Kudos

Hi,

String fname = "";
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = 
DynamicConfigurationKey.create("http://sap.com/xi/XI/System","FileName");
   fname = conf.get(key1);
   conf.put(key1,fname);
return fname;

Use this code bro, just copy and paste. Namespace is : "http://sap.com/xi/XI/System"

I already explained everything. If you face any problem let us know.

Regards,

Anoop Rai

former_member435556
Participant
0 Kudos

Hi

I was using the same code before you mentioned above having same namespace.http://sap.com/xi/XI/System

String fname = "";
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = 
DynamicConfigurationKey.create("http://sap.com/xi/XI/System","FileName");
   fname = conf.get(key1);
   conf.put(key1,fname);
return fname;

I again just copy and paste the code but same exception happened.

Please guide.

Regards

former_member207703
Active Participant
0 Kudos

Hi,

Use below code and give Dynaic Configuration and trace log:

String fname = "";
MappingTrace mapTrace  = container.getTrace();
mapTrace.addInfo("UDF Started");
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System","FileName");
mapTrace.addInfo("File name found : "+ conf.get(key1));
fname = conf.get(key1);
mapTrace.addInfo("File name set as : " + fname);
return fname;
former_member435556
Participant
0 Kudos

Hi,

I have tested again with Code kindly see the Logs

Dynamic Configuration logs (Sxmb_moni)

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<!-- Response -->
-<SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
<SAP:Record namespace="http://sap.com/xi/XI/System" name="Directory">/documents/payments/in/rpt/</SAP:Record>
<SAP:Record namespace="http://sap.com/xi/XI/System" name="FileName">GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.398713.CSV-BANSTA.rpt</SAP:Record>
<SAP:Record namespace="http://sap.com/xi/XI/Message/30/general" name="senderAgreementGUID">d45cd5ff909139748226d00a73287a14</SAP:Record>
</SAP:DynamicConfiguration>
former_member435556
Participant
0 Kudos

Trace log Sxmb_moni).

<Trace type="T" level="1">Start with pipeline element PLEL= 5EC3C53B4BB7B62DE10000000A1148F5</Trace>
-<Trace type="B" name="PLSRV_MAPPING_REQUEST" level="1">
<Trace type="Timestamp" level="3">2018-03-20T10:13:03Z UTC+5 Start of pipeline service processing PLSRVID= PLSRV_MAPPING_REQUEST</Trace>
-<Trace type="B" name="CL_XMS_MAIN-CALL_PLSRV" level="1">
<Trace type="T" level="3">Calling pipeline service: PLSRV_MAPPING_REQUEST</Trace>
<Trace type="T" level="3">Reading Pipeline-Service specification... </Trace>
<Trace type="T" level="3">PLSRVTYPE = </Trace>
<Trace type="T" level="3">ADRESSMOD = LOCAL</Trace>
<Trace type="T" level="3">P_CLASS = CL_MAPPING_XMS_PLSRV3</Trace>
<Trace type="T" level="3">P_IFNAME = IF_XMS_PLSRV</Trace>
<Trace type="T" level="3">P_METHOD = ENTER_PLSRV</Trace>
<Trace type="T" level="3"> </Trace>
-<Trace type="B" name="CL_XMS_MAIN-CALL_PLSRV_LOCAL" level="1">
-<Trace type="B" name="CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV" level="1">
<Trace type="T" level="2">......attachment XI_Context not found </Trace>
<Trace type="T" level="3">Append context with name =FileName and value =GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.398713.CSV-BANSTA.rpt </Trace>
<Trace type="T" level="3">Append context with name =Directory and value =/documents/payments/in/rpt/ </Trace>
<Trace type="T" level="3">Append context with name =senderAgreementGUID and value =d45cd5ff909139748226d00a73287a14 </Trace>
<Trace type="T" level="3">Mapping already defined in interface determination </Trace>
<Trace type="T" level="3">Object ID of Interface Mapping 1CB9D9C184E736318EADEA3D2BA9885D </Trace>
<Trace type="T" level="3">Version ID of Interface Mapping 1DC485408FE711DFBB77CDB10AFE1082 </Trace>
<Trace type="T" level="1">Interface Mapping http://ptcl.scb.bps.ack.com IM_SCB </Trace>
<Trace type="T" level="3">Mapping Steps 1 JAVA com/sap/xi/tf/_MP_SCB_ </Trace>
<Trace type="T" level="3">MTOM Attachments are Transferred to the Payload </Trace>
<Trace type="T" level="3">Dynamic Configuration ( http://sap.com/xi/XI/System FileName GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.398713.CSV-BANSTA.rpt ) ( http://sap.com/xi/XI/System Directory /documents/payments/in/rpt/ ) ( http://sap.com/xi/XI/Message/30/general senderAgreementGUID d45cd5ff909139748226d00a73287a14 ) </Trace>
<Trace type="T" level="2">Mode 0 </Trace>
<Trace type="T" level="2">Call method execute of the application Java mapping com.sap.xi.tf._MP_SCB_ </Trace>
<Trace type="T" level="1"> *** START APPLICATION TRACE *** </Trace>
<Trace type="T" level="3">Document start </Trace>
<Trace type="T" level="3">Start tag [ns1:YPTCL_BPS_ACK_TRANS] </Trace>
<Trace type="T" level="3">Add raw attribute [ xmlns:ns1="urn:sap-com:document:sap:rfc:functions"] </Trace>
<Trace type="T" level="2">UDF Started </Trace>
<Trace type="T" level="2">File name found : GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.398713.CSV-BANSTA.rpt </Trace>
<Trace type="T" level="2">File name set as : GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.398713.CSV-BANSTA.rpt </Trace>
<Trace type="T" level="3">Start tag [FNAME] </Trace>
<Trace type="T" level="3">Put value [GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.398713.CSV-BANSTA.rpt] </Trace>
<Trace type="T" level="3">Close tag [FNAME] </Trace>
<Trace type="T" level="3">Start tag [T_DOC] </Trace>
<Trace type="T" level="3">Start tag [item] </Trace>
<Trace type="T" level="3">Start tag [REF] </Trace>
<Trace type="T" level="3">Put value [20182600053130_S] </Trace>
<Trace type="T" level="3">Close tag [REF] </Trace>
<Trace type="T" level="3">Start tag [STATUS] </Trace>
<Trace type="T" level="3">Put value [F1] </Trace>
<Trace type="T" level="3">Close tag [STATUS] </Trace>
<Trace type="T" level="3">Start tag [AMOUNT] </Trace>
<Trace type="T" level="3">Put value [100.00] </Trace>
<Trace type="T" level="3">Close tag [AMOUNT] </Trace>
<Trace type="T" level="3">Start tag [CHECK_NO] </Trace>
<Trace type="T" level="3">Put value [R0000032] </Trace>
<Trace type="T" level="3">Close tag [CHECK_NO] </Trace>
<Trace type="T" level="3">Start tag [NAME1] </Trace>
<Trace type="T" level="3">Put value [Raja Babar Naseer] </Trace>
<Trace type="T" level="3">Close tag [NAME1] </Trace>
<Trace type="T" level="3">Start tag [NAME2] </Trace>
<Trace type="T" level="3">Put value [64 ZAFAR AKBAR ROAD LALAZAR] </Trace>
<Trace type="T" level="3">Close tag [NAME2] </Trace>
<Trace type="T" level="3">Close tag [item] </Trace>
<Trace type="T" level="3">Close tag [T_DOC] </Trace>
<Trace type="T" level="3">Close tag [ns1:YPTCL_BPS_ACK_TRANS] </Trace>
<Trace type="T" level="3">Document end </Trace>
<Trace type="T" level="1"> *** END APPLICATION TRACE *** </Trace>
<Trace type="T" level="2">Java mapping com/sap/xi/tf/_MP_SCB_ completed. (executeStep() of com.sap.xi.tf._MP_SCB_). </Trace>
<Trace type="T" level="1">#Dynamic Header entries= 0000000003 </Trace>
<Trace type="T" level="3">Dynamic Configuration ( http://sap.com/xi/XI/System Directory /documents/payments/in/rpt/ ) ( http://sap.com/xi/XI/System FileName GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.398713.CSV-BANSTA.rpt ) ( http://sap.com/xi/XI/Message/30/general senderAgreementGUID d45cd5ff909139748226d00a73287a14 ) </Trace>

former_member435556
Participant
0 Kudos
<Trace type="T" level="1">attachments #remove= 000000 #set= 000000 #copy= 000000 </Trace>
<Trace type="T" level="1">ContentType application/xml </Trace>
</Trace>
</Trace>
</Trace>
<Trace type="Timestamp" level="3">2018-03-20T10:13:03Z UTC+5 End of pipeline service processing PLSRVID= PLSRV_MAPPING_REQUEST</Trace>
</Trace>
-<Trace type="B" name="CL_XMS_MESSAGE_PERS_MAN-WRITE_MESSAGE_LOG_TO_PERSIST" level="1">
<Trace type="T" level="3">Persisting message after plsrv call </Trace>
<Trace type="T" level="3">Message-Version = 005</Trace>
<Trace type="T" level="3">Pipeline CENTRAL</Trace>
</Trace>
-<Trace type="B" name="PLSRV_OUTBOUND_BINDING" level="1">
<Trace type="Timestamp" level="3">2018-03-20T10:13:03Z UTC+5 Start of pipeline service processing PLSRVID= PLSRV_OUTBOUND_BINDING</Trace>
-<Trace type="B" name="CL_XMS_MAIN-CALL_PLSRV" level="1">
<Trace type="T" level="3">Calling pipeline service: PLSRV_OUTBOUND_BINDING</Trace>
<Trace type="T" level="3">Reading Pipeline-Service specification... </Trace>
<Trace type="T" level="3">PLSRVTYPE = </Trace>
<Trace type="T" level="3">ADRESSMOD = LOCAL</Trace>
<Trace type="T" level="3">P_CLASS = CL_XMS_PLSRV_OUTBINDING</Trace>
<Trace type="T" level="3">P_IFNAME = IF_XMS_PLSRV</Trace>
<Trace type="T" level="3">P_METHOD = ENTER_PLSRV</Trace>
<Trace type="T" level="3"> </Trace>
-<Trace type="B" name="CL_XMS_MAIN-CALL_PLSRV_LOCAL" level="1">
-<Trace type="B" name="CL_XMS_PLSRV_OUTBINDING-ENTER_PLSRV" level="1">
<Trace type="T" level="2">O U T B O U N D - B I N D I N G </Trace>
<Trace type="T" level="2"> Cache content is up to date </Trace>
<Trace type="T" level="2">determine OUTBOUND BINDING for: </Trace>
<Trace type="T" level="2">-SCB_ACK_SENDER </Trace>
<Trace type="T" level="2">-SCB_ACK_RECIEVER </Trace>
<Trace type="T" level="2">urn:sap-com:document:sap:rfc:functions.YPTCL_BPS_ACK_TRANS </Trace>
<Trace type="T" level="2">Channel found: - SCB_ACK_RECIEVER - SCB_ACK_RECIEVER_CH </Trace>
<Trace type="T" level="2">no header mapping defined </Trace>
</Trace>
</Trace>
</Trace>
<Trace type="Timestamp" level="3">2018-03-20T10:13:03Z UTC+5 End of pipeline service processing PLSRVID= PLSRV_OUTBOUND_BINDING</Trace>
</Trace>

Regards,

former_member190293
Active Contributor
0 Kudos

Hi David! Log shows that your FileName attribute was successfully read in message mapping.

Regards, Evgeniy.

former_member207703
Active Participant
0 Kudos

Hi David,

As per your trace logs there is no problem with UDF and its setting FNAME value as fileName.

<Trace type="T" level="2">File name found : GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.398713.CSV-BANSTA.rpt </Trace>
<Trace type="T" level="2">File name set as : GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.398713.CSV-BANSTA.rpt </Trace>
<Trace type="T" level="3">Start tag [FNAME] </Trace>
<Trace type="T" level="3">Put value [GPK10940.PAYMENTS.201708171915358Y.QLPAY012R.398713.CSV-BANSTA.rpt] </Trace>
<Trace type="T" level="3">Close tag [FNAME] </Trace>

In your trace there is no error. Where are you getting Exception? Or is it working fine now?

Regards,

Anoop Rai

former_member435556
Participant
0 Kudos

Dear Anoop,

I myself amazed when i just copy and paste your last code , it started working fine, i dont know why, now file is getting populated correctly,for my knowledge can you please tell what was wrong with my code what did you call in this code?

Well thank you So much Anoop and Evgeniy. you guys are awesome.you have made my day.

former_member435556
Participant
0 Kudos

kindly put your last answer in the answer section so i can Mark correct your answer

Answers (0)