Skip to Content
avatar image
Former Member

How to test/debug the UDF used for storing file on Server

Hi Experts,

I had written the UDF to save the runtime created xml file on server. It was working 3-5 days back but now it is not working.

I had to store the timestamp from response and save it as a xml file to be used for next request sent to Target system.

Code for your reference,

public String StoreTimeStamp(String TimeStamp, Container container) throws StreamTransformationException{

try {

                            String FinalXML = "";

                            String FilesPath = "/usr/sap/tmp";

                String StartString = " ariba.com:xi:AribaIntegration\"> ";

                String EndString = "</TimeStamp></ns0:MT_GetPendingRequest_TimeStamp>";

               

                FinalXML = FinalXML.concat(StartString);

                FinalXML = FinalXML.concat(TimeStamp);

                FinalXML = FinalXML.concat(EndString);

                             byte[] FinalBytes = FinalXML.getBytes();

                            try{

                                String FileName = "GetPendingRequestOrderConfirmation.xml";

                                File path = new File(FilesPath+FileName);

                              FileOutputStream fos = new FileOutputStream(path);    

                                fos.write(FinalBytes);

                            }

                            catch(IOException IOE)

                            {

                                StreamTransformationException STE = new StreamTransformationException(IOE.getMessage(),IOE);

                                STE.setStackTrace(IOE.getStackTrace());

                                throw STE;

                         }                 

return TimeStamp;

}

catch(Exception e){

throw new RuntimeException("Exception : "+e);

}

}

Please let me know how can I troubleshoot/test or debug the UDF or any other suggestion.

Regards,

Nitin Patil

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 01, 2015 at 04:23 PM

    Add traces in your code, wherever you think, something is going wrong, like below.

    container.getTrace().addInfo("*** Debugging *** Entered UDF StoreTimeStamp to store timestamp");

    Test your code either in OM or MM, using test tab to troubleshoot.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 02, 2015 at 02:09 AM

    Hi Nitin,

    Could be a folder permission problem, can you check this with your basis team?

    Regards,

    Mark

    Add comment
    10|10000 characters needed characters exceeded