FUNCTION ZFI_VENDOR_BLOCK.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(IV_LIFNR) TYPE LIFNR
*" VALUE(IV_BUKRS) TYPE BUKRS OPTIONAL
*" VALUE(IV_SPERR) TYPE SPERB_X OPTIONAL 중앙전기보류(X:보류,blank:해제, Z:유지)
*" VALUE(IV_LOEVM) TYPE LOEVM OPTIONAL 삭제 지시자(X:삭제,blank:해제, Z:유지)
*" VALUE(IV_MODE) TYPE CTU_MODE DEFAULT 'N' 처리모드
*" EXPORTING
*" VALUE(EV_LIFNR) TYPE LIFNR
*" VALUE(EV_MSGTY) TYPE MSGTY
*" VALUE(EV_MSGTX) TYPE MSGTX
*"----------------------------------------------------------------------
CLEAR it_bdctab. REFRESH it_bdctab.
CLEAR it_bdcmsg. REFRESH it_bdcmsg.
SET PARAMETER ID 'BPA' FIELD ' '.
SET PARAMETER ID 'BUK' FIELD IV_BUKRS.
IF IV_SPERR = 'Z'.
SELECT SINGLE SPERR INTO IV_SPERR
FROM LFA1
WHERE LIFNR = IV_LIFNR.
ENDIF.
IF IV_LOEVM = 'Z'.
SELECT SINGLE LOEVM INTO IV_LOEVM
FROM LFA1
WHERE LIFNR = IV_LIFNR.
ENDIF.
**<<BP 수정 수정모드->조회모드
PERFORM dynpro USING:
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=SCREEN_1000_SETTINGS'.
PERFORM dynpro USING:
'X' 'SAPLBUPA_DIALOG_SETTINGS' '4000',
' ' 'BDC_OKCODE' '=BUS_MAIN_ENTER',
' ' 'BUS_JOEL_SET-BUPA_DISPLAY_MODE' 'X'.
PERFORM dynpro USING:
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=SCREEN_1000_MAIN_NOT'.
**>>BP 수정 모드->조회모드
PERFORM dynpro USING:
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=BUS_MAIN_ENTER',
' ' 'BUS_JOEL_MAIN-CHANGE_NUMBER' IV_LIFNR.
PERFORM dynpro USING:
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BUS_JOEL_MAIN-PARTNER_ROLE' 'FLVN00',
' ' 'BDC_OKCODE' '=SCREEN_1000_ACTIVITY'.
PERFORM dynpro USING:
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=SCREEN_1000_MAIN_REL',
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=SCREEN_1000_MAIN_P01'.
PERFORM dynpro USING:
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=SCREEN_1100_TAB_06'.
PERFORM dynpro USING:
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=SCREEN_1000_MAIN_P02',
' ' 'BUT000-XDELE' IV_LOEVM,
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=SCREEN_1100_TAB_04',
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=BUS_MAIN_SAVE',
' ' 'GS_LFA1-SPERR' IV_SPERR,
' ' 'GS_LFB1-LOEVM' IV_LOEVM,
'X' 'SAPLSPO1' '0600',
' ' 'BDC_OKCODE' '=OPT2'.
CALL TRANSACTION 'BP' USING it_bdctab
MODE IV_MODE
UPDATE 'S'
MESSAGES INTO it_bdcmsg.
READ TABLE it_bdcmsg WITH KEY MSGTYP = 'S'
MSGID = 'R1'
msgnr = '215'.
IF SY-SUBRC EQ 0.
EV_MSGTY = 'S'.
EV_MSGTX = 'Success'.
EV_LIFNR = it_bdcmsg-msgv1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = EV_LIFNR
IMPORTING
OUTPUT = EV_LIFNR.
ELSE.
EV_MSGTY = 'E'.
READ TABLE it_bdcmsg WITH KEY MSGTYP = 'E'.
IF SY-SUBRC NE 0.
loop at it_bdcmsg.
endloop.
ENDIF.
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
MSGID = it_bdcmsg-MSGID
MSGNR = it_bdcmsg-MSGNR
MSGV1 = it_bdcmsg-MSGV1
MSGV2 = it_bdcmsg-MSGV2
MSGV3 = it_bdcmsg-MSGV3
MSGV4 = it_bdcmsg-MSGV4
IMPORTING
MESSAGE_TEXT_OUTPUT = EV_MSGTX.
ENDIF.
ENDFUNCTION.
댓글 없음:
댓글 쓰기