Set the serial number in the SAP system

Source: Internet
Author: User

In general, the serial number is generated according to the defined rules. The following describes how to generate a serial number:

1. Set the serial number in the system

Use T-code snro to create a serial number to identify an object,

 

Enter the object zlc_001 and click Create.

 

Enter short text, long text, number length domain to writeProgramIt should be created separately. Here we will use the domain matnr of the item number for testing. Other parameters can use the default value, and then save the input data.

A message is displayed, indicating that the sub-object is successfully created. You need to maintain a sub-object and click "number range ".

 

Click "interval" to maintain the specific serial number rules.

 

Save and set the serial number. The next step is how to obtain the serial number in the program.

 

2. Get the serial number in the program

Report zlc_number_range.

 

Data w_matnr type matnr.

 

Start-of-selection.

 

Call function 'Number _ range_enqueue'

Exporting

Object = 'zlc _ 001' "ceate with snum

Exceptions

Foreign_lock = 1

Object_not_found = 2

System_failure = 3

Others = 4.

 

Call function 'Number _ get_next'

Exporting

Nr_range_nr = '00'

Object = 'zlc _ 001'

Importing

Number = w_matnr

Exceptions

Interval_not_found = 1

Number_range_not_intern = 2

Object_not_found = 3

Quantity_is_0 = 4

Quantity_is_not_1 = 5

Internal_overflow = 6

Others = 7.

 

Call function 'Number _ range_dequeue'

Exporting

Object = 'zlc _ 001 '.

 

If SY-SUBRC <> 0.

Message ID SY-MSGID type SY-MSGTY number SY-MSGNO

With SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

Endif.

Repeat the screen field:

Data Field (50 ).

Field-Symbols: <F1> type any, <F2> type any.

Data I _no (10) type N.

Clear I _no.

 

Call function 'Number _ get_next'

Exporting

Nr_range_nr = '00'

Object = 'zlc _ 001'

Importing

Number = I _no.

Field = 'I _no '.

Assign (field) to <F1>.

Field = '(saplmigo) GOHEAD-XBLNR'. "saplmigo program name; GOHEAD-XBLNR screen Field

Assign (field) to <F2>.

<F2 >=< F1>.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.