Skip to Content
author's profile photo Former Member
Former Member

Issue with validation in chain endchain

Hello All,

I've created a screen through screen painter. I've created a table in which I need to put a validation that if 1st field is not empty all other fields in the row should not be blank.

I've out all the fields in chain endchain. The issue , which I am facing is that every time 'ENTER' is pressed on the screen , it always shows only the first field mentioned in chain endchain as RED for error even if it has values . It does not consider the other fields.

CHAIN.

FIELD : p_bin01MODULE check_data.

FIELD : p_frm01 MODULE check_data.

FIELD : p_qty01 MODULE check_data.

endchain.

Please suggest.

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2011 at 06:57 AM

    Hi,

    check below code..

    you have list of fields in the table : field1, field2, field3, field4, field5....

    CHAIN.

    FIELDS: itab-field2,

    itab-field3,

    itab-field4,

    itab-field5 MODULE check_data ON CHAIN-INPUT.

    ENDCHAIN.

    MODULE check_data ON INPUT.

    IF NOT itab-field1 IS INITIAL AND .

    ( itab-field2 IS INITIAL OR

    itab-field3 IS INITIAL OR

    itab-field4 IS INITIAL OR

    itab-field5 IS INITIAL ).

    give a message..........

    ENDIF.

    ENDMODULE.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      in that case, between MODULE ....... ENDMODULE. set the cursor.

      MODULE check_data ON INPUT.

      IF itab-field2 IS INITIAL.

      set cursor on field - > field2.

      ELSEIF itab-field3 IS INITIAL.

      set cursor on field - > field3.

      ELSEIF itab-field4 IS INITIAL.

      set cursor on field - > field4.

      ELSEIF itab-field5 IS INITIAL.

      set cursor on field - > field5.

      ENDIF.

      ENDMODULE

  • Posted on Aug 23, 2011 at 10:01 AM

    Hi ,

    Just use below code

    CHAIN.
    FIELD : p_bin01.
    FIELD : p_frm01.
    FIELD : p_qty01.
    endchain.

    IN PAI ...

    it will check the field and get the cursor on empty field ...write ur logic accordingly

    regards

    Deepak.

    Add a comment
    10|10000 characters needed characters exceeded

    • Then use Simple Logic of FLAG i.e

      IN PAI ....

      Perform Validate .

      in driving program .

      form validate .

      if p_bin01 is initial .

      flag = 'B' .

      elseif p_bin01 is not initial and p_frm01 is initial .

      FLAG = 'F' .

      elseif p_bin01 is not initial and p_frm01 is not initial and p_qty01 is initial.

      FLAG = 'Q' .

      endif.

      endform .

      accoring to flag you can set messages and also set cursor .

      OR check CASE SY-UCOMM .

      WHEN OTHERS .

      Because ENTER is ConSIdered in OTHERS .

      regards

      Deepak

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2011 at 05:51 AM

    Used attribute required in Screen Painter

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.