Defining and managing a single column in table
Hi,
Is is possible to define an attribute for an EJB 3.0 entity Pojo, which will have a corresponding column in the database but will be ignored by the EntityManager in create / read's / update / deletes i.e. not have an getter or setter method.
Thanks
Hi,
Thanks a lot for the reply.
Your reply is very much helpful and by setting the Editable = true, made button enabled.
I am not able to give points because some problem is there in thread page as soon as it is solved i will give points.
My button problem is solved, now one more thing is, is it possible to assign a image at runtime in Visual Composer, because on click of button I am calling a RFC which gives image URL, and I am supposed to show image in new Layer, currently I achieved same using html page but then I am not able to adjust Size of image.
Thanks
Similar Messages
-
How to access single column in table?
Hi,everybody!
How to access a single column in table.
I sorted my table with standard TableSorter.
Now I need to get one column from this table to
do something with it's data.How do I get it?
Regards,
MichaelHi Michael,
If you just want to retrieve the data, you could use the following code.
//Get the node which the table is bound to
IWDNode node = wdContext.nodeTable();
//iterate thru the elements
for(int i = 0 ; i<node.size();i++)
IWDNodeElement ne = node.getElementAt(i);
Object value = ne.getAttributeValue("<column name>");
//Here you have the data in the value variable
//and you can manipulate this now
Regards,
Sudeep -
How to check 2 tables(Table A and Table B) and figure out new columns present in Table A and add these new columns to Table b.
DDL-
Create table A
( A INT,
B INT,C VARCHAR(2)
Create table B
A INT,
B INT
Any advice on the best approach or method to achieve this.
I understand that I need to check the schema of the columns and then do a match between 2 tables and find new columns and then alter my target table
MudassarCan you try this..
CREATE TABLE A ( A INT, B INT, C VARCHAR(2) )
CREATE TABLE B ( A INT, B INT )
Declare @ColumnVar nvarchar(128),@DatatypeVar nvarchar(128)
SELECT @ColumnVar=x.COLUMN_NAME, @DatatypeVar=x.DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS AS x
WHERE TABLE_NAME = 'A'
AND NOT EXISTS ( SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'B'
AND COLUMN_NAME = x.COLUMN_NAME )
Declare @SQL VarChar(1000)
SELECT @SQL = 'ALTER TABLE B ADD ' + @ColumnVar + ' '+ @DatatypeVar
Exec (@SQL)
select * from B
Please Mark This As Answer if it helps to solve the issue
http://stackoverflow.com/questions/2614101/alter-table-my-table-add-column-int -
Reordering of rows - issue with drag and drop of editable columns in table
JDeveloper: 11.1.1.6.0
ADF Faces - Drag and Drop for reordering of rows within the same af:table
I have a requirement for reordering rows in a table using drag and drop. This table is loaded using a list and I am able to programmatically do the reordering of the rows based on the events of drag and drop by manipulating the list. Reordering of rows is working fine if all the columns are read only. For all the input text and input date columns the values are not getting reordered. Anyone has any idea on what the issue may be with reordering of the rows for editable columns/rows (af:inputText and af:inputDate) in af:table. Below is what Iam doing on drop event which is a collection drop target.
public DnDAction dropCollection(DropEvent dropEvent) {
try
Object dropSite = dropEvent.getDropSite();
Transferable transferable = dropEvent.getTransferable();
DataFlavor<RowKeySet> rowKeySetFlavor = DataFlavor.getDataFlavor(RowKeySet.class, "rowmove");
RowKeySet rowKeySet = transferable.getData(rowKeySetFlavor);
RichTable table = (RichTable) dropEvent.getDragComponent();
if (rowKeySet != null)
CollectionModel dragModel = transferable.getData(CollectionModel.class);
Object dragM = dragModel.getRowData(0);
Object currKey = rowKeySet.iterator().next();
dragModel.setRowKey(currKey);
table.setRowKey(currKey);
OrderData orderData = (OrderData)this.prodReportTableData.get(Integer.parseInt(currKey.toString()));
this.prodReportTableData.remove(Integer.parseInt(currKey.toString()));
this.prodReportTableData.add(Integer.parseInt(dropSite.toString()), orderData);
OrderData orderDataAdded = this.prodReportTableData.get(Integer.parseInt(dropSite.toString()));
JSFUtils.addPartialTarget(this.getProdReportTableBinding());
catch(Exception e)
e.printStackTrace();
return DnDAction.MOVE;
Code snippet from UI:
<af:table value="#{pageFlowScope.prodReportBackingBean.prodReportTableData}"
var="row" styleClass="AFStretchWidth" rowBandingInterval="0"
rows="40" emptyText="No data to display." id="t1"
partialTriggers=":::cb1" columnStretching="column:c3"
binding="#{pageFlowScope.prodReportBackingBean.prodReportTableBinding}" summary="PROD TABLE">
<af:dragSource actions="MOVE" defaultAction="MOVE"
discriminant="rowmove"
dragDropEndListener="#{pageFlowScope.prodReportBackingBean.afterDragAndDrop}"/>
<af:collectionDropTarget dropListener="#{pageFlowScope.prodReportBackingBean.dropCollection}"
actions="MOVE"
modelName="rowmove"/>Hi,
not sure its the reason but you have huge bummer in your configuration.
<af:table value="#{pageFlowScope.prodReportBackingBean.prodReportTableData}"
var="row" styleClass="AFStretchWidth" rowBandingInterval="0"
rows="40" emptyText="No data to display." id="t1"
partialTriggers=":::cb1" columnStretching="column:c3"
*binding="#{pageFlowScope.prodReportBackingBean.prodReportTableBinding}"* summary="PROD TABLE">
JSF component bindings should not be to beans in a scope larger than request to avoid stale component instances.
Frank -
Amount and Quantity (with curr and unit) into single column
Hi All,
I have a query with several measures in the rows and two columns, one with 0AMOUNT and the other with 0QUANTITY. At least one of them (0AMOUNT, 0QUANTITY) equals 0 and I'd like to have the query just one column with 0AMOUNT and if 0AMOUNT = 0, then to put there 0QUANTITY. So I used this formula :
( 'Amount' <> 0 ) * NODIM ( 'Amount' ) + ( 'Amount' == 0 ) * NODIM ( 'Quantity' )
The problem is that I need to preserve 0UNIT and 0CURRENCY and if I remove NODIM the formula of course ends with error. Any idea how to solve this??
Thanks for any suggestions.
Paveluser9502062 wrote:
i want to do this without using any predefined functions.Well this solution still uses an analytical function if that's allowed...
SQL> ed
Wrote file afiedt.buf
1 select deptno
2 ,rtrim(max(decode(rn,1,ename))||','||
3 max(decode(rn,2,ename))||','||
4 max(decode(rn,3,ename))||','||
5 max(decode(rn,4,ename))||','||
6 max(decode(rn,5,ename))||','||
7 max(decode(rn,6,ename))||','||
8 max(decode(rn,7,ename))||','||
9 max(decode(rn,8,ename))||','||
10 max(decode(rn,9,ename))||','||
11 max(decode(rn,10,ename)),',') as enames
12 from (select deptno, ename, row_number() over (partition by deptno order by ename) as rn from emp)
13* group by deptno
SQL> /
DEPTNO ENAMES
10 CLARK,KING,MILLER
20 ADAMS,FORD,JONES,SCOTT,SMITH
30 ALLEN,BLAKE,JAMES,MARTIN,TURNER,WARD
SQL>... but it does limit you to how many rows you can join together.
Otherwise I'd suggest you go back to your teacher and ask them for more information about why you can't use predefined functions. -
Get min and max for a column from table with 24 million rows.
What is the best way to re-write the following query in a procedure for the table which has around 24 million rows?
SELECT MIN(ft_src_ref_id), MAX(ft_src_ref_id )
INTO gn_Min_ID, gn_Max_ID
from UI_PURGE_FT;
Thanks
Edited by: tcode on Jun 21, 2012 12:31 PMWhich of the following plan is better, can you please breifly explain?
Also I need to gather statics to know recursive calls , db block gets ,consistent gets etc. etc. how can I get that?
Thanks
1.
Execution Plan
Plan hash value: 3702745568
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 6 | 13991 (2)| 00:02:48 |
| 1 | SORT AGGREGATE | | 1 | 6 | | |
| 2 | INDEX FAST FULL SCAN | UI_PURGE_FT_PK | 23M| 136M| 13991 (2)| 00:02:48 |
2.
Execution Plan
Plan hash value: 1974183109
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | | 2 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 6 | | |
| 2 | INDEX FULL SCAN (MIN/MAX)| UI_PURGE_FT_PK | 23M| 136M| 2 (0)| 00:00:01 |
| 3 | SORT AGGREGATE | | 1 | 6 | | |
| 4 | INDEX FULL SCAN (MIN/MAX)| UI_PURGE_FT_PK | 23M| 136M| 2 (0)| 00:00:01 |
| 5 | FAST DUAL | | 1 | | 2 (0)| 00:00:01 |
--------------------------------------------------------------------------------------------- -
Update a single column of a table
Hi Champs,
I want to update a single column of table PA0000.
Following is ABAp code I am using:
UPDATE pa0000 SET massn = wa_upd_actn71-massn
WHERE pernr = wa_upd_actn71-pernr AND
massn = c_crct_entry.
where in current scenario wa_upd_actn71-massn = 54,
wa_upd_actn71-pernr = 10005092,
c_crct_entry = 71.
But this code is not working and note updating the DB table PA0000.
Can you help me out?
Edited by: Nishant Khimesra on Apr 7, 2009 2:00 PM
Edited by: Nishant Khimesra on Apr 7, 2009 2:00 PMhiii,
If u want to update it thr program then write the query as update <dbtablename> set fld = value where <condn>. make sure that the values u pass are converted as per the values in database.
2nd way is goto se16n
specify table name and then enter &sap_edit on command line. sap editing function will be edited. specify the filter parameters on the field and then execute the transaction. u can change thd data instantly as the data appears in editable alv.
Regards,
Anil N. -
How to Sort single column in webdynpro table
Hi all
I have requirement as follows.
i have webdynpro table with the following columns like Date,firstname,lastname,address etc.
now when i run the the application the table is populating the data at runtime that is fine.
i need as soon as table is loaded , Date field in the table should be displayed the values in the decending order...i have the requirement as follows...
how to sort the single column in table ...by default the values of the column displayed with decending order as soon as table displays at runtime....i dont want to click any button specific button to do the sort for that column
Regards
binduHi, I solved the same problem by modifying the sort() method in the default TableSorter class so that it takes a column id and direction rather than an event.
I assume you have read the TableSorter tutorial.
Like this. (This was done on nw ce 7.1 btw but may work on older versions as well.
Oh and then you just call the sort method right after you have made the request
//Code that goes into controller/view to execute sorting
wdContext.currentContextElement().getPensionplanTableSorter().sort("MyColumnId", "Up", wdContext.nodePensionPlan());
//Part of TableSorter.java
//The original method that needs an event. Now it just calls the new method
public void sort(IWDCustomEvent wdEvent, IWDNode dataSource) {
// find the things we need
String columnId = wdEvent.getString("selectedColumn");
String direction = wdEvent.getString("sortDirection");
sort(columnId, direction, dataSource);
//This is the new method.
public void sort(String columnId, String direction, IWDNode dataSource) {
if (columnId == null || direction == null ) {
return;
IWDTableColumn column = (IWDTableColumn) table.getView().getElement(columnId);
NodeElementByAttributeComparator elementComparator =
(NodeElementByAttributeComparator) comparatorForColumn.get(column);
if (elementComparator == null){
//not a sortable column
column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
return;
// sorting
elementComparator.setSortDirection(WDTableColumnSortDirection.valueOf(direction));
dataSource.sortElements(elementComparator); -
How to define and manage the same end user service for users based around the world in different locations...
Hi,
Does anyone have any suggestions / solutions for the following scenario:
I have a single service of "Desktop - Order New", this will be a standard desktop provided to the end users but how can this service be managed in the respect to the user's different geographic location (China, Dubai, etc). My issue is how to manage the different SLA's, different pricing etc as the supporting contracts for these different geographic locations are from different service providers.
Is the best solution to create separate services for these kind of services or is there a smarter way of doing this.
Any suggestions please let me know.
CraigHi Craig,
From the standpoint of managing delivery acrossmultiple locations, you can use dynamic task assignment. You can create geographically-based queues, each with their own calendar, and then assign the delivery tasks to those queues using an expression. For example:
QUEUE=#Service.Data.RC_Queue.Location# Desktop Services
The Namespace Guide has more details on this. As long as you resolve the expression before the delivery moment begins, the due dates for the tasks wll be computed based on the calendars of the dynamically assigned queue.
As for pricing, your options are version-dependent. in newScale9 there is a new Dynamic Pricing feature which allows you to use a Set Price action in a conditional rule that will set the transactional price of a service based on data in the service form. For versions prior to newScale9, you might want to consider using the Pricing Moment (Pricing Type =Pricing Required). This would create a task before any Approvals which would allow IT to manually set the price for a particular service request.
Do either of these approaches help? -
How to disable a single cell in a table (and not the whole column)
Hi there,
I've got a webdynpro table with a few columns, rows can be created dynamically through a button in the table toolbar.
Depending on the value of a certain cell I have to disable another cell (in the same row).
I tried to manipulate the view in the modifyview but no joy. I also tried to manipulate the attribute property through the coding below:
DATA lv_knttp TYPE knttp.
lo_nd_kostl = wd_context->path_get_node( path = `MULTIVALUES.KOSTL` ).
lo_el_kostl = lo_nd_kostl->get_element( ).
lo_el_kostl->set_attribute_property(
attribute_name = 'LTEXT'
property = lo_el_kostl->e_property-enabled
value = ''
but it disables the whole column!!!! I just need the cell to be disabled (I thought the code above, through the lead selection, would affect a certain cell only - but I was wrong).
Any ideas?
Thanks!!!Hi,
using cell variants you can do this.,
check this article: [Cell Variants in WDA|http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynproforABAPCellVariants]
Instead of binding the read only property of table as a whole , just bind the read only property of column group of table., You can do this bu drill down the table and select the required column and bind the read only column.,
then In onAction Event of button .,
loop the table, if condition satisfied set the read only property to true else false.,!!
hope this helps u.,
Thanks & regards,
Kiran -
How to identify missing records in a single-column table?
How to identify missing records in a single-column table ?
Column consists of numbers in a ordered manner but the some numbers are deleted from the table in random manner and need to identify those rows.Something like:
WITH t AS (
SELECT 1 ID FROM DUAL UNION ALL
SELECT 2 ID FROM DUAL UNION ALL
SELECT 3 ID FROM DUAL UNION ALL
SELECT 5 ID FROM DUAL UNION ALL
SELECT 8 ID FROM DUAL UNION ALL
SELECT 10 ID FROM DUAL UNION ALL
SELECT 11 ID FROM DUAL
-- end of on-the-fly data sample
SELECT '[' || (id + 1) || ' - ' || (next_id - 1) || ']' gap
FROM (
SELECT id,
lead(id,1,id + 1) over(order by id) next_id
FROM t
where id != next_id - 1
GAP
[4 - 4]
[6 - 7]
[9 - 9]
SQL> SY.
P.S. I assume sequence lower and upper limits are always present, otherwise query needs a little adjustment. -
Adding a single column to mulitple tables
I have to add a single column to 664 tables.
I can copy the column from the table it is originally created in.
Is there a way to paste the column in all the remaining tables?
It doesn't work by selecting all the tables in the design ('Ctrl + a', right click 'paste').
It does work if I click each individual table ('Ctrl', left click) but i do not want to have to click each of the 664 tables.
Thanks,
NicYou can create script for this purpose for all 664 tables.
And if you use MS Excel to create that script, you will feel a bit relieved. Its not too much difficult, just simple steps to create the script.
In MS Excel
1- In first column Write >>Alter table [Drag this cell for 664 times]
2- In second table Paste >>Table_Name [Select all tables Ctrl+a, and copy table names in this column 664 Tables will come there]
3- In third column Write >>Add (COLUMN_NAME VARCHAR2(50)); [Drag this cell for 664 times]
Now Script is Ready, You can select all three columns now and paste them in notepad file.
And execute this script in Database;
Hope this will resolve your problem. -
Hi Experts,
I need single column to be selected from a ALV table...selected in da sense to be highlighted....as it happens..by default for a row.....
I hope u understood my query...
Please help me out in this..
I know u all will surely help me...
Thks and Regards,
Runali.Hi Runali,
Get the reference to the column settings of your ALV Model. Then you can get the reference of each column by passing the column ID. There is a method set_selected_state in the column class, but that does not highlight the column as it does for a row. So what you can use is a cell design for a column that will highlight the column with a color or whatever.
lr_column = lr_column_settings->get_column( ID = id ).
lr_column->set_cell_design( preferred design ).
Hope this helps. Please award points if it solves your purpose.
Regards,
Nithya -
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. -
Adding Amount field in BSEG table and display it single line item?
hi experts,
I am doing credit / debit form now my requirement is
According to BELNR , GJAHR,BUKRS i want to find credit amount for this selection cretiria.
so i want to add all the lines of amount filed for a particular BELNR and display it as single line.
so i am getting data from print program like this
SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 2.
PARAMETERS: p_belnr LIKE bkpf-belnr OBLIGATORY,
p_bukrs LIKE bkpf-bukrs OBLIGATORY,
p_gjahr LIKE bkpf-gjahr OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b0.
SELECT SINGLE *
FROM bkpf
INTO i_bkpf
WHERE belnr = p_belnr
AND ( blart = 'DG' OR blart = 'ZG' )
AND bukrs = p_bukrs
AND gjahr = p_gjahr.
IF sy-subrc = 0.
SELECT *
FROM bseg
INTO table it_bseg
WHERE belnr = i_bkpf-belnr .
ENDIF.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_CREDIT_DEBIT' " p_name
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = v_form_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION v_form_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
i_bkpf = i_bkpf
i_bseg = i_bseg
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
so my I_BSEG containing all line items of particular BELNR . with the field SHKZG iam getting only credit line items .
now i want to do is add all credited amount and display like this in a table.
against ref# (BSEG-REBZG) ! details (BSEG-SGTXT)! amount
124569 10%discount 950.00(total amount ie sum of all lines amount for a BELNR)
10.00(total tax amt ie sum of all lines of tax amount for a BELNR)
960.00hi arun,
i used collect in smartform my procedure is like this .
i am getting data into i_BSEG because i declared like this in TABLES parameter
i created a loop .
in that i mentioned like I_BSEG into WA_BSEG.
then i created a program lines here i mentioned like this.
COLLECT WA_BSEG INTO IT_BSEG.
but because of BUZEI "Number of Line Item Within Accounting Document .it is not same it is varying for every credited time that means for every line of BELNR. thats why it is not adding it is just appending .
so pls tell me any other chance to find sum .
because i want to sum up all credted amount and display it in single line
ie first column REBZG "Number of the Invoice the Transaction Belongs to(against ref) i want to display once .
And Second column SGTXT "item text(details) for amount once and for tax amount once
And Third column Amount first line consists total amount & second line consists total for tax amount
regards,
satheesh.
[email protected]
any doubts chat me regarding this post.
Maybe you are looking for
-
I'm going to Kill iphoto... Complete freezing ALL the time
Okay - I'm about to throw my whole computer out the window. I can not get iphoto to run without freezing my whole computer. I have a new Intel mini with all the current updates. It all started a few weeks ago when i bought my new canon 5d. I was usin
-
Error when creating SharePoint WebPart - "An error occurred while generating the project"
I am getting a Error in Visual Studio when I create a SharePoint Web Part.. "An error occurred while generating the project. Please see the Visual Studio Output window for more information." I have checked the Output window and there is noting in it
-
Where to find the OC4J-ready Pet Store Demo file jps112.zip
where to find the OC4J-ready Pet Store Demo file jps112.zip in OTN So that we may better diagnose DOWNLOAD problems, please provide the following information. - Server name - Filename - Date/Time - Browser + Version - O/S + Version - Error Msg
-
2nd gen apple tv not synching with iTunes match
I've got the cloud on, and match on in the iTunes store, but I'm not getting most of my library in Apple TV. I have tried turning them off, restarting, and turning them back on (and restarting) several times. still nothing. What can I do to "kick" th
-
Safari Plugins missing in Tiger?
I upgraded to Tiger from Jaguar and in the process Safari was upgraded to 2.0.2. However, I now keep running into sites that I could navigate before with no problem in Jaguar that say plugins are now missing. Real Player, flash etc. are gone. This is