06-18-2008 11:36 AM
hi all,
I create a field on screen(from dictionary) named zvtrans-zsdate. and the value entered in this screen field should be update to zvtrans table.
but in the PAI of the screen if I write like this it is not working
PROCESS AFTER INPUT.
MODULE finalise.
MODULE finalise INPUT.
IF sy-dynnr = '0200'..
IF ok_code = 'SAVE'.
PERFORM refresh_screen_200.
PERFORM save_screen_200.
endif.
FORM save_screen_200
zvtrans-zsdate = zvtrans-zsdate.
MODIFY zvtrans.
endform.
06-18-2008 11:40 AM
06-18-2008 11:40 AM
Hi please see wat is the key fild of the table that u are using..
supose zkey is the field...
then inside the FM
FORM save_screen_200
zvtrans-zsdate = zvtrans-zsdate.
zvtrans-zkey = wf_zkey.
MODIFY zvtrans transporting zsdate.
endform.
wf_zkey ...is the value of the key in the program...that u will be using
alternatively u can declare a workarea of the type ztrans i.e wa_ztrans.
selct * into wa_ztrans
from ztrans
where zkey = wf_key.
FORM save_screen_200
wa_ztrans-zsdate = zvtrans-zsdate.
.
MODIFY zvtrans from wa_ztrans transporting zsdate.
endform.
this also will work....
Reward points if the soltn is helpful...
Edited by: Rudra Prasanna Mohapatra on Jun 18, 2008 12:41 PM
06-18-2008 11:41 AM
Hi
U should post the code of form refresh_screen_200, probably u clear the headerline of the table before saving it.
MAx
06-18-2008 11:43 AM
hi....
just check if you hae declared ok_code in the screen attributes.
and also in the top include of the program.
activate it and then check if the ok_code is getting assigned properly.
you can use the update functionality to update your table corressponding the screen field rather than modify if you dont have the key fields.
06-18-2008 11:54 AM
Hi,
Why don't you try UPDATE command.
Example :
UPDATE zvtrans-zsdate = zvtrans-zsdate
SET zvtrans-zsdate = zvtrans-zsdate
WHERE some condition....
IF sy-subrc EQ 0.
COMMIT WORK.
l_error = 'X1'.
ELSE.
l_error = 'X2'.
CLEAR l_error.
ROLLBACK WORK.
ENDIF.
Hope this will help you.
Plz reward if useful.
Thanks,
Dhanashri.
06-18-2008 12:13 PM
if i am giving zvtrans-zsdate eq sy-datum.
it is taking the current system date.
but if i am giving zvtrans-zsdate(table field) = zvtrans-zsdate(screen field).
it is not taking the database table.
06-18-2008 12:14 PM
Check the format of the date , wht format it is using . kIndly change it to SAP standard format.