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: 

NRIV updation by current number range number

debdatta_panda
Participant
0 Kudos

Dear Experts,

                    I am creating manual excise doc. no. through a customized program.One number range object is assigned for the manual excise number.In that number range object I have assigned number range also.I have picked the next number through NUMBER_GET_NEXT function module.But cannot get updated the NRIV table with current excise no.

My code is under....

CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'

     EXPORTING

       I_DATE         = BUDAT

       I_MONMIT       = 00

       I_PERIV        = 'V3'

     IMPORTING

       E_BUPER        = LV_PERIOD

       E_GJAHR        = LV_YEAR

     EXCEPTIONS

       INPUT_FALSE    = 1

       T009_NOTFOUND  = 2

       T009B_NOTFOUND = 3

       OTHERS         = 4.

   IF SY-SUBRC <> 0.

     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

   ENDIF.

   SELECT SINGLE NRRANGENR TOYEAR INTO (LV_NRN , LV_TOYEARFROM NRIV WHERE OBJECT = 'ZEXCISE'

     AND TOYEAR = LV_YEAR.

   CALL FUNCTION 'NUMBER_GET_NEXT'

     EXPORTING

       NR_RANGE_NR             = LV_NRN

       OBJECT                  = 'ZEXCISE'

       TOYEAR                  = LV_TOYEAR

       IGNORE_BUFFER           = ' '

     IMPORTING

       NUMBER                  = LV_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.


Please tell me how to update NRIV table with current excise no.

2 REPLIES 2

PeterJonker
Active Contributor
0 Kudos

So if I understand you well, you didn't get a new number form FM NUMBER_GET_NEXT ??

Did you check in debug if an error occurred (sy-subrc <> 0 ) ?

Did you define a subobject as well ? If you did you have to add this to the FM call.

Did you declare LV_NRN as TYPE NRNR and LV_TOYEAR as TYPE NRYEAR ?

Try to use lv_object type NROBJ value 'ZEXCISE' in stead of using the text string when calling the FM.

How did you come to the conclusioon that it doesn't work, Did you check the last number with TC SNRO ?

0 Kudos

Thanks a lot.Its working fine..