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.
Similar Messages
-
I've been utilizing the below script (thank you so much Ramkumar. P!) to set column widths throughout a sizable InDesign book with tables on every page and it is truly a time saver. At this point in time, I have three versions of it because there are different column widths throughout the book. Is it possible to augment the script to run only on a selected text frame (containing a table)? If so, would someone be kind enough to share the augmented script with me? I've been trying to figure out this seemingly simple change through trial and error with no success as yet. I realize this is a totally newbie request and I'm entirely at the mercy of the kindness of the Javascript gods that contribute within this forum. Seeing that in a different post related to this script, one such guru responded to a request as simple as "Where do I put the scripts in InDesign" gave me enough courage to ask for some help! Thank you in advance to anyone willing to provide a solution.
var myDoc = app.activeDocument;
var myWidths = [100, 100, 150, 150];
for(var T=0; T < myDoc.textFrames.length; T++){
for(var i=0; i < myDoc.textFrames[T].tables.length; i++){
for(var j=0; j < myWidths.length; j++){
myDoc.textFrames[T].tables[i].columns[j].width = myWidths[j];
alert("Table width updated successfully...");Hello all
I have the same problem in that I'm not a scripting person, but was able to get the above script working without problem, and it does set irregular table column widths perfectly, so thanks to Ramkumar. P for that.
BUT, it changes the column width for ALL tables in the document, whereas I would like to just target the selected table.
Any ideas as to how I might amend this script to achieve this?
Thx, Christian -
How to define Column Header text table control
Hi All,
I have to create a function in which user will pass Field Name, Field Description.
I have to show that field description in Table Control Columns as Text for columns.
Like if a user pass Material , PLant etc, then first column header text will be Material and so on and in rows it will show the data.
One more thing, is it possible to define the technical attributes like length based on field passed through function.
Please help me to find out the solution.
Thanks
Piyush MathurHi Piyush,
here are the some components of the screen . you can change tehm at run time in your code.
components: name,input,output,required,length,active,invisible,intensified,group1,group2...etc.
at ruin time you modify these attributes..
your requirement is to change the name attribute.
regards,
sateesh -
SAPUI5: How to set the appearance of Table control?
Hi there,
I have a table on my app UI. Now I want simply show the table grid lines (currently, the vertical lines between columns are not shown). Any idea?
Furthermore, how to set the width of the bord lines or even teh color of the lines?
Thanks very much in advance!
Dong ZhuHi,
The demo link provided by Chandra uses Blue Crystal theme, hence it shows the vertical lines between the columns of the table. If you are using Gold Reflection theme, then to get the vertical lines, you need to play with CSS. Add the below snippet of CSS between <head></head> of your html file.
<style>
.sapUiTableTr>td {
border-right: 1px solid #cccccc !important;
</style>
Thanks & Regards,
Vishwa -
How do I get and set column attributes in a table or a treetable with Java?
Using 11.1.1.4.0
Hi,
How do I get and set column attributes in a table or a treetable with Java? For a simple example, say I have a table and want certain roles to see all columns (including address), and other roles can see only certain columns (no address). In a Java method, I want to test if a table's column visible attribute is true and if so, set it to false before rendering it.
Thanks in advance,
TroyHi,
this use case would be a perfect example for using seeded MDS customization. Instead of checking what users are allowed to see or not upon rendering time, you have a customization class and thus the framework doing this for you.
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/31-mds-sample-169173.pdf
In this paper and sample, specific users see different layouts. It also contains a customization class that shows how this can leverage ADF Security
Frank -
How to delete a column from the table control in module pool?
Hi,
can any one please tell How to delete a column from the table control in module pool?
thanks in advance
warm regards
HareeshKumar Nhi hareesh,
I think it is better to hide it.
How to hide: You can check this link
Dynamic Hide column in table control -
How to grey out one single column in a table control of TPMOE
Hi Experts,
Any body please tell me how to greyout a single column in a table control of TPMOE.
Help needed ASAP.
Thanks,
sreenivas.lr_result TYPE REF TO if_bol_bo_property_access
lr_iterator TYPE REF TO if_bol_bo_col_iterator
CALL METHOD lr_iterator->get_by_index
EXPORTING
iv_index = index
RECEIVING
rv_result = lr_result.
CALL METHOD lr_result->get_property_as_value
EXPORTING
iv_attr_name = 'TRANSFER_STATUS'
IMPORTING
ev_result = lv_status.
if lv_status = x and component = cost_category.
rv_disabled = true.
else.
call super.
endif.
INDEX will have the row number.
Frame ur logic based on this. -
How to Hide a entire column in a Table Control?
Can we hide an entire column in a Table control? Plz give some hints in doing the same...
Here is a sample, if you wish to do it programattically. If you used the table control wizard, then you should have a module which is listed in the flow logic PBO of the screen. Its probably commented out.
itabcon_change_col_attr
Uncomment it and create the module. Then put the code that I have in the module below into your module.
report zrich_0003 .
*&spwizard: declaration of tablecontrol 'ITABCON' itself
controls: itabcon type tableview using screen 0100.
data: begin of itab occurs 0,
fld1 type c,
fld2 type c,
end of itab.
start-of-selection.
call screen 100.
*& Module STATUS_0100 OUTPUT
* text
module status_0100 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
endmodule.
*& Module ITABCON_change_col_attr OUTPUT
* text
module itabcon_change_col_attr output.
<b> data: wa like line of itabcon-cols.
loop at itabcon-cols into wa.
if wa-screen-name = 'ITAB-FLD2'.
wa-invisible = '1'.
modify itabcon-cols from wa.
endif.
endloop.</b>
endmodule.
Regards,
Rich Heilman -
How to set two attributes as a primary key in database ?
how to set two attributes as a primary key?
Take COffeesbreak as an example ,
let's suppose that there are cof_name ,sup_id,price and so on;
the same cof_name may be suplied by more sup_ids,
and one sup_id may suply more cof_names.
so the Primary key should be set the cof_name and sup_id ,
how to set ?
(of course that i konw if I set a cof_id,the problem will be easy work out
but now there are those like above)
I set that as following:
create table coffees (cof_name VARCHAR(32) PRIMARY KEY,sup_id INTEGER, PRIMARY KEY,PRICE INTEGER )
THE database print error :cant add more primary keys!
thanks in advanceYou can only use the PRIMARY KEY declaration on a column if it is the only Primary Key column.
Use the PRIMARY KEY constraint statement instead.
create table coffees (
cof_name VARCHAR(32),
sup_id INTEGER,
PRICE INTEGER,
PRIMARY KEY ( cof_name ,sup_id )
)Dave -
How to set column width in alvgrid
hi
how to set column width in alvgrid.
thanks.Hi,
Check this,
REPORT ztest.
DATA: BEGIN OF i_scarr_tab OCCURS 0.
INCLUDE STRUCTURE scarr.
DATA: END OF i_scarr_tab.
DATA: i_scarr LIKE TABLE OF i_scarr_tab WITH HEADER LINE,
w_scarr LIKE LINE OF i_scarr_tab.
DATA: o_grid TYPE REF TO cl_gui_alv_grid,
o_container TYPE REF TO cl_gui_custom_container.
DATA: lt_fcat TYPE lvc_t_fcat,
ls_layo TYPE lvc_s_layo,
ls_sort TYPE lvc_s_sort,
lt_sort TYPE lvc_t_sort,
ls_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
START-OF-SELECTION.
CALL SCREEN 9000.
*& Module status_9000 OUTPUT
text
MODULE status_9000 OUTPUT.
SET PF-STATUS '9000'.
SET TITLEBAR '9000'.
ENDMODULE. " status_9000 OUTPUT
*& Module user_command_9000 INPUT
text
MODULE user_command_9000 INPUT.
CASE sy-ucomm .
WHEN 'BACK' OR 'EXIT'.
SET SCREEN 0.
LEAVE SCREEN.
ENDCASE.
ENDMODULE. " user_command_9000 INPUT
*& Module init_9000 OUTPUT
text
MODULE init_9000 OUTPUT.
IF o_container IS INITIAL.
SELECT * FROM scarr INTO CORRESPONDING FIELDS OF TABLE
i_scarr UP TO 100 ROWS.
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
Create a custom container control for ALV Control
CREATE OBJECT o_container
EXPORTING
container_name = 'CONTROL'.
Create a ALV Control
CREATE OBJECT o_grid
EXPORTING i_parent = o_container.
PERFORM build_field_catalgue.
ls_layo-sel_mode = 'A'.
CALL METHOD o_grid->set_table_for_first_display
EXPORTING
i_save = 'A'
i_default = 'X'
is_layout = ls_layo
CHANGING
it_outtab = i_scarr[]
it_fieldcatalog = lt_fcat
it_sort = lt_sort[].
ENDIF.
ENDIF.
ENDMODULE. " init_9000 OUTPUT
*& Form build_field_catalgue
text
--> p1 text
<-- p2 text
FORM build_field_catalgue .
DATA: ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-cprog
i_internal_tabname = 'I_SCARR_TAB'
i_structure_name = 'SCARR'
i_client_never_display = 'X'
CHANGING
ct_fieldcat = ls_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE 'FCAT Error' TYPE 'I'.
EXIT.
ENDIF.
LOOP AT ls_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = ls_fieldcat-fieldname. "Fieldname
ls_fcat-ref_table = ls_fieldcat-tabname. "DDIC ref struct
ls_fcat-inttype = ls_fieldcat-inttype. "Data type
ls_fcat-outputlen = ls_fieldcat-outputlen. "Column width
ls_fcat-coltext = ls_fieldcat-seltext_m. "Column Header
ls_fcat-seltext = ls_fieldcat-seltext_m. "Column Desc
ls_fcat-ref_field = ls_fieldcat-ref_fieldname. "Reference field
ls_fcat-ref_table = ls_fieldcat-ref_tabname. "Reference table
CASE ls_fieldcat-fieldname.
WHEN 'LUGGWEIGHT' OR 'FORCURAM'.
ls_fcat-edit = 'X'.
ls_fcat-do_sum = 'X'.
WHEN 'URL'.
ls_fcat-no_out = 'X'.
WHEN OTHERS.
ls_fcat-edit = ' '.
ls_fcat-do_sum = ' '.
ENDCASE.
APPEND ls_fcat TO lt_fcat.
ENDLOOP.
ENDFORM. " build_field_catalgue
check the programs bcalv_grid*.
check this link for more detailed example.
http://www.supinfo-projects.com/fr/2005/alv_display_fr/2/
Regards
Sruthi -
How to have push button in Table control
Hi Experts,
I have an internal table which I populate in table control. How can I have pushbutton in table control(in every row). If done how to have funtion code which will trigger PAI.
Thanks and regards.
VenkatHi,
I dont think that pushbuttons will be of much use as when you click a button same code will be executed all time.
So, you can take either selection column in table control (use the SELCOL in the table attributes)
or you can also take a checkbox in table control and then can perform action on lines which were selected by the user.
Hope this helps you out.
Regards,
Tarun -
Is it possible to change nunmber of columns dynamically in table control
Is it possible to change number of columns dynamically in table control? if so how it could be done?
Thnaks in advance.
SounderYou can update the table control in your program, the table control is a structure of the type CXTAB_CONTROL of TYPE-POOLS cxtab.
There you can hide or display column the same way you do for fields in LOOP AT SCREEN. there you will ahve to LOOP AT <control>-COLS.
TYPE-POOL CXTAB .
TYPES:
BEGIN OF CXTAB_COLUMN,
SCREEN LIKE SCREEN, "Attributes struktur SCREEN
INDEX TYPE I, "Position of a column on the screen
SELECTED(1) TYPE C, "Indicator 'column selected'
VISLENGTH LIKE ICON-OLENG, "Visualised length of a column
INVISIBLE(1) TYPE C, "Indicator 'column invisible'
END OF CXTAB_COLUMN,
BEGIN OF CXTAB_CONTROL,
FIXED_COLS TYPE I, "Number of fixed columns
LINES TYPE I, "Number of lines to display
TOP_LINE TYPE I, "Top line during next PBO
CURRENT_LINE TYPE I, "Current line during LOOP/ENDLOOP
LEFT_COL TYPE I, "Fist scrollable column after fixed area
LINE_SEL_MODE TYPE I, "Line-selection : none(0), single(1),
COL_SEL_MODE TYPE I, "Column-selection: multiple(2)
LINE_SELECTOR(1) TYPE C, "Indicator: 'With line-selection col'
V_SCROLL(1) TYPE C, "not used
H_GRID(1) TYPE C, "Indicator: 'Horizontal grid-lines'
V_GRID(1) TYPE C, "Indicator: 'Vertikal grid-lines'
COLS TYPE STANDARD TABLE OF CXTAB_COLUMN
WITH NON-UNIQUE DEFAULT KEY,
INVISIBLE(1) TYPE C,
END OF CXTAB_CONTROL,
Regards -
How to set border lines in table and also in template in the smartforms ?
How to set border lines in table and also in template in the smartforms ?
As I have to create table with following detals
total row = 3
row1 = 3 column
row2 = 6 column
row3 = 9 column
for 2nd and 3rd row data to be fetched using coding.
so can anybody explain me what should i use
Table or Template ?
and I want the border like excel format.
Can anybody suggest me ?
Thanks
nareshif the data is multiple i.e. line items choose table.
if the data is single i.e. fixed choose template.
Create table
> Draw u r no lines
> choose option select pattern
> select display framed patterns
Choose u r required one.
out lined, or full lined. u can choose option.
same procedure to be followed for template also.
with regards,
Kiran.G -
How to create vertical Scrollbar in table control?
Dear All,
How to create vertical scrollbar in table controll.?
regards,
DharmeshHi
It should be created automatically, if you can't see it, try to set the field lines of table control
PROCESS PBO
MODULE SET_ATTR_TC.
LOOP AT ITAB WITH .....
ENDLOOP.
MODULE SET_ATTR_TC.
DESCRIBE TABLE ITAB LINES SY-TABIX.
<TABLE CONTROL>-LINES = SY-TABIX.
ENDMODULE.
Max -
Programatically setting column values for table
hi...
I am programatically setting column values for table.
But these values are not getting reflected on table after commit.
I mean to say,new values are not persisted after commit.
The code is as follows,It is in Application Module class
public void createRecord()
OAViewObject vo = (OAViewObject)this.getOpptyLoeVO1();
if (!vo.isPreparedForExecution())
vo.executeQuery();
Row row = vo.createRow();
row.setAttribute("Id",new Number(850));
row.setAttribute("Model","Honda");
row.setAttribute("Role","Team Lead");
row.setAttribute("Hours",new Number(35));
vo.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);
getTransaction().commit();
Here "Id,Model,Role,Hours" are columns in table .Hi,
is your VO based on an Entity Object?
If not, you can't update values in the DB using only a View Object!
If yes, you should control that, in your VO, you have not selected the flag "Read Only" for the EO you want to update.
Hope this helps you.
Bye
Raffy
Maybe you are looking for
-
Firefox crashes every time I try to open personas
All I do is roll over the personas menu item and it's gone.
-
Hello, There are lots open item exists in the GL a/c ,that items comes from WE document type ie material documents. Kindly suggest me how to reverse those document in GL a/c or how to clear all those items. F.13 is also not working on it. Suggest,
-
Populate document header text in SES by bapi BAPI_ENTRYSHEET_CREATE
Hi, I am using BAPI BAPI_ENTRYSHEET_CREATE to create a service entry sheet. But I am not able to populate the document header text (bktxt) in acceptance tab in service entry sheet header in ML81N. Can anybody help me what I need to pass to this BAPI
-
PC not detecting my Nomad MuVo
I was pasing a music file and it froze, when I rebooted and tryed to verify if all my music was still in it just didnt detect it and have tryed to use it on other computers and have had no luck. I can still use it for listening to music but I andt co
-
Hello, I'm taking a PhoneGap Mobile Apps class this semester in college. I'm using Win7, with CS6. We are the ginny-pig class. First time being taught at school. Please explain.We are using Dreamweaver as our IDE? Now I need to download the PhoneGap