2008 Apr 14 7:13 PM
Hi,
Please validate my below UPDATE statement.
I have given values ( in debugger ) for the parameter in WHERE condition. Still the below UPDATE stmt is not updating the data base table zbmta0016ref_bep.
IF p_test IS INITIAL.
UPDATE zbmta0016ref_bep
SET bepo_haupt = lw_mainbepo-nhb
aenam = sy-uname
laeda = sy-datum
utime = sy-uzeit
WHERE matnr = pc_main-matnr
AND abt = lw_mainbepo-abt
AND wg = lw_mainbepo-wg
AND ag = lw_mainbepo-ag
AND bepo_k = lw_mainbepo-bepo_k
AND betr_s = l_betr_s
.
ENDIF.
Please help me.
Hi,
Please validate my below UPDATE statement.
I have given values ( in debugger ) for the parameter in WHERE condition. Still the below UPDATE stmt is not updating the data base table zbmta0016ref_bep.
IF p_test IS INITIAL.
UPDATE zbmta0016ref_bep
SET bepo_haupt = lw_mainbepo-nhb
aenam = sy-uname
laeda = sy-datum
utime = sy-uzeit
WHERE matnr = pc_main-matnr
AND abt = lw_mainbepo-abt
AND wg = lw_mainbepo-wg
AND ag = lw_mainbepo-ag
AND bepo_k = lw_mainbepo-bepo_k
AND betr_s = l_betr_s
.
ENDIF.
Please help me.
2008 Apr 14 7:16 PM
Use Commit work statement ...
IF p_test IS INITIAL.
UPDATE zbmta0016ref_bep
SET bepo_haupt = lw_mainbepo-nhb
aenam = sy-uname
laeda = sy-datum
utime = sy-uzeit
WHERE matnr = pc_main-matnr
AND abt = lw_mainbepo-abt
AND wg = lw_mainbepo-wg
AND ag = lw_mainbepo-ag
AND bepo_k = lw_mainbepo-bepo_k
AND betr_s = l_betr_s
.
commit work
ENDIF.
Regards,
Santosh
2008 Apr 14 10:21 PM
Hi Kumar,
first check the where condition is working properly means whether is there any record with the specified criteria.check the statement.
select * from zbmta0016ref_bep
WHERE matnr = pc_main-matnr
AND abt = lw_mainbepo-abt
AND wg = lw_mainbepo-wg
AND ag = lw_mainbepo-ag
AND bepo_k = lw_mainbepo-bepo_k
AND betr_s = l_betr_s.
if sy-subrc = 0.
write:/ 'the code is executing properly'.
else.
write: / 'please check the code'.
endif.
if the above code is working means if sy-subrc = 0 then check whether p_test has any data or not.
the problem must be in either of these two.if these two are working properly let me know.
please reward points if useful.
2008 Apr 15 6:54 AM
If any of the variables that used in the where condition is a select-option then use in instead of =
Eg:
Where
betr_s in l_betr_s
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |