2007 Jun 22 11:26 AM
hi experts,
i have developed a table control in which 10 rows are coming in the output,what i want that when i press save button the complete 10 rows will get save in my own database table at a time ..for this what sud i write under my save button ,plz help me as i new to module pool also i have to save the time in my database table i.e at what time the particluar rows are saving in my database table...thnx in advance,,,
Hello,
IN PAI Module of the screen.
MODULE UPDATE.
if sy-ucomm = 'SAVE'.
modify ztable from itab " Here Itab should have have the same structure of ZTABLE.
endif.
ENDMODULE UPDATE.REgards,
VAsanth
2007 Jun 22 11:29 AM
Hello,
IN PAI Module of the screen.
MODULE UPDATE.
if sy-ucomm = 'SAVE'.
modify ztable from itab " Here Itab should have have the same structure of ZTABLE.
endif.
ENDMODULE UPDATE.REgards,
VAsanth
2007 Jun 22 11:30 AM
hi..
please check this link..
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3ac8358411d1829f0000e829fbfe/frameset.htm
Thanks
Ashu
2007 Jun 22 11:33 AM
Hi Ravi,
Check the code below. I have wrked on the similar task. So it would be helpfrul.
After UPDATE in the below code give the field name in that table which u want to update.
Write this code in the PAI Module.
WHEN c_save.
CLEAR g_update_cnt.
LOOP AT i_eine1.
CLEAR g_cnctnt.
CONCATENATE sy-mandt i_eine1-infnr
i_eine1-ekorg i_eine1-esokz
i_eine1-werks INTO g_cnctnt.
CONDENSE g_cnctnt.
CALL FUNCTION 'ENQUEUE_E_TABLEE'
EXPORTING
mode_rstable = 'E'
tabname = 'EINE'
varkey = g_cnctnt
_scope = '2'
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
UPDATE eine
SET zira = i_eine1-zira
aplfz = i_eine1-aplfz
minbm = i_eine1-minbm
bstae = i_eine1-bstae
inco1 = i_eine1-inco1
inco2 = i_eine1-inco2
WHERE
infnr = i_eine1-infnr
AND ekorg = i_eine1-ekorg
AND esokz = i_eine1-esokz
AND werks = i_eine1-werks.
IF sy-subrc = 0.
g_update_cnt = g_update_cnt + 1.
ENDIF.
ENDLOOP.
COMMIT WORK AND WAIT.
IF sy-subrc NE 0.
ROLLBACK WORK.
MESSAGE i076(zptp).
ELSE.
MESSAGE s077(zptp) WITH g_update_cnt.
ENDIF.
CALL FUNCTION 'DEQUEUE_E_TABLEE'
EXPORTING
mode_rstable = 'E'
tabname = 'EINE'
_scope = '3'.
ENDCASE.
Reward if helpful.
Regards & Thanks,
Ramana Prasad. T
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |