2009 Jan 30 5:42 AM
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
2009 Jan 30 5:51 AM
Hi,
If your requirement is to use serial number as primary key in your table
then better to use number range for this...
If your requirement is other than serial number then please clarify...
Regards,
Meet
2009 Jan 30 6:10 AM
2009 Jan 30 6:20 AM
HI,
For number range you need to create Z number range from SNRO transaction,
then use that in your code..
At the time of inserting data in Z table, you need to call FM : 'NUMBER_GET_NEXT'
it will give you next number to the maximum number of you \r number range..
steps are below...
create number range using SNRO transaction
then call Fm 'NUMBER_GET_NEXT' before inserting data in tabel.
it will give you nex number, use it as your serial number.
insert data using that number..
hope it will help you..
Regards,
Meet
2009 Jan 30 6:24 AM
Hi
You will save the data along with the counter in PAI.
Because it will be executed after you insert the values and hit a button.
Hope this helps
Regards,
Jayanthi.K
2009 Jan 30 10:20 AM
2009 Jan 30 10:29 AM
You don't have to leave nonsense when marking as answered, the comment field is optional.
Thomas