Skip to Content

Table Control Validation on SAVE

Feb 21, 2017 at 05:38 PM


avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sandra Rossi Feb 21, 2017 at 07:09 PM

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).

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.


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'.

David Antonio Arroyo León Feb 22, 2017 at 10:35 PM

Hi Rohit,

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


10 |10000 characters needed characters left characters exceeded