Ansicht
Dokumentation

/AIN/GTIN_GET_NEXT_NRRANGE - Get Next Serial Number for GTIN

/AIN/GTIN_GET_NEXT_NRRANGE - Get Next Serial Number for GTIN

CPI1466 during Backup   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This function module gets the serial numbers for the GTIN.

The interface of the function module has changed from that delivered in SAP Auto-ID Infrastructure (SAP AII ) 2.1. This is NOT A RELEASED function module and is not supported by SAP. However, anybody who has called this function module with the old interface can make the changes as explained below to his / her call to get equivalent results.

Example

All data elements, table types, and structures used below are NOT released by SAP and can change in future. The interface of the function module can also change in the future

A typical call for the old interface would have been:

DATA:

,,lv_next_number ,,TYPE /ain/epc_current ,

,,lv_epc_type ,,TYPE /ain/epc_type,

,,lv_gtin ,,,,TYPE comt_gtin,

,,lt_ret_msg ,,TYPE bapirettab.

lv_epc_type = 'SGTIN-96'.

lv_GTIN = ' 00037000101123'.,,,,"a gtin for which you want the next serial number

CALL FUNCTION '/AIN/GTIN_GET_NEXT_NRRANGE'

EXPORTING

iv_gtin ,,= lv_gtin

iv_epc_type ,,= lv_epc_type

IMPORTING

ev_next_number = lv_next_number

et_ret_msg ,,= lt_ret_msg

EXCEPTIONS

no_number_range_avaiable = 1

number_range_locked ,,= 2

OTHERS ,,,,= 3.

IF sy-subrc <> 0.

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

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

ENDIF.

*****************************************************************************************************

Modify the above call as follows for the new interface:

DATA:

,,lv_next_number ,,TYPE /ain/epc_current ,

,,lv_epc_type ,,TYPE /ain/epc_type,

,,lv_gtin ,,,,TYPE comt_gtin,

,,lt_ret_msg ,,TYPE bapirettab,

,,lt_comp ,,,,TYPE /ain/id_comp_tab,

,,ls_comp ,,,,TYPE /ain/id_comp_str,

,,lv_number_from ,,TYPE /ain/id_an_serial_no.

lv_epc_type = 'SGTIN-96'.

lv_GTIN = ' 00037000101123'.,,,,"a gtin for which you want the next serial number

ls_comp-element = 'GTIN'.

ls_comp-element_value = lv_gtin.

APPEND ls_comp TO lt_comp.

CALL FUNCTION '/AIN/GTIN_GET_NEXT_NRRANGE'

EXPORTING

iv_epc_type ,,= lv_epc_type

it_comp ,,= lt_comp

IMPORTING

ev_number_from ,,= lv_number_from

et_ret_msg ,,= lt_ret_msg

EXCEPTIONS

no_number_range_available = 1

number_range_locked ,, = 2

OTHERS ,,,, = 3.

IF sy-subrc <> 0.

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

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

ENDIF.

lv_next_number = lv_number_from.

Notes

Further information





Parameters

ET_RET_MSG
EV_NUMBER_FROM
EV_NUMBER_TO
EV_SIZE
IT_COMP
IV_DEVGRP_GUID
IV_DOC_GUID
IV_EPC_TYPE
IV_SIZE

Exceptions

NO_NUMBER_RANGE_AVAILABLE
NUMBER_RANGE_LOCKED

Function Group

/SAPLGTIN_NRRANGE

General Data in Customer Master   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 3925 Date: 20240425 Time: 041944     sap01-206 ( 43 ms )