11-07-2007 6:06 AM
Hi Experts!!,
I have created a object in SRNO / SNUM tr code. with specifying Number range from 00000001 to 99999999 and current number as 0. Now while executing the program to generate auto number and fill it to the particular z-table. Its giving dump error can any one help me on the same. The program is as follows.
INCLUDE MZFIRSTPAGETOP . " global Data
TABLES: ZCHP_CUST_INFO.
DATA: OKCODE LIKE SY-UCOMM.
data: wnorange like INRI-NRRANGENR. "number range
DATA: CNAME LIKE ZCHP_CUST_INFO-CREATED_BY,
REQTYP LIKE ZCHP_CUST_INFO-REQUEST_TYPE,
DESC LIKE ZCHP_CUST_INFO-SHORT_TEXT,
PRIO_TYPE LIKE ZCHP_CUST_INFO-PRIORITY_TYPE,
EFFECTIVE_DATE like ZCHP_CUST_INFO-REQUIRED_STR_DAT,
COMM_TYP like ZCHP_CUST_INFO-MODE_OF_COMM,
COMM like ZCHP_CUST_INFO-ADDRESS,
NEW_NUM LIKE ZCHP_CUST_INFO-REQ_NUM.
NEW_NUM(12).
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'FOR1000'.
SET TITLEBAR '1000'.
ENDMODULE. " STATUS_0100 OUTPUT
INCLUDE MZFIRSTPAGEO01 . " PBO-Modules *
INCLUDE MZFIRSTPAGEI01 . " PAI-Modules *
INCLUDE MZFIRSTPAGEF01 . " FORM-Routines *
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
MODULE USER_COMMAND_1000 INPUT.
CASE SY-UCOMM.
WHEN 'SUBMIT'.
*----
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
NR_RANGE_NR = wnorange
OBJECT = 'ZREFNUM'
IMPORTING
NUMBER = NEW_NUM
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.
*----
new_num = new_num + 1.
ZCHP_CUST_INFO-REQ_NUM = NEW_NUM.
ZCHP_CUST_INFO-CREATED_BY = CNAME.
ZCHP_CUST_INFO-REQUEST_TYPE = REQTYP.
ZCHP_CUST_INFO-PRIORITY_TYPE = PRIO_TYPE.
ZCHP_CUST_INFO-SHORT_TEXT = DESC.
ZCHP_CUST_INFO-CREATED_ON = EFFECTIVE_DATE.
ZCHP_CUST_INFO-MODE_OF_COMM = COMM_TYP.
ZCHP_CUST_INFO-ADDRESS = COMM.
INSERT ZCHP_CUST_INFO.
COMMIT WORK.
WHEN 'RESET'.
CLEAR: CNAME,REQTYP,PRIO_TYPE,
DESC,EFFECTIVE_DATE,COMM_TYP,COMM.
WHEN 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUT
Thanks in advance,
Sunil
11-07-2007 6:09 AM
Hi
What error it is giving in dump
check the dump analysis in ST22
if you have created the NR object in SNRP/SNUM correctly it should work.
goto SE37 enter this fun module and see where used list and take the sample code and do it in similar way
Regards
Anji
11-07-2007 6:09 AM
Hi
What error it is giving in dump
check the dump analysis in ST22
if you have created the NR object in SNRP/SNUM correctly it should work.
goto SE37 enter this fun module and see where used list and take the sample code and do it in similar way
Regards
Anji
11-07-2007 6:16 AM
Hi Anji
Its giving the following error
The call to the function module "number_get_next" is incorrect.
The fm interface allows you to specify only fields of a particular type under "NR_Range_NR". the field "'wnorange'" specified here has a different field type.
regards,
Sunil
11-07-2007 6:19 AM
Hi sunil,
Take same field type for wnorange which is defined in FM number_get_next.
That's all.
Regards
Srimanta
11-07-2007 8:16 AM
Hi Experts!,
<b> The following is the error I got in dump. while execting the FM Number_get_next.
Program error: ASSIGN with length 0 in program "SAPLSNR3 ".
error analysis:
An ASSIGN statement in the program "SAPLSNR3 " contained a field symbol with
length 0. This is not possible.
length 0.
This is not possible.
[/b
any helping hands will get big rewards!!!
Thnbaks in advance,
Sunil
11-07-2007 8:20 AM
Hi,
check the below include for sample code..
/SPE/STO_DELIV_F03
CONSTANTS: lc_number_range TYPE inri-nrrangenr VALUE '01',
lc_cond_object TYPE inri-object VALUE 'KONV'.
DATA: l_is_repl_deliv TYPE xflag.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = lc_number_range
object = lc_cond_object
IMPORTING
number = c_knumv.
Reward if helpful..
Regards,
nagaraj
11-07-2007 9:36 AM
Hi,
I used the same type of code, but now again new dump error:
/b
Type conflict when calling a function module.
/b
Thanks in advance,
Sunil
11-07-2007 9:39 AM
Hi Nagaraj,
you used KONV, wht is that, whr you got this, is that related to any table filed name or the object name created in the SNUM tr code.
regards,
Sunill
11-07-2007 10:55 AM
Hi Nagaraj,
<b> I don't know how much thanks I have to tell, You codes really it worked. You really geneous. I was struggling from past few days to solve it and you did it in just 5 lines. Thanks a lot dude. I am very much happy.
Also I thank all the people who helped me to solve this problem.
Once again Thanks a lot and WISH YOU HAPPY DEEPAVALI
</b>
regards,
Sunil K Shetty
Bangalore
sapsuni@gmail.com
11-07-2007 6:11 AM
11-07-2007 6:12 AM
Hi
Refer this piece of code.I think u need to populate ur 'wnorange' with some value.Have u done that?
*--Local declarations
DATA : lw_numkr TYPE t003-numkr,
lw_inri TYPE inri.
*--Selecting the number range for the document
SELECT SINGLE numkr INTO lw_numkr
FROM t003 WHERE blart = 'ZP'.
IF sy-subrc NE 0.
CLEAR lw_numkr.
EXIT.
ENDIF.
Get Information to get Doc number
lw_inri-nrrangenr = lw_numkr.
lw_inri-object = 'RF_BELEG'.
lw_inri-subobject = '1000'.
Get next document number
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = lw_inri-nrrangenr
object = lw_inri-object
subobject = lw_inri-subobject
IMPORTING
number = lp_header-obj_key
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
CLEAR lp_header-obj_key.
EXIT.
ELSE.
gs_dochead-obj_key = lp_header-obj_key.
ENDIF.
Thanks
Vasudha
11-07-2007 6:16 AM
Hi Sunil,
Thru ST22 u can easily identify the dump. See the info where it gets terminated & why.
Otherwise u can take the following sample code for help.
call function 'NUMBER_GET_NEXT'
exporting
nr_range_nr = wnorange
object = 'ZREFNUM'
subobject = space
toyear = xyear
importing
number = NEW_NUM
exceptions
interval_not_found = 01
number_range_not_intern = 02
object_not_found = 03
quantity_is_0 = 04.
if it is helpfull pls reward it.
Regards
Srimanta
11-07-2007 6:21 AM
instead of declaring like data: wnorange like INRI-NRRANGENR. "number range
declare like
data : wnorange type nrnr value '01'.
11-07-2007 7:58 AM
Hi Friends,
Nothing worked out, still its giving dump error. I have created the obj and assigned the same in the FM number_get_next. But I dont know why its giving error. I m using SAP R/3 4.7EE. Could anyone pls help me out solving this. If you wanna chat with me, you can add my gtalk id <b>sapsuni@gmail.com</b>. So Please solve my issue.
regards,
Sunil K Shetty.
sapsuni@gmail.com
11-07-2007 8:17 AM
Hi
I think the problem is with the number range which you have declared in the intervals
when u click on the intervals a table control is displayed where you declare the intervals
something like this
No From number To number
1 0000001 9999999
what ever number you are giving in the field 'No' is to be given for the number range object. suppose if you have given as '01' then pls give '01' for nr_range_nr etc
let me know if this solves
11-07-2007 10:58 AM
Thanks a lot to SDN and experts, My issue resolved and am very much happy.
I ll go forward and give good rewards all the people who tried to help me out......
Thanks a Lot,
Sunil K Shetty