-
Hi, FUNCTION z_rfc_doc_to_archiv.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(DATEIPFAD) TYPE SAEPFAD
*" VALUE(OBJEKT_ID) TYPE SAEOBJID
*" VALUE(SAP_OBJEKT) TYPE SAEANWDID
*" VALUE(DOKUMENTART) TYPE SAEOBJART
*" VALUE(DATEIENDUNG) TYPE SAEDOKTYP
*" EXPORTING
*" VALUE(ERFOLG) TYPE BOOL
*" VALUE(FEHLERMELDUNG) TYPE CHAR1250
*" EXCEPTIONS
*" ERROR_CONECTIONTAB
*" ERROR_PARAMETER
*" ERROR_ARCHIV
*" ERROR_UPLOAD
*" ERROR_KERNEL
*" NO_ENTRY_POSSIBLE
*" ERROR_COMUNICATIONTABLE
*" BLOCKED_BY_POLICY
*"----------------------------------------------------------------------
CALL FUNCTION 'ARCHIV_CREATE_FILE'
EXPORTING
ar_object = dokumentart
object_id = objekt_id
sap_object = sap_objekt
doc_type = dateiendung
path = dateipfad
" path255 = PFAD
" vscan_profile = '/SCMS/KPRO_CREATE' "--- Default Virenscanner Profil
EXCEPTIONS
error_conectiontable = 1
error_parameter = 2
error_archiv = 3
error_upload = 4
error_kernel = 5
no_entry_possible = 6
error_comunicationtable = 7
blocked_by_policy = 8
OTHERS = 9.
CASE sy-subrc.
fehlermeldung = ''.
erfolg = abap_false.
WHEN 0.
erfolg = abap_true.
WHEN 1.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO fehlermeldung.
" RAISING error_conectiontable.
WHEN 2.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO fehlermeldung.
" RAISING error_parameter.
WHEN 3.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO fehlermeldung.
" RAISING error_archiv.
WHEN 4.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO fehlermeldung.
" RAISING error_upload.
WHEN 5.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO fehlermeldung.
" RAISING error_kernel.
WHEN 6.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO fehlermeldung.
" RAISING no_entry_possible.
WHEN 7.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO fehlermeldung.
" RAISING error_comunicationtable.
WHEN 8.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO fehlermeldung.
" RAISING blocked_by_policy.
WHEN 9.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO fehlermeldung.
" RAISING others.
ENDCASE.
ENDFUNCTION. Now if I try to invoke this RFC an Exception is thrown with this failure message: The function works, if I test it on the quality system directly. But invoked from external system the failure comes. result = self.conn.call('Z_RFC_DOC_TO_ARCHIV',DATEIPFAD=pfad, OBJEKT_ID=objekt_id, SAP_OBJEKT=sap_objekt, DOKUMENTART=dokumentart, DATEIENDUNG=dateiendung) Is ARCHIV_CREATE_FILE the wrong function for this. It seems to search for a callback. And is there an alternative function that doesn't need a callback function in my Python Code (I would prefer)? Best regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I am not familiar with
This is something ABAP developer or SAP Community can help find out
Not really. PyRFC supports also server scenario, so that ABAP can call Python function over RFC channel, just like it calls ABAP function module. Replace ABAP callback function with Python would be easy, in case the function does something like adding two numbers. That is unfortunately not the case, ABAP functions call other ABAP functions etc. and moving one isolated ABAP function to Python is in general not possible. I would try to find answer in SAP community if another function is available, without callback, doing the same. |
Beta Was this translation helpful? Give feedback.
I am not familiar with
ARCHIV_CREATE_FILE
function module and what it exactly does and would suggest to ask this kind questions in SAP community.This is something ABAP developer or SAP Community can help find out
Not really. PyRFC supports also server scenario, so that ABAP can call Python function over RFC channel, just like it calls ABAP function module. Replace ABAP callback function with Python would be easy, in case the function does something like adding two numbers. That is unfortunately not the case, ABAP functions call other AB…