SAP ABAP 공부하기
DATA :
LV_WRBTR TYPE BSEG-WRBTR,
LV_WRBTR2 TYPE BSEG-WRBTR,
LT_MRDAT TYPE STANDARD TABLE OF RTAX1U15.
LV_WRBTR = 10000.
CALL FUNCTION 'CALCULATE_TAX_FROM_NET_AMOUNT'
EXPORTING
I_BUKRS = '1000' "회사코드
I_MWSKZ = 'A1' "세금코드
* I_TXJCD = ' '
I_WAERS = 'KRW' "통화
I_WRBTR = LV_WRBTR
* I_ZBD1P = 0
* I_PRSDT =
* I_PROTOKOLL =
* I_TAXPS =
* I_ACCNT_EXT =
* I_ACCDATA =
* I_PRICING_REFRESH_TX = ' '
IMPORTING
* E_FWNAV =
* E_FWNVV =
E_FWSTE = LV_WRBTR2
* E_FWAST =
TABLES
T_MWDAT = LT_MRDAT
* EXCEPTIONS
* BUKRS_NOT_FOUND = 1
* COUNTRY_NOT_FOUND = 2
* MWSKZ_NOT_DEFINED = 3
* MWSKZ_NOT_VALID = 4
* KTOSL_NOT_FOUND = 5
* KALSM_NOT_FOUND = 6
* PARAMETER_ERROR = 7
* KNUMH_NOT_FOUND = 8
* KSCHL_NOT_FOUND = 9
* UNKNOWN_ERROR = 10
* ACCOUNT_NOT_FOUND = 11
* TXJCD_NOT_VALID = 12
* OTHERS = 13
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
*CALL FUNCTION 'CALCULATE_TAX_FROM_NET_AMOUNT'
WRITE : /, LV_WRBTR,
/, LV_WRBTR2.
SAP ABAP 개발을 하면서 세금코드별 세금을 구하기 위해 비율이 들어있는 테이블을 찾아보았으나 찾지 못하였다.
하지만 세금을 구하는 스탠다드 펑션을 찾아내어 사용하였다.
해당펑션의 필수값들이다.
핵심로직은 아래에 적어놓았다.
DATA :
LV_WRBTR TYPE BSEG-WRBTR,
LV_WRBTR2 TYPE BSEG-WRBTR,
LT_MRDAT TYPE STANDARD TABLE OF RTAX1U15.
LV_WRBTR = 10000.
CALL FUNCTION 'CALCULATE_TAX_FROM_NET_AMOUNT'
EXPORTING
I_BUKRS = '1000' "회사코드
I_MWSKZ = 'A1' "세금코드
* I_TXJCD = ' '
I_WAERS = 'KRW' "통화
I_WRBTR = LV_WRBTR
* I_ZBD1P = 0
* I_PRSDT =
* I_PROTOKOLL =
* I_TAXPS =
* I_ACCNT_EXT =
* I_ACCDATA =
* I_PRICING_REFRESH_TX = ' '
IMPORTING
* E_FWNAV =
* E_FWNVV =
E_FWSTE = LV_WRBTR2
* E_FWAST =
TABLES
T_MWDAT = LT_MRDAT
* EXCEPTIONS
* BUKRS_NOT_FOUND = 1
* COUNTRY_NOT_FOUND = 2
* MWSKZ_NOT_DEFINED = 3
* MWSKZ_NOT_VALID = 4
* KTOSL_NOT_FOUND = 5
* KALSM_NOT_FOUND = 6
* PARAMETER_ERROR = 7
* KNUMH_NOT_FOUND = 8
* KSCHL_NOT_FOUND = 9
* UNKNOWN_ERROR = 10
* ACCOUNT_NOT_FOUND = 11
* TXJCD_NOT_VALID = 12
* OTHERS = 13
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
*CALL FUNCTION 'CALCULATE_TAX_FROM_NET_AMOUNT'
WRITE : /, LV_WRBTR,
/, LV_WRBTR2.
Tags:
SAP ABAP