01-09-2007 4:02 PM
I am trying to update a custom table in BW with the following statement.
UPDATE customtable FROM TABLE ITAB1.
itab1 has entries but the customtable is not getting updated do i need to use any commit statement for that.
01-09-2007 4:16 PM
For UPDATE to work, entries have to exist in the data base table for the entries you want to update from the internal table. So in your caase, the entries likely don't exist in the database and you are getting sy-subrc = 4.
There is an implicit COMMIT at the end of the program, so adding one won't really help.
Rob
01-09-2007 4:05 PM
Hi,
Right after that stmt write 'COMMIT WORK'.
This shud work.
Regards,
Vinod.
01-09-2007 4:06 PM
01-09-2007 4:09 PM
Hello,
Alwasy use Modify/Insert command to update the ZTABLE.
Vasanth
01-09-2007 4:10 PM
Hi,
Yes..Give COMMIT WORK statement after the update statement.
Example
-
UPDATE customtable FROM TABLE ITAB1.
IF SY-SUBRC = 0.
COMMIT WORK.
ENDIF.
Thanks,
Naren
01-09-2007 4:14 PM
Which value get SY-SUBRC after your update.
Remembre not to change primary keys of your records.
regards.
01-09-2007 4:16 PM
For UPDATE to work, entries have to exist in the data base table for the entries you want to update from the internal table. So in your caase, the entries likely don't exist in the database and you are getting sy-subrc = 4.
There is an implicit COMMIT at the end of the program, so adding one won't really help.
Rob
01-09-2007 4:28 PM
There are no entries in the custom table now so may be i can use modify statement as the table will be updated on a regular basis
01-09-2007 4:32 PM
01-09-2007 4:51 PM
01-09-2007 5:10 PM
Thanks for your help. I have another problem. The custom table exists in both R/3 and BW. I have to update the R/3 table from the BW table. I am calling a function module from BW in a program with destination as test system of R/3 for updating the table in R/3 but the table is not getting updated . How can i correct this ?
01-09-2007 5:13 PM
Hope both R/3 and BW table are same. Check the calling FM excuted successfully.
01-09-2007 5:13 PM
This seems like a separate problem/question. You will likely get more responses if you open a new thread.
Rob
01-09-2007 4:30 PM
Hi,
Use MODIFY statement..Which will insert a record if the matching key is not found..Also if the key is found it will update the record..
MODIFY customtable FROM TABLE ITAB1.
COMMIT WORK.
THanks,
Naren