Tcode to maintain Number range is Vn01
Include RV60AFZZ
*---------------------------------------------------------------------*
* FORM USEREXIT_NUMBER_RANGE *
*---------------------------------------------------------------------*
* This userexit can be used to determine the numberranges for *
* the internal document number. *
* US_RANGE_INTERN - internal number range *
* This form is called from form LV60AU02 *
*---------------------------------------------------------------------*
FORM USEREXIT_NUMBER_RANGE USING US_RANGE_INTERN.
* Example: Number range from TVFK like in standard
* US_RANGE_INTERN = TVFK-NUMKI.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form USEREXIT_NUMBER_RANGE, End A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZZSD_INVNUM_RANGE. "active version
IF sy-tcode EQ 'VF01' OR sy-tcode EQ 'VF04' OR sy-tcode EQ 'VF11'.
DATA : gv_numki TYPE zsd_t_invnum-numki.
SELECT SINGLE numki
FROM zsd_t_invnum
INTO gv_numki
WHERE bukrs EQ vbrk-bukrs
AND vkorg EQ vbrk-vkorg
AND werks EQ vbrp-werks
AND fkart EQ vbrk-fkart.
IF gv_numki IS INITIAL.
MESSAGE e000(zcss) WITH 'Number range for the Plant' vbrp-werks 'is not maintained'.
ELSE.
us_range_intern = gv_numki.
ENDIF.
ENDIF.
ENDENHANCEMENT.
*$*$-End: (1)---------------------------------------------------------------------------------$*$*
ENDFORM.
*eject
No comments:
Post a Comment