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

How to Enable a single record in Table control

Hi All,

im working on table control...i made all the field disable .now for adding purpose i have to make disable a single record.

if im writing loop at screen in PBO all the records are going to enable.but i want a single record to enable.

please help me out.

Thanks,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 16, 2008 at 02:50 PM

    In flow logic of screen

    you must be having

     LOOP AT   ITAB
           INTO   Work area
           WITH CONTROL control_name
           CURSOR control_name-CURRENT_LINE.
    MODULE xyz.
    ENDLOOP.
    

    in MODULE xyz.

    write

          LOOP AT SCREEN.
            IF screen-name = 'ABC'.
             screen-input = 0/1.
                            MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
    

    Add a comment
    10|10000 characters needed characters exceeded

    • HI

      Please check this demo program.

      *Flow Logic part of 100 screen.

      PROCESS BEFORE OUTPUT.

      MODULE STATUS_0100.

      LOOP AT itab WITH CONTROL tc.

      module enab_tc.

      ENDLOOP.

      *

      PROCESS AFTER INPUT.

      • MODULE USER_COMMAND_0100.

      LOOP AT itab.

      module modify_tc.

      ENDLOOP.

      Top Include declaration

      CONTROLS tc TYPE TABLEVIEW USING SCREEN 100.

      DATA : BEGIN OF itab OCCURS 0,

      mark.

      INCLUDE STRUCTURE sflight.

      DATA END OF itab.

      Corresponding Modules in the program

      &----


      *& Module enab_tc OUTPUT

      &----


      • text

      ----


      MODULE enab_tc OUTPUT.

      IF itab-mark = 'X'.

      LOOP AT SCREEN.

      IF screen-group1 = 'GRP'.Delcare a group for all the fields of the Row of Table Control

      screen-input = 1.

      MODIFY SCREEN.

      ENDIF.

      ENDLOOP.

      ENDIF.

      ENDMODULE. " enab_tc OUTPUT

      &----


      *& Module STATUS_0100 OUTPUT

      &----


      • text

      ----


      MODULE status_0100 OUTPUT.

      • SET PF-STATUS 'xxxxxxxx'.

      • SET TITLEBAR 'xxx'.

      DATA : fi.

      IF fi IS INITIAL.

      SELECT * FROM sflight

      INTO corresponding fields of TABLE itab UP TO 20 ROWS.

      fi = 'X'.

      ENDIF.

      ENDMODULE. " STATUS_0100 OUTPUT

      &----


      *& Module modify_tc INPUT

      &----


      • text

      ----


      module modify_tc input.

      describe table itab lines tc-lines.

      if tc-current_line > tc-lines.

      append itab.

      else.

      modify itab index tc-current_line.

      endif.

      endmodule. " modify_tc INPUT

      Best Regards

      Ramchander Rao.K

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.