Dynamic setting of cell attributes in Table Controls
Hi everybody,
I would like to set dynamicly wheather a cell or a line in a Table Control is only for output or ready for input.
I know how it works with columns, but nothing is said about cells or lines.
Thanx for clues.
Greets
Olaf
Hi Olaf,
Basically this works the same for all fields. However for table controls you should do the 'LOOP AT SCREEN' (within routine modify_screen_line in the example code) within the LOOP/ENDLOOP over your table control:
LOOP AT g_tc_itab
INTO g_tc_wa
WITH CONTROL tc_delivplant
CURSOR tc_delivplant-current_line.
MODULE modify_screen_line.
ENDLOOP.
Regards,
John.
Similar Messages
-
How do I click on a cell in a table control, and display the value in a string?
What I would like to do is to click on a cell in a table control, and have the value of the cell be displayed in a string indicator. What ever cell I click on, I would like the value to be displayed in the indicator.
Thank you!
Solved!
Go to Solution.... or
Event >>> ouse down for table.
Use Coords" to feed invoke node "point To Row Column" and returned "Cell Postion" can be unbundled to produce the row and column tht can be used to index out the value.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
How to set column attributes in table control?
I have the following requirement to build a table by using table control:
if content of col 1 = 'Y', enable input for col 2 for that line only.
if content of col 1 = 'N', disable input for col 2 for that line only.
So the input attribute for col 2 in each line can be different.
How can I achieve this?
I have tried using loop at screen or loop at tablecontrol-cols into wa_cols statements,
but these will change the entire column attributes to either on or off, and not on individual line.
Instead of changing the COLUMN attributes, I think I should change the CELL attributes.
What is the syntax for that, is there something like tablecontrol-field?
Thanks for any help in advance.I still not able to get the field attributes set on individual lines.
These are my codes, can you help again.
PROCESS BEFORE OUTPUT.
MODULE pbo_0200.
MODULE zitem_change_tc_attr.
LOOP AT lt_asset_item
INTO ls_asset_item
WITH CONTROL zitem
CURSOR zitem-current_line.
MODULE ZITEM_CHANGE_FIELD_ATTR.
MODULE zitem_get_lines.
ENDLOOP.
MODULE zitem_change_field_attr OUTPUT.
loop at screen.
if ls_asset_item-replace_asset = 'X'.
if screen-group1 EQ 'FR4'. "these are the columns I want to turn input ON or OFF.
screen-input = '1'.
modify screen.
endif.
endif.
endloop.
Endmodule.
At debug mode, the screen-input did change to '1'. Can I check the return code of the MODIFY SCREEN statement?
I tried to initialize the colums to be output only at screen definition, but it still doesn't help.
I don't think I have to do anything at the PAI event.
PROCESS AFTER INPUT.
MODULE save_cursor_position.
LOOP AT lt_asset_item.
FIELD ls_asset_item-replace_asset
MODULE get_replace_asset ON REQUEST.
CHAIN.
FIELD LS_ASSET_ITEM-REPLACE_ASSET.
FIELD ls_asset_item-replace_cost.
MODULE zitem_modify ON CHAIN-REQUEST.
ENDCHAIN.
FIELD ls_asset_item-mark
MODULE zitem_mark ON REQUEST.
ENDLOOP.
MODULE zitem_user_command.
Thanks again. -
Dynamic output & input fields in the table control
HI Guys,
How can one change the attribute of input field to output field basically greying of field) dynamically
based on the some flag. Loop at screen does not work. I need to change the attributes
of field 'outfiled' and output field display only'.
Any help is highly appreciated.
Regards,
HarshaHi Harsha,
I generated a table control (ERP 6.2) and somewhere I found the coding like this (the name of the table control is TABLE_CONTROL):
*&spwizard: output module for tc 'TABLE_CONTROL'. do not change this lin
*&spwizard: get lines of tablecontrol
module TABLE_CONTROL_get_lines output.
g_TABLE_CONTROL_lines = sy-loopc.
If I do a loop at the screen at this place, I can control the individual input/output for the screen fields (the table fields). In my work area (WA_CONTROL) I can see the actual value of fields. Depending on this, I choose to enable/disable input via:
loop at screen.
if wa_control-material <> ' '.
screen-input = '0'.
modify screen.
endif.
endloop. -
Setting field header width in table control
I have created a table control by using the wizard and i am populating my internal table data in to this.
Here i have small issue.
There are two fields called recoverable, identifiable with char (1).
These two field headers are displayed as R, I on the table control.
Is there any way that i can adjust the field width to accomodate the header.
points will be awarded immediately.
ThanksIn SE51 (Screen Painter), select/click-on the field (not the column header).
Press F2 (to get the Properties window) and set the Visible Length to a larger number. Save and activate the screen. -
Dynamically picking the line item of table control
Hi all,
Can u suggest me a way to dynamically picking the no of line item in the table control displayed.
Regards,
Ashutosh KumarHi Ashutosh,
In BDC case, what you can do is use the "position button" instead of finding the number of lines on the table control.
Or else you can use call transaction with 'Options addition'
eg:
Call transaction parameters
clear gs_options.
<b> gs_options-defsize = 'X'. "Default size</b>
gs_options-dismode = 'N'.
gs_options-updmode = 'S'.
call transaction 'VI02' using t_bdcdata
"mode 'N'
"update 'S'
options from gs_options
messages into t_messages.
Please let us know why do you want to know the number of lines on the Table control.If the above answer doesn't satisfy you.
Regards,
Ravi -
Permanently set Repeat cell values on table view obiee11g
Hi,
By default Analysis presentation Column comes with "Column Value Suppression" but we need to switch "Column Value Suppression" to "Repeat cell values" from source xml reference file
Note:don't want to do it via analysis table/column properties(its manual work) ..just looking to change permanently by changing xml
Thanks
DevaHi,
What is that datatypeformats.xml ? couldn't find out. once again will explain my requirement
Creating new analysis(Table/Pivot table view) and applying format as Repeat Cell by changing Table/Pivot Properties to set Enable alternating row "green bar" styling Repeat cell values on table/pivot view (instead of doing manual way)
Refer the below image --> i just want to avoid manual enabling below Repeat cell option for entire table/pivot view option
http://i.imgur.com/122wp.jpg?1
Thanks
Deva
Edited by: Devarasu on Nov 26, 2012 5:06 PM -
How make Invisible a particular Cell in the TAble Control.
Dear Freinds,
I have requirement where in on a particular conditon i have to close one of the fields in the TAble contorl . That is i have to make it as invisible ....iam able only to make only display (greyed out) only iam not able to make invisible.
Please could any one let me know how can we make invisible a particular field.
regards
divya.Hi,
Try this it works,
LOOP AT tc_release_ord-cols INTO wa_cols. "tc_release_ord-----> table control
CASE wa_cols-screen-name.
WHEN 'ZRELEASE_ORDER-SPOTS1'.
IF spots1 = ' '. > use your condition here
wa_cols-invisible = 'X'. > set property to invisible
MODIFY tc_release_ord-cols FROM wa_cols. >modify table control
ENDIF.
WHEN 'ZRELEASE_ORDER-SPOTS2'.
IF spots2 = ' '.
wa_cols-invisible = 'X'.
MODIFY tc_release_ord-cols FROM wa_cols.
ENDIF.
WHEN 'ZRELEASE_ORDER-SPOTS3'.
IF spots3 = ' '.
wa_cols-invisible = 'X'.
MODIFY tc_release_ord-cols FROM wa_cols.
ENDIF.
endcase.
Endloop.
Hope it helps you,
Regards,
Abhijit G. Borkar -
Dynamically setting the vo attribute Update property
Hi All,
Can we set the vo attribute update property dynamically.if so please let me know how can we achieve this.
I have a read only view..But in my process request i need to set the value for that attribute based on some condition.
How can i achieve this.I cant set at bean level.only row level i need to set.
Its a dynamically created seeded vo.
Please help.
Thanks
BharatHi,
Capture the VO row and then set the value on the view attribute.
OAViewObject vo = (OAViewObject)am.findViewObject("viewinstance");
If(vo!=null)
Row row = (Row)vo.first();
row.setAttribute("Attribute Name", "Value");
Thanks,
Gaurav -
Can we change the attributes of table control wizard once it is created?
hi,
i hav created table control using wizard......now i hav to change attributes of that table control.......how to do it ?
can anyone help me in this...............HI,
Double click on the screen Number in whcih Table control is placed.
Then Select the ELEMENT List Tab->place the cursor on the Table control and select the Atributes button in the Application toolbar. -
Dynamicaly setting SCREEN-INPUT field in TABLE CONTROL
hai guys,
in my table control i have REFNUM field and some other fields.
now my task is,
in every row,i have to enable the REFNUM field of table control for editing only if REFNUM is blank.
else i shud disable it.(when REFNUM is filled).
all other fields should be always disabled.
(right now,i am just able to either totaly enable the entire REFNUM coloumn or or totaly disable it for editing,irrespective of the values it is holding.)
shravan ramidiis this not possible?
can some one confirm it.. -
Drop mouse cursor disappears after setting custom cell renderer in table.
Hi,
I've a JList and a JTable, drag&drop works ok between them. Now, if I change TableCellRenderer to custom cell renderer, say a descendent of JComponent that implements TableCellRenderer, it doesn't display drag cursor when it's on top of a cell, and on 1 pixel grid lines it displays right again. can someone help me to fix this issue.
Regards, thanks in advance,
Ozgurit doesn't display drag cursor when it's on top of a cell, and on 1 pixel grid linesThe following renderer works ok for me, although I must admit there is a slight "flicker" when you move over the grid line. Not sure why that happens.
class MultiLabelRenderer implements TableCellRenderer
private JPanel panel;
private JLabel red;
private JLabel blue;
public MultiLabelRenderer()
panel = new JPanel(new BorderLayout());
red = new JLabel();
red.setForeground(Color.RED);
blue = new JLabel();
blue.setForeground(Color.BLUE);
public Component getTableCellRendererComponent(
JTable table, Object value, boolean isSelected,
boolean hasFocus, final int row, final int column)
String text = value.toString();
red.setText( text.substring(0,1) );
blue.setText( text.substring(1) );
panel.removeAll();
int columnWidth = table.getColumnModel().getColumn(column).getWidth();
int redWidth = red.getPreferredSize().width;
if (redWidth > columnWidth)
panel.add(red);
else
panel.add(red, BorderLayout.WEST);
panel.add(blue);
if (isSelected)
panel.setBackground( table.getSelectionBackground() );
else
panel.setBackground( table.getBackground() );
return panel;
} -
Calrify this regarding table control?
hi,
while dealing with table control we must create global structure for that table control or we define structure using types or is there any other way of defining the table control structure.
ex:
*& Include ZSS_TABTOP Module Pool ZSS_TABSTRIP
PROGRAM ZSS_TABSTRIP.
CONTROLS: ZSUB1 TYPE TABLEVIEW USING SCREEN '2441',
SUB2 TYPE TABLEVIEW USING SCREEN '2442',
TABLE_TABSTRIP TYPE TABLEVIEW USING SCREEN '2444',
ZSS_TABSTRIP TYPE TABSTRIP.
TYPES: BEGIN OF S_VBAK,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
ERZET TYPE VBAK-ERZET,
ERNAM TYPE VBAK-ERNAM,
AUDAT TYPE VBAK-AUDAT,
VBTYP TYPE VBAK-VBTYP,
NETWR TYPE VBAK-NETWR,
WAERK TYPE VBAK-WAERK,
END OF S_VBAK.
TYPES: BEGIN OF S_VBAP,
VBELN TYPE VBAP-VBELN,
POSNR TYPE VBAP-POSNR,
MATNR TYPE VBAP-MATNR,
NETWR TYPE VBAP-NETWR,
WAERK TYPE VBAP-WAERK,
NTGEW TYPE VBAP-NTGEW,
GEWEI TYPE VBAP-GEWEI,
ERDAT TYPE VBAP-ERDAT,
ERNAM TYPE VBAP-ERNAM,
NETPR TYPE VBAP-NETPR,
KPEIN TYPE VBAP-KPEIN,
END OF S_VBAP.
DATA: I_VBAK TYPE TABLE OF S_VBAK,
I_VBAP TYPE TABLE OF S_VBAP,
W_VBAK TYPE S_VBAK,
W_VBAP TYPE S_VBAP,
OK_CODE TYPE SY-UCOMM,
G_LINES TYPE I,
H_LINES TYPE I.
I WANT TO DISPLAY THESE INTERNAL TABLE DATA IN TABLE PLZ PROVIDE FURTER CODEHi,
TABLE CONTROL
These are the screen elements used to display tabular data they can be called
as screen tables( like STEP LOOP).To use table control we have to create it on the screen using SCREEN PAINTER(SE51) and declare a control variable of TYPE TABLEVIEW using CONTROLS statement in the ABAP program. We have to use LOOP .. ENDLOOP statement in both PBO and PAI with or without AT int_table parameter. IF AT int_table parameter is not used than we have to place a MODULE call between the LOOP...ENDLOOP statement to fill the screen table rows from the ABAP program in PBO and program our own scrolling functions
using OK_CODE field.
Having a parallel loop(at screen table rows & int table rows) by using parameter
AT int_table makes the ABAP code simple.
A special structure of type CXTAB_CONTROL is used to set/get various
attributes of table control at runtime like CURRENT_LINE ,TOP_LINE.
ABAP declaration
CONTROLS: tab_con TYPE TABLEVIEW USING SCREEN nnnn
Here tab_con is the same name we used in screen for the table control.
This ABAP statement will declare a control variable that will be used to access
the table control , and set it's various attributes like number of fixed columns(tab_con-FIXED_COLS) ,total number of records it will display(tab_con-LINES).It is of type CXTAB_CONTROL and is a deep structure(structure containing structures).
REFRESH CONTROL tab_con FROM SCREEN nnnn
This ABAP statement will initialize the table control on the screen nnnn to its initial values.
PBO processing
In PBO we have to use the screen LOOP ...ENDLOOP statement , with or without
intenal table.
LOOP WITH CONTROL tab_con.
MODULE fill_tab_con.
ENDLOOP.
Here a module should be called between the loop endloop statement to transfer
data from th ABAP program to the screen table through a structure.This module
should use the CURRENT_LINE attribute of the table control variable to get the
current screen table record index to read the data from the internal table into a work area.
e.g.
READ TABLE int_table INDEX tab_con-CURRENT_LINE
The record read will be placed in the header line of the internal table and will be available to the similarly named screen fields or if these are different it can be written explicitly. e.g.
screen_field_name = int_table-field_name
LOOP AT int_table INTO workarea WITH CONTROL tab_con CURSOR i FROM
n1 TO n2.
ENDLOOP.
Here the module call is not required to fill the screen table.The CURSOR parameter is a integer of type I indicating which absolute internal table line
should be the first to display on the table control .FROM n1 TO n2 can be used
to restrict the starting line and ending line number of the internal table , they are of type SY-TABIX.
In both cases before the LOOP statement a module should be called which
is generally for setting of status ,in which we should fill the LINES attribute
(tab_con-LINES ) of the control with the total number of internal table records,doing this ensures correct and automatic scrolling.
The ABAP statement DESCRIBE TABLE int_table LINES lines can be used
to get the total lines in an int table.
PAI Processing
We have to use LOOP ... ENDLOOP in PAI so that data can transfer fro table control to ABAP program. If we want to write changes to the data we should
call a module between the LOOP ... ENDLOOP. The MODULE call to process user commands (SY-UCOM) should be called after the ENDLOOP statement.
e.g.
PROCESS AFTER INPUT
MODULE mod AT EXIT-COMMAND.
LOOP AT itab_table or LOOP "depending on whether we are using AT int_table
MODULE modify_int_table.
ENDLOOP.
MODULE user_command.
In the MODULE call modify_int_table we can use
MODIFY int_table FROM workarea INDEX tab_con-CURRENT_LINE
or we can use
int_table-field_name = screen_field_name.
The steps to create a table control is given in this link.
http://members.aol.com/skarkada/sap/table_control/table_control.htm -
Hi all,
I want to create a table control which is allow the user to Display/Change records from the new Custom table B that have no Acknowledgement Received Date or Time. The users will be able view this data without changing it. When a change is to take place the user will press the Display  Change button or select Display  Change from the Table view menu option.
The following fields will be displayed on the screen:
PNC Sender ID
Payment Run Date
Payment Run ID
of Items
Net Amount of Items
Date Acknowledgement Received
Time Acknowledgement Received
. When change mode is selected, then only the Date Acknowledgement Received and Time Acknowledgement Received will be changeable.
thanks!
Vipinhi
TABLE CONTROL
These are the screen elements used to display tabular data they can be called
as screen tables( like STEP LOOP).To use table control we have to create it on the screen using SCREEN PAINTER(SE51) and declare a control variable of TYPE TABLEVIEW using CONTROLS statement in the ABAP program. We have to use LOOP .. ENDLOOP statement in both PBO and PAI with or without AT int_table parameter. IF AT int_table parameter is not used than we have to place a MODULE call between the LOOP...ENDLOOP statement to fill the screen table rows from the ABAP program in PBO and program our own scrolling functions
using OK_CODE field.
Having a parallel loop(at screen table rows & int table rows) by using parameter
AT int_table makes the ABAP code simple.
A special structure of type CXTAB_CONTROL is used to set/get various
attributes of table control at runtime like CURRENT_LINE ,TOP_LINE.
ABAP declaration
CONTROLS: tab_con TYPE TABLEVIEW USING SCREEN nnnn
Here tab_con is the same name we used in screen for the table control.
This ABAP statement will declare a control variable that will be used to access
the table control , and set it's various attributes like number of fixed columns(tab_con-FIXED_COLS) ,total number of records it will display(tab_con-LINES).It is of type CXTAB_CONTROL and is a deep structure(structure containing structures).
REFRESH CONTROL tab_con FROM SCREEN nnnn
This ABAP statement will initialize the table control on the screen nnnn to its initial values.
PBO processing
In PBO we have to use the screen LOOP ...ENDLOOP statement , with or without
intenal table.
LOOP WITH CONTROL tab_con.
MODULE fill_tab_con.
ENDLOOP.
Here a module should be called between the loop endloop statement to transfer
data from th ABAP program to the screen table through a structure.This module
should use the CURRENT_LINE attribute of the table control variable to get the
current screen table record index to read the data from the internal table into a work area.
e.g.
READ TABLE int_table INDEX tab_con-CURRENT_LINE
The record read will be placed in the header line of the internal table and will be available to the similarly named screen fields or if these are different it can be written explicitly. e.g.
screen_field_name = int_table-field_name
LOOP AT int_table INTO workarea WITH CONTROL tab_con CURSOR i FROM
n1 TO n2.
ENDLOOP.
Here the module call is not required to fill the screen table.The CURSOR parameter is a integer of type I indicating which absolute internal table line
should be the first to display on the table control .FROM n1 TO n2 can be used
to restrict the starting line and ending line number of the internal table , they are of type SY-TABIX.
In both cases before the LOOP statement a module should be called which
is generally for setting of status ,in which we should fill the LINES attribute
(tab_con-LINES ) of the control with the total number of internal table records,doing this ensures correct and automatic scrolling.
The ABAP statement DESCRIBE TABLE int_table LINES lines can be used
to get the total lines in an int table.
PAI Processing
We have to use LOOP ... ENDLOOP in PAI so that data can transfer fro table control to ABAP program. If we want to write changes to the data we should
call a module between the LOOP ... ENDLOOP. The MODULE call to process user commands (SY-UCOM) should be called after the ENDLOOP statement.
e.g.
PROCESS AFTER INPUT
MODULE mod AT EXIT-COMMAND.
LOOP AT itab_table or LOOP "depending on whether we are using AT int_table
MODULE modify_int_table.
ENDLOOP.
MODULE user_command.
In the MODULE call modify_int_table we can use
MODIFY int_table FROM workarea INDEX tab_con-CURRENT_LINE
or we can use
int_table-field_name = screen_field_name.
also check this link
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/contro02.htm
Hope this helps
<b>if it helped, you can acknowledge the same by rewarding</b>
regards
dinesh -
Hi gurus what is table control can explin with example
hi gurus what is table control can explin with example
TABLE CONTROL
These are the screen elements used to display tabular data they can be called
as screen tables( like STEP LOOP).To use table control we have to create it on the screen using SCREEN PAINTER(SE51) and declare a control variable of TYPE TABLEVIEW using CONTROLS statement in the ABAP program. We have to use LOOP .. ENDLOOP statement in both PBO and PAI with or without AT int_table parameter. IF AT int_table parameter is not used than we have to place a MODULE call between the LOOP...ENDLOOP statement to fill the screen table rows from the ABAP program in PBO and program our own scrolling functions
using OK_CODE field.
Having a parallel loop(at screen table rows & int table rows) by using parameter
AT int_table makes the ABAP code simple.
A special structure of type CXTAB_CONTROL is used to set/get various
attributes of table control at runtime like CURRENT_LINE ,TOP_LINE.
ABAP declaration
CONTROLS: tab_con TYPE TABLEVIEW USING SCREEN nnnn
Here tab_con is the same name we used in screen for the table control.
This ABAP statement will declare a control variable that will be used to access
the table control , and set it's various attributes like number of fixed columns(tab_con-FIXED_COLS) ,total number of records it will display(tab_con-LINES).It is of type CXTAB_CONTROL and is a deep structure(structure containing structures).
REFRESH CONTROL tab_con FROM SCREEN nnnn
This ABAP statement will initialize the table control on the screen nnnn to its initial values.
PBO processingI
n PBO we have to use the screen LOOP ...ENDLOOP statement , with or without
intenal table.
LOOP WITH CONTROL tab_con.
MODULE fill_tab_con.
ENDLOOP.
Here a module should be called between the loop endloop statement to transfer
data from th ABAP program to the screen table through a structure.This module
should use the CURRENT_LINE attribute of the table control variable to get the
current screen table record index to read the data from the internal table into a work area.
e.g.
READ TABLE int_table INDEX tab_con-CURRENT_LINE
The record read will be placed in the header line of the internal table and will be available to the similarly named screen fields or if these are different it can be written explicitly. e.g.
screen_field_name = int_table-field_name
LOOP AT int_table INTO workarea WITH CONTROL tab_con CURSOR i FROM
n1 TO n2.
ENDLOOP.
Here the module call is not required to fill the screen table.The CURSOR parameter is a integer of type I indicating which absolute internal table line
should be the first to display on the table control .FROM n1 TO n2 can be used
to restrict the starting line and ending line number of the internal table , they are of type SY-TABIX.
In both cases before the LOOP statement a module should be called which
is generally for setting of status ,in which we should fill the LINES attribute
(tab_con-LINES ) of the control with the total number of internal table records,doing this ensures correct and automatic scrolling.
The ABAP statement DESCRIBE TABLE int_table LINES lines can be used
to get the total lines in an int table.
PAI Processing
We have to use LOOP ... ENDLOOP in PAI so that data can transfer fro table control to ABAP program. If we want to write changes to the data we should
call a module between the LOOP ... ENDLOOP. The MODULE call to process user commands (SY-UCOM) should be called after the ENDLOOP statement.
e.g.
PROCESS AFTER INPUT
MODULE mod AT EXIT-COMMAND.
LOOP AT itab_table or LOOP "depending on whether we are using AT int_table
MODULE modify_int_table.
ENDLOOP.
MODULE user_command.
In the MODULE call modify_int_table we can use
MODIFY int_table FROM workarea INDEX tab_con-CURRENT_LINE
or we can use
int_table-field_name = screen_field_name.
Maybe you are looking for
-
RE: Sending jpg bytes over a server
I had another topic but it has not been answered for a couple days so I guess I will clarify my problem more. I'm sending my image over a server, Client->Server->Client. My sending and receiving works but I get the image and it cannot be displayed. S
-
Hi Friends, I am working in ADF11g and I need some help in creating LOV's. I need a list of value to be displayed on .jsff page where the values should be populated from a Properties file and not from Database. Is there a way to create? And if insert
-
Run repartition but no update to table RSDCUBE
hi expert, i got a question about partition. i have some cube containing data without partition and i don't want to delete the data then do the partition. so i run the repartition directly and i found that: after i ran the repartition , the table RS
-
What is used to produce this layered, motion-tracking effect?
The video is here (http://vimeo.com/4343746?pg=embed&sec=4343746). Is this done in FCP, Motion, After Effects? None of the above? Thanks for any insights.
-
How can I make Word work again?
I've noticed this only occurs on my account on the home computer. Every time I try to open Word, I get an error report that I press don't send on, and other times it actually gets to opening the page before it changes quickly back to the error report