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: 

Module pool Program table control

Former Member
0 Kudos

Hi,

In Module pool programming, table control i have 10 items out of which in the same colum i want to put them in edit mode and certain in disply mode.

Regards

1 ACCEPTED SOLUTION

I355602
Advisor
Advisor
0 Kudos

Hi,

Take the group1 for the textbox field as 'ABC', which needs to be in display mode.

Use this code, its working:-

In PBO:-


MODULE passdata OUTPUT.
  READ TABLE itab INDEX tab_clc-current_line.
  IF sy-subrc = 0.
    if <condition>. "condition on which textbox needs to be in display mode
      LOOP AT SCREEN.
       IF screen-group1 = 'ABC'.
          screen-input = 0. "disable for input
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDIF.
ENDMODULE.                 " PASSDATA  OUTPUT

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

7 REPLIES 7

Former Member
0 Kudos

Hi,

You can use loop at screen,



MODULE passdata OUTPUT.

  READ TABLE it_revision INTO wa_rev INDEX tab_clc-current_line.
  IF sy-subrc = 0.
    LOOP AT SCREEN.
      IF screen-group1 = '111'.      " 111 IS THE GROUP NAME
        screen-input = 1.          " input mode
        screen-active = 1.         " input mode.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = '111'.       "GROUP NAME
        screen-input = 0.           " display mode
        screen-active = 1.          " DISPLAY MODE.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDMODULE.                 " PASSDATA  OUTPUT

Make the group of those field ,that you want in input mode

Hope it will Solve your problem

Thanks

Arun kayal.

former_member673464
Active Contributor
0 Kudos

hi ,

you can show some lines in the editable mode and some of the lines in non-editable mode by changing the screen properties of table control.

you can write that code in the pbo of the the screen in loop at i_table.

refer the demo program demo_dynpro_tabcont_loop_at.

regards,

Veeresh

Former Member
0 Kudos

Try this:

CONTROLS controlname TYPE TABLEVIEW USING SCREEN screenname.

DATA: cols LIKE LINE OF controlname-cols.

LOOP AT controlname-cols INTO cols.

&nbsp;&nbsp;cols-screen-input = '0'. "input not possible

&nbsp;&nbsp;cols-screen-input = '1'. "input possible

&nbsp;&nbsp;MODIFY controlname-cols FROM cols INDEX sy-tabix.

ENDLOOP.

Former Member
0 Kudos

Hi Soumya,

Based on some condition we can do, and this condition is 'based on the value in the table control'.

loop at screen.
if screen-group1 = 'GRP1'.
if itab-field eq 'FieldValue'.   -----> condition 
screen-input eq 0 or 1.
modify screen.  
endif.
endif.
endloop.

Check this Link..

[]

[]

I355602
Advisor
Advisor
0 Kudos

Hi,

Take the group1 for the textbox field as 'ABC', which needs to be in display mode.

Use this code, its working:-

In PBO:-


MODULE passdata OUTPUT.
  READ TABLE itab INDEX tab_clc-current_line.
  IF sy-subrc = 0.
    if <condition>. "condition on which textbox needs to be in display mode
      LOOP AT SCREEN.
       IF screen-group1 = 'ABC'.
          screen-input = 0. "disable for input
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDIF.
ENDMODULE.                 " PASSDATA  OUTPUT

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Former Member
0 Kudos

Hi,

In table control field screen input = 0 means desable and 1 means enabled. Refer below code.

LOOP AT flights-cols INTO cols WHERE index GT 2.

cols-screen-input = '0'.

MODIFY flights-cols FROM cols INDEX sy-tabix.

ENDLOOP.

Regards

Md.MahaboobKhan

Former Member
0 Kudos

Thanks