Dynamic addition of a column to a table
Hi All,
I need to add one column dynamically to the existing table and also I have to populate the data dynamically. Can you help me out in this? Thanks in advance.
Message was edited by:
Bharath Akuthota
Either create it a design-time invisible and make it visible if needed (probably more simply than by code), or use some code like this:
wdDoModifyView(...)
if (<table structure changed>)
IWDTable table = (IWDTable) view.getElement("TableID");
IWDTableColumn col = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
table.addColumn(col); // NW04
table.addGroupedColumn(col); // NW 7.0
IWDInputField editor = (IWDInputField) view.createElement(IWDInputField.class, null);
col.setTableCellEditor(editor);
editor.bindValue(<attribute inside table data source that should be edited>);
Armin
Similar Messages
-
Dynamic populate rows and columns in adf table
Hi everybody !
I have a query thats returns a unic value !
and I want to populate an af:table with this value !
i need to execute this query to get the values for each columns .... and jump to next row and continue to execute the query for new values of the columns of the new row !!!
in backing bean ... im try to do someting like this :
RichColumn coluna = new RichColumn();
coluna.setId("id");
HtmlOutputText out = new HtmlOutputText();
out.setId("receive");
out.setValue("Contas a Receber");
coluna.getChildren().add(out);
out = new HtmlOutputText();
out.setId("pay");
out.setValue("Contas a Pagar");
coluna.getChildren().add(out);
this.getTableFluxo().getChildren().add(coluna);
but i get the same values for all the rows !!!!Hi there,
If you use ADF BC you can make transient variable in the View Object and fill it in the get method,every time the
get method is executed you will execute the query and change the value of the new transient variable.
Even better solutions is to extend the query with this extra column and map the table with it.
Regards,
Alexander -
How can I dynamically change group field column?
Hello!
I need to group data and create group totals for that table. Is
it possible to dynamically change group field column for
specific table, depending on data retreived from parameter form?
Thanks,
Mario.quote:
Originally posted by:
ljonny18
Hi,
I am using a grid within a component in my Flex application.
I have an XML dataProvider, and I want to change the row
colour of my Grid depending on a value coming form my dataProvider
– but I cant seem to get this to work :(
can anyone help / advise me on how I can dynamically change the
colour of my grid row depending on a value coming from my XML
DataProvider????
Thanks,
Jon.
Hi,
a few hours ago I stumbled across this cookbook entry - it
didn't solve MY problem, but maybe it provides a way to solve your
problem?
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=61&product Id=2&loc=en_US
From the article:
quote:
Changing the background color of a DataGrid cell is not as
simple as changing some style because the default renderer for a
DataGrid cell does not have a backgroundColor. Therefore, to do
this simple task, you have to create a custom itemRenderer where
you draw your own background in the updateDisplayList function.
HTH
Uwe -
How to clone data with in Table with dynamic 'n' number of columns
Hi All,
I've a table with syntax,
create table Temp (id number primary key, name varchar2(10), partner varchar2(10), info varchar2(20));
And with data like
insert itno temp values (sequence.nextval, 'test', 'p1', 'info for p1');
insert into temp values (sequence.nextval, 'test', 'p2', 'info for p2');
And now, i need to clone the data in TEMP table of name 'test' for new name 'test1' and here is my script,
insert into Temp select sequence.nextval id, 'test1' name, partner, info from TEMP where name='test1';
this query executed successfully and able to insert records.
The PROBLEM is,
if some new columns added in TEMP table, need to update this query.
How to clone the data with in the table for *'n' number of columns and*
some columns with dynamic data and remaining columns as source data.
Thanks & Regards
PavanPinnu.
Edited by: pavankumargupta on Apr 30, 2009 10:37 AMHi,
Thanks for the quick reply.
My Scenario, is we have a Game Details table. When ever some Game get cloned, we need to add new records in to that Table for the new Game.
As, the id will be primary key, this should populate from a Sequence (in our system, we used this) and Game Name will be new Game Name. And data for other columns should be same as Parent Game.
when ever business needs changes, there will be some addition of new columns in Table.
And with the existing query,
insert into Temp (id, name, partner, info) select sequence.nextval id, 'test1' name, partner, info from TEMP where name='test'_
will successfully add new rows but new added columns will have empty data.
so, is there any way to do this, i mean, some columns with sequence values and other columns with existing values.
One way, we can do is, get ResultSet MetaData (i'm using Java), and parse the columns. prepare a query in required format.
I'm looking for alternative ways in query format in SQL.
Thanks & Regards
PavanPinnu.
Edited by: pavankumargupta on Apr 30, 2009 11:05 AM
Edited by: pavankumargupta on Apr 30, 2009 11:05 AM -
How to make columns in a table dynamic
Hi,
I want to make the columns of a table dynamic.
At design time I dont know how many columns will be required.
Rows are made dynamic by using the bean concept.
Please help me in this reference(columns).
Thanks
PoojaHi, i don't know how you create the rows dynamically but
have you tried to use a forEach?
<af:table ...>
<af:forEach items="..." var="...">
<af:column headerText="...">
<af:outputText value="..."/>
</af:column>
</af:forEach>
</af:table>
here there is an example of a dynamic panelList:
<af:panelList rows="3" maxColumns="6">
<af:forEach items="#{bindings.ContratosView1.rangeSet}" var="li">
<af:commandLink text="#{li.Codigo}" action="Edit"/>
</af:forEach>
</af:panelList> -
Dynamic creation of column in database table
Can I create columns in a database table dynamically?
Let's say I have two columns in a table. Users requested to have dynamic columns in the table. They wanted to create any no. of fields in the table dynamically. We can't alter the table every now and then. Is there any solution for this. Please let me.
Your early response is highly appreciated.
ThanksI can't use "Alter" statement every time. User may need to insert any no.of columns dynamically. There is no fixed columns. Right now there are two columns which are static. Somebody said it is durable through XML. Can you please let me know in detail. I haven't not done anything using XML.
Thanks for the response. -
APP-FND-01444 additional columns in "validation table information"
I have the following ERROR, when add additional columns in validation table information.
Table Name: “oe_order_headers_all oea, HZ_CUST_ACCOUNTS hca, hz_parties hp”
Table Columns:
Name
Type
Size
Value
OEA.ORDER_NUMBER
Number
10
Meaning
ID
OEA.HEADER_ID
Number
10
Where/Order By: OEA.SOLD_TO_ORG_ID = HCA.CUST_ACCOUNT_ID
AND HCA.PARTY_ID = HP.PARTY_ID
AND OEA.FLOW_STATUS_CODE= 'BOOKED'
Aditional Columns: HP.PARTY_NAME"Customer"(50)the problem was the following space were not there.
Aditional Columns: HP.PARTY_NAME "Customer" (50)
before and after "Customer" there were no space. so we need spaces before and after the column name. -
Additional Columns field in Table Valueset
Hi all,
I would like to display all fields of a table using a valueset.I tried with giving additional columns names of that table at specified column while creating table valueset.But these additional fields are not shown when i select that Valueset that is attached to a parameter for a report.What i need to do inorder to display additional colums of a table using a valueset?
Thanks & Regards
BinuFirst test the feasibility that the enhancement can be done or not.
For finiding the exists in the program :
1> find the program name of the tcode under the status button.
[hope you can do tht]
2> go to table modsap
3> execute it .in the member give <programname> and then execute
4> it will give you the userexits if any .
in the form
endform
you can write your own code.
Else you can go for badi also.
1>go to se24
2>give the class name - CL_EXITHANDLER
3>in the methods go to get_instance
4>create a breakpoint in the first call method
5>then run your transaction /nMIR7.
6>it would stop .find the badi's.
7>if you get any as per your requirement ,work upon it .
Friend i am not working anywhere , i am just learning sap-abap.this is what i knew regarding enhancements . -
Dynamically Hiding Column in a Table View in VC Model
How to dynamacally hide the columns in a table view in a VC model. Through the expression in Control Property, Form element/field or table view as a whole can be made hidden, however, the individual column can not seem to be hidden.
I am using VC server version 700.8.0.1.
Any help would be much appreciated.
Kind Regards
SanjoyIn this scenario, if the source is SAP BI, you can use the webapi commands. If not, you would have to have 2 separate tables in different layers and you can show and hide those layers or UI elements...
-
Addition of a custom column in a table view
Hi all,
I want to add a custom column in a table view. Kindly tell me if this is possible.
Regards,
Vivek PandeyHi Vivek,
This can definately be done....you will have to declare and iterator and in the GET_COLUMN_DEFINITIONS, declare the column name....
Referr to blogs :
<a href="/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator Basics</a>
and
<a href="/people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators Iterator.</a>
The second blog shows how to insert a icon, which is an extra column...
Hope this helps.
<b><i>Do reward each useful answer..!</i></b>
Thanks,
Tatvagna. -
Cannot add column to flexible table when ddl autocommit is off using Procedure
Hello All,
Through procedure I am trying to insert data into the target(EX_92) table(with schema flexibility)
Source table data
ID
PRODUCT_CODE
PRODUCT_NAME
PRICE
COLOR
TYPE
1
1
rugg
101.22
2
1
rugg
101.22
3
2
book
200.32
BLUE
Y
Target table QUERY
drop table EX_P2;
CREATE COLUMN TABLE EX_P2(
ID INTEGER PRIMARY KEY,
PRODUCT_CODE VARCHAR(3),
PRODUCT_NAME NVARCHAR(20),
PRICE DECIMAL(5,2)
) WITH SCHEMA FLEXIBILITY;
Procedure to insert above records with additional columns into the target table(EX_P2)
Procedure
drop procedure "DS_O1"."PROC";
create procedure "DS_O1"."PROC"(IN max_value INTEGER, IN schema_name varchar(40), IN table_name varchar(40), IN column_list varchar(400))
LANGUAGE SQLSCRIPT AS
BEGIN
DECLARE maxid integer :=0;
DECLARE INSERT_STR VARCHAR(1000) :='';
select max(ID) into maxid from "DS_O1"."EX_P2";
select :maxid from dummy;
INSERT_STR :='insert into "' || 'DS_O1' ||'"."EX_P2" ('||:column_list||') (select ' ||:column_list||'
FROM "'||:schema_name||'"."'||:table_name||'"' || ' where ID >' || :max_value || ')';
EXECUTE immediate(:INSERT_STR);
END;
Now while executing above procedure
CALL "DS_O1"."PROC" ( 0, 'DS_O1', 'TMP_EXL2','ID,PRODUCT_CODE,PRODUCT_NAME,PRICE,COLOR,STATUS,TYPE');
I am getting the following error
Could not execute 'CALL "DS_O1"."PROC" ( 0, 'DS_O1', 'TMP_EXL2','ID,PRODUCT_CODE,PRODUCT_NAME,PRICE,COLOR,STATUS,TYPE')' in 23 ms 564 µs .
SAP DBTech JDBC: [7]: feature not supported: [7] "DS_O1"."PROC": line 18 col 1 (at pos 779): [7] (range 3): feature not supported: cannot add column to flexible table when ddl autocommit is offHi Rajnish,
I had the same issue. For what it’s worth I was able to do a workaround basically creating all the columns when I create the table. The following code works for me to create the table which is just a matrix with one Integer column as the key and the rest as type Double.
It is not ideal in all scenarios because the table columns cannot be added dynamically via a procedure at a later point. This table has 27K columns now
Of course one of the advantages of a flex table would be programmatically adding columns dynamically. This works, but maybe there is still a way to add columns dynamically from a procedure, and someone else can advise.
Apparently dynamically adding columns via procedures may have some "minor" limitations due to the need to compile the procedure with knowledge of the flex table DDL. But again, hopefully someone knows another solution.
Best regards,
Mark
DROP PROCEDURE CREATE_MATRIX;
CREATE PROCEDURE CREATE_MATRIX(
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
AS
/*********BEGIN PROCEDURE SCRIPT ************/
BEGIN
-- cursor over messages
declare cursor matrix_cursor for
select distinct TERM
from TERMS
order by term;
declare cnt INTEGER := 0;
declare temptxt NVARCHAR(500000) := 'CREATE COLUMN TABLE DOC_MATRIX ( CONTENT_ID INTEGER ';
for cur_matrix as matrix_cursor do
cnt:=:cnt + 1;
select temptxt || ', C' || cnt || ' DOUBLE' into temptxt from dummy;
end for;
temptxt:=temptxt || ' ) WITH SCHEMA FLEXIBILITY';
EXEC :temptxt;
select :temptxt from dummy;
END;
DROP TABLE DOC_MATRIX;
CALL CREATE_MATRIX(); -
To check whether there is any size mismatch between columns of two tables
Hi,
Here i got two tables T and M where i am going to migrate data from T to M. But before migrating i need to check whether all the data in source table fits into destination table columns. The datatypes of all columns in source table T is of Varchar2 only as it is a temp table.
Ex :- Table 'T' (Source table) with columns
T_Lat Varchar2(50);
T_Amt Varchar2(50);
T_Cat Varchar2(50);
T_Vat Varchar2(50);
Now I have another table 'M'(Destination Table) with columns
M_Lat Varchar2(50);
M_Amt varchar2(25);
M_Cat date;
M_Vat number;
Now my task is I have to do a prevalidation of the data in 'T' that whether all the data in those columns will suit for the destination table columns respectively (to check whether there is any size mismatch). This check should be done dynamically.
For suppose, in T_Amt(source column of T table) if text is abt 50 characters, it cant fit M_Amt(destination column of M table). In this case it should throw an error indicating that destination column size is less for the source column.
Note:- There is no unique mapping column for these two tables and there are about 400 columns in the source table to be validate
I think it can be done using arrays or plsql tables.
Can any one help in this regard.>
Now my task is I have to do a prevalidation of the data in 'T' that whether all the data in those columns will suit for the destination table columns respectively (to check whether there is any size mismatch). This check should be done dynamically.
>
Just because the source table T_Amt column is defined as 50 doesn't mean any of the data is really that long. So the data itself needs to be checked. That is just what a simple query can do.
See my answer in this thread Posted: Jul 25, 2012 1:14 PM
Re: Help in Execute Immediate - Invalid relational Operator
Here is the modified sample query and results for a query of a clone of the EMP table with some modified data
select count(*) cnt,
-- job column
sum(case when job is null then 1 else 0 end) job_nul,
sum(case when job = 'SALESMAN' then 1 else 0 end) job_salesman,
min(length(job)) job_minlength, max(length(job)) job_maxlength,
min(job) job_min, max(job) job_max,
-- hiredate colulmn
sum(case when hiredate is null then 1 else 0 end) hiredate_nul,
min(hiredate) hiredate_min,
max(hiredate) hiredate_max
from emp1
CNT JOB_NUL JOB_SALESMAN JOB_MINLENGTH JOB_MAXLENGTH JOB_MIN JOB_MAX HIREDATE_NUL HIREDATE_MIN HIREDATE_MAX
14 2 4 5 9 ANALYST SALESMAN 0 9/28/0001 12/3/9999With one query and ONE pass thru the table I was able to get the COUNTs, the MIN and MAX values for each column and the MIN and MAX lengths of the VARCHAR2 columns.
There are 14 total records, 2 where JOB is null, 4 where the JOB is SALESMAN. The MIN length of the JOB data is 5 and the MAX is 9.
Look at the date values. The results tell me I have some problem data.
The length data tells me if I try to put the JOB data into another table I need to define the length as at least 9 or it won't fit.
For your use case you might find that all of the data in the T_Lat column is shorter than 26 and will actually fit into the M_Lat target table column. -
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 -
Adding up entries of 2 different columns of a table in a single view column
Hi All,
I have a requirement wherein I have to add up the entries of 2 different columns of 2 different database tables and show it in one column of a View.
Eg. Table A has column A and Table B has column B. I create a view C with column C.
Now Col C = Col A + Col B
Can anyone please let me know how this view can be created?
Thanks,
MomdipaHi Momdipa,
ABAP Table View does not support dynamic arithmetic operations. So, you can't achieve this business logic in the view. There are no operators in the view which can help you to do this.
If you need this functionality, you need to create a ABAP Report to calculate the sum on the execution of the Report. And then you can update the View based on your own business logic.
Hope this helps.
Thanks,
Samantak. -
How to make a particular record in a particular column in a table as a link
Hi All,
I have a table in which the data is getting populated from the response of the BAPI.
I have a column in this table which is not related to the BAPI response. I am binding the column with locally created attribute which is related to the custom controller also.
The name of this column is LINK. The records for this column is "click to view".
According to the requirement,I have two webservices which I am suppose to use in the same table.
So the "click to view" should be enbled for the records from one webservice and should be disabled for the other.
Now I have successfully added the column LINK and the record for it is also"click to view" as i have set it.But its not acting as a link.
So kindly help me out.Looking forward to you.
Regards
DKHi Dipendra,
You can dynamically change TableCellEditor as you want a LINK at one time and no LINK(i.e. TextView ) at other time.
You can get the handle for your table with IWDTable interface and then get handle for your table column with IWDTableColumn. Once you get these you can change the TableCellEditor for that column at runtime.
I would sugesst you to read <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7f531207-0301-0010-5f9c-8652a3232ae0">this</a> document for further details on how to set TableCellEditor at runtime etc.
Hope this helps,
Regards,
Mausam
Maybe you are looking for
-
TAN not getting coppied to Delivery in Free Goods process
Hi I am creating a sales Order With Standard Item TAN and entering Sub Items mannually TANN, System has allowed me to do this, but when i am creating Delivery Document,System is not takeing Higher Level Item, only considering Line items wth TANN, I h
-
I am not able to log into FaceTime after multiple attempts. I am logging in from India. Is there any country specific setup or activation required? Does anyone know about it?
-
Hi, I started having problem connecting to WEP 40/128-bit ASCII access point after installing the following updates. http://www.info.apple.com/kbnum/n305031 I always get an error something like.. "There was an error connecting on the airport network
-
I am using JDBC driver ojdbc14.jar in my Spring application. The java version is 1.4.2 and the JDev version is 10.1.2. The application works perfectly. I do not specify Types.VARCHAR etc while doing the DML operations. It works perfectly on this Jdev
-
MRP contoller From Remote in PR
Hi, I got a situation where I'm having STR created in remote with MRP contoller lets say 003 and in base MRP controller is maintained as 001. But when by o3o_sc01 I'm converting the STR to STO & PR, the PR is capturing the STR MRP contoller 003 not 0