Datatable - One column bound, one column dependent
Hi,
I am trying to make a datatable. What I want, which gives me some difficulty, is one column bound to data, while the next column uses that data to decide what to print.
Specifically, here is what I am trying to do. I have a column in the table pulled from a database column. The only values are 1 and 0. If it is 1, I want the second column to say "working" and if it is 0, to say "not working".
Please let me know a way to do this. Thank you.
Thanks for your reply. I figured out a way to show what I wanted another way. I put two static texts in the same column as the 0/1 column. I made a boolean property which was false when {currentRow.getValue['colName']} was 0 and true when it was 1. Then I bound the render property of the 2 static texts in the column to the boolean. The value I used for the "working" text was {boolProperty} and for "not working" I used {not boolProperty}.
This strategy works really well.
Similar Messages
-
Multi-column Index vs One index for each column
Hello everyone,
i have one table about 20 000 000 rows, some developers have to generate reports on it and i want to create indexes on this table.
The table has 34 columns, no primary key, no unique keys.
The "where..." clause of the reports usually use 8 columns but some reports uses 8 + some other columns.
can any one help me on what kind of indexes do i have to create?
1. one index for each column used in "where clause"
2. one index for 8 columns and some other indexes for other used columns
3. one index for all columns
or something else etc...
br flagi have one table about 20 000 000 rows, some developers have to generate reports on it and i want to create indexes on this table.
The table has 34 columns, no primary key, no unique keys.
The "where..." clause of the reports usually use 8 columns but some reports uses 8 + some other columns.
can any one help me on what kind of indexes do i have to create?
1. one index for each column used in "where clause"
2. one index for 8 columns and some other indexes for other used columns
3. one index for all columns
or something else etc...What's the version of your data base? what kind of database you have, DWH or OTLP? The answer might depend on the type of database as far as bitmap indexes might suit or might not depending if you are runing DWH or OLTP kind of database
Let me suppose that you are runing OLTP database and you have a where clause with 8 columns.
1) are all those where clause equalities (where col1 = and col2 =) or there are inequalities?
2) could you evaluate the most repetitive columns?
3) could you know the column that could have the best clustering factor (the column which most follow a certain order in the table)
Based on that I would suggest to create one b-tree index having 8 columns (even though that it seems for me to high) this index should follow the following points:
1) put the most repetitive column at the leading edge (and compress the index if necessary)
2) put the columns that are used in equalitity predicate first
3) put the column having the best clustering factor first
The most precise index you have the best access you could gain.
Of course that you have to know that an index access is not always good and a FULL table scan is not always bad.
Best regards
Mohamed Houri
www.hourim.wordpress.com -
SQL update one column from another column
I'm looking for a way to update a SQL column with a portion
of info from another column in the same table.
example of a sql command
UPDATE table1
SET table1.columnname1 = table1.columnname2
FROM table
WHERE blah blah blah
Here's the thing... I only need a portion of the data found
in the source column. I'm not sure how I would do this then.
for example, the database has countries and states combined
into one column like this 'US-DC', 'US-CA', US-FL', etc. I want to
separate these into two columns, a country column and a state
column.... and I dont want to go though all the results and do this
line by line. How would I write the SQL command so that it puts
just the country in the country column, and puts just the state in
the state column, and it omits the dash all together.
any ideas?It depends. Are you using PHP and mySQL or ASP and SQL?
If you are using mysql and PHP you could use the following
code to loop through all records in your datatbase.
$sql="SELECT * FROM tablename"; //SET tablename to the name
of your database table.
$result=mysql_query($sql)or die(mysql_error(). " - $sql");
for($x = 0; $row=mysql_fetch_assoc($result); $x++){
//set up the variables from the table
$ID=$row['ID']; //this is the primary key
$var1=$row['contrystatecolumn']; //this is the name of the
column which holds the country-state
$var2=explode("-", $var1); //now we explode the string to get
the country and the state seperated and place the results into an
array
$country=$var2[0]; //this is the first piece of the exploded
string in the array
$state=$var2[1]; //this is the second piece of the exploded
string in the array
//now we update the database record with the new information
//remember to replace the tablename with your actual table
name and the columns country and state with the acutal names of
your columns in your table
$sql2="UPDATE tablename SET country='$country'.
state='$state' WHERE ID='$ID'";
$result2=mysql_query($sql2)or die(mysql_error() . " -
$sql2");
This code will loop through every record in your table and do
what you want very quickly.
Hope this helps
Stan Forrest
Senior Web Developer
ATG Internet -
How to print all columns in one page
Hi,
Can anybody explain me how to print all columns in one page.we have around 15 to 20 columns for 4 reports and all these reports are build on one multiprovider.we are using BW 3.5.
Can anyone explain me how to print ALL COLUMNS IN ONE PAGE .currently they are getting all columns in 2 to 3 pages. They are using PORTAL to run the reports here.
Is it possible to do by customizing Webtemplate or by macros in Workbook.Please help me
Edited by: kotha123 on Oct 11, 2010 5:58 PMHi,
Your best bet is to use a workbook template or else Excel to pdf option...Thanks -
Search a text in a multiple tables and one table has BLOB column
Hi,
I couldn't find a solution/examples for below scenario in oracle text documentation or related forums.
I need to search a text in a multiple tables,in that one table has blob column which is used to store the documnents(pdf,doc,jpg..etc) and other tables have varchar2 columns,These tables have realation each other.
Please provide a sample examples for above scenario.
Thanks in advance..Have a look at my blog entry here:
https://blogs.oracle.com/searchtech/entry/indexing_data_from_multiple_tables
That describes two methods of achieving what you are looking for. -
Hide a column in one table view but show it in another
I need to hide a column in one tables view but show it in another table view in the same report. Is this possible?
Any help on this is appreciated.
Edited by: VNC on Jan 11, 2010 9:26 AMHi VNC,
If you're crafty with javascript, you could probably write a script that would set the CSS property DISPLAY to NONE to hide the column in the table view you didn't want but leave it there in the view you did want.
-Joe -
More than one SDO_GEOMETRY columns in one Oracle 8i spatial table
I have a spatial table as follows:
CREATE TABLE TEST(
ID VARCHAR2(255) NOT NULL,
POINT MDSYS.SDO_GEOMETRY,
LINE MDSYS.SDO_GEOMETRY,
POLYGON MDSYS.SDO_GEOMETRY,
PRIMARY KEY(ID));
Is it a good practice to have more than one SDO_GEOMETRY columns
in one spatial table? What are the drawbacks if any to have a
spatial with more than one layer?I have one question about more than one SDO_GEOMETRY columns
in one table in Oracle 8.1.7. When I wanted to create two
spatial indices for this table, every time I got some error.
Can anyone tell me how to figure it out?
Thanks very much,
Fan Fan,
You need to insert metadata record before creating spatial
indices.
Try the following:
REM USER_SDO_GEOM_METADATA :
REM insert a row for the geom layer for TEST TEST2 tables
REM
INSERT INTO USER_SDO_GEOM_METADATA
( TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
VALUES ('TEST', 'POINT', MDSYS.SDO_DIM_ARRAY
(MDSYS.SDO_DIM_ELEMENT('LON', -180,
180, .000005),MDSYS.SDO_DIM_ELEMENT('LAT', -90, 90, .000005)),
NULL);
INSERT INTO USER_SDO_GEOM_METADATA
( TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
VALUES ('TEST', 'LINE', MDSYS.SDO_DIM_ARRAY
(MDSYS.SDO_DIM_ELEMENT('LON', -180,
180, .000005),MDSYS.SDO_DIM_ELEMENT('LAT', -90, 90, .000005)),
NULL);
INSERT INTO USER_SDO_GEOM_METADATA
( TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
VALUES ('TEST', 'POLYGON', MDSYS.SDO_DIM_ARRAY
(MDSYS.SDO_DIM_ELEMENT('LON', -180,
180, .000005),MDSYS.SDO_DIM_ELEMENT('LAT', -90, 90, .000005)),
NULL);
REM create a spatial index based on TRAFFIC.GEOM
REM
REM
CREATE INDEX TEST_G_POINT_IDX ON TEST(POINT) INDEXTYPE IS
MDSYS.SPATIAL_INDEX;
CREATE INDEX TEST_G_LINE_IDX ON TEST(LINE) INDEXTYPE IS
MDSYS.SPATIAL_INDEX;
CREATE INDEX TEST_G_POLYGON_IDX ON TEST(POLYGON) INDEXTYPE IS
MDSYS.SPATIAL_INDEX; -
I can't import a table contains BLOB column from one user to another user.
1) I create two user both have connect role,and each has its own tablespace, DDL:
create user d2zd identified by d2zd default tablespace d2zd quota unlimited on d2zd account unlock;
grant connect to d2zd;
create user d3zd identified by d3zd default tablespace d3zd quota unlimited on d3zd account unlock;
grant connect to d3zd;
2)Then enter oracle as d2zd and create a table contains BLOB column and insert data to the table.
3) export d2zd as follow:
exp d2zd/d2zd file=d2zd.dmp
4) import to d3zd as follow:
imp d3zd/d3zd fromuser=d2zd touser=d3zd file=d2zd.dmp
the question is the table with BOLB colum can't be import,
it says:have no privilege on tablespace d2zd.
How can I import a table contains BLOB column from one user to another user?Hi - the reason for as our friend already told ist that a blob can be stored outside of the table segment, in another Tablespace, This is for performance reason.
Sou you would need to have Quota on two tablespaces.
the one which holds the table segment the other which holds the blob(segment).
Regards
Carl
Message was edited by:
kreitsch -
More than one index for a column.
Hi,
I am trying to create more than one index for a particular column of the table.But oracle does not allow more than one index for a column.
I just want to make sure whether we can add more than one index for a column
and if yes what are the scenarios.
Because as far as i know some database allows more than one index for a single column.You cannot create more than one index for the same column(s).This is not so true Nicolas. Look at following example:
SQL> create index idx_mytest_id on mytest(id);
Index created.
SQL> create index idx_mytest_id_desc on mytest(id desc);
Index created.
SQL> create index idx_fbi_mytest_id_upper on mytest(upper(id));
Index created.
SQL> create index idx_fbi_mytest_id_upper_desc on mytest(upper(id) desc);
Index created.
SQL> create index idx_fbi_mytest_id_lower_id on mytest(lower(id));
Index created.
SQL> create index idx_fbi_mytest_id_lower_id_dsc on mytest(lower(id) desc);
Index created.
SQL> create index idx_fbi_mytest_id_tr_up on mytest(trunc(upper(id)));
Index created.
-- I can still continue but for this example this will be enough
SQL> select index_name from dba_indexes where table_name = 'MYTEST';
INDEX_NAME
IDX_MYTEST_ID
IDX_FBI_MYTEST_ID_UPPER
IDX_MYTEST_ID_DESC
IDX_FBI_MYTEST_ID_UPPER_DESC
IDX_FBI_MYTEST_ID_LOWER_ID
IDX_FBI_MYTEST_ID_LOWER_ID_DSC
IDX_FBI_MYTEST_ID_TR_UP
7 rows selected.You can see 7 indexes for one column (ID) and I could still continue...
So according this test we can say you can't create more than one index for one column (or the same group of columns in case of composite index) with same condition(s).
Message was edited by:
Ivan Kartik
Or simplified: you can't create the same index for same column(s) twice :-) -
Help needed in returning multiple columns from one field
Hi,
I have been given a task to rewrite the query (see below), so that I get three columns from the one field, based on their contents.
The script returns all the columns and concatenates them into one, but returns them as comma delimmited within the returned column, to generate a report.
These tables are from Siebel.
Our Oracle version is:
select banner from sys.v_$version;
--returns
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
PL/SQL Release 8.1.7.4.0 - Production
CORE 8.1.7.0.0 Production
TNS for Solaris: Version 8.1.7.4.0 - Production
NLSRTL Version 3.4.1.0.0 - Production
Here is what I was given;
set arraysize 200
Spool d:\Daily_reports\Data\RegManage\Electricity\eCISPLUS_Product_Switch_Not_Started_Discount.csv
-- this will concatenate all the returned columns into one
SELECT DISTINCT '"'||
rtrim(ltrim(S_ORG_EXT.OU_NUM)) || '","' ||
rtrim(ltrim(S_ORG_EXT.NAME)) || '","' ||
rtrim(ltrim(S_EVT_ACT.TODO_CD)) || '","' ||
rtrim(ltrim(S_EVT_ACT.EVT_STAT_CD)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.X_SOURCE_TYPE)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.X_TXU_PRICELIST_NAME)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_ELEC)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_CLASS_ELEC)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PEAKANYTIME_ELEC)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PA_CLASS_ELEC)) || '","' ||
rtrim(ltrim(S_ORG_EXT.X_OTH_ACCOUNT_NUMBER)) || '","' ||
rtrim(ltrim(S_ADDR_PER.X_NMI_NUM)) || '","' ||
rtrim(ltrim(S_ADDR_PER.X_NMI_CHECKSUM)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.QUOTE_NUM)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.X_COOLING_OFF_DATE)) || '","' ||
rtrim(ltrim(S_PROD_INT.NAME)) || '"'
The field S_PROD_INT.NAME is the one that I need to split so that it is retured
into three different columns.
1st column needed -
where S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge __ %'
OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now __ %'
OR S_PROD_INT.NAME Like 'Electricity Go for More __ %'
OR S_PROD_INT.NAME Like 'Electricity Mates Rates __ %'
2nd column needed -
where S_PROD_INT.NAME Like 'Gas TRUenergy Business Edge __ %'
OR S_PROD_INT.NAME Like 'Gas TRUenergy Business Now __ %'
OR S_PROD_INT.NAME Like 'Gas Go for More __ %'
OR S_PROD_INT.NAME Like 'Gas Mates Rates __ %'
3rd column needed from
S_PROD_INT.NAME Like '* ___ Discount for Paying Your Bill by the Due Date')
-- Tables
FROM SIEBEL.S_ADDR_PER S_ADDR_PER,
SIEBEL.S_DOC_QUOTE S_DOC_QUOTE,
SIEBEL.S_EVT_ACT S_EVT_ACT,
SIEBEL.S_ORG_EXT S_ORG_EXT,
SIEBEL.S_PRI_LST S_PRI_LST,
SIEBEL.S_PROD_INT S_PROD_INT,
SIEBEL.S_QUOTE_ITEM S_QUOTE_ITEM
WHERE S_EVT_ACT.TARGET_OU_ID = S_ORG_EXT.ROW_ID
AND S_DOC_QUOTE.ROW_ID = S_QUOTE_ITEM.SD_ID
AND S_ADDR_PER.ROW_ID = S_ORG_EXT.PR_ADDR_ID
AND S_PROD_INT.ROW_ID = S_QUOTE_ITEM.PROD_ID
AND S_ORG_EXT.ROW_ID = S_DOC_QUOTE.TARGET_OU_ID
AND S_DOC_QUOTE.PRI_LST_ID = S_PRI_LST.ROW_ID
AND S_EVT_ACT.TODO_CD = 'Product Switch-Electricity'
AND S_EVT_ACT.EVT_STAT_CD In ('In Progress','Not Started','On Hold')
AND S_DOC_QUOTE.STAT_CD In ('Completed','Verbal Acceptance','Written Acceptance')
AND S_DOC_QUOTE.X_OFFER_TYPE = 'Product Switch'
AND (S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge __ %' OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now __ %'
OR S_PROD_INT.NAME Like 'Electricity Go for More __ %' OR S_PROD_INT.NAME Like 'Electricity Mates Rates __ %'
OR S_PROD_INT.NAME Like 'Electricity __ Discount for Paying Your Bill by the Due Date' or S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge ___ %'
OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now ___ %'
OR S_PROD_INT.NAME Like 'Electricity Go for More ___ %'
OR S_PROD_INT.NAME Like 'Electricity Mates Rates ___ %'
OR S_PROD_INT.NAME Like 'Electricity ___ Discount for Paying Your Bill by the Due Date')
UNION
SELECT DISTINCT '"'||
rtrim(ltrim(S_ORG_EXT.OU_NUM)) || '","' ||
rtrim(ltrim(S_ORG_EXT.NAME)) || '","' ||
rtrim(ltrim(S_EVT_ACT.TODO_CD)) || '","' ||
rtrim(ltrim(S_EVT_ACT.EVT_STAT_CD)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.X_SOURCE_TYPE)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.X_TXU_PRICELIST_NAME)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_ELEC)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_CLASS_ELEC)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PEAKANYTIME_ELEC)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PA_CLASS_ELEC)) || '","' ||
rtrim(ltrim(S_ORG_EXT.X_OTH_ACCOUNT_NUMBER)) || '","' ||
rtrim(ltrim(S_ADDR_PER.X_NMI_NUM)) || '","' ||
rtrim(ltrim(S_ADDR_PER.X_NMI_CHECKSUM)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.QUOTE_NUM)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.X_COOLING_OFF_DATE)) || '"'
FROM SIEBEL.S_ADDR_PER S_ADDR_PER,
SIEBEL.S_DOC_QUOTE S_DOC_QUOTE,
SIEBEL.S_EVT_ACT S_EVT_ACT,
SIEBEL.S_ORG_EXT S_ORG_EXT,
SIEBEL.S_PRI_LST S_PRI_LST
WHERE S_EVT_ACT.TARGET_OU_ID = S_ORG_EXT.ROW_ID
AND S_ADDR_PER.ROW_ID = S_ORG_EXT.PR_ADDR_ID
AND S_ORG_EXT.ROW_ID = S_DOC_QUOTE.TARGET_OU_ID
AND S_DOC_QUOTE.PRI_LST_ID = S_PRI_LST.ROW_ID
AND S_EVT_ACT.TODO_CD = 'Product Switch-Electricity'
AND S_EVT_ACT.EVT_STAT_CD In ('In Progress','Not Started','On Hold')
AND S_DOC_QUOTE.STAT_CD In ('Completed','Verbal Acceptance','Written Acceptance')
AND S_DOC_QUOTE.X_OFFER_TYPE = 'Product Switch'
AND NOT EXISTS (SELECT /*+ unnest */ 'X'
FROM SIEBEL.S_PROD_INT S_PROD_INT, SIEBEL.S_QUOTE_ITEM S_QUOTE_ITEM
WHERE S_DOC_QUOTE.ROW_ID = S_QUOTE_ITEM.SD_ID
AND S_PROD_INT.ROW_ID = S_QUOTE_ITEM.PROD_ID
AND (S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge __ %'
OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now __ %'
OR S_PROD_INT.NAME Like 'Electricity Go for More __ %'
OR S_PROD_INT.NAME Like 'Electricity Mates Rates __ %'
OR S_PROD_INT.NAME Like 'Electricity __ Discount for Paying Your Bill by the Due Date' or S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge ___ %'
OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now ___ %'
OR S_PROD_INT.NAME Like 'Electricity Go for More ___ %'
OR S_PROD_INT.NAME Like 'Electricity Mates Rates ___ %'
OR S_PROD_INT.NAME Like 'Electricity ___ Discount for Paying Your Bill by the Due Date'));
spool off
This is what one row looks like;
"1-UWLHY","Alpha Vic Kelly Kay","Product Switch-Electricity","Not Started","AMBASS_50REBATE","Go Green PKANY-Powercor","QEGS1","GG","QEGS1","GG","","6407421678","8","1-UWLI6","12-JUN-07","Electricity Mates Rates 7% Discount"
we want
"1-UWLHY","Alpha Vic Kelly Kay","Product Switch-Electricity","Not Started","AMBASS_50REBATE","Go Green PKANY-Powercor","QEGS1","GG","QEGS1","GG","","6407421678","8","1-UWLI6","12-JUN-07",'Electricity Mates Rates 7% Discount","Gas TRUenergy Business Edge 10% Discount","Electricity 3% Discount for Paying Your Bill by the Due Date"
I have tried to:
- create a cursor
- each column as - ie
S_PROD_INT.NAME as "EVD",
S_PROD_INT.NAME as "GVD",
S_PROD_INT.NAME as "PbDDD"
but when I try to use them in where "EVD" Like 'etc...'
error that table does not exist
I have tried also as
where 'EVD' Like 'etc...' -- error
where EVD Like 'etc...' -- error
- create them as %TYPE variable
- more
but keep getting errors
Any ideas and help will be most appreciated as I have tried and researched all I can think and get my hands on with my limited skills.
Thanks.
Regards, SteveUnfortunately my skills are not high enough as I obviously don't know where to put the code exaclty.
I am first just running it on the top part of the script but get the error;
ORA-00900: invalid SQL statement
What I am running is; -- Commented
WITH s_prod_int AS
SELECT 1 row_id, 'Electricity Mates Rates 7% Discount' name FROM s_prod_int --these were 'FROM dual' originally, I changed to s_prod_int (Received same error regardless whether from dual or s_prod_int)
UNION ALL
SELECT 1, 'Gas TRUenergy Business Edge 10% Discount' FROM s_prod_int
UNION ALL
SELECT 1, 'Electricity 3% Discount for Paying Your Bill by the Due Date' FROM s_prod_int
SELECT DISTINCT '"'||
rtrim(ltrim(S_ORG_EXT.OU_NUM)) || '","' ||
rtrim(ltrim(S_ORG_EXT.NAME)) || '","' ||
rtrim(ltrim(S_EVT_ACT.TODO_CD)) || '","' ||
rtrim(ltrim(S_EVT_ACT.EVT_STAT_CD)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.X_SOURCE_TYPE)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.X_TXU_PRICELIST_NAME)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_ELEC)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_CLASS_ELEC)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PEAKANYTIME_ELEC)) || '","' ||
rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PA_CLASS_ELEC)) || '","' ||
rtrim(ltrim(S_ORG_EXT.X_OTH_ACCOUNT_NUMBER)) || '","' ||
rtrim(ltrim(S_ADDR_PER.X_NMI_NUM)) || '","' ||
rtrim(ltrim(S_ADDR_PER.X_NMI_CHECKSUM)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.QUOTE_NUM)) || '","' ||
rtrim(ltrim(S_DOC_QUOTE.X_COOLING_OFF_DATE)) || '","' ||
rtrim(ltrim(a.name)) ||'","'|| --I assume I am still able to right and left trim
rtrim(ltrim(b.name)) ||'","'||
rtrim(ltrim(c.name))||'"' name -- not sure what this name is here for (have ran with and without it here
FROM SIEBEL.S_ADDR_PER S_ADDR_PER,
SIEBEL.S_DOC_QUOTE S_DOC_QUOTE,
SIEBEL.S_EVT_ACT S_EVT_ACT,
SIEBEL.S_ORG_EXT S_ORG_EXT,
SIEBEL.S_PRI_LST S_PRI_LST,
s_prod_int a, -- I assume these needed to go in here
s_prod_int b,
s_prod_int c
SIEBEL.S_QUOTE_ITEM S_QUOTE_ITEM
WHERE S_EVT_ACT.TARGET_OU_ID = S_ORG_EXT.ROW_ID
AND S_DOC_QUOTE.ROW_ID = S_QUOTE_ITEM.SD_ID
AND S_ADDR_PER.ROW_ID = S_ORG_EXT.PR_ADDR_ID
AND S_PROD_INT.ROW_ID = S_QUOTE_ITEM.PROD_ID
AND S_ORG_EXT.ROW_ID = S_DOC_QUOTE.TARGET_OU_ID
AND S_DOC_QUOTE.PRI_LST_ID = S_PRI_LST.ROW_ID
AND S_EVT_ACT.TODO_CD = 'Product Switch-Electricity'
AND S_EVT_ACT.EVT_STAT_CD In ('In Progress','Not Started','On Hold')
AND S_DOC_QUOTE.STAT_CD In ('Completed','Verbal Acceptance','Written Acceptance')
AND S_DOC_QUOTE.X_OFFER_TYPE = 'Product Switch'
AND a.NAME LIKE 'Electricity TRUenergy Business Edge%' --Placed all the where part in the original where clause
OR a.NAME LIKE 'Electricity TRUenergy Business Now%'
OR a.NAME LIKE 'Electricity Go for More%'
OR a.NAME LIKE 'Electricity Mates Rates%'
AND a.row_id = b.row_id
AND (
b.NAME LIKE 'Gas TRUenergy Business Edge%'
OR b.NAME LIKE 'Gas TRUenergy Business Now%'
OR b.NAME LIKE 'Gas Go for More%'
OR b.NAME LIKE 'Gas Mates Rates%'
AND b.row_id = c.row_id
AND (
c.NAME LIKE '%Discount for Paying Your Bill by the Due Date'
NAME -- Not sure what this NAME is for - tried with and without - same error -
Move column from one place to another..
Hi
I need to arrange the order in which the columns are displayed in my ALV Grid displayed so that i can move the columns from one position to another but its not been allowed in the program so could u pls suggest which field needs to be set for this?
Regards
GunjanHi
You can use the following statement
ls_fcat-col_pos = 01.
By using this you can fix your column position
or else to sort the column try like this
sort-spos = '10'.
SORT-FIELDNAME = 'Years'.
SORT-TABNAME = 'DATA_TAB2'.
sort-UP = 'X'.
sort-subtot = 'X'.
SORT-GROUP = '* '.
APPEND SORT. CLEAR SORT.
In the It_SOET internal table write:
IT_SORT-Group = 'X'.
REPORT ZSDN .
TABLES : ekkn,ekko,EKPO,EKET,VBEP,LFA1.
TYPE-POOLS : slis, ICON.
DATA : DATE1 TYPE SY-DATUM.
data : begin of itab occurs 0,
VBELN like ekkn-VBELN, "SALE ORDER
VBELP LIKE EKKN-VBELP, "LINE ITEM
BEDAT LIKE EKKO-BEDAT, "DOCUMENT DATE
KUNNR LIKE VBAK-KUNNR, "SOLD TO PARTY
VBELN1 like VBEP-VBELN, "SALE ORDER1
POSNR1 LIKE VBEP-POSNR, "LINE ITEM
EDATU LIKE VBEP-EDATU, "END DATE
EMATN LIKE EKPO-EMATN, "STATUS
BMENG LIKE VBEP-BMENG, "DAYS
TDDAT LIKE VBEP-TDDAT, "START DATE
LMENG LIKE VBEP-LMENG, "DAYS -START DATE
LABNR LIKE EKPO-LABNR, "STATUS
PLNUM LIKE VBEP-PLNUM, "OVERALL STATUS
EKGRP like ekko-EKGRP, "PURCHASING GROUP
EBELN LIKE EKKN-EBELN, "PO NO
EBELP like ekkn-EBELP, "LINE ITEM
EINDT LIKE EKET-EINDT, "DELIVERY DATE
MATNR LIKE EKPO-MATNR, "MATERIAL NUMBER
TXZ01 LIKE EKPO-TXZ01, "MATERIAL TEXT
LIFNR LIKE EKKO-LIFNR, "VENDOR
MENGE LIKE EKPO-MENGE, "QUANTITY
WEMNG LIKE EKET-WEMNG, "GR QTY
WAMNG LIKE EKET-WAMNG, "BAL QTY
MEINS LIKE EKPO-MEINS, "OUn
NETPR LIKE EKPO-NETPR, "PRICE
LOEKZ LIKE EKPO-LOEKZ, "DELETED
LIFNR1 LIKE LFA1-LIFNR, "VENDOR
NAME1 LIKE LFA1-NAME1, "VENDOR NAME
WERKS LIKE EKPO-WERKS, "PLANT
end of itab.
DATA : BEGIN OF it_final OCCURS 0,
KUNNR LIKE VBAK-KUNNR, "SOLD TO PARTY
LABNR LIKE EKPO-LABNR, "STATUS
EMATN LIKE EKPO-EMATN, "STATUS
VBELN like ekkn-VBELN, "SALE ORDER
VBELP LIKE EKKN-VBELP, "LINE ITEM
BEDAT LIKE EKKO-BEDAT, "DOCUMENT DATE
EDATU LIKE VBEP-EDATU, "END DATE
TDDAT LIKE VBEP-TDDAT, "START DATE
PLNUM LIKE VBEP-PLNUM, "OVERALL STATUS
EKGRP like ekko-EKGRP, "PURCHASING GROUP
EBELN LIKE EKKN-EBELN, "PO NO
EBELP like ekkn-EBELP, "LINE ITEM
EINDT LIKE EKET-EINDT, "DELIVERY DATE
MATNR LIKE EKPO-MATNR, "MATERIAL NUMBER
TXZ01 LIKE EKPO-TXZ01, "MATERIAL TEXT
NAME1 LIKE LFA1-NAME1, "VENDOR NAME
MENGE LIKE EKPO-MENGE, "QUANTITY
WEMNG LIKE EKET-WEMNG, "GR QTY
WAMNG LIKE EKET-WAMNG, "BAL QTY
MEINS LIKE EKPO-MEINS, "OUn
NETPR LIKE EKPO-NETPR, "PRICE
WERKS LIKE EKPO-WERKS, "PLANT
END OF it_final.
DATA: color TYPE TABLE OF lvc_s_scol WITH HEADER LINE,
st_layout TYPE slis_layout_alv.
DATA : fcat TYPE slis_t_fieldcat_alv,
ls_fcat LIKE LINE OF fcat,
fheader TYPE TABLE OF slis_listheader WITH NON-UNIQUE DEFAULT KEY
WITH HEADER LINE INITIAL SIZE 0.
DATA :i_repid LIKE sy-repid,
gs_layout TYPE slis_layout_alv,
week type n.
SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: zso FOR ekkn-vbeln.
SELECT-OPTIONS: zpgr FOR ekko-EKGRP.
SELECT-OPTIONS: ZPL FOR EKPO-WERKS.
SELECTION-SCREEN END OF BLOCK bk1.
gs_layout-colwidth_optimize = 'X'.
select A~VBELN
A~VBELP
A~EBELN
A~EBELP
B~MATNR
B~TXZ01
B~MENGE
B~MEINS
B~NETPR
B~WERKS
B~LOEKZ
C~EINDT
C~WEMNG
D~EKGRP
D~LIFNR
D~BEDAT
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM EKKN AS A
INNER JOIN EKPO AS B ON A~EBELN = B~EBELN
AND A~EBELP = B~EBELP
INNER JOIN EKET AS C ON A~EBELN = C~EBELN
AND A~EBELP = C~EBELP
INNER JOIN EKKO AS D ON A~EBELN = D~EBELN
WHERE A~VBELN IN ZSO
AND D~EKGRP IN ZPGR
AND B~WERKS IN ZPL.
LOOP AT ITAB.
ITAB-WAMNG = ITAB-MENGE - ITAB-WEMNG.
SELECT SINGLE VBELN KUNNR
FROM VBAK INTO (ITAB-VBELN , ITAB-KUNNR )
WHERE VBELN = ITAB-VBELN.
SELECT SINGLE VBELN EDATU
FROM VBEP INTO (ITAB-VBELN , ITAB-EDATU)
WHERE VBELN = ITAB-VBELN.
DATE1 = SY-DATUM.
ITAB-BMENG = ITAB-EDATU - DATE1.
if itab-BMENG < 0.
ITAB-EMATN = 'OVER DUE'.
elseif itab-BMENG ge 0 AND itab-BMENG le 10.
ITAB-EMATN = 'CRITICAL'.
elseif itab-BMENG > 10.
ITAB-EMATN = 'UNDER FOLLOW-UP'.
endif.
SELECT SINGLE VBELN POSNR TDDAT
FROM VBEP INTO (ITAB-VBELN1 , ITAB-POSNR1 , ITAB-TDDAT)
WHERE VBELN = ITAB-VBELN AND
POSNR = ITAB-VBELP.
ITAB-LMENG = ITAB-TDDAT - DATE1.
if itab-LMENG < 0.
ITAB-LABNR = 'OVER DUE'.
elseif itab-LMENG ge 0 AND itab-LMENG le 10.
ITAB-LABNR = 'CRITICAL'.
elseif itab-LMENG > 10.
ITAB-LABNR = 'UNDER FOLLOW-UP'.
endif.
IF ITAB-WAMNG LE 0 OR
ITAB-LOEKZ = 'L' OR
ITAB-LOEKZ = 'S'.
ITAB-PLNUM = 'CLOSED'.
ELSE.
ITAB-PLNUM = 'OPEN'.
ENDIF.
SELECT SINGLE LIFNR NAME1
FROM LFA1 INTO (ITAB-LIFNR1 , ITAB-NAME1)
WHERE LIFNR = ITAB-LIFNR.
MODIFY ITAB.
ENDLOOP.
loop at itab.
move-corresponding itab to it_final.
append it_final.
endloop.
perform edit_mask.
i_repid = sy-repid.
PERFORM fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = i_repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = fcat
i_save = 'A'
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
*& Form fieldcat
* text
* --> p1 text
* <-- p2 text
FORM fieldcat .
MOVE sy-repid TO i_repid.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-decimals_out = 2.
ls_fcat-col_pos = 1.
ls_fcat-fieldname = 'KUNNR'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'Sold to Party'.
ls_fcat-emphasize = 'C310'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 6.
ls_fcat-fieldname = 'LABNR'.
ls_fcat-outputlen = 20.
ls_fcat-seltext_m = 'Window Start Status'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C510'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 5.
ls_fcat-fieldname = 'EMATN'.
ls_fcat-outputlen = 15.
ls_fcat-seltext_m = 'Window End Status'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C410'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 2.
ls_fcat-fieldname = 'VBELN'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'Sale Order'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C710'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 3.
ls_fcat-fieldname = 'VBELP'.
ls_fcat-outputlen = 5.
ls_fcat-seltext_m = 'Item'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C710'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 4.
ls_fcat-fieldname = 'EBELN'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'PO Number'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C710'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 7.
ls_fcat-fieldname = 'EBELP'.
ls_fcat-outputlen = 5.
ls_fcat-seltext_m = 'PO Item'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 8.
ls_fcat-fieldname = 'EKGRP'.
ls_fcat-outputlen = 3.
ls_fcat-seltext_m = 'Pur.Group'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 9.
ls_fcat-fieldname = 'BEDAT'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'PO Doc.Date'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 10.
ls_fcat-fieldname = 'EINDT'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'PO Delivery Date'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 11.
ls_fcat-fieldname = 'MATNR'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'Material Number'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 12.
ls_fcat-fieldname = 'TXZ01'.
ls_fcat-outputlen = 15.
ls_fcat-seltext_m = 'Description'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 13.
ls_fcat-fieldname = 'NAME1'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'Vendor'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C110'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 14.
ls_fcat-fieldname = 'MENGE'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'PO Quantity'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 15.
ls_fcat-fieldname = 'WEMNG'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'Quantity Recvd'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 16.
ls_fcat-fieldname = 'WAMNG'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'Bal Qty'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 17.
ls_fcat-fieldname = 'MEINS'.
ls_fcat-outputlen = 2.
ls_fcat-seltext_m = 'OUn'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 18.
ls_fcat-fieldname = 'NETPR'.
ls_fcat-outputlen = 8.
ls_fcat-seltext_m = 'NetPrice'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 19.
ls_fcat-fieldname = 'TDDAT'.
ls_fcat-outputlen = 15.
ls_fcat-seltext_m = 'Window Start date'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 20.
ls_fcat-fieldname = 'EDATU'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'Window End date'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 21.
ls_fcat-fieldname = 'PLNUM'.
ls_fcat-outputlen = 10.
ls_fcat-seltext_m = 'PO Status'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C610'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ls_fcat-col_pos = 22.
ls_fcat-fieldname = 'WERKS'.
ls_fcat-outputlen = 5.
ls_fcat-seltext_m = 'Plant'.
ls_fcat-tabname = 'IT_FINAL'.
ls_fcat-emphasize = 'C210'.
APPEND ls_fcat TO fcat.
clear ls_fcat.
ENDFORM. " fieldcat
*& Form edit_mask
* text
* --> p1 text
* <-- p2 text
FORM edit_mask .
loop at it_final.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = it_final-vbeln
IMPORTING
OUTPUT = it_final-vbeln.
Read table it_final.
* modify it_final.
endloop.
ENDFORM. " edit_mask
Reward all helpfull answers
Regards
Pavan -
How to add one date column and charecter column
hi all,
i have 3 column start_date(date),end_date( date),duration (varchar2)
i am trying to add start_time and duration like this
end_date := to_char(start_time) + duration;
but its showing value_error
how to add one date column and charecter column.
Thanksyou need something that does:
end_date (DATE) := start_date (DATE) + <number of
days> (NUMBER)Not necessarily, because if the duration is just a string representation of a number then it will be implicitly converted to a number and not cause an error
e.g.
SQL> ed
Wrote file afiedt.buf
1 with t as (select to_date('01/07/2007','DD/MM/YYYY') as start_dt, '3' as duration_days from dual)
2 -- END OF TEST DATA
3 select start_dt + duration_days
4* from t
SQL> /
START_DT+
04-JUL-07 -
How to insert select columns from one internal table to another
Hi,
How to insert select columns from one internal table to another based on condition as we do from a standart table to internal table.
regards,
SriramHi,
If your question is for copying data from 1 int table to other ;
we can use
APPEND LINES OF it_1 TO it_2.
or if they have different columns then:
loop at it_1 into wa_it1.
move wa_it1-data to wa_it2-d1.
apped wa_it2 to it_2.
clear wa_it2.
endloop.
thnxz -
How can I select rows of cells and merge them vertically into one cell in each column?
I'm working in CS4 and need to be able to select 2 to 6 rows of cells (with many columns) in a table and then merge the selected cells vertically into one cell in each column. A few cells in the chart will not need to merge so I must select the ones that do. I have almost 100 pages of charts with cells that need merged this way by Tuesday. Please help!
Top chart example needs to change to the bottom example.
Header 1
Header 2
Header 3
Header 4
Header 5
Header 6
100
600
300
600
20000
120000
2000
500
400
50000
10000
5000
3000
200
700
67
122
600
900
100
2
7
123
1110
Header 1
Header 2
Header 3
Header 4
Header 5
Header 6
100
500
200
100
600
400
700
900
300
5000
30000
2
600
10000
67
7
20000
2000
122
123
120000
5000
600
1110SmartCellMerge may help you:
http://www.indiscripts.com/post/2012/04/improve-the-way-you-merge-cells-in-indesign
@+
Marc -
How to display more than 30 columns in one line?
Hi,
I want to display some 30 columns in the report.
I dont want to split it into sub reports.
How can i do.
In that i have 3 groups.
For each group i need one total.
For example.
after group 3 i need sub-total
after group 2 i need total
after group 1 i need Grand-total.
Please help me to solve this issue.
Thanks in advance,
Saravanakumar.Sorry about that,
Ill tell you clearly.
Actualy I am having 12 columns, under each column, i have 5 sub-columns.
I couldn't accomodate all the columns in a single horizontal line(I tried in A2 paper size).
So i decided to have cross tab. Because top 5 columns can be dinamic.
How can have subtotals inside cross tab after each group.
Thanks ,
Saravanakumar -
Column text to flow across more than one page in same column
I am trying to write a document of several pages with three, or maybe even four columns. There will be text headers in one column, alongside which there will be the main text associated with the headers. In another column there will some more key phrases, and again these will need to be lined up against particular text in the first two columns.
I would like to make the text in one column stay in that single column across the whole document, and not flow into the next column on the particular page. I know that using a succession of text boxes is one solution, but it is clumsy and is also difficult to manage. Perhaps another solution would be to use a table, but again that feels clumsy.
Can anyone advise on the best way to do this please.Hi everyone and thanks for your help. I tried to explain more clearly than I seem to have done. Walt has understood that I want the text in column one, page one, to flow to column one, page two; and the text from column two, page one, to flow to column two, page two, etc. I thought it might have to be text boxes. I now need to learn about how to 'link' them, and whether it is across or down the page I need to create the links.
The document is an aide memoire or manual for a trainer to use. It has the media to be used in one column, the visual aid in the next column and the notes in column three. I might also include a fourth column to show essential or key questions etc that have to be used.
Thanks again everyone.
Maybe you are looking for
-
IPod Touch stuck on "syncing"...
i really don't know what started this issue, starting today when i try and sync my ipod touch it just sticks on "syncing ipod touch" (waited 15+ minutes), doesn't say what it's sending as it would before. i can cancel the sync on the ipod touch with
-
24" iMac summer 2008. CPU fan runs at highest speed, some times goes to "sleep" mode. CPU t' is about 35'- 42'C. Run hardware test: 4sns/1/40000000:tlop-130.000, next time 4sns/1/40000000:tlop-128.000 errors. Tried SMC, NVRAM, PRAM. Reinstalled all s
-
@WEBLOGIC in properties file
Hi, What am I supposed to replace this. My weblogic is installed on drive E: on NT. E:\weblogic However, when I didn't replace, and tried to access the cloudscape DB, I noticed that a directory @WEBLOGIC was created in E:\weblogic ! Should I just rep
-
Application authentication works fine after restart
Team, I have a problem with an application. when the users start working it works fine. After some time it starts problem. Login page will not allow to login. As we observed threads start stuck at login page authentication. Application configured to
-
Using Leopard 1.5.1 and Epson R2400 printer, with the issues surrounding LR 1.3.1 printing and the latest Epson drivers (6.12), I have settled on either printing TIFFs with ProPhoto RGB assigned color space (1) with CS3 and having Photoshop manage co