cancel
Showing results for 
Search instead for 
Did you mean: 

E-invoicing generated xml

former_member689468
Participant
3,305

Hello,

I am trying to implement e-invoicing in ByD.

I have checked out these blog posts from Maria Trinidad

https://blogs.sap.com/2020/10/16/sap-business-bydesign-output-management/comment-page-1/

https://blogs.sap.com/2020/10/16/sap-business-by-design-output-management-part-2/

Since I dont have too much time to finish the project, and want this to be all tightly coupled solution I cant ask of our customers to spend resources and time implementing a cloud integration middleware that would handle the outgoing requests. So I am trying to create a custom solution where I would use the generated XML for each invoice and try and send it to an external web service by using a custom object.

Problem is I cant figure out where the generated XML data is stored for each customer invoice ? Is it possible to get the xml data after it has been transformed using XSLT transformation as described in the blogs above ?

Is it perhaps possible to edit the XML BEFORE it goes trough the XSLT transformation ?

I have also read these two blogs wich suggest that a solution like Im trying to create is possible I just dont understand from the blog posts how exaclly it is done:

https://blogs.sap.com/2020/11/13/electronic-invoice-for-italy-with-sap-business-bydesign/

https://blogs.sap.com/2020/07/22/e-invoicing-with-sap-business-bydesign/

Best regards,

Josip

Accepted Solutions (1)

Accepted Solutions (1)

former_member689468
Participant

The way about this is to use the standard webservice QueryDocumentOutputIn with a combination of before save event in the customer invoice standard BO.

Its not possible to edit the xml before the transformation

Answers (2)

Answers (2)

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Josip,

Here you have the customer invoice in xml format via standard web service by following this blog post.
Just out of my curiosity, if the end goal is to send the customer invoice in a desired xml format to external system, why output management with XSLT transformation can't fulfill this request?

Kind Regards, Yatsea

former_member689468
Participant
0 Kudos

Hi, well basically the output xml is not in the format that I can work with. I need to send it to a 3rd party web service that then communicates with government agency and directs the eInvoice where it needs to go. In order to send a request that will be accepter by that 3rd party web service I need some authentication parameters as well as the XML in UBL 2.1 format in the body of the request. As it seems now I cant do it without some sort of middleware to format that request and I was hoping it would be possible to do it withing ByD so I dont have to ask my customers to invest in another product in the middle of the project

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Josip,

The goal of the Output Management and Output Channels is to communicate with external systems: Printers, E-Mail, External Systems,...

If you want to develop a Cloud Application add-in then you shouldn't use Output Management but internal CAS events. Have you had a look to the series of blog we have published around ByD events? In there we focus on side by side applications but one of the options for getting the events to external applications is making use of CAS events. Maybe this solution will fit your needs? You just need to listen for ByD BO events in your CAS add-in and implement your specific actions.

Hope it helps
Trinidad.

former_member689468
Participant
0 Kudos

Dear Maria,

thank you for the answer. As I am reading it I think I had a similar idea for an aproach. Could you pls give me a feedback what you think of it.

I like the option of having an xslt transformation, because I need the generated XML of the invoice to be transformed into another XML that complies with UBL 2.1 format. After that I just have to put that XML in the body of a post request and send it to an external web service where the process is automated from there.

My initial plan was to have a custom inbound web service which would serve as the target of my output chanel but you already mentioned that you think that will not work.

The idea now would be to let the XSLT transformation transform the standard Invoice XML that is generated and only use that transformed XML. I am guessing the transformed XML is saved somewhere in the Invoice object and I would like to create a custom object that would then save the Invoice ID and some other necesarry data + the transformed XML. After that I would be able to send requests to external web service from where the process is automated. Basically I just need to send the transformed XML to the external web service.

It seems similar to the solution you proposed in this link : https://blogs.sap.com/2020/10/22/bridging-the-event-pub-sub-for-sap-business-byd-with-an-internal-pu...

Hopefuly there is a way to query invoices after they have been released and transformed, and then save that new transformed XML into a custom BO for sending it to external we services.

I need the transformed XML because I think it would be too much work to do all the transformation in ABSL if that is even possible.

Kind regards,

Josip