2009 Feb 07 10:03 AM
Dear Experts,
I got a requirement, The sales order number after saving the document the SO document number should be SO ( Alphabetic) 00012074 (Numeric) ie. SO00012074,
The numeric portion will come from the number range assigned for that document and Alphabatic portion should come depending on the transaction code and document type.
in SAPMV45AFZZ User-exit
FORM USEREXIT_NUMBER_RANGE USING US_RANGE_INTERN.
This exit triggers before call function 'NUMBER_GET_NEXT' that generates document number for the current document and return to the field vbak-vbeln and finally this is the document number, In the debug mode if I change the number for example 0000012074 to SO00012074 runtime I can get the expected number and also it is saved in the system. But in the real time it is not possible as this coding in not any user-exit.
So I can't use this user-exit for the to get alphanumeric number in the document.
FORM USEREXIT_SAVE_DOCUMENT
This exit triggers after the generation of document number. In this user exit if we change the document number for example 0000012074 to SO00012074, it shows the expected number after saving the sales order but it is not actually saving in the database. Means if we try to open the same SO for example SO00012074 in va02/va03 it is showing
SD document SO00012074 is not in the database or has been archived but if we try open 0000012074 in va02/va03, we can get the document.
We can use this user-exit but if we change the value of vbak-vbeln in this user-exit finally it is not saving in the system.
Can anybody help me how I can achieve the requirement ?
Dear Experts,
I got a requirement, The sales order number after saving the document the SO document number should be SO ( Alphabetic) 00012074 (Numeric) ie. SO00012074,
The numeric portion will come from the number range assigned for that document and Alphabatic portion should come depending on the transaction code and document type.
in SAPMV45AFZZ User-exit
FORM USEREXIT_NUMBER_RANGE USING US_RANGE_INTERN.
This exit triggers before call function 'NUMBER_GET_NEXT' that generates document number for the current document and return to the field vbak-vbeln and finally this is the document number, In the debug mode if I change the number for example 0000012074 to SO00012074 runtime I can get the expected number and also it is saved in the system. But in the real time it is not possible as this coding in not any user-exit.
So I can't use this user-exit for the to get alphanumeric number in the document.
FORM USEREXIT_SAVE_DOCUMENT
This exit triggers after the generation of document number. In this user exit if we change the document number for example 0000012074 to SO00012074, it shows the expected number after saving the sales order but it is not actually saving in the database. Means if we try to open the same SO for example SO00012074 in va02/va03 it is showing
SD document SO00012074 is not in the database or has been archived but if we try open 0000012074 in va02/va03, we can get the document.
We can use this user-exit but if we change the value of vbak-vbeln in this user-exit finally it is not saving in the system.
Can anybody help me how I can achieve the requirement ?
2009 Feb 09 4:34 AM
bro...
You have got an option to copy the program the standard program into zprogram....
goto se38 and copy the program into a z program....and in doing so copy everything from the ctandard program ie vaients,documentation and function module etc.
now change this z program to meet your need....
both way if you dont make lot of changes you will get same performance with your work done
regards
2009 Feb 09 5:24 AM
are you calling any standard bapi to post the chages to ur db in the exit?
2009 Feb 09 10:21 AM
hi,
am not having the SAP system now to check anyway try this work around.,,,
search in sapmv45a program for database commit or insert ..put a break point there....
and once it hits there change the order number...and see whether its working fine...
if so then create a enhancement point in the form and concetanate with s ....
and insert it to the db table...
hope it works