06-26-2008 6:34 AM
hi everybody,
Table PLAF fields are plnum and AUFFX.
in plaf table plnum is the planned order number and AUFFX is the firming Indicator ( X or SPace).
first i am selecting the plnum from table plaf with AUFFX = 'X' and displaying in table control.
upto here working fine.
if user selects particular plnum and press close button on screen i need to set AUFFX = SPACE.
and this should be update to PLAF table.
through programming can i update database table? if its possible how to do?
06-26-2008 6:44 AM
Hi,
First you try to findout any FM will do the update or not.
if you are not get any FM, then check the it if any tables are depending on this table or not using the button 'Graphic' in the toolbar.
if it is ok then you will do the update in the standard table using the UPDATE statement.
Reference for update statement.
[http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3a94358411d1829f0000e829fbfe/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3a94358411d1829f0000e829fbfe/frameset.htm]
Regards,
SB
06-26-2008 6:44 AM
Hi,
Try this.
data: g_ok_code TYPE sy-ucomm.
If g_ok_code = 'CLOSE'.
UPDATE PLAF
SET AUFFX = ' '
WHERE plnum = p_plnum
.....
IF sy-subrc EQ 0.
COMMIT WORK.
l_error = 'X1'.
ELSE.
l_error = 'X2'.
CLEAR l_error.
ROLLBACK WORK.
ENDIF.
endif.
hope this helps you.
plz reward if useful.
thanks,
dhanashri.
Edited by: Dhanashri Pawar on Jun 26, 2008 7:45 AM
Edited by: Dhanashri Pawar on Jun 26, 2008 7:45 AM
06-26-2008 6:45 AM
Hi,
Check this program,it updates the check box for GRIV
REPORT ZMM .
tables : EKPO.
DATA: BEGIN OF ITAB OCCURS 0.
INCLUDE STRUCTURE EKPO.
data:end of itab.
selection-screen : begin of block blk1 with frame title text-001.
parameters : p_BSART like EKkO-BSART.
*Indicator: GR-based invoice verification
selection-screen : begin of line.
parameters : r_grivc radiobutton group rbg1.
selection-screen : comment 5(40) text-004.
selection-screen : end of line.
selection-screen : begin of line.
parameters : r_grivn radiobutton group rbg1.
selection-screen : comment 5(44) text-005.
selection-screen : end of line.
selection-screen : end of block blk1.
start-of-selection.
*Update the value as X for Indicator: GR-based invoice verification
*WEBRE".
if r_grivc = 'X'.
select A~ebeln
b~EBELP
b~WEBRE
from ekko as a
inner join ekpo as b
on aebeln = bebeln
into corresponding fields of table ITAB
where
a~BSART = p_BSART.
sort itab.
LOOP AT ITAB.
update EKPO set WEBRE = 'X'
where EBELN = itab-EBELN
and EBELP = itab-EBELP.
endloop.
endif.
if r_grivn = 'X'.
select A~ebeln
b~EBELP
b~WEBRE
from ekko as a
inner join ekpo as b
on aebeln = bebeln
into corresponding fields of table ITAB
where
a~BSART = p_BSART.
sort itab.
LOOP AT ITAB.
update EKPO set WEBRE = ' '
where EBELN = itab-EBELN
and EBELP = itab-EBELP.
endloop.
endif.
K.Kiran.
06-26-2008 6:49 AM
Hi....
You can update database table.....
*select * from PLAF into table itab.*
LOOP AT itab where AUFFX = 'X' .
itab-AUFFX = ' ' .
MODIFY plaf FROM itab.
endif.
ENDLOOP.
with this code at....
OK_code = "CLOSE'
you can update databasse table...
and extend the code if you want to met any perticuler conditions, because you are used SELKZ field to select the rows..... also care at Clear itab...
Let me know if u want any futher clarification..
Thanks,
Naveen Inuganti.
Edited by: Naveen Inuganti on Jun 26, 2008 11:20 AM
06-26-2008 7:04 AM
You can use the event At Line-Selection
There just Read the data from your database table into the WorkArea(WA). and change the WA value of AUFFX to space.
and Modify the table content using the modify command.
Regards,
Vijaya Sankar
06-26-2008 7:45 AM