Application Development and Automation 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:Ā 
Read only

Modulepool table control line item validation

Former Member
0 Likes
1,556

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,344

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

7 REPLIES 7
Read only

Former Member
0 Likes
1,345

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

Read only

0 Likes
1,344

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 ??

Read only

0 Likes
1,344

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

Read only

0 Likes
1,344

Pl. anybody reply ???

Need your expertise..

Read only

0 Likes
1,344

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

Read only

0 Likes
1,344

Thank you Max....I think it will work for me.

Read only

0 Likes
1,344

If you think my suggestion can help you, why have you mark your answer?