‎2016 Mar 15 9:19 AM
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
‎2016 Mar 15 9:52 AM
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
‎2016 Mar 15 9:31 AM
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.
‎2016 Mar 15 9:39 AM
‎2016 Mar 15 9:52 AM
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
‎2016 Mar 15 12:05 PM
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
‎2016 Mar 15 12:26 PM
‎2016 Mar 15 1:10 PM
Could you please share pseudo logic for reload record module?
Thanks,
Sri
‎2016 Mar 15 1:37 PM