Skip to Content
0
Jan 30, 2009 at 05:42 AM

Automatic counter in database

303 Views

Dear friends

I am doing module pool programming and i am saving data in database table through screen..

I have to give counter to that saved data..

Following is my logic to give counter to database table...

where i have to define it in PBO or PAI

SELECT SINGLE ZRD_HDRID INTO P FROM ZRD_ORDTYP

WHERE ZRD_HDRID = ( SELECT MAX( ZRD_HDRID ) FROM ZRD_ORDTYP ) .

LOOP AT WA_ORDTYP.

P = 0.

P = P + 1.

WA_ORDTYP-ZRD_HDRID = P.

ENDLOOP.

modify zrd_ordtyp from wa_ordtyp

Please Help me

Regards

Rohan