SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error retrieving InvoicePDF

former_member191210
Participant
0 Kudos

Hello Experts,

While checking SLG1 log I am getting few errors like

Error retrieving InvoicePDF: InvoiceDoc 03******1 URL for object 084******380 (CA_DOC)


Error retrieving Invoice for user C*****23, BP 0*****1 (return code 0, response 0)


Assume these stars are any alphanumeric value.


Could you please tell  me what is the root cause of error and any solution.



Thanks & Regards

Amit



2 REPLIES 2

william_eastman
Advisor
Advisor
0 Kudos

Amit:

Look at the message details - and also at the process which is being executed. 

regards,

bill.

yevgen_trukhin
Advisor
Advisor
0 Kudos

Hi Amit, i guess you are working with OData entity InvoicePDF from Multichannel foundation.

To make it work, you need to read this help documentation:

Configuring Invoices, Invoice PDFs, and Contract Account Balance - SAP Multichannel Foundation for U...

Standard implementation will take a look at archive for pdfs. If it is not setup and you want to simulate PDFs in real time , then you can overwrite the Badi. Mentioned here:

In this API, BAdI FIS_INVOICEDETAIL is used. This BAdI has several SAP-delivered implementations. One of them is specifically for IS-U: ISU_INVOICEDETAIL.

Sample code (should not be used productively) for method GET_INVOICE_DETAIL could look like this:


DATA lv_empty TYPE string.

   DATA lv_invoice_id TYPE opbel_kk.

   DATA:

        l_pdf         TYPE xstring,

        lt_pdf_sim    TYPE w3mimetabtype,

        l_pdf_sim     LIKE LINE OF lt_pdf_sim,

        lt_pdf_arc    TYPE ebc_t_raw_data,

        l_pdf_arc     LIKE LINE OF lt_pdf_arc.

   DATA: lt_pdf TYPE fis_inv_docdetail_raw_t,

         ls_pdf TYPE tbl1024.

* First try to retrieve simulated PDF bill

   IF i_billing_doc CN 'ISU'.

     SPLIT i_billing_doc AT 'ISU' INTO lv_empty lv_invoice_id.

     CALL FUNCTION 'ISU_GET_PDF_FILE'

       EXPORTING

         x_opbel           = lv_invoice_id

         x_no_dialog       = 'X'

       IMPORTING

         y_pdf_file_sim    = lt_pdf_sim

         y_pdf_file_archiv = lt_pdf_arc

       EXCEPTIONS

         not_found         = 1

         general_fault     = 2

         OTHERS            = 3.

     IF sy-subrc = 0.

       IF lt_pdf_sim[] IS NOT INITIAL.

*   converting lines of pdf table into one string

         LOOP AT lt_pdf_sim INTO l_pdf_sim.

           CONCATENATE l_pdf l_pdf_sim-line INTO l_pdf IN BYTE MODE.

         ENDLOOP.

         CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

           EXPORTING

             buffer     = l_pdf

           TABLES

             binary_tab = t_pdf.

       ENDIF.

     ENDIF.

     "t_pdf = lt_pdf.

ENDIF.

I hope this helps.

Yevgen