6 Replies Latest reply: Jun 26, 2008 12:37 PM by Ki-Joon Seo RSS

how to create required field in alv?

Ki-Joon Seo
Currently Being Moderated

hi friends^^

 

how to create required field in alv?

 

i don't find required option in fieldcatalog and others.

 

is it possible?

  • Re: how to create required field in alv?
    Boobalan Suburaj
    Currently Being Moderated

    Hi,

     

    Try the field key_sel in field catalog if you are using in ALV Grid using FM. it should be work for column level.

     

    regards,

    SB

    • Re: how to create required field in alv?
      Ki-Joon Seo
      Currently Being Moderated

      thanks for you answer.

       

      but key_sel does't.

       

      key_sel = 'X'. -> does not required field.

       

      i want to make required field(obligatory field) in editable alv.

       

      please answer me..

      • Re: how to create required field in alv?
        Currently Being Moderated

        Hi,

         

        In the field catlog KEY_SEL = 'X' which enables your required field.

         

        do reward points also do send the code..

        • Re: how to create required field in alv?
          Currently Being Moderated

          Hi

           

          While saving check if the required field is not marked with 'X'.

          then show the message "Reqd field to be entered'.

           

          do reward points

        • Re: how to create required field in alv?
          Ki-Joon Seo
          Currently Being Moderated

          Source code..

          PLANETYPE is key_sel = 'X'.

          But does't required field...

           

           

          REPORT  zs32editable1  .

           

          TYPE-POOLS : slis.

          DATA : gt_sflight  TYPE TABLE OF sflight.

          DATA : gt_fieldcat TYPE slis_t_fieldcat_alv,

                 gs_fieldcat LIKE LINE OF gt_fieldcat,

                 gs_layout   TYPE slis_layout_alv.

           

          START-OF-SELECTION.

            SELECT *

              INTO CORRESPONDING FIELDS OF TABLE gt_sflight

              FROM sflight.

           

            gs_layout-colwidth_optimize = 'X'.

            gs_layout-edit = 'X'.

           

            gs_fieldcat-fieldname = 'PLANETYPE'.

            gs_fieldcat-key_sel = 'X'.

            append gs_fieldcat to gt_fieldcat.

           

          END-OF-SELECTION.

            CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

              EXPORTING

                I_STRUCTURE_NAME = 'SFLIGHT'

                is_layout        = gs_layout

                IT_FIELDCAT      = gt_fieldcat

              TABLES

                t_outtab         = gt_sflight

              EXCEPTIONS

                program_error    = 1

                OTHERS           = 2.

            IF sy-subrc <> 0.

              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

                      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

            ENDIF.

  • Re: how to create required field in alv?
    Durai V
    Currently Being Moderated

    Hi,

     

    if u don't want to display i.e. Hide the field.

     

    U declare the fieldcatlog  -NO_OUT = 'X'.

     

    Now this field hide but if u want display u can click the layout in the alv display screen. Then u move to display list.

     

     

    Thanks,

     

    Durai.V

Actions