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 records manipulation dynamically

Former Member
0 Kudos

Hi Gurus,

I have some records in module pool table control. i need to disable some rows based on condition(plant). For example if the plant in the table control record is 1000. i have to disable the rows. How to acheive this? Kindly help me out...

Regards,

Rao

5 REPLIES 5

former_member182485
Active Contributor
0 Kudos

Hi,

You can make one whole column inactive but making a row inactive i think is not possible.

former_member233090
Active Contributor
0 Kudos

hi,

Define Columns table based on table control in the TOP include.


CONTROLS TABC TYPE TABLEVIEW USING SCREEN 100.
DATA: COLS LIKE LINE OF TABC-COLS.

Write the below code in the PBO of the screen to hide certain fields


"At runtime as TABC is deep structure which has COLS table
 "inside we have to do the following.
 LOOP AT TABC-COLS INTO COLS.
   IF COLS-SCREEN-NAME = 'ITAB-MATNR'. "Which is to be hidden
     COLS-SCREEN-ACTIVE = '0'.
     MODIFY TABC-COLS FROM COLS INDEX SY-TABIX.
   ENDIF.
 ENDLOOP.

cheers bhavana

0 Kudos

Your code is for disable total column.. i have asked row wise disabling based on condition... can u help me?

0 Kudos

hi ,

in PBO module

LOOP AT it_qty WITH CONTROL tabl

CURSOR tabl-current_line.

MODULE edit.

ENDLOOP.

create module edit in program

module edit output

if it_qty-plant = '7100 ' .

  • check if condition for plant and loop through screen with all table control fields and such as

LOOP AT SCREEN.

IF ( screen-name = 'IT_qty-QTY1' ) OR ( screen-name = 'IT_QTY-QTY2' )

OR ( screen-name = 'IT_QTY-QTY3' ) OR ( screen-name = 'IT_QTY-QTY4' )

OR ( screen-name = 'IT_QTY-QTY5' ) OR ( screen-name = 'IT_QTY-QTY6' )

OR ( screen-name = 'IT_QTY-QTY7' ) OR ( screen-name = 'IT_QTY-QTY8' ).

screen-input = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

regards

Deepak .

endif.

endmodule .

0 Kudos

HI,

"KIndly close this thread if your purpose is Served so that it will be useful for others with similar Issue

Check the below thread

In Place of ITAB-MARK use ITAB-WERKS = 1000.

And also check this one

"In Flow Logic In The Simplest Way, 

PROCESS BEFORE OUTPUT.
 MODULE STATUS_0100.
  LOOP AT itab WITH CONTROL tc.
    module disable_row. " This should be here only
  ENDLOOP.

"In Program
MODULE disable_row OUTPUT.
  IF itab-carrid = 'AA'. " Pass your Plant Value here
    LOOP AT SCREEN.
      IF screen-group1 = 'GRP'. " Create Screen Group 
        screen-input = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = 'GRP'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDMODULE.

Cheerz

Ram