Skip to Content
0
Feb 17, 2016 at 08:40 AM

NRIV updation by current number range number

958 Views

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_TOYEAR) FROM 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.