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

ZTABLE New Record

Former Member
0 Likes
800

Dear All

I have ZTABLE call ZMASTER

there is a one field called ZMASCode (i.e. H001, H002)

my question is ....

when I add a new record, I want to add this field automaticaly (next code)

what are your sugestions for this matter.

Dear All

I have ZTABLE call ZMASTER

there is a one field called ZMASCode (i.e. H001, H002)

my question is ....

when I add a new record, I want to add this field automaticaly (next code)

what are your sugestions for this matter.

4 REPLIES 4
Read only

Former Member
0 Likes
766

HI,

<b>I want to add this field automaticaly (next code)</b>

what do you mean by automatically?

do you mean the record should automatically be sorted in an order ?

and what do you mean by next code in brackets?

-pankaj

Read only

Former Member
0 Likes
766

Hi Nelson

Is this Code based on fetch from any other table....in which the where condition has any other field of ZMASTER ?

then when you pass the where cond value, the fetch will give the Code....this code can be passed to the screen field...

Is this you mean by automatic ?

Thanks

Gaurav

Read only

Former Member
0 Likes
766

Hi ,

You can write select statement on your Zmaster table .

then sort the internal table descending with ZMASCode.

then read teh first record of the internal table ,

then replace numbers by adding 1 to it

then you can update the table with that increamented record

*Please mark useful answers

Read only

Former Member
0 Likes
766

Hi Nelson,

You want automatically update the field ZMAS code as H001,H002...etc.

Goto SNRO (numberrange)

Define a number range as H001 to H999.

Call fm NUMBER_GET_NEXT and pass the number range object, value. and use the FM before inserting a record into ZMASTER in your program (whether it may custom program or SAP standrad program (use userexit in case SAP standrad program).

Regards

Bhupal Reddy