‎2013 May 21 4:22 AM
Hi All,
I am facing issue in table control, i am loading entries into table control before display,
i have validations on table control lines but it is validating only entries which are displayed(say 10 lines) not all entries.
how to validate all entries for mandatory fields when press enter?
Regards,
‎2013 May 21 4:32 AM
Hi Venkata,
It's good practice that you validate data on input, not on output.
anyway, if absolute necessary, you could have a module/subroutine BEFORE your LOOP for the table control, where you loop your internal table and do your validations. I honesty think it's an ugly solution, but will do the job.
Cheers,
Custodio
@zcust01
‎2013 May 21 5:41 AM
Hi Venkata,
You have to validate the data on input i.e PAI. Loop at your internal table and validate through all the records with your necessary conditions. May this solve your problem.
‎2013 May 21 6:50 AM
Include all the fields which need to be validated in CHAIN - ENDCHAIN. Check the below example code.
PROCESS AFTER INPUT.
LOOP AT ITAB.
CHAIN.
FIELD ITAB-KUNNR .
FIELD ITAB-MATNR .
MODULE VALIDATE ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
‎2013 May 21 7:00 AM
Problem lies with loop -controls statement .
My code piece will help you surely !
Don't use this as loop goes only to visible lines
** LOOP AT WT_EXPIRY INTO WA_EXPIRY WITH CONTROL T_ITEM .
** MODULE FILL_TABLE_CONTROL.
** ENDLOOP.
Use this
LOOP WITH CONTROL T_ITEM .
MODULE FILL_TABLE_CONTROL.
ENDLOOP.
‎2014 Dec 23 10:26 AM
You have to write separate sub module in PAI.
Like..
Module Validate_ITAB.
Module Validate_ITAB.
Loop at Itab into wa.
….
Put your validation & Capture error messages.
Endloop.
Here Show Messages….
Endmodule.