Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

Upload File to SAP using RFC

$
0
0

Hello Colleagues.

Now I'm trying to create a function that upload a PDF file using RFC connection.

We've created a .NET application that reads data from XML files in order to create a vendor invoice in SAP, additionally we need to upload the PDF belongs to physical document, we use some functions for IXOS that able to create the relation between the file and document.

My problem is that my .NET application needs to run unattended in our W2K8 server, so when we passed the parameters to our RFC function module in .NET show and error "NOT_SUPPORTED_BY_GUI", this situation happened when I tried to did that using gui_upload mehtod...I have tried several methods without success...I don't know if any colleague in this forum know the better way to solve my problem.

********

I tried using this code in my function module in SAP with error described above

cl_gui_frontend_services=>gui_upload(

    exporting  filename   = str_filename

               filetype   = 'BIN'

    importing  filelength = file_length

    changing   data_tab   = filedata_t

    exceptions others     = 1

               not_supported_by_gui    = 2 ).

  if ( sy-subrc <> 0 ).

    message id sy-msgid type 'S' number sy-msgno

            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4

            display like 'E'.

    return.

  endif.

***********

and also this method..........

  DATA: BEGIN OF i_pdf OCCURS 0.

        INCLUDE STRUCTURE solisti1.

  DATA: END OF i_pdf.

 

  OPEN DATASET str_filename FOR INPUT IN BINARY MODE.

  IF sy-subrc <> 0.

  •    WRITE: /10 'Error al abrir el fichero ', str_filename.

  ENDIF.

  DO.

    CLEAR i_pdf.

    READ DATASET str_filename INTO i_pdf.

    IF sy-subrc EQ 0.

      APPEND i_pdf.

    ELSE.

      APPEND i_pdf.

      EXIT.

    ENDIF.

  ENDDO.

  CLOSE DATASET str_filename.

 

But our security policy doesn't allow the operation upload.

So, finally I would like to know if any people here know a another way

to solve this.

Thanks in advance for your time. For any comments you can reach me at lgutierrez at spl.cl

Best Regards from Chile.


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>