cancel
Showing results for 
Search instead for 
Did you mean: 

XML File Upload for custom BO is not working

NagaPrakashT
Contributor
0 Kudos

Hello experts.

I created a custom BO and trying to upload data into it using XML File Input.Run was successful with no errors but the data is not stored in the BO, i checked using OWL. I referred below these docs. Can any one tell me what could be the issue,

SAP Cloud Dev: Integration - 2 - XML upload - YouTube

Thanks,

Naga

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Naga,

Your information is not enough to identity where goes wrong. Now i assume that your definition of interface was correct. Thus before you deeply check it, can you check the communication errors in the frontend with path: Application and User Management->Process Communication Errors;

within it you can filter the Sending Document is File input to see what has been wrong when upload your file.

Then you might have chance to fix the issue accordingly.

Regards,

Qiang

Answers (2)

Answers (2)

Former Member
0 Kudos

Can you post what is in your XML file? Does it work for one record?

umehring4cloud
Participant
0 Kudos

Hi,

checking for errors in the Process Communication Errors view is mots probably the best idea, like Qiang wrote. If any error messages have been raised they should appear there under Open Errors with Incidents.

If you cannot find any errors there you might check the following:

- is XML file input working in general on this tenant by testing a different file input (we one had the process agent stopped in our development tenant preventing any file input)

- has the file been processed -> check the execution details of the run and have a look in the application log. You should have 3 entries there in the General tab (Start..., Process document..., End...) If the process document does not show up, the file has not been processed

- in the worst case you might try to debug the file input - maybe some Save Validation returns false or something like that prevents your file input.

Best regards,

Uwe

NagaPrakashT
Contributor
0 Kudos

Hi Uwe,

How would i debug ? can you please through some more light on it ? I also need to do validation for the data coming from XML file and if something is wrong with data i need show them back.In this scenario what should be my approach .

Thanks,

Naga

umehring4cloud
Participant
0 Kudos

Hi Naga,

Add Trace statements and breakpoints to the ABSL scripts of that custom BO e.g. a good place would be the AfterModify scripts of the root node of that BO. Thus you will be able to see, if the BO makes it to the tenant.

To start debugging you have to set up the user you want to debug in the studio:

-> Administration > Options and Settings > SAP > General > Debugging and Tracing tab > Tick Enable for business user and insert the user that you use for the file input

Then start the debugging: -> Debug > Start Debugging

In the tenant you can now schedule the file input run - after you have uploaded the XML file. I recommend to use the "Start immediately" option for debugging. Even then it might happen that the run needs up to one minute to start. The traces and other debugging information should show up in the Output window of the studio. The debugger should hold at the first breakpoint.

In case neither of this happens there are two possibilites:

1. There is an error before the object instances are processed by debugging. E.g. the XML file contains errors like wrong data types, wrong scheme etc. These errors should show up in the process communication errors.

2. Starting the debugger did not work properly (Unfortunately I had this experience several times). Stopping and restarting the debugger and doing the file input again might help then. It can take several times until it works. I am very sorry, but sometimes it is very hard to tell which of those cases happened.

Regarding the validation of the data coming from XML:

If one of the field does not match the expected type, e.g. expected is a numeric value but the string "abc" comes via XML then the file input will fail, the status of the log shows a red traffic light and an error comes up in the process communication errors. As far as I know you cannot handle these errors in ByDesign in ABSL scriopts or so. Please everybody, correct me if I am wrong here.

Other errors like you expect only certain values like IDs of existing objects, these ones you can handle in the ABSL scripting. Best place would be the Save Validation for that.

I hope that helps, best regards,

Uwe

NagaPrakashT
Contributor
0 Kudos

Hi Uwe,

Thanks for you inputs.I will try it.

regarding the validation, lets say i am uploading customer ID which already exists in C4C to my custom BO with file input.I need to do a validation and check whether the ID matches with C4C ID or not. I know i should write in Validation-OnSave ABSL(by doing a BO Query), but if the ID does not exists i should through an error message. Whether the error messages will be shown in the Application and User Management log ?


If i have 10 records in XML input and if 2 record failed in validation whether the file input continues ?



Thanks,

Naga

umehring4cloud
Participant
0 Kudos

Hi Naga,

this error message should show up in the Process Communication Error view, in Open Errors with Incidents:

Sending Document is File Input

Receiving Document is the name of you custom BO

Main error will be the text of the message

If one record in the XML fails, the whole file should not work. You would have to correct the error in the XML and do the whole file again.

Best regards,

Uwe

NagaPrakashT
Contributor
0 Kudos

Hi Uwe,

Debugger got triggered, thanks. I have written Trace.Info("Record uploaded successfully") in ABSL.

I can see this message in the Trace Explorer. If i want to show the same message in the Application Log(In RESULTS tab) of the Run, is there any way.

Thanks,

Naga

umehring4cloud
Participant
0 Kudos

Hi Naga,

I don't think that this is possible but to be honest, I don't know. I never tried this or did some research on it. Maybe someone else knows.

Best regards,

Uwe

Former Member
0 Kudos

Hi Naga,

I think it could be possible to raise messages and they should be logged int the result tab.

But I didn't tested this before.

Best regards,

Tobias Kuhn

NagaPrakashT
Contributor
0 Kudos

Hi Tobias,

I tried but the messages are not appearing in RESULT Tab,

Thanks,

Naga

NagaPrakashT
Contributor
0 Kudos

Hi Uwe,

Uwe Mehring Is it possible to create Mass Data Maintenance Template for custom BO like we have in standard BO ?

Thanks,

Naga

umehring4cloud
Participant
0 Kudos

Hi Naga,

It is possible to create a Mass Data Sheet for custom BOs. I recommend that you create you new custom BO with an alternative key e.g. some ID to identify the instances. Thus it will be very simple to make some mass change.

Creata a service integration of type XML File Input. Include all your fields, set the alternative key as readable Id and tick the mass processing check box. Make sure you use the instance identification for update and set you alterntive key there as well.

Then you download the XSD file of this PID and use it as XML scheme in an Excel Sheet. I think you should be familiar with those steps so far as you have already done XML file input.

You can now use this sheet for initial creation or for mass change of BO istances that already exist. Just make sure you also enter the values that you don't wanna change. You can extract the values with a simple report based on a simple datasource of this BO in the Business Analytics WoC.

I hope this answer your question or at least part of it. Let me know if you need more information.

Best regards,

Uwe

NagaPrakashT
Contributor
0 Kudos

Hi Uwe,

I am uploading the data using XML file from Application and User Management->File Input. But for the Mass Data Template where is the option in Silver Light ?

Thanks,

Naga

umehring4cloud
Participant
0 Kudos

Hi Naga,

I am not sure if I exactly understand what you want to do.

If you want to do mass data maitenance for a custom BO I would use the XML file input (works for mass change as well).

If that does not fit your needs, maybe you can give me an example from the standard, so that I can see what you want to do.

Best regards,

Uwe