2010 Oct 06 6:02 AM
Hi experts,
in the tab control that have 9 cols. and output willl come Dynamically . EX.. Output coming in Cols 1,2,3,5, so i want that
Cols will disable 6,7,8,9 . which have no output so Please tell me.
thank's
Amit
Hi experts,
in the tab control that have 9 cols. and output willl come Dynamically . EX.. Output coming in Cols 1,2,3,5, so i want that
Cols will disable 6,7,8,9 . which have no output so Please tell me.
thank's
Amit
2010 Oct 06 6:13 AM
HI,
U can do this but there is one problem , as u said u want to disable column based on the data in it right ?
In tcontrol there might be multiple records so if the first row in the tcontrol has no value in the col 6 and has value in the second row, then should the column be displayed If yes then u have to check row by row and if all row in the col 6 is blank then only u have to disable the column.
In PBO
loop at it.
module screen_property.
endloop.
in the module write the code by
module screen_property.
loop at screen.
if it-col6 is initial.
screen-input = 1.
endif.
modify screen
endloop.
end module
this is the make the field display mode , But if u want to make invisible the column the n u have to check first tat all rows are initial and then make invisible the column then use the structure CXTAB_COLUMN and make the column invisble
Regards,
Madhukar Shetty.
Edited by: Madhukar Shetty on Oct 6, 2010 7:14 AM
2010 Oct 06 1:05 PM
Hi Amit,
You will have the table control defined in your program as
CONTROLS <ctrl> TYPE TABLEVIEW USING SCREEN <scr>.
This table has the structure of type CXTAB_CONTROL which has one field called column
which we can repfer as <ctrl>-cols and this cols has a structure CXTAB_COLUMN by varying
the attributes of this cols field you can disable the fields.
Write below code in your PBO
If flag = 'X' (condition on which you will be varying the table control o/P to show 1,2,3,5 column)
data wa_cols type cxtab_column.
LOOP AT <ctrl>-COLS INTO wa_cols.
IF wa_cols-index = 6 or
wa_cols-index = 7 or
wa_cols-index = 8 or
wa_cols-index = 9 or.
wa_cols-INVISIBLE= 'X'.
MODIFY <ctrl>--COLS FROM wa_cols INDEX SY-TABIX.
ENDIF.
ENDLOOP.
else. (condition on which you will be varying the table control o/P to show 6,7,8,9 column)
in above code just replace 6,7,8,9 with 1,2,3,5
endif.Regards,
Pawan
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |