on 06-23-2009 5:05 PM
How Gurus
I would like to have a document number that includes a fixed part and a changing part, for example PF/HCM/0001, i want PF/HCM/ to be fixed and then the number will always increase, how can i make this happen. I have tried checking on number assignements but i couldnt get anything meaningfull but i have a feeling that this is possible in SAP, pliz help me.
partson
Hi
You can have the number assignment 3 -Mixed Number assignment with Exit so that if you pass ABC as document number it appends a number to it . But while creation , document number field cannot be left blank.
If you want to automatically generate this number try implementing the BADI ,DOCUMENT_NUMBER01~DOCNUMBER_CHECK() .
make sure that the number assignment for the documenttype is either blank or 1 .
you can try something like this :
METHOD if_ex_document_number01~docnumber_check.
DATA : tdwa TYPE tdwa.
DATA: subrc TYPE inri-returncode,
number LIKE draw-doknr,
number1 LIKE draw-doknr,
new_number LIKE draw-doknr,
new_num TYPE string,
lv_docnum1 TYPE string.
CHECK sy-uname = 'MSRO'.
CHECK tcode = 'CV01'.
CHECK draw-doknr = '' OR draw-doknr = '*'.
CALL FUNCTION 'CV200_DB_TDWA_SELECT'
EXPORTING
pf_dokar = draw-dokar
IMPORTING
psx_tdwa = tdwa
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
Implement suitable error handling here
ELSE.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = tdwa-inumnr
object = 'DOKUMENT'
IMPORTING
number = number
returncode = subrc
EXCEPTIONS
interval_not_found = 4
number_range_not_intern = 8
object_not_found = 12
quantity_is_0 = 16.
CONCATENATE 'ABC' '-' number INTO new_num.
WRITE new_num TO doc_number.
CONDENSE doc_number NO-GAPS.
ENDIF.
ENDMETHOD.
This should work .
Best Regards,
Roopa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
I am trying to give some idea,
1. Define number ranges (intervals)
For external number ranges, set the Indicator: external number assignment.
More hints
If you maintain several number ranges for document management, the number ranges must not overlap.
If you assign an alphanumeric number, the system does not check the number against any number range, unless you are using a user exit.
You can configure a check route for number assignment programs using user exits.
Example:
You can enter a template (prefix) which defines a classifying component of the number. You can write a check routine (using a user exit) that checks your entry and completes it with a unique internal number.
External component: 2NG-
Internal component: XXXX (from a number range)
Template: 2NG-XXXX
Do not change the number range status of internal number range intervals.
Benakaraja
??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You can achieve this using 'Z' number generation exit. Develop exit 'ZMCDOKZNR' by copying standard number generation exit and put necessary logic in it. Assign this exit in configurations of that specific document type in field "Number Exit". With help of good technical consultant you can achieve this easily.
Regards,
Milind Dumbre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.