Application Development and Automation 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: 
Read only

Table Control ----Modulepool program..

Former Member
0 Likes
729

Hi,

In my table control there are say 5 rows...now user will select only row then automatically the other 4 which user has not selected should be Grayed out.....how to do it....

I have tried with the loop at screen syntax in PBO and also the Cols-screen syntax....

these both are not working ...plz suggest any other method ...Help me out in this...

regards,

Rohan.

1 ACCEPTED SOLUTION
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
710

Hi

it_zekpo is my internal table w/o header line,

wa_zekpo is work area.

Name of input/output fields on screen are:-

wa_zekpo-field1,

wa_zekpo-field2, and so on...

Add a field as flag(1) type c in the internal table and work area

And keep a name of SELCOL in the attributes of table control as wa_zekpo-flag

Take the group1 for all textboxes as 'ABC' in the table control

Try using code:-

At screen logic:


PROCESS BEFORE OUTPUT.
*  MODULE status_8003.
 
  LOOP WITH CONTROL po_tb.
    MODULE read_data.
  ENDLOOP.
 
PROCESS AFTER INPUT.
*  MODULE user_command_8003.
 
  LOOP WITH CONTROL po_tb.
    MODULE modify_data.
  ENDLOOP.

In PBO


*&---------------------------------------------------------------------*
*&      Module  READ_DATA  OUTPUT
*&---------------------------------------------------------------------*
MODULE read_data OUTPUT.
  READ TABLE it_zekpo INTO wa_zekpo INDEX po_tb-current_line. "po_tab is table control name
 
  data : line_count type i.
 
  describe it_zekpo
  lines line_count.
 
  po_tb-lines = line_count + 10.
  "to increase the number of lines in table control dynamically

  if wa-zekpo-flag = 'X'.
    if screen-group1 = 'ABC'.
      loop at screen.
        screen-input = 1. "enable
        screen-active = 1.
      endloop.
      modify screen.
    endif.
  else.
    if screen-group1 = 'ABC'.
      loop at screen.
        screen-input = 0. "disable
        screen-active = 0.
      endloop.
      modify screen.
    endif.
  endif.
  
ENDMODULE.                 " READ_DATA  OUTPUT

In PAI


*&---------------------------------------------------------------------*
*&      Module  MODIFY_DATA  INPUT
*&---------------------------------------------------------------------*
MODULE MODIFY_DATA INPUT.
  MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tb-currentline.
  "this will modify the contents of existing line
ENDMODULE.                 " MODIFY_DATA  INPUT

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

6 REPLIES 6
Read only

Former Member
0 Likes
710

Hi,

In the PAI:

get the value of the selected row using sy-stepl into a variable.

Inside Loop the table control.(Either in PBO or PAI)

Use condition:

If sy-stepl ne <Selected row>.

Loop at screen.

Modify screen.

endloop.

endif.

Hope this resolves your issue.

Regards,

Gurpreet

Read only

0 Likes
710

Hi,

not working please guide me with a code if possible..

Regards,

Rohan.

Read only

Former Member
0 Likes
710

hi,

thanks

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
711

Hi

it_zekpo is my internal table w/o header line,

wa_zekpo is work area.

Name of input/output fields on screen are:-

wa_zekpo-field1,

wa_zekpo-field2, and so on...

Add a field as flag(1) type c in the internal table and work area

And keep a name of SELCOL in the attributes of table control as wa_zekpo-flag

Take the group1 for all textboxes as 'ABC' in the table control

Try using code:-

At screen logic:


PROCESS BEFORE OUTPUT.
*  MODULE status_8003.
 
  LOOP WITH CONTROL po_tb.
    MODULE read_data.
  ENDLOOP.
 
PROCESS AFTER INPUT.
*  MODULE user_command_8003.
 
  LOOP WITH CONTROL po_tb.
    MODULE modify_data.
  ENDLOOP.

In PBO


*&---------------------------------------------------------------------*
*&      Module  READ_DATA  OUTPUT
*&---------------------------------------------------------------------*
MODULE read_data OUTPUT.
  READ TABLE it_zekpo INTO wa_zekpo INDEX po_tb-current_line. "po_tab is table control name
 
  data : line_count type i.
 
  describe it_zekpo
  lines line_count.
 
  po_tb-lines = line_count + 10.
  "to increase the number of lines in table control dynamically

  if wa-zekpo-flag = 'X'.
    if screen-group1 = 'ABC'.
      loop at screen.
        screen-input = 1. "enable
        screen-active = 1.
      endloop.
      modify screen.
    endif.
  else.
    if screen-group1 = 'ABC'.
      loop at screen.
        screen-input = 0. "disable
        screen-active = 0.
      endloop.
      modify screen.
    endif.
  endif.
  
ENDMODULE.                 " READ_DATA  OUTPUT

In PAI


*&---------------------------------------------------------------------*
*&      Module  MODIFY_DATA  INPUT
*&---------------------------------------------------------------------*
MODULE MODIFY_DATA INPUT.
  MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tb-currentline.
  "this will modify the contents of existing line
ENDMODULE.                 " MODIFY_DATA  INPUT

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Read only

Former Member
0 Likes
710

HI,

None of the above logics are working.

any more syntaxes...

Regards,

Rohan

Read only

Former Member
0 Likes
710

Hi Rowan,

I am not giving the exact code.But you can try following logic.

Loop at itab with control tc.

if itab-sel ne 'X'.

loop at screen.

if ( screen-fieldname = 'ABC' or screen-fieldname = 'PQR' ) . -


> all field names in table control

screen-active = '0'.

endif.

modify screen.

endloop.

endloop.

Hope it will help you.

Regards,

Anil Salekar