본문 바로가기

ERP_Work/ABAP

공급가액에 따른 부가세 자동계산 (KR)


FUNCTION Z_CALC_VAT.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(BIAMT) OPTIONAL
*"     REFERENCE(MWSKZ) LIKE  T007A-MWSKZ
*"  EXPORTING
*"     VALUE(KBETR) LIKE  KONP-KBETR
*"     VALUE(BITAX)
*"     VALUE(BITOT)
*"----------------------------------------------------------------------
* Make by Franklee
*"----------------------------------------------------------------------
  DATA : LS_A003 LIKE A003,
         LS_KONP LIKE KONP.

  CLEAR : KBETR, BITAX, BITOT.
  CLEAR : LS_A003, LS_KONP.

  LS_A003-MWSKZ = MWSKZ.

  SELECT SINGLE * INTO LS_A003
    FROM A003
   WHERE KAPPL EQ 'TX'
     AND ALAND EQ 'KR'
     AND MWSKZ EQ LS_A003-MWSKZ.
  CHECK SY-SUBRC = 0.

  SELECT SINGLE * INTO LS_KONP
    FROM KONP
   WHERE KNUMH EQ LS_A003-KNUMH
     AND LOEVM_KO EQ ''.
  CHECK SY-SUBRC = 0.

  KBETR = LS_KONP-KBETR / 1000.
  BITAX = KBETR * BIAMT.
  BITOT = BIAMT + BITAX.

ENDFUNCTION.

'ERP_Work > ABAP' 카테고리의 다른 글

SAP Shotcut EnablePassword  (0) 2011.08.03
전화번호 Conversion Exit  (0) 2010.08.26
주민등록번호 외국인등록번호 Check 프로그램  (0) 2009.03.20
임시전표 Table에 대한 고찰  (0) 2009.03.09
FIEB_PASSWORD  (0) 2009.02.27