2006 Dec 29 12:34 PM
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.
2006 Dec 29 12:38 PM
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
2006 Dec 29 12:51 PM
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
2006 Dec 29 12:52 PM
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
2006 Dec 29 12:52 PM
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