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: 

Table Control Validation on SAVE

Former Member
0 Kudos

Custom table control with 4 fields.

In the PAI section inside the loop at itab written the validation for the four fields inside chain endchain statement.

It works perfectly fine while entering data in the TC and on pressing enter if the validation fails, the line in the table control with the error becomes editable and all other fields are disabled.

However the requirement is that the validation take place only at SAVE event and not on pressing enter after filling each line in the TC.

So I added a IF condition in the validation module. - This works fine till the number of records is less than or equal to the table control rows displayed on the screen.

That is if 10 rows are displayed in the table control screen and the number of records are 15 then the validation fails for the last 5 records which are not displayed at that moment.

I hope I am able to explain my issue.

Kindly advice any workaround.

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

The loop in the PAI only works for the 10 displayed lines. So, if you want to validate everything only at SAVE time, you must do it after the loop: you'll loop at all lines in the internal table (containing the lines of the table control). Of course, the effect is that in case of error, all fields will still be in input state, and you'll have to position the cursor yourself on the erroneous line/field (SET CURSOR).

0 Kudos

Hi Sandra

Thanks for your reply, as suggested by you if I put the whole validation after the loop that is looping all the lines at user command SAVE and exiting the loop at the error line, the whole table control becomes non editable and I am unable to point to the error line which not very user friendly.

I tried to take reference of the error line in PAI and called the SET CURSOR statement in PBO but it does not work. My screen has tabstrips and tables controls in all 3 tabs. The validation fields are present in the first tab only which is the default one.

0 Kudos

Sorry, you're true, table control fields are protected in case of error message in the PAI after the loop. Just send a message like that: MESSAGE ... TYPE 'S' DISPLAY LIKE 'E'.

former_member235395
Contributor
0 Kudos

Hi Rohit,

Use "GET CURSOR LINE" sentence for stablish positions on TC.

Regards,