10-09-2007 11:10 AM
Hi All,
I am using following code in a custom-function module.
tables: z_time.
move emp_no to z_time-empid.
move name to z_time-name.
move date to z_time-zdate.
move proj_id to z_time-projid.
move act_id to z_time-actid.
move hrs to z_time-hrs.
move remarks to z_time-remarks.
update z_time.
Now while debugging, the values are moving from variable to databse fields.
But finally sy-subrc is showing '4' value when the system executes "update z_time" statment executes....
How to come out of this error and update the table?
Regards
Pavan
10-09-2007 11:14 AM
use Update <DBTAB> from <Internal table name>.
then use.
commit-work.
cheers
10-09-2007 11:14 AM
use Update <DBTAB> from <Internal table name>.
then use.
commit-work.
cheers
10-09-2007 11:14 AM
Hi,
Try this,
Data: wa_z_time type z_time.
move emp_no to wa_z_time-empid.
move name to wa_z_time-name.
move date to wa_z_time-zdate.
move proj_id to wa_z_time-projid.
move act_id to wa_z_time-actid.
move hrs to wa_z_time-hrs.
move remarks to wa_z_time-remarks.
update z_time from wa_z_time.
10-09-2007 11:16 AM
10-09-2007 12:23 PM
Hi Pavan,
I understand you are trying to use UPDATE to update the DB table, but the z_time fields you declared are taken as WA, so you need to use the synatx as follows :
<b>UPDATE z_time from z_time.</b>
Here, second z_time is WA.
Hope this resolves your query.
Regards,
Nagaraj
10-09-2007 12:29 PM
Hi Pavan
Upto my knowledge update keyword is used for database table only.
If you want to change the contents of internal table then use modify,append or insert.
If z_time is database table then see to that you have declared the table using TABLES keyword in declaration part,even then if you get the error use update z_time from z_time.
Regards
Varalakshmi.K
10-09-2007 12:35 PM
Hi Pavan,
How does the system know, which record to update.
Shouldn't first point to a specific record using a select statement?
I always first select a record, and after I'm sure to point to right one I update it.
regards
Sven
10-09-2007 12:46 PM