sapdev logo background
sapdev logo sapdev logo
Comments

Manipulating individual abap dynpro table control field attributes




If you place the following ABAP into the 'populate_screen' PBO module (the PBO module within flow logic the table control loop) it will set the 'EBELN' field on the 2nd row to display only. The first bit of the code calculates which row is currently being processed, based on the current top viewable table control row. Once the desired row has been reached it performs 'LOOP AT SCREEN' to find the correct field and sets its attributes.

Using the example of a basic table control as your starting point please implement the following ABAP code changes:



   MODULE populate_screen OUTPUT.
    DATA: ld_line TYPE i.

*   Set which line of itab is at the top of the table control
    IF sy-stepl = 1.
      tc100-lines =
        tc100-top_line + sy-loopc - 1.
    ENDIF.

*   move fields from work area to scrren fields
    MOVE-CORRESPONDING wa_ekko TO ztc_ekko.

    ld_line =  sy-stepl + tc100-top_line - 1.

*   Changes individual field attributes of table control,
*   Sets EBELN field on 3rd row of TC to not be an input field!
    LOOP AT SCREEN.
      IF ld_line EQ 3.
        IF screen-name EQ 'ZTC_EKKO-EBELN'.
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
    ENDLOOP.
  ENDMODULE.                 " populate_screen  OUTPUT





comments powered by Disqus