RFC-Aufrufe haben keine Verbindung zu einer GUI, wie sollen dann Befehle wie: cl_gui_frontend_services=>file_copy ausgeführt werden?MartinZapf hat geschrieben:Meines Wissens nach kann man schon Nicht-RFC-fähige Bausteine in RFC-fähigen Bausteinen aufrufen!?!?
Was könnte es noch sein!
Wie kann ich das dann bewerkstelligen?RFC-Aufrufe haben keine Verbindung zu einer GUI, wie sollen dann Befehle wie: cl_gui_frontend_services=>file_copy ausgeführt werden?
Du brauchst eine Funktion, die das Dokument ausliest und als Stream an den Aufrufer zurück gibt. Der Aufrufer muss sich um die Speicherung/Anzeige des Dokumentenstreams kümmern.MartinZapf hat geschrieben:Wie kann ich das dann bewerkstelligen?
Code: Alles auswählen.
function z_dms_original_links.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(IV_DOKAR) TYPE DOKAR
*" VALUE(IV_DOKNR) TYPE DOKNR
*" VALUE(IV_DOKVR) TYPE DOKVR
*" VALUE(IV_DOKTL) TYPE DOKTL_D
*" EXPORTING
*" VALUE(ES_RETURN) TYPE BAPIRET2
*" TABLES
*" ET_LINKS STRUCTURE ZST_ORIGINAL_LINK
*"----------------------------------------------------------------------
* Do not use a table type for the returning parameter, the sap_RFC libary can't interpret it.
data:
lv_doc type text30,
lv_url type dms_url,
lt_ptxdata type dms_tbl_file,
ls_phio_id type sdokobject.
field-symbols:
<ls_link> like line of et_links[],
<ls_dms_rec_phio> type dms_rec_phio,
<ls_ptxdata> like line of lt_ptxdata[].
*
clear:
et_links[],
es_return.
*
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = iv_doknr
importing
output = iv_doknr.
*
call function 'CV120_KPRO_MASTER_DATA_GET'
exporting
pf_dokar = iv_dokar
pf_doknr = iv_doknr
pf_dokvr = iv_dokvr
pf_doktl = iv_doktl
* PF_ACTIVE_ONLY = ' '
* PF_ACTIVE_ATTR_ONLY = ' '
* PF_COMP_GET = 'X'
* PF_BAPI_CALL =
tables
ptx_data = lt_ptxdata[]
exceptions
not_found = 1
error = 2
others = 99.
if sy-subrc <> 0.
if sy-msgid is initial.
case sy-subrc.
when 1.
concatenate iv_dokar iv_doknr iv_dokvr iv_doktl into lv_doc separated by '|'.
* Document '&1' not found
message e002(hp) into es_return-message with lv_doc.
when others.
* &1: Unexpected failure &2! Inform the IT department!
message e001(z_document_search) into es_return-message with 'CV120_KPRO_MASTER_DATA_GET' sy-subrc.
endcase.
* ELSE.
* NOP - sy fields already filled
endif.
call function 'BALW_BAPIRETURN_GET2'
exporting
type = sy-msgty
cl = sy-msgid
number = sy-msgno
par1 = sy-msgv1
par2 = sy-msgv2
par3 = sy-msgv3
par4 = sy-msgv4
importing
return = es_return.
else.
loop at lt_ptxdata[] assigning <ls_ptxdata>.
loop at <ls_ptxdata>-tbl_phios[] assigning <ls_dms_rec_phio>.
ls_phio_id-class = <ls_dms_rec_phio>-ph_class.
ls_phio_id-objid = <ls_dms_rec_phio>-ph_objid.
call function 'CV120_KPRO_CHECKOUT_TO_URL'
exporting
* PF_BATCHMODE =
ps_phio_id = ls_phio_id
* PF_FILE =
* PF_STD_URL = ' '
* PF_DP_URL = ' '
* PF_COMP_GET = ' '
importing
pfx_url = lv_url
exceptions
error = 1
no_content = 2
others = 99.
if sy-subrc <> 0.
if sy-msgid is initial.
* &1: Unexpected failure &2! Inform the IT department!
message e001(z_document_search) into es_return-message with 'CV120_KPRO_CHECKOUT_TO_URL' sy-subrc.
* ELSE.
* NOP - sy fields already filled
endif.
call function 'BALW_BAPIRETURN_GET2'
exporting
type = sy-msgty
cl = sy-msgid
number = sy-msgno
par1 = sy-msgv1
par2 = sy-msgv2
par3 = sy-msgv3
par4 = sy-msgv4
importing
return = es_return.
else.
insert initial line into table et_links[] assigning <ls_link>.
<ls_link>-link = lv_url.
endif.
endloop.
endloop.
endif.
endfunction.