FUNCTION ZFI_CUSTOMER_CREATE.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(IS_KNA1) LIKE KNA1 STRUCTURE KNA1
*" VALUE(IS_KNB1) LIKE KNB1 STRUCTURE KNB1
*" VALUE(IS_ADRC) LIKE ADRC STRUCTURE ADRC OPTIONAL
*" VALUE(IV_LAISO) TYPE LAISO OPTIONAL
*" VALUE(IV_EMAIL) TYPE AD_SMTPADR OPTIONAL
*" VALUE(IV_REMARK) TYPE AD_REMARK1 OPTIONAL
*" VALUE(IV_MODE) TYPE CTU_MODE DEFAULT 'N'
*" EXPORTING
*" VALUE(EV_KUNNR) TYPE KUNNR
*" VALUE(EV_MSGTY) TYPE MSGTY
*" VALUE(EV_MSGTX) TYPE MSGTX
*"----------------------------------------------------------------------
CLEAR IT_BDCTAB. REFRESH IT_BDCTAB.
CLEAR IT_BDCMSG. REFRESH IT_BDCMSG.
IF IS_KNA1-LAND1 IS INITIAL.
IS_KNA1-LAND1 = 'KR'.
ENDIF.
IF IS_KNA1-PSTLZ IS INITIAL.
IS_KNA1-PSTLZ = '00000'.
ENDIF.
IF IS_KNA1-ORT01 IS INITIAL.
IS_KNA1-ORT01 = '.'.
ENDIF.
IF IS_KNA1-STRAS IS INITIAL.
IS_KNA1-STRAS = '.'.
ENDIF.
IF IS_KNA1-SORTL IS INITIAL.
IS_KNA1-SORTL = IS_KNA1-NAME1.
ENDIF.
IF IS_KNB1-GUZTE IS INITIAL.
IS_KNB1-GUZTE = IS_KNB1-ZTERM.
ENDIF.
IF IV_LAISO IS INITIAL.
SELECT SINGLE LAISO INTO IV_LAISO
FROM T002
WHERE SPRAS = SY-LANGU.
ENDIF.
DATA : LV_GROUP TYPE BU_GROUP,
LV_PRTNR TYPE BU_PARTNER,
LV_SAMNR TYPE BD_SAMENUMBER.
SELECT SINGLE BU_GROUP XSAMENUMBER
INTO (LV_GROUP, LV_SAMNR)
FROM TBD001
WHERE KTOKD = IS_KNA1-KTOKD.
IF IS_KNA1-KUNNR IS NOT INITIAL.
IF LV_SAMNR IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IS_KNA1-KUNNR
IMPORTING
OUTPUT = LV_PRTNR.
IF LV_GROUP = 'C009'.
LV_PRTNR = 'S' && '0' && LV_PRTNR.
ELSE.
LV_PRTNR = 'S' && LV_PRTNR.
ENDIF.
ELSE.
LV_PRTNR = IS_KNA1-KUNNR.
ENDIF.
ENDIF.
SET PARAMETER ID 'BUK' FIELD IS_KNB1-BUKRS.
SET PARAMETER ID 'LND' FIELD IS_KNA1-LAND1.
** (1) BP 채번
PERFORM DYNPRO USING:
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=SCREEN_1000_CRE_ORGA',
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=SCREEN_1110_CHG_ROLE',
' ' 'BUS_JOEL_MAIN-CREATION_NUMBER' LV_PRTNR,
' ' 'BUS_JOEL_MAIN-CREATION_GROUP' LV_GROUP,
' ' 'BUS_JOEL_MAIN-PARTNER_ROLE' '000000',
' ' 'ADDR1_DATA-COUNTRY' IS_KNA1-LAND1,
' ' 'BUT000-NAME_ORG1' IS_KNA1-NAME1,
'X' 'SAPLSPO1' '0600',
' ' 'BDC_OKCODE' '=OPT1',
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=SCREEN_1100_TAB_01',
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=SCREEN_1100_TAB_03',
' ' 'ADDR1_DATA-COUNTRY' IS_KNA1-LAND1,
' ' 'BUT000-NAME_ORG1' IS_KNA1-NAME1.
**<< ID
PERFORM DYNPRO USING:
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=BUS_MAIN_ENTER'.
IF IS_KNA1-STCD2 IS NOT INITIAL.
PERFORM DYNPRO USING:
' ' 'DFKKBPTAXNUM-TAXTYPE(01)' 'KR2',
' ' 'DFKKBPTAXNUM-TAXNUMXL(01)' IS_KNA1-STCD2.
ENDIF.
IF IS_KNA1-STCD1 IS NOT INITIAL.
PERFORM DYNPRO USING:
' ' 'DFKKBPTAXNUM-TAXTYPE(02)' 'KR1',
' ' 'DFKKBPTAXNUM-TAXNUMXL(02)' IS_KNA1-STCD1.
ENDIF.
PERFORM DYNPRO USING:
'X' 'SAPLBUS_LOCATOR' '3000',
' ' 'BDC_OKCODE' '=BUS_MAIN_SAVE'.
**>> ID
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 = '425'.
IF SY-SUBRC EQ 0.
EV_MSGTY = 'S'.
EV_MSGTX = 'Success'.
LV_PRTNR = IT_BDCMSG-MSGV1.
IF LV_PRTNR+0(1) = 'S'.
IS_KNA1-KUNNR = LV_PRTNR+1(9).
ELSE.
IS_KNA1-KUNNR = LV_PRTNR.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = IS_KNA1-KUNNR
IMPORTING
OUTPUT = IS_KNA1-KUNNR.
ELSE.
EV_MSGTY = 'E'.
READ TABLE IT_BDCMSG WITH KEY MSGTYP = 'E'.
IF SY-SUBRC NE 0.
READ TABLE IT_BDCMSG WITH KEY MSGID = 'ZFI'.
IF SY-SUBRC NE 0.
LOOP AT IT_BDCMSG.
ENDLOOP.
ENDIF.
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.
EXIT.
ENDIF.
**(2) 고객 생성(BP수정)
CALL FUNCTION 'ZFI_CUSTOMER_CHANGE'
EXPORTING
IS_KNA1 = IS_KNA1
IS_KNB1 = IS_KNB1
IS_ADRC = IS_ADRC
IV_LAISO = IV_LAISO
IV_EMAIL = IV_EMAIL
IV_REMARK = IV_REMARK
IV_MODE = IV_MODE
IMPORTING
EV_KUNNR = EV_KUNNR
EV_MSGTY = EV_MSGTY
EV_MSGTX = EV_MSGTX.
ENDFUNCTION.
*----------------------------------------------------------------------*
***INCLUDE LZFI33F01.
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form dynpro
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0539 text
* -->P_0540 text
* -->P_0541 text
*----------------------------------------------------------------------*
FORM dynpro USING begin fnam fval.
CLEAR it_bdctab.
IF begin = ' '.
it_bdctab-fnam = fnam.
it_bdctab-fval = fval.
APPEND it_bdctab.
ELSE.
it_bdctab-program = fnam.
it_bdctab-dynpro = fval.
it_bdctab-dynbegin = 'X'.
APPEND it_bdctab.
ENDIF.
ENDFORM. " dynpro
Casino Near Portland, Oregon - Mapyro
답글삭제Looking for 충주 출장마사지 a good deal on Casino Near Portland, Oregon? Mapyro 경상남도 출장마사지 is your complete guide to all 출장안마 your favorite Casino in 파주 출장샵 Oregon, 제천 출장안마 including popular casino