2013 Mar 09 9:21 AM
Dear all
I have used 'number_get_next' fm to generate sno. in snro i have defined number range with 10 digits ..but in the output im getting only first 7 digits after ecxecuting the program.how to resolve this
Thanks
2013 Jul 23 12:03 PM
Hi Karthick
I tried like this i am getting
DATA:
NUMBER TYPE I.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = '01'
object = 'ZDEMO'
IMPORTING
NUMBER = NUMBER
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.
Write 😕 'Next available number is: ', Number.
Dear all
I have used 'number_get_next' fm to generate sno. in snro i have defined number range with 10 digits ..but in the output im getting only first 7 digits after ecxecuting the program.how to resolve this
Thanks
2013 Mar 09 3:22 PM
Hi,
IMPORTING
number = <snro>
snro must be defined as numeric 10 which you have already done. Can you please write the code?
Regards
Purnand
2013 Mar 09 6:23 PM
2013 Mar 11 6:28 AM
Hi karthik,
Check your variable length if you have given LENGTH 10.
Also when you assign the variable as NUM format if it has '0's in front of it it will vomit it and display.
for eg: if your sno is "0001234567" you will get only '1234567'
if you still want to display '0's use CHAR format.
DATA number(10) type c.
IMPORTING
number = number
Thanks
Askar.
2013 Mar 13 8:56 AM
2013 Jul 23 7:27 AM
Thanks for all ur replies,
I m am passing 10 digit number into FM not prefixed with '0' s , but at out im getting 7 digits,,i have debugged that FM , ther variable has been declared with 7 , will any issue happen if i change length in standard FM
2013 Jul 23 12:03 PM
Hi Karthick
I tried like this i am getting
DATA:
NUMBER TYPE I.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = '01'
object = 'ZDEMO'
IMPORTING
NUMBER = NUMBER
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.
Write 😕 'Next available number is: ', Number.
2013 Jul 23 12:11 PM
hi karthik,
"the variable has been declared with 7"
thats the reason!!!
Step 1- Check that the object in snro has a type of num length of 10
Step 2- then check where you are calling the num_next function the value returning should also be 10 length.
Step 3- if none above then are you calling the right object make sure...
There shouldnt be other reason apart from these.
2013 Jul 24 6:14 AM
Hi Karthik
Please try the below code
data : w_head type mseg-mblnr.
call function 'NUMBER_GET_NEXT'
exporting
nr_range_nr = 'CR'
object = 'ZDEMO'
quantity = '1'
importing
number = w_head-docno
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
.
Hope it helps..
Regards
Suganya
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |