‎2009 Aug 20 1:10 PM
Hi All
In my program i need to save some records. But when i click on submit, records are not getting saved
Regards
Richa
‎2009 Aug 20 1:13 PM
Hi,
check if the screen element name is same what you are checking with okcode or sy-ucomm.
Hope it works.
Regards,
Nidhi Kothiyal
‎2009 Aug 20 1:17 PM
Hi,
What do you mean by save records in program ?
Do you want your records to be saved in Ztable through dialog program using some screen.
Then you can do like this:
CASE sy-ucomm.
WHEN 'F_SUBMIT'.
MOVE Ztable-field1 TO wa_table-field1.
MOVE Ztable-field2 TO wa_table-field2.
MOVE Ztable-field3 TO wa_table-field3.
INSERT Ztable FROM wa_table.
IF sy-subrc = 0.
MESSAGE 'Successfully saved' TYPE 'I'.
ENDIF.
ENDCASE.Thanks,
Sri.
‎2009 Aug 20 1:27 PM
Hi,
Write this in the PAI
module save_data.
if sy-ucomm eq 'SUBMIT'.
screen-field1 = wa_table-field1.
screen-field2 = wa_table-field2.
insert dbtable from wa_table.
endif.
endmodule.
‎2009 Aug 20 1:40 PM
Hi Richa ,
Create an work area of the type Z table.
then use the following code :
IF ( SY-UCOMM = 'F_SUBMIT').
wa-field=screenname .
Modify ztable from wa .
if sy-subrc = 4 .
mesasge "successful " type i .
else .
message "unsuccesful" type w.
endif.
endif.If you have written the same code and still facing the problem then :
check whether screen names are correct .
Debug the program and see whether the values are coming in the internal table or not .
This will surely help .
Hope this helps you .
Thanks and Regards
Aditi Wason