Application Development 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: 

How to check current internal number

bartlomiej_lach
Participant
0 Kudos

Hello Experts!

I have one question. Do you know where is stored current number of notification. I have to have number of nofification in user-exit "EXIT_SAPMIWO0_020". During saving notification in VIQMEL there i no number. I think it is stored in SAP buffer but I don't know how to import it from there.

Thanks for hints.

Regards BL

10 REPLIES 10

Former Member
0 Kudos

Hello

Try table NRIV

Former Member
0 Kudos

you check in SPRO using the object for which the number range is created.

-Rajat

0 Kudos

I can't find it there. I don't need number range, but current number. I am in transaction IW21 and create new notification. To my operation I have to know what is the number of current notification (I haven't saved it yet, I am during creating of this notification).

Any hints?

Regards

BL

0 Kudos

Hi,

See the Documentation of FM NUMBER_GET_NEXT, while calling pass the object as QMEL_NR and the corresponding Number range number to get the next notification number.

You can search SDN with NUMBER_GET_NEXT for sample codes.

Regards

Karthik D

0 Kudos

Thanks for hint is ws really helpfull, but.... when I trigger FM "NUMBER_GET_NEXT" I reserve next number so when transaction IW21 calls this FM one more time it takes next numer. Of course I can increment this number and then everything will be ok, but then system everytime will leave one numer during creating new notification.

So maybe someone knows how to release this number after calling NUMBER_GET_NEXT functional module?

0 Kudos

Hi,

You can Use FM NUMBER_GET_INFO to get the current number as below;

DATA G_NRIV TYPE NRIV.

CALL FUNCTION 'NUMBER_GET_INFO'
  EXPORTING
    nr_range_nr              = '02'
    object                   = 'QMEL_NR'
 IMPORTING
   INTERVAL                 = G_NRIV.

You can get the current number from G_NRIV-NRLEVEL.

But this will give the current number provided that you have maintained the "N0. of Number in Buffer" in SNRO for QMEL_NR as 0.

Hope this solves your problem.

Regards

Karthik D

0 Kudos

Hi,

We have another way to get the current number irrespective of the no of entries in the buffer.

For that use FM NUMBER_RANGE_GET_BUFFERED as above and you will get the current number in the export parameter E_NRIV-NRLEVEL.

Ignore the above solution as it is little complicated and need change in configurations.

Mark the question as anwered if your problem is solved

Regards

Karthik D

0 Kudos

Hi

Unfortunatelly las two solution are not good. The nearies of ideal is first with GET_NEXT FM, but sill I don't know how to release this number.

In GET_BUFFERED solution FM return only "000000000000" everytime, in GET_INFO FM it return all the time number which is far away from current.

0 Kudos

Hi,

Read the NUMBER_GET_INFO solution given by me carefully, it will only work provided that you have maintained 0 or nothing in the No. Of numbers in buffer in tcode SNRO for the Object QMEL_NR.

If u do the above and try it might work fine.

Regards

Karthik d

0 Kudos

Hi,

Unfortunatelly I can't change it because of performance reasons.