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: 

Issue in table control in modulepool

venkata_reddy6
Participant
0 Kudos

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,

5 REPLIES 5

custodio_deoliveira
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

former_member200345
Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.