‎2007 Apr 06 1:40 PM
Hi , I have a z table. I need to insert values into that table using the MODIFY Statement. The program is working fine except for the last entry not being Updated and a Run time error being generated.
The following code executes this
ZGRN_DETAILS-UNAME = sy-uname.
ZGRN_DETAILS-MTIME = sy-uzeit.
ZGRN_DETAILS-MDATE = sy-datum.
ZGRN_DETAILS-BELNR = IT_EKBE_CP-BELNR.
MODIFY ZGRN_DETAILS.
COMMIT WORK.
Can anybody tell me why is it Generating a Run time error.
Answer will be rewarded with deserving Points
Thanks
Manu
‎2007 Apr 06 2:10 PM
hi declare a internal table similar to the ZTABLE which will act as work area
data: itab type table of ztable.
itab-UNAME = sy-uname.
itab-MTIME = sy-uzeit.
itab-MDATE = sy-datum.
itab-BELNR = IT_EKBE_CP-BELNR.
MODIFY ZGRN_DETAILS from table itab.
If still it doesnt get updated then it means that there must be a same matching record in ZTABLE already with matching primary keys
‎2007 Apr 06 1:53 PM
try using MODIFY <dbtab> client specified....also, use commit statement at end of the program.
‎2007 Apr 06 2:02 PM
Im using the commit statement as well. The last entry is not being updated and
the SNAP Runtime error msg is being generated.
Don't know whats wrong. Something is wrong with the MOdify clause it seems like.
‎2007 Apr 06 4:27 PM
Got the problem. Actually there was no space on the Development Server. Thanks for ya suggestion.
‎2007 Apr 06 2:05 PM
Hi Manu,
What U have used is correct. try using move :-
MOVE sy-uname to ZGRN_DETAILS-UNAME .
MOVE sy-uzeit to ZGRN_DETAILS-MTIME .
MOVE sy-datum to ZGRN_DETAILS-MTIME .
MOVE IT_EKBE_CP-BELNR to ZGRN_DETAILS-BELNR .
MODIFY ZGRN_DETAILS.
Regards
Avi
‎2007 Apr 06 2:10 PM
hi declare a internal table similar to the ZTABLE which will act as work area
data: itab type table of ztable.
itab-UNAME = sy-uname.
itab-MTIME = sy-uzeit.
itab-MDATE = sy-datum.
itab-BELNR = IT_EKBE_CP-BELNR.
MODIFY ZGRN_DETAILS from table itab.
If still it doesnt get updated then it means that there must be a same matching record in ZTABLE already with matching primary keys
‎2007 Apr 06 2:22 PM
Hi,
First you find records in z table. If record is already exist, then you delete duplicate records. After that you can use modify statement.
Regards,
Bhaskar
‎2007 Apr 06 5:02 PM
Manu,
If you got the answer than plz marked it as answered.
Regards,
Amey