‎2013 Jul 10 12:12 PM
Dear Friends,
I have created table control and populated values successfully. the issue is if no row is selected in the table control and save button is clicked it should through error message. the message is coming sucessfully but only first row is enabled for input again not other rows.
my flow logic is as follows.
PROCESS BEFORE OUTPUT.
LOOP AT po_paymt_it INTO wa_po_paymt_it WITH CONTROL tc .
MODULE display.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT po_paymt_it.
CHAIN.
FIELD: po_paymt_it-EBELN,SEL1,EBELP,matnr,mblnr,belnr,xblnr,menge..
MODULE validate .
MODULE modify_table.
ENDCHAIN.
endloop.
module user_command.
my validate module is as follows.
module VALIDATE input.
if sy-ucomm = 'BDC'.
READ TABLE po_paymt_it INTO wa_po_paymt_it1 with key sel1 = 'X'.
if sy-subrc ne 0.
message 'Please select atleast one row' type 'E'.
endif.
exit.
endif.
endmodule.
pls share ideas.
Thanks.
‎2013 Jul 10 1:08 PM
Hi Shanmuga Senthil,
One of the solution for your case is changing your error message as,
MESSAGE 'Please select atleast one row'' TYPE 'S' DISPLAY LIKE 'E'.
leave to screen XXXX,
Regards,
‎2013 Jul 10 12:53 PM
If you are using Chain end chain with field for validation it will only enable those fields specified in the chain end chain.
Your requirement is to make all the entries editable. so definitely you have to remove the validation from the CHAIN ... ENDCHAIN. and need to write it in a separate module in PAI before module user command.
If you have other fields in screen and if you require these fields to be non editable till this error is cleared, set a flag if error exist and amke these fields non editable in PBO.
‎2013 Jul 10 1:06 PM
HI Devanand,
I moved the MODULE validate before user command after pai endloop. now also the issue exists. and also after raising error message pbo is not firing. now the first line which is enabled previously also get disabled . correct me if i am doing wrong.
‎2013 Jul 10 2:04 PM
If thats the case remove the message type from E to S and add the comment Display like E for your message. This will help to execute the PBO on next hit .
Also as i said set a flag if the error exist and check while performing save or any other update activities .
it will help in avoiding update with non validated values.
Also if you have other fields to become non editable follow as i said in my previous thread.
‎2013 Jul 10 1:08 PM
Hi Shanmuga Senthil,
One of the solution for your case is changing your error message as,
MESSAGE 'Please select atleast one row'' TYPE 'S' DISPLAY LIKE 'E'.
leave to screen XXXX,
Regards,