ā2014 Sep 24 2:35 PM
Dear Sir
I am facing a prob. when trying to validate line item wise in table control.
I am explaining my requirement below.
I have no. of line items which are displaying table control screen output.one field is SERNR (seriel number).(Always editable)
If user selects all the line items ex. 7 lines (rows) ..and press check button ..It shoud give an error message
Message ''Serial number should not be blank''' type 'E'... Now user put enter and system allowing to enter the
serial number . I put the value ex. 2 in the first line item ..Then check button press, system again should
give the same error message.. because other 6 line items (SERNR) field still blank ..So the error message should follow
all line items check unless and until the SERNR number has hold some value.
How to achieve this validation ??Pl. help me ..
Thanks
ā2014 Sep 24 2:44 PM
Hi
If you wan to manage a validation for a single line of table control, you need to insert it in the LOOP of PAI, if you want to manage a validation for all lines of table control you need to insert it after the LOOP of PAI
Max
ā2014 Sep 24 2:44 PM
Hi
If you wan to manage a validation for a single line of table control, you need to insert it in the LOOP of PAI, if you want to manage a validation for all lines of table control you need to insert it after the LOOP of PAI
Max
ā2014 Sep 24 2:53 PM
Hi
yes my all 7 line items marked as SEL = 'X'.
but how to check line item wise one by one ...that SERNR entry should n't be left blank ..
If first line item enter SERNR value as 2 , then it shoud throw again error message because 2 to 7 line item sernr value is blank..
So how to do this ??
ā2014 Sep 24 2:59 PM
Hi
PROCESS PAI.
LOOP ......
FIELD: SERNR MODULE CHECK_SERNR.
ENDLOOP.
MODULE CHECK_SERNR.
CHECK SERNR IS INITIAL.
----> error message
ENDMODULE.
But I'm not sure it's want you need
Max
ā2014 Sep 24 3:25 PM
ā2014 Sep 24 3:51 PM
As I said before you need to insert a check out of LOOP:
PROCESS PAI.
LOOP...
ENDLOOP.
MODULE CHECK_ALL_SERNR.
MODULE CHECK_ALL_SERNR.
* Check if all items all selected:
LOOP AT ITAB WHERE MARK = 'X'.
IF ITAB-SERNR IS INITIAL.
MESSGE .......
EXIT.
ENDIF.
ENDLOOP.
If you insert the check out of LOOP of table control you can't use an error message else the user can't update the data, so you should use an information message.
You should clear OK_CODE in order to stop the action if the error occurs:
MODULE CHECK_ALL_SERNR.
* Check if all items all selected:
LOOP AT ITAB WHERE MARK = 'X'.
IF ITAB-SERNR IS INITIAL.
MESSGE .......
CLEAR OK_CODE.
EXIT.
ENDIF.
ENDLOOP.
Max
ā2014 Sep 24 3:57 PM
ā2014 Sep 24 4:18 PM
If you think my suggestion can help you, why have you mark your answer?