|
<< Click to Display Table of Contents >> Navigation: All About ABAP Technique > Indonesia > ABAP Tutorial > ABAP Workbench Tools > User Exits > Contoh User Exits > RV60AFZC |
***INCLUDE RV60AFZC.
************************************************************************
* *
* This include is reserved for user modifications *
* Forms for invoicing *
* The name of modification modules should begin with 'ZZ'. *
* *
************************************************************************
* USEREXIT_NUMBER_RANGE_INV_DATE *
* USEREXIT_FILL_VBRK_VBRP *
************************************************************************
*---------------------------------------------------------------------*
* FORM USEREXIT_NUMBER_RANGE_INV_DATE *
*---------------------------------------------------------------------*
* This userexit can be used to determine the numberranges for *
* the internal document number. This userexit can be used when *
* the number_ranger should impact the invoice date via table *
* TVFKD. *
* If this userexit is active the USEREXIT_NUMBER_RANGE is not *
* processed anymore, that means this userexit has priority. *
* US_RANGE_INTERN - internal number range *
* This form is called from form LV60AU02 and LV60AU11 *
*---------------------------------------------------------------------*
FORM USEREXIT_NUMBER_RANGE_INV_DATE USING US_RANGE_INTERN.
* Example: Number range from TVFK like in standard
* US_RANGE_INTERN = TVFK-NUMKI.
ENDFORM.
*---------------------------------------------------------------------*
* FORM USEREXIT_FILL_VBRK_VBRP *
*---------------------------------------------------------------------*
* This userexit can be used to fill fields in VBRK and VBRP *
* Be aware, that at this time the work areas KUAGV KURGV *
* KUWEV and KUREV are not filled. *
* This form is called from FORM VBRK_VBRP_FUELLEN. *
*---------------------------------------------------------------------*
FORM USEREXIT_FILL_VBRK_VBRP.
* Example: change Tax country
* VBRK-LANDTX = T001-LAND1.
*{ INSERT WDVK900750 1
**** Check Validation for Invoice List Type (Faktur Pajak)
*** Faktur Pajak is only for Invoice and Debit Memo
IF VBRK-VBTYP ne 'M' and VBRK-VBTYP ne 'P'.
VBRK-FKART_RL = ''.
ENDIF.
*** Nota Retur Pajak
IF VBRK-FKART = 'ZS11' or VBRK-FKART = 'ZEX2'.
VBRK-FKART_RL = 'ZFPR'.
ENDIF.
*** Faktur Pajak is only for PKP customers
IF VBRK-KONDA eq '02' or VBRK-KONDA is initial.
VBRK-FKART_RL = ''.
ENDIF.
*} INSERT
*{ INSERT WDVK902978 2
*** Determine Business Area
tables: TGSB.
IF VBRP-VKBUR is initial.
VBRP-VKBUR = 'AB01'.
ENDIF.
IF VBRP-VKBUR ne VBRP-GSBER.
select single * from TGSB where GSBER = VBRP-VKBUR.
IF SY-SUBRC = 0.
VBRP-GSBER = VBRP-VKBUR.
ENDIF.
ENDIF.
*} INSERT
*{ INSERT WDVK903424 3
**** Check authorization based on sales office
AUTHORITY-CHECK OBJECT 'Z_VKBUR'
ID 'VKBUR' FIELD VBRP-VKBUR
ID 'ACTVT' FIELD '01'.
IF SY-SUBRC ne 0.
message e907 with VBRP-VKBUR .
ENDIF.
*} INSERT
ENDFORM.
*eject