‎2006 Mar 27 12:16 PM
Hi all,
While doing module pool Programming, After completion of data entered into screen fields, while saving it should generate automatic serial number in an ascending order.
Right now i am following this logic.
fetch the data from database and sort in descending order and increase one number and populate in to that particular field . Then i am showing sucessfull message that order has created with serial number has created.
<b>For this functionality any function module is available in sap. if available please let me know..</b>
Thanks in avance.
praveen
‎2006 Mar 27 12:23 PM
‎2006 Mar 27 12:23 PM
‎2006 Mar 27 12:32 PM
Hi praveen,
Use the Function nodule GET_NEXT_NUMBERS
pass the first number , second and last number ...
Hope it would solve the purpose....
‎2006 Mar 27 12:37 PM
Hi Praveen,
use the FM GET_JOB_NUMBER it Generate a new job number
without giving any number as input..
even when you quit and execute the program..
you'll get a unique number..
regards
satesh
‎2006 Mar 28 2:42 PM
thanks for the FM name,
but how do we reset the FM at certain point.
help is much appreciated.
thanks in advance.
Regards
Rahul.
‎2006 Mar 27 12:40 PM
Hi,
use this FM <b>NUMBER_GET_NEXT</b>, create your own number range using SNRO transaction.
Regards
Vijay
‎2006 Mar 27 2:41 PM
Hi praveen,
you can use the below procedure.
first create the an number range object using SNRO tcode
see the below example assuming ZGE057 as the number range object.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
NR_RANGE_NR = '01'
OBJECT = 'ZGE057'
QUANTITY = '1'
SUBOBJECT = '0001'
TOYEAR = '0000'
IGNORE_BUFFER = ' '
IMPORTING
NUMBER = P_LCL_TEXT_KEY
QUANTITY =
RETURNCODE =
EXCEPTIONS
INTERVAL_NOT_FOUND = 1
NUMBER_RANGE_NOT_INTERN = 2
OBJECT_NOT_FOUND = 3
QUANTITY_IS_0 = 4
QUANTITY_IS_NOT_1 = 5
INTERVAL_OVERFLOW = 6
BUFFER_OVERFLOW = 7
OTHERS = 8
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
‎2006 Mar 27 2:41 PM
Hi praveen,
you can use the below procedure.
first create the an number range object using SNRO tcode
see the below example assuming ZGE057 as the number range object.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
NR_RANGE_NR = '01'
OBJECT = 'ZGE057'
QUANTITY = '1'
SUBOBJECT = '0001'
TOYEAR = '0000'
IGNORE_BUFFER = ' '
IMPORTING
NUMBER = P_LCL_TEXT_KEY
QUANTITY =
RETURNCODE =
EXCEPTIONS
INTERVAL_NOT_FOUND = 1
NUMBER_RANGE_NOT_INTERN = 2
OBJECT_NOT_FOUND = 3
QUANTITY_IS_0 = 4
QUANTITY_IS_NOT_1 = 5
INTERVAL_OVERFLOW = 6
BUFFER_OVERFLOW = 7
OTHERS = 8
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
Anil Kumar K