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

Number range subobject creation

Former Member
0 Likes
3,113

Hi all,

In my code I check if a number range subobject exists in table NRIV and when not existing I would like to add the subobject to the table. I know that the tables NRIV, TNRO and TNROT hold the data for the number range objects and subobjects.

I would like to know if someone has ever created a new number range subobject from code and what the minimum of entries to the tables (NRIV, TNRO and TNROT) are to get a new (working) subitem.

greetz Fred.

5 REPLIES 5
Read only

Former Member
0 Likes
1,876

Hi Fred,

Try using function module NUMBER_RANGE_INTERVAL_UPDATE.

Sri

Read only

Former Member
0 Likes
1,876

I would like to add a subobject to an existing number range without extra user input.

The system gets the subobject name and checks if it already exists of not existing I need to add an extra subobject with standard values with the name of the given subobject.

I can not find a Function (wihout dialog) to realize this, so I think I can add an entry to the tables through code. But I am not sure if the system accepts this (recognizes the new subobject) and which fields I need to fill.

All help on this subject is welcome.

greetings Fred.

Read only

Former Member
0 Likes
1,876

Hello,

Do you mean this i am not sure.

select * from t003o where auart = x_bncom-auart.

endselect.

if sy-subrc = 0.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

NR_RANGE_NR = t003o-numkr

OBJECT = 'AUFTRAG'

QUANTITY = '1'

  • SUBOBJECT = ' '

  • TOYEAR = '0000'

  • IGNORE_BUFFER = ' '

IMPORTING

NUMBER = next_number

  • 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,

Shekhar Kulkarni

Read only

Former Member
0 Likes
1,876

I would indeed like to use the function 'NUMBER_GET_NEXT' but when the subobject does not exist it will not work.

That's why I first check if the subobject exist and when not, than I must create one from source code.

I do not know how to create a subobject from source code.

greetings Fred

Read only

Former Member
0 Likes
1,876

Hello,

Try using transaction snro. In this transaction you can create number range object and there are function module that are associated with that.

http://help.sap.com/saphelp_47x200/helpdata/en/1f/8311204bc511d189750000e8322d00/frameset.htm

http://help.sap.com/saphelp_47x200/helpdata/en/2a/fa0365493111d182b70000e829fbfe/frameset.htm

Hope this helps.

Regards,

Shekhar Kulkarni