09-14-2008 2:31 PM
Hi,
i have created table control with 2 mandatory fields, delete functionality is working fine when data populated in those fields, but when when data was not there in those fields and when i try to select that particular row and delete it. It was not deleting and error msg is coming that 'make an entry in all required fields'.
basically i wrote code for deleting in at exit-command module and added function type for the delete button as 'E' too. Basically that functionality is triggering perfectly but my internal table - MARK is not updating with 'X' to delete it.
delete itab where mark = 'X'.
itab-mark is not updating with 'X' when i select the row and try to delete it since it has an error as 'make an entry in all required fields'. i need to delete a selected record even it has errors. Could any one suggest me.
09-15-2008 2:54 AM
Hi,
Check it out when the module for that exit command 'DELETE', is executed in PAI. If it is before 'LOOP... ENDLOOP' of your internal table that you are displaying in your table control, then change this order.
Put that 'LOOP... ENDLOOP' and that module next.
Why we want to change this order is, in that loop only whatever changes we made in the internal table that is displayed in the table control will be updated back in the internal table in the program.
Regards,
R.Nagarajan
09-15-2008 2:38 PM
Hi,
I have changed the order, even though no use since ... since i used function type E - for that delete button, without executing any other modules in the PAI - cursor coming directly to AT EXIT COMMAND module. Since that select record is not updating in the internal table, it was failing to delete that record and then error msg is coming. Anyway thanks for your time.
09-17-2008 2:50 PM
09-15-2008 6:25 AM
Hi Jaya Sri,
You must reflect the changes you made in the layout (screen ) to your internal table.
For that,
in the PAI ,
between loop .... endloop create a module update_itab.
and in that module you update the internal table where mark = 'X'.
your PAI
loop.
module update_itab.
endloop.
you can write the code in the following way
IF wa_vbak-check = 'X'.
MODIFY i_vbak FROM wa_vbak TRANSPORTING check WHERE vbeln = vbak-vbeln.
where wa_vbak is work area
i_vbak is internal table
regards
prasanth
09-15-2008 2:40 PM
Since the msg was triggering by system (Standard msg), Internal table was not updating for the selected record.
09-16-2008 7:56 AM
hi,
use the module addition AT EXIT-COMMAND in the above procedure I mentioned and try that out.
i.e
loop.
module update_itab at exit-command.
endloop.
regards
prasanth
09-17-2008 2:51 PM
Hi Prasanth,
Basically it was not updating the flag for selected row to delete.
09-15-2008 6:52 AM
hi
first of all if had make a field mendatory from screen painter
then without values in those field ur sy-ucomm will not work
so do make mendatory field if u want to process those field without values .
u have to create a module in pai in
loop at internal table
module check .
end lopp,
in module check.
use condition
if ok_code = <create> and fields are initial
then error message .
endif .
now in pai u can work on delete button u will not get any error message
no need use fuction type e for delete
regards
anil chaudhary
09-15-2008 2:41 PM
If we dont assign function type E for the Delete button, then surely it will be triggered after 'Error msg'. So i need to avoid that error msg in case of DELETE and selected record should be deleted from the table control.
09-16-2008 7:52 AM
You can Provide Function Type 'E' to the Pushbutton And
write Down the Delete code in AT Exit-command
it will Directly Execute At EXIT-Command (Delete Row Process ) without Error Checking
Regards
Alpesh
09-17-2008 2:52 PM
Hi Alpesh,
I am doing in the same way, but it was not updating the selected row.
09-17-2008 3:22 PM
Hi,
i have created table control with 2 mandatory fields, delete functionality is working fine when data populated in those fields, but when data was not there in those fields and when i try to select that particular row and delete it. It was not deleting and error msg is coming as 'make an entry in all required fields'.
basically i wrote code for deleting in at exit-command module and added function type for the delete button as 'E' too. Basically that functionality is triggering perfectly but my internal table - MARK is not updating with 'X' to delete it.
delete itab where mark = 'X'.
itab-mark is not updating with 'X' when i select the row and try to delete it since it has an error as 'make an entry in all required fields'. i need to delete a selected record even it has errors. Could any one suggest me. I made the 2 fields mandatory in screen painter only. Is there any solution for this?
09-24-2008 7:01 PM
10-22-2008 2:38 PM