Application Development and Automation 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: 
Read only

Auto generation

former_member224008
Active Participant
0 Likes
837

hi,

if there is any standard function module for auto generator of char value . eg 'cust00001'.

regards,

ARUN

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
807

HI,

Please note my understanding is correct.

if you are looking to generate the number ranges and then add 'CUST' to it

use number range object

you can create them in SNRO tcode.

regards

Ramchander Rao.K

6 REPLIES 6
Read only

Former Member
0 Likes
807

hi,

you can create your own subroutine like this:

FORM new_number.

DATA: lv_lines TYPE i.

CONSTANTS: lc_0001 TYPE char4 VALUE '0001'.

DESCRIBE TABLE total LINES lv_lines.

IF lv_lines IS INITIAL.

num = lc_0001 .

concatenate 'cust' num to num.

ELSE.

num = lc_0001 + lv_lines.

concatenate 'cust' num to num.

ENDIF.

ENDFORM."form new_number.

Read only

0 Likes
807

hi,

what is the data type of num.

regards,

ARUN

Read only

0 Likes
807

Hi,

while you try to create a number range object it asks for a data element

take S_CARR_ID

and a domain CO_RMZHL

then you can create a number range object

create a simple program to update the SCARR table where carrid contains 01, 02 etc

now you can maintain the number ranges for this subobjects i.e, 01 02 etc

call the FM NUMBER_GET_NEXT

pass the required parameters

for info understand the signature of the FM in SE37

regards

Ramchander Rao.K

Read only

0 Likes
807

Hi Arun,

Num will be of character data type.

thanks

AD

Read only

Former Member
0 Likes
808

HI,

Please note my understanding is correct.

if you are looking to generate the number ranges and then add 'CUST' to it

use number range object

you can create them in SNRO tcode.

regards

Ramchander Rao.K

Read only

former_member224008
Active Participant
0 Likes
807

Thanks to all