Application Development 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: 

Table Control :Making only one row in editable mode .

former_member667836
Active Participant
0 Kudos

Hi experts,

how can i change the table control first row(not column!) as editable mode and rest of the rows(not columns!) in display mode .One entry(user key in) will come in this table control.

PBO

<b>loop at it_tab into wa_tab with control tc_msg .

ENDLOOP.</b>

Points rewarded for helpful answer.<b></b>

1 ACCEPTED SOLUTION

former_member491305
Active Contributor
0 Kudos

Hi,

it is possible.Check out the following code.

PROCESS BEFORE OUTPUT.

MODULE tc2_change_tc_attr.

LOOP AT it_marc INTO x_marc WITH CONTROL tc2 CURSOR tc2-current_line.

MODULE tc2_get_lines.

ENDLOOP.

MODULE tc2_get_lines OUTPUT.

g_tc2_lines = sy-loopc.

IF tc2-current_line = 1.

LOOP AT SCREEN.

IF screen-group1 = 'G1'. -


<" Set the group name1 as G1 for all the table control fields----


>

screen-input = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

ENDMODULE.

6 REPLIES 6

Former Member
0 Kudos

Highlight individual table control field

The example below sets the EBELN field on the 1rd row of the table control to be an input field. This is a fairly simple process which involves firstly calculating which row of the internal table is displayed at the top of the table control. From this you can work out which itab row is on the 1st row and set its attributes using the LOOP AT SCREEN command.

Based on the example table control the ABAP code for this will be as follows, resulting in a modified version of the PBO MODULE 'populate_screen'.



   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 1.
      IF screen-name EQ 'ZTC_EKKO-EBELN'. "  if  you comment this if  then full row 
          screen-input = X.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
    ENDLOOP.
  ENDMODULE.        
 

reward points if it is usefull ....

Girish

0 Kudos

Hi Gireesh,

Thanks .solved my problem based on the logic.

rgds

shibu

former_member404244
Active Contributor
0 Kudos

Hi,

I don't think in table control it is possible to make one row editable..U can do it for column.

Regards,

Nagaraj

former_member491305
Active Contributor
0 Kudos

Hi,

it is possible.Check out the following code.

PROCESS BEFORE OUTPUT.

MODULE tc2_change_tc_attr.

LOOP AT it_marc INTO x_marc WITH CONTROL tc2 CURSOR tc2-current_line.

MODULE tc2_get_lines.

ENDLOOP.

MODULE tc2_get_lines OUTPUT.

g_tc2_lines = sy-loopc.

IF tc2-current_line = 1.

LOOP AT SCREEN.

IF screen-group1 = 'G1'. -


<" Set the group name1 as G1 for all the table control fields----


>

screen-input = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

ENDMODULE.

0 Kudos

Hi Vigneswaran,

Thanks a lot.solved my problem.

rgds

shibu

former_member667836
Active Participant
0 Kudos

Thanks its working