CN25 网络完成确认操作路径如下:
DATA:
"bdc 执行内表
lt_bdcdata TYPE TABLE OF bdcdata,
"bdc 返回信息表
lt_msgtab TYPE TABLE OF bdcmsgcoll,
lv_str TYPE string,
lv_message TYPE string.
lt_bdcdata = VALUE #( ( program = 'SAPLCORU' dynpro = '2000' dynbegin = 'X' )
( fnam = 'BDC_CURSOR' fval = 'CORUF-VORNR' )
( fnam = 'BDC_OKCODE' fval = '=ENTR' )
( fnam = 'CORUF-AUFNR' fval = ls_act-network )
( fnam = 'CORUF-VORNR' fval = ls_act-activity )
( program = 'SAPLCORU' dynpro = '2200' dynbegin = 'X' )
( fnam = 'BDC_CURSOR' fval = 'AFRUD-IEDD' )
( fnam = 'BDC_OKCODE' fval = '=BU' )
( fnam = 'AFRUD-ISDD' fval = iv_isdd )
( fnam = 'AFRUD-IEDD' fval = iv_iedd ) ).
CALL TRANSACTION 'CN25' USING lt_bdcdata
MODE gv_mode
MESSAGES INTO lt_msgtab
UPDATE 'S'.
CLEAR: lv_str,lv_message.
LOOP AT lt_msgtab INTO DATA(ls_msgtab) WHERE msgtyp CA 'AEX'.
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = ls_msgtab-msgid
msgnr = ls_msgtab-msgnr
msgv1 = ls_msgtab-msgv1
msgv2 = ls_msgtab-msgv2
msgv3 = ls_msgtab-msgv3
msgv4 = ls_msgtab-msgv4
IMPORTING
message_text_output = lv_str.
IF lv_message IS INITIAL.
lv_message = lv_str.
ELSE.
lv_message = |{ lv_message }/{ lv_str }|.
ENDIF.
ENDLOOP.
IF lv_message IS NOT INITIAL.
"失败
ELSE.
"成功
ENDIF.
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/17902.html