Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in creating No. Range Object

Former Member
0 Likes
1,618

HI All,

I have one ztable ZDESIGN having fields

NFDESIGN

DEPT

MACH_TYPE

MATNR

CODE

CUST_NM

MACH_NO

MAKTX

NETWORK_NO

QTY

MOD_CODE

STATUS

DVER

IMPL

PART_ST

RELBY

RELDT

i want to store the number in code field on save. but i want to add many records at one time.

while creating number range object(SNRO) , foll error is coming

Table ZDESIGN may have only the no.range el.field and the subobject as a key

how create number range object.

Thanks

12 REPLIES 12
Read only

Former Member
0 Likes
1,380

hi kushi,

go to SNRO tcode and give data element as S_CARR_ID and give domain as ( take it from afru table the counter for confirmation number , that is the next field to the RUECK )

then give the warning percentage .

then maintain the number ranges.

here you need to add 01, 02 etc to the SCARR TABLE

WRITE A SMALL PROGRAM WHICH INSERTS THE CARRID values with 01 02 ETC.

now maintain the number ranges in the same SNRO tcode.

now call the FM NUMBER_GET_NEXT

regards

Ramchander Rao.K

Read only

0 Likes
1,380

Hi Ramchander,

Thanks for help.

Created number range.

but now how to use it in my module pool program. Please tell me.

Regards,

Read only

0 Likes
1,380

hi all,

Please tell me how this No.Range Object (ZABC) can be used in the program.

Thanks

Read only

0 Likes
1,380

HI All,

Anyone work on SNRO tcode. how to use it in program.

Read only

0 Likes
1,380

Hi all,

I used CO_RUECK as Number length domain in SNRO tcode, will it affect the data in afru table ?

Another query is i use FM 'NUMBER_RANGE_INTERVAL_LIST' to get the first number in PAI .

How to increment it in next save. I want it monthwise, so i use subobject as 01,02, 03 etc.

Thanks

Read only

0 Likes
1,380

Hi Kushi,

it doesnt effect any other tables.

yes you need to use subobjects as you mentioned above.

Use FM NUMBER_GET_NEXT to get the next value.

regards

Ramchander Rao.K

Read only

0 Likes
1,380

hi Ramchander,

i write in PAI as follows

when 'SAVE'.

LOOP AT ITAB.

move itab-reldt+4(2) to sub. " date field' s month

CALL FUNCTION 'NUMBER_RANGE_INTERVAL_LIST'

EXPORTING

object = 'ZABC'

SUBOBJECT = sub

tables

interval = ZNRIV.

message W012(zdes) with ZNRIV-NRLEVEL.

MOVE ZNRIV-NRLEVEL TO ITAB-CODE.

MODIFY ITAB.

MODIFY ZDESIGN FROM TABLE ITAB.

CLEAR OK_CODE.

CLEAR ITAB.

SET SCREEN 1001.

ENDLOOP.

now how to increment it every month using FM 'NUMBER_GET_NEXT'.

thanks

Read only

0 Likes
1,380

hi,

check this.

[https://forums.sdn.sap.com/click.jspa?searchID=19051479&messageID=6400876]

Read only

0 Likes
1,380

hI,

But i am able to initialize it every month as 1st entry of every month may not done on 1st .

Thanks.

Read only

0 Likes
1,380

Hi Kushi,

Number ranges are not meant for initialization.

you need to use subobjects which allows you to create number range values for example based on the month.

you need not to increase the number every time.

the FM gives you increased number every time.

as i said earlier create entries in SCARR table. carrid values like 01 02 03 04 -- 10 11 12 ETC.

12 sub objects for 12 months.

then go to SNRO tcode and create the values for each month.

in the program

data date type sy-datum.

month(2) type c.

month = sy-datum+3(2) will give you the current month.

pass this to the FM NUMBER_GET_NEXT

along with other parameters.

hope this is clear to you.

regards

Ramchander Rao.K

Read only

0 Likes
1,380

Hi,

I understood the concept, but how to pass it intermediate table because my requirement is to pass the same number to all enteries in one transaction ta the time of save. What value should pass to nr_range_nr field of FM.

thanks.

Edited by: Khushi p on Nov 24, 2008 9:38 AM

Read only

0 Likes
1,380

Hi,

My problem is solved.

Thanks to all.