cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning Document Number automatically without user input

Former Member
0 Kudos

Hello all DMS Gurus,

I have some specific requirement while assigning Docuemnt number while creating DIR's , but I am not sure how to address that.

The requirement is :

1) User should be able to make out Dcoument type by looking at its Document number.

2) User need not to bother about defining Document number while creation of DIR (DIR number generation should be taken care by the system).

To address above requirement I had some action plans

The Document type is PRT.

When ever user wants to create Document (CV01n) of Type PRT , all the numbers generated for this Document type should start with PRT followed by some internal numbering and user should not be allowed to enter Document number.

Can someone please help me with this?

Accepted Solutions (1)

Accepted Solutions (1)

former_member182387
Active Participant
0 Kudos

Hi

This can be done by some configuration in SPRO transaction.

1.) Goto SPRO -->Click SAP reference IMG.

2.) Cross application Components --> Document Management --> Control data.

3.) Execute Define Document Type.

4.) Create new doc type name 'PRT', give the description, give the number assignment field as 1 - only internal number assignment.And then select your number ranges.

5.) Create one Z program by copying the existing "MCDOKZNR" and modify the code according to your requirement and give "ZMCDOKZNR" in Number exit fields.

In the PERFORM "get_number", you can write your code for concatenating the Doc type and internal number.

Search in net for more details. Functional will know more about this automatic number assignment.Please contact your functional for information.

Edited by: Senthil Kumar on Aug 23, 2010 3:59 PM

Former Member
0 Kudos

Thanks a lot Senthil for your response.

I was able to understand till step #4 , and as I am new to SAP I was not able to understand Point #5 , where we need to change MCDOKZNR USER_EXIT program. I searched in the net regarding this, but that was not clear enough so that I am go ahead.

Can you please explain me about how to view, copy ,edit and use modified ZMCDOKZNR as USER_EXIT program.

Thanks you again for quick clarification.

Best regards,

Arun

Edited by: Arun 08 on Aug 23, 2010 1:05 PM

former_member182387
Active Participant
0 Kudos

Hi,

You need to copy the report "MCDOKZNR" to new Z prog "ZMCDOKZNR".

And Edit the prog ZMCDOKZNR, exactly at the place perform get_number

FORM get_number changing draw STRUCTURE draw
                         drad STRUCTURE drad
                         drat STRUCTURE drat
                         drap STRUCTURE drap
                         tdwa STRUCTURE tdwa.


After calling the FM  CALL FUNCTION 'NUMBER_GET_NEXT',
 you will get the automatic number in the variable 'number'

Change the perform convert_doknr as shown below

FORM convert_doknr USING doknri doknro.
  DATA: hlp_nr1 LIKE draw-doknr,
        hlp_nr2 LIKE draw-doknr.

  FIELD-SYMBOLS: <doknr>.

  IF draw-dokar EQ 'PRT'.

    doknro+0(3) = 'PRT'.
    WRITE doknri TO hlp_nr1.
    REPLACE ' ' WITH hlp_nr1 INTO doknro.
    CONDENSE doknro NO-GAPS.

  ELSE.

    hlp_nr1 = doknri.
    CONDENSE hlp_nr1 NO-GAPS.
    IF hlp_nr1 EQ doknri.
      ASSIGN hlp_nr2 TO <doknr> TYPE 'N'.
      <doknr> = doknri.
      doknri = <doknr>.
    ENDIF.
    doknro = doknri.

  ENDIF.

ENDFORM.                    "convert_doknr

Answers (0)