Skip to Content
0
Oct 28, 2012 at 01:00 PM

Issue with validating a table control

26 Views

Hi,

I have a subscreen with table control. I'd like to validate /check if one of the fields is populated/ the table control and if the required field is not populated to stop program for further processing.

I have an internal table on which I do LOOP ENDLOOP and inside of that LOOP I have CHAIN and ENDCHAIN.

The logic works perfect when my internal table has records / there is at least one record populated in the table control /, but if there are no records it doesn't get into CHAIN ENDCHAIN at all.

Please check my code below and advise !

Internal table: gt_mit_itab

Table control: comp

Field to be checked: zpmet_aufk-zzmit_act_ca

Flow logic of my screen:

PROCESS BEFORE OUTPUT.

* MODULE STATUS_0900

MODULE check_status.

MODULE screen_modify_0900.

* MODULE set_tc_lines.

LOOP AT gt_mit_itab WITH CONTROL comp CURSOR comp-current_line.

MODULE list_output.

ENDLOOP.

PROCESS AFTER INPUT.

* MODULE user_command_0900.

MODULE refresh_itab_0900.

MODULE check_confirmation.

MODULE insert_initial_rec.

LOOP AT gt_mit_itab.

CHAIN.

FIELD zpmet_aufk-zzmit_act_ca MODULE check_deferals.

ENDCHAIN.

MODULE append_tab_lines_0900.

ENDLOOP.

MODULE user_command_0900.

MODULE export_itab_0900.

Thanks,

Stefan