我正在运行 RFC 以从 SAP 获取数据。当我运行这个 RFC 时,我似乎得到了一个指向数据的指针,而不是数据本身。
<ET_RETURN>BAPIRET2_</ET_RETURN>
看起来这个 BAPIRET2_ 是一些数据集名称或指针。我想要这个 BAPIRET2_ 数据集中的数据。
有什么方法可以获取数据本身吗?
蒂姆
编辑:RFC是:
FUNCTION z_esrv_offer_getlist.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(IV_USERID) TYPE UNAME OPTIONAL
*" VALUE(IV_REQUESTID) TYPE ZESRVREQGUID OPTIONAL
*" VALUE(IV_OFFER_NUM) TYPE TKONN OPTIONAL
*" VALUE(IV_STATUS_CHANGE_FROM_DATETIME) TYPE ZDATETIME OPTIONAL
*" VALUE(IV_STATUS_CHANGE_TO_DATETIME) TYPE ZDATETIME OPTIONAL
*" VALUE(IV_PURCH_SALES) TYPE ZPUR_SALE OPTIONAL
*" VALUE(IV_TYPE) TYPE BSARK OPTIONAL
*" VALUE(IV_IDOC) TYPE XFELD DEFAULT SPACE
*" VALUE(IT_PLANTS) TYPE CCVX_WERKS_TAB OPTIONAL
*" VALUE(IT_PARTNERS) TYPE ZESRVBPLIST_TAB OPTIONAL
*" VALUE(IT_OFFER_STATUS_CODES) TYPE ZESRV_BTBSTA_TAB OPTIONAL
*" CHANGING
*" VALUE(ET_OFFERS) TYPE ZESRVOFFER_TAB
*" VALUE(ET_CHANGE_HIST) TYPE ZESRVOFFER_HIST_TAB
*" VALUE(ET_RETURN) TYPE BAPIRET2_TAB
*"----------------------------------------------------------------------
DATA: l_error TYPE symsgv,
lv_return TYPE bapiret2.
FIELD-SYMBOLS: <error> TYPE bapiret2.
* Initialize.
PERFORM initialize_setup.
PERFORM initialize_for_getlist.
gv_userid = iv_userid.
gv_req_id = iv_requestid.
PERFORM get_function_name CHANGING gv_funcname.
* Unload selection criteria into global variables
gv_offer = iv_offer_num.
gv_frm_chngdtm = iv_status_change_from_datetime.
gv_to_chngdtm = iv_status_change_to_datetime.
gv_ps = iv_purch_sales.
gv_type = iv_type. "(F)irm / (S)oft
gv_idoc = iv_idoc. "X if for idoc creation
* partners
IF it_partners[] IS NOT INITIAL.
r_partners-sign = 'I'.
r_partners-option = 'EQ'.
CLEAR r_partners-high.
LOOP AT it_partners INTO gs_partners.
APPEND gs_partners TO gt_logprtnrs.
r_partners-low = gs_partners-bu_partner.
APPEND r_partners TO gt_partner_rng.
ENDLOOP.
ENDIF.
* plants
IF it_plants[] IS NOT INITIAL.
r_plants-sign = 'I'.
r_plants-option = 'EQ'.
CLEAR r_plants-high.
LOOP AT it_plants INTO gn_plant.
r_plants-low = gn_plant-werks.
APPEND r_plants TO gt_plant_rng.
APPEND gn_plant TO gt_plants.
ENDLOOP.
ENDIF.
* status codes
IF it_offer_status_codes[] IS NOT INITIAL.
r_status-sign = 'I'.
r_status-option = 'EQ'.
CLEAR r_status-high.
LOOP AT it_offer_status_codes INTO gn_status.
r_status-low = gn_status-btbsta.
APPEND r_status TO gt_status_rng.
APPEND gn_status TO gt_status_codes.
ENDLOOP.
ENDIF.
* make sure there is at least one criteria filled
IF iv_offer_num IS INITIAL AND
iv_status_change_from_datetime IS INITIAL AND
iv_status_change_to_datetime IS INITIAL AND
iv_type IS INITIAL AND
it_plants[] IS INITIAL AND
it_partners[] IS INITIAL AND
it_offer_status_codes[] IS INITIAL.
PERFORM get_message_for_bapi USING gc_warning gc_esrv '057'
space space space space
CHANGING lv_return.
APPEND lv_return TO et_return.
APPEND lv_return TO gt_error.
* IF iv_userid IS INITIAL AND iv_requestid = 0.
* ELSE.
PERFORM bapi_logging USING gv_funcname.
* ENDIF.
EXIT.
ENDIF.
* at least one selection criteria has been entered, so validate selections
PERFORM validate_selections.
READ TABLE gt_error INTO lv_return WITH KEY type = 'W'.
IF sy-subrc = 0.
* errors found in selection criteria, stop
et_return[] = gt_error[].
EXIT.
ELSE.
* no errors found, select data
PERFORM get_offers.
IF gt_offers[] IS NOT INITIAL.
PERFORM get_history.
et_change_hist[] = gt_chng_hist[].
et_offers[] = gt_offers[].
ENDIF.
DESCRIBE TABLE et_offers LINES gv_recordsfound.
IF gv_recordsfound = 0.
* no offers found
PERFORM get_message_for_bapi USING gc_warning gc_esrv '061'
space space space space
CHANGING lv_return.
APPEND lv_return TO et_return.
APPEND lv_return TO gt_error.
* IF iv_userid IS INITIAL AND iv_requestid = 0.
* ELSE.
PERFORM bapi_logging USING gv_funcname.
* ENDIF.
EXIT.
ELSE.
READ TABLE et_return INTO lv_return WITH KEY type = 'W'.
IF sy-subrc <> 0.
* success, history returned
PERFORM get_message_for_bapi USING gc_success gc_esrv '002'
space space space space
CHANGING lv_return.
APPEND lv_return TO gt_error.
APPEND lv_return TO et_return.
* IF iv_userid IS INITIAL AND iv_requestid = 0.
* ELSE.
PERFORM bapi_logging USING gv_funcname.
* ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDFUNCTION.