Application Development and Automation 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: 
Read only

Module pool table control data validation

Former Member
0 Likes
2,332

Hi Experts,

I have a question on data validation in table control.

There is a table control on the input screen where the user needs to enter data.

The system should validate the entered data and throw error message if there is wrong value against each field.

When I clicked on enter after entering the data in table control, it is getting disappered.

Please suggest to resolve this.

Thank you.

Regards,

Sri

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,704

How did you code your PAI, does it look like


process before output.

  MODULE pf_status_and_attr.

  LOOP AT itab INTO record with control ctrl cursor ctrl-current_line.

    MODULE record_fill. " fill data if required (e;g. not TABLES)

    MODULE record_attr. " modify screen attributes for this line

  ENDLOOP.

process after input.

  module user_command at exit-command.

  LOOP AT itab.

    MODULE reload_record. " if reload previous data required (e.g. not displayed fields)

    chain.

      field record-field1.

      field record-field2.

      module record_check on chain-request. " if PAI NE PBO

      MODULE modify_itab.

    endchain.

  ENDLOOP.

  MODULE user_command.

Regards,

Raymond

7 REPLIES 7
Read only

Patrick_vN
Active Contributor
0 Likes
1,704

Normally the flow logic of your screen should look something like this (cfr the loops). I'd start by making sure the loop in the PAI is present as well.

Ex:

PROCESS BEFORE OUTPUT.

* MODULE STATUS_0100.

  module data_retrieval.

  loop at it_ekko into wa_ekko with control TC100.

    module populate_screen.

  endloop.

*

PROCESS AFTER INPUT.

  loop at it_ekko.

  endloop.

* MODULE USER_COMMAND_0100.

Read only

siva_subramanian2
Participant
0 Likes
1,704

Hi

Please check the field properties and mark the output field checkbox .Now try the same. Let us know if you still have issues.

Also please check the below previous discussions relevant to this

Thanks

Siva.A

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,705

How did you code your PAI, does it look like


process before output.

  MODULE pf_status_and_attr.

  LOOP AT itab INTO record with control ctrl cursor ctrl-current_line.

    MODULE record_fill. " fill data if required (e;g. not TABLES)

    MODULE record_attr. " modify screen attributes for this line

  ENDLOOP.

process after input.

  module user_command at exit-command.

  LOOP AT itab.

    MODULE reload_record. " if reload previous data required (e.g. not displayed fields)

    chain.

      field record-field1.

      field record-field2.

      module record_check on chain-request. " if PAI NE PBO

      MODULE modify_itab.

    endchain.

  ENDLOOP.

  MODULE user_command.

Regards,

Raymond

Read only

0 Likes
1,704

Hi,

The table control initially is an empty one.

User may enter values in any number of rows and correspondingly each row needs to be validated for two fields.

I am unable to retrieve the data entered by user into the internal table.

@Raymond,

The code almost looks like the way you shared other than chain-request.

FIELD fld1 MODULE check_fld1.

Appreciate your help.

Thanks,

Sri

Read only

0 Likes
1,704

Basically from MODULE reload_record. til MODULE modify_itab  you will append new or update existing records.

Regards,

Raymond

Read only

0 Likes
1,704

Could you please share pseudo logic for reload record module?

Thanks,

Sri

Read only

0 Likes
1,703

Resolved on our own.

Thanks,

Sri