I have this query of moving to fields outside of a roster and then re-entering the roster. Kindly help me achieve this scenario.
For instance, I have a roster TABLE1_FORM. It has 4 rows and one column as RESPONSE. 4 corresponding fields, that is DESC1, DESC2, DESC3, DESC4 are present outside the roster aligned to each row of the roster.
The flow for these fields is as :
(1) if RESPONSE value is > 0 for any row, let's say Row1, it moves to the outside field aligned to it, that is DESC1.
(2) After entering value for DESC1, it should re-enter the roster and move to next row, that is Row2.
This process should continue till it reaches DESC4 after which it moves to the next section.
My code is as such:
Code: Select all
PROC RESPONSE
PREPROC
if CUROCC() = 1 and RESPONSE(1) >0 then skip to next;
endif;
if CUROCC() = 2 and RESPONSE(2) >0 then skip to next;
endif;
if CUROCC() = 3 and RESPONSE(3) >0 then skip to next;
endif;
if CUROCC() = 4 and RESPONSE(4) >0 then skip to next;
endif;
POSTPROC
if CUROCC() = 1 and RESPONSE(1) >0 then move to DESC1;
endif;
if CUROCC() = 2 and RESPONSE(2) >0 then move to DESC2;
endif;
if CUROCC() = 3 and RESPONSE(3) >0 then move to DESC3;
endif;
if CUROCC() = 4 and RESPONSE(2) >0 then move to DESC4;
endif;
PROC DESC1
move to TABLE1_FORM;
PROC DESC2
move to TABLE1_FORM;
PROC DESC3
move to TABLE1_FORM;
Please find attached the image of the respective ROSTER/FORM.
However, this logic fails when you are modifying an entered data or partially saving it.
Kindly let me know, if this is the correct way to do it. Or do we have any other solution for this. Thanks in advance.