cancel
Showing results for 
Search instead for 
Did you mean: 

UDF error

former_member650236
Participant
0 Kudos

Hi Experts,

I am using this UDF to call the file name and pass it to the RFC lookup to update it in the table.But unfortunately am getting the below error

Error getting:

java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.get(com.sap.aii.m

UDF Using:

public String getFileName(Container container) throws StreamTransformationException{

try {

String filename    = "";

DynamicConfiguration conf = (DynamicConfiguration) container

    .getTransformationParameters()

    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

filename = conf.get(key);

return filename;

}

catch(Exception e)

{

     String exception = e.toString();

      return exception;

}

}

Please help is it any thing wrong in the code.

Regards,

Shaik

Accepted Solutions (1)

Accepted Solutions (1)

former_member186851
Active Contributor
0 Kudos

Hello Shaik,

Try with the below UDF and see if it works.

public String getFileName(Container container) throws StreamTransformationException{

try {

String FileName    = "";


DynamicConfiguration conf = (DynamicConfiguration) container.getParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);


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


String FileName = conf.get(key);


}

catch(Exception e)

{

     String exception = e.toString();

      return exception;

}

}

@Manoj. Was about to say the same.:)

If you wish to test the mapping remove that UDF mapping and run.

Answers (1)

Answers (1)

manoj_khavatkopp
Active Contributor
0 Kudos

Are u testing this END to END or just in ESR local ? You need to test it END to END don't test it locally it gives error.

UDF looks fine

former_member650236
Participant
0 Kudos

Hi Manoj,

Thanks for the reply.

Actually i am calling the value like this

After that it should update

Previuosly am able to update the value MT1009112 etc...

But now am not able to update the value of filename through empty in the filename.Pls help am i missing anything....?

Regards,

Shaik

former_member186851
Active Contributor
0 Kudos

Hello Shaik,

Any recent changes made?

filename through empty?its a bit confusing.

manoj_khavatkopp
Active Contributor
0 Kudos

I hope you are not triggering message from RWB it wont work .

the sender channel has to pick the file and cross check again if ASMA is enabled or not.

former_member650236
Participant
0 Kudos

No....Raghu not changed any thing in PI. Previously i was testing in DEV and now am testing in QA.


Please help... Any thing need to do in PI or udf?






Regards,

Shaik

former_member186851
Active Contributor
0 Kudos

Hello Shaik,

Check the ASMA in the Sender file channel.