Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

delete row at errors in table control

Former Member
0 Kudos

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.

14 REPLIES 14

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

No, Its not working.

prasanth_kasturi
Active Contributor
0 Kudos

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

0 Kudos

Since the msg was triggering by system (Standard msg), Internal table was not updating for the selected record.

0 Kudos

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

0 Kudos

Hi Prasanth,

Basically it was not updating the flag for selected row to delete.

Former Member
0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

Hi Alpesh,

I am doing in the same way, but it was not updating the selected row.

Former Member
0 Kudos

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?

Former Member
0 Kudos

solved my own

0 Kudos

This message was moderated.