Additional column for output table
Hi,
I have created an ABAP function wherein I am reading table to output in a table. Code as follows
SELECT * FROM <source_table>
INTO CORRESPONDING FIELDS OF TABLE <t_output_table>
WHERE <conditions>
Import tab has two import parameters.
Export tab has none.
Changing has none.
Table tab has
PARAMETER NAME as t_output_table,
TYPING as LIKE,
ASSOCIATED TYPE as source table
What I want to do next is to add another field to the output which will be substring of one of the field of source table. For example if FieldA of source table has value "abcdefgh", I want to return "defgh" as additional column of the output table.
Appreciate any help !!
IMS
Hi,
You would need to create a structure that includes your extra column. Use this structure as the reference in your tables tab.
Now when you have selected the data in the table.
loop at the table.
populate the new column according to your logic.
Modify the new column.
endloop.
Hope this solves the problem.
Regards,
Anju
Similar Messages
-
Hi Experts,
How to add additional field into output table VENDORS/WH TAX TYPES AND CODES in RFIDYYWT(Generic Withholding Tax Reporting).
I have no idea how to start with, please give some advice.
Thanks!
IceDear Ice,
Use Append structure, see given link:
https://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eb61446011d189700000e8322d00/content.htm
Regards,
Abbas. -
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. -
IDM with SQL server Error: Cannot find columns for the table...
Hi all,
I am Configuring IDM with SQL Server repository and ran into this error.
'Cannot find columns for the table 'object'
.....jdbc...[SQL Server]Invalid object name 'object'
Can anybody please help me!!
GYes, permissions are very important. I ran into a similar problem because I didn't have the correct permissions. Make sure the user has the following permissions:
CREATE ANY TABLE
ALTER ANY TABLE
DROP ANY TABLE
CREATE ANY PROCEDURE
EXECUTE ANY PROCEDURE
DROP ANY PROCEDURE
Also, make sure there is enough space in the default tablespace of that user.
HTH
~Suvesh -
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 . -
How to extend No. of columns for PIVOT table in BI Publisher Desktop
Hello Everyone,
I am using the Oracle BI Publisher Desktop to design the TEMPLATE for Oracle Reports.
I need to create the PIVOT table .In my PIVOT table I need to display 9 columns but when I tried to create PIVOT table by dragging 9 columns only first 4 columns are displaying in report.
Can anyone suggest me how can I increase the number of columns in PIVOT table?
Thank You.
Regards,
Guru.hi jim
if you carefully look inside the form field's you will find the logic of sort . if you remove that you will get the data without any sorting order.
else send me your template and xml to my email id i can look into that .
email : [email protected] -
How to add columns for existing table dynamically?
Hi,
I created table structure only. I want to add columns for this existing table. Columns are not fixed, according to the user choice i need to write code.
Plz give me reply asap.
Thanks
ShirishaHi Shirisha,
I think the following code snippet will help you.
int l_no_cols = 0;
//Get the number of columns in this variable, something like the following
//l_no_cols = wdContext().currentContextElement().get<Context_attribute_name>;
IWDTable l_tab;
IWDTransparentContainer l_tbl_cont = (IWDTransparentContainer)view.getElement("TableDataCont");//ID of Container
l_tab = (IWDTable)view.getElement("TableData");//ID of Table
l_tab.setVisible(WDVisibility.VISIBLE);
l_tab.bindDataSource(wdContext.nodeTable_Data().getNodeInfo());
for(int a = 1; a <=l_no_cols; a++)
//Creating the column
IWDTableColumn l_tab_col = (IWDTableColumn)view.createElement(IWDTableColumn.class,"COL"+a);
//Creating Caption for Column Header
IWDCaption l_tab_cap = (IWDCaption)view.createElement(IWDCaption.class,"Caption"+a);
l_tab_cap.setText("Col"+i);
l_tab_col.setHeader(l_tab_cap);
//Creating Table Cell Editor for column
IWDInputField l_tab_cell = (IWDInputField)view.createElement(IWDInputField.class,"CellEditor"+a);
//creating context node attribute for the column dynamically
wdContext.nodeTable_Data().getNodeInfo().addAttribute("Col"+i,"com.sap.dictionary.String");
l_tab_cell.bindValue(wdContext.nodeTable_Data().getNodeInfo().getAttribute("Col"+i));
l_tab_col.setTableCellEditor(l_tab_cell);
l_tab.addColumn(l_tab_col);
l_tbl_cont.addChild(l_tab);
Regards,
Alka -
Need mapping columns for the table ic_whse_inv in R12.
Hi Guys,
We are upgrading to R12, and I need mapping for the following columns in the table ic_whse_inv
to the Tables in R12.
SAFETY_STOCK ,REORDER_POINT ,FIXED_LEADTIME, PURCHASE_IND
Can you guys help me?
Thanks\Kiran S.Hi,
I have already gonr through the OPM release 12.1 migration documents provided in 376683.1.
The metalink ID1098353.1 is somewhat helpful for me in analyzing the transactions duting upgrade phase. However, I still not able to get the exact replacement for ic_loct_inv in R12. Your assistance is really required and appreciated.
Thanks -
Count number of distinct values for a column for all tables that contains that column
Imagine I have one Column called cdperson. With the query below I know which Tables have column cdperson
select
t.[name]fromsys.schemassinnerjoin
sys.tables
tons.schema_id=t.schema_idinnerjoin
sys.columnscont.object_id=c.object_idinnerjoin
sys.types
donc.user_type_id=d.user_type_idwherec.name ='cdperson'
now I want to know for each table, how many distinct values of cdperson I have and I want the result ordered by the table that has more distinct values (descending)
Table1
cdperson select distinct(cdperson) = 10
cdadress
quant
Table2 with
cdaddress (no column cdperson in this table)
quant
Table3
cdperson select distinct(cdperson) = 100
value
Table 4
cdperson select distinct(cdperson) = 18
sum
I want this result ordered by number of distinct cdperson
table3 100
table4 18
table 10
Thks for your answersI had to add schema name to the above script to make it work in AdventureWorks:
CREATE TABLE #temp(TableName sysname , CNT BIGINT)
DECLARE @QRY NVARCHAR(MAX);
SET @qry=(SELECT
N'INSERT INTO #TEMP SELECT '''+schema_name(t.schema_id)+'.'+T.[name] +''' AS TableName, COUNT (DISTINCT ProductID) DistCount FROM '+
schema_name(t.schema_id)+'.'+t.[name] +';'
FROM sys.schemas s INNER JOIN sys.tables t ON s.schema_id=t.SCHEMA_ID
INNER JOIN sys.columns c ON t.object_id=c.object_id INNER JOIN sys.types d ON c.user_type_id=d.user_type_id
WHERE c.name ='ProductID'
FOR XML PATH(''))
EXEC(@QRY)
SELECT * FROM #temp ORDER BY TableName
DROP TABLE #temp
Production.Product 504
Production.ProductCostHistory 293
Production.ProductDocument 31
Production.ProductInventory 432
Production.ProductListPriceHistory 293
Production.ProductProductPhoto 504
Production.ProductReview 3
Production.TransactionHistory 441
Production.TransactionHistoryArchive 497
Production.WorkOrder 238
Production.WorkOrderRouting 149
Purchasing.ProductVendor 211
Purchasing.PurchaseOrderDetail 211
Sales.SalesOrderDetail 266
Sales.ShoppingCartItem 3
Sales.SpecialOfferProduct 295
Kalman Toth Database & OLAP Architect
SQL Server 2014 Database Design
New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014 -
I am working no one SSRS my table headers are freeze cangrow property is false and my report is working perfect while rendering data on RDL and i want same report after exporting in Excel also , i want my table header to be freeze and wrap text property
to work after exporting in my report in excel but its not working ,is there any solution ? any patch ? any other XML code for different rendering ?Hi Amol,
According to your description, you find the wrap text property and fix column is not working after exporting into Excel. Right?
In Reporting Services, when exporting to excel file, it has limitation for textbox.
Text boxes are rendered within one Excel cell. Font size, font face, decoration, and font style are the only formatting that is supported on individual text within an Excel cell.
Excel adds a default padding of approximately 3.75 points to the left and right sides of cells. If a text box’s padding settings are less than 3.75 points and is just barely wide enough to accommodate the text, the text may wrap in Excel.
In this scenario, it supposed to be wrap text unless you merge cells. If cells are merged, word-wrap does not work correctly. If any merged cells exist on a row where a text box is rendered with the
AutoSize property, autosize will not work. For the Fix Data Property, it can't be working in Excel. These are features when exporting to Excel. We can't change it because it's by design.
Reference:
Exporting to Microsoft Excel (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Getting a list of all months between 2 DATE columns for a table
Current set:
IF OBJECT_ID('tempdb..#TEST') IS NOT NULL
DROP TABLE #TEST
CREATE TABLE #TEST
ID INT,
DOB DATE,
EffectiveDate DATE,
TerminationDate DATE,
GCode CHAR(1)
INSERT INTO #TEST
VALUES
(1043,'1/1/1970','1/1/2014','4/1/2014','S'), -- Active in month Jan,Feb,March,April
(1051,'1/1/1989','3/1/2014','5/1/2014','P'), -- Active in month March,April,May
(1070,'1/1/2010','5/1/2014','8/1/2014','G') -- Active in month May,June,July,August
SELECT * FROM #TEST
Expected result set:
ID Month GCode
1043 January S
1043 February S
1043 March S
1043 April S
1051 March P
1051 April P
1051 May P
---- Similarly for ID 1070
This is needed for the reporting and each ID will have points associated to it, that will be a separate column that I'll be adding. The reason that I want this result set is because, the user might say, how many points did the ID have for a particular month.
The points are not going to change for an ID. Please let me know how to get the expected result setTry
-- code #1
set LANGUAGE English;
set dateformat MDY;
declare @Month table (N int, T varchar(20));
declare @I int, @D date;
set @I= 1;
set @D= '1/1/2014';
while @I <= 12
begin
INSERT into @Month values (@I, DateName(month, @D));
set @I+= 1;
set @D= DateAdd(month, +1, @D);
end;
SELECT ID, T, GCode
from @Month as M inner join
#TEST as T on M.N between Month(EffectiveDate) and Month(TerminationDate)
order by ID, N;
José Diz Belo Horizonte, MG - Brasil -
Add additional column in existing table
Hello guys,
I need to add new columns to the existing table, but when I'm trying to add, nothing happens. Checked table itself and all Rows and Column fields are read-only. Can't see any property which indicates this locking behavior. I'm using ES2 LC.
Thanks,
UldisYou can use an APPEND function.
Append Structures (SAP Library - Tables) -
Can you have a calculated column in a table not a view?
We have a table which contains a series of rows
Key Effective Date Value
1 10/Feb/2006 123
1 23/Oct/2006 456
...We have a requirement to store an indicator that tells us which row is the most current and what the end date of the preceding row was so that we get something along the lines of:
Key Effective Date Value Status End Date
1 10/Feb/2006 123 HISTORY 22/Oct/2006
1 23/Oct/2006 456 CURRENT NULL
...I can produce this result quite easily using the analytic function LEAD. My question is, is the answer to this problem to create a view over the table that includes the analytic function or is it possible to define a calculated column in a table that would populate/maintain this vale as part of a table definition?
And as I finish writing this I feel I've answered my own question but hey, there's no harm in asking how others have handled this kind of situation.
Cheers
RichardMy bias would be to create a view that did the calculation.
In theory, you could add those additional columns to a table and maintain the data via a set of triggers, but that would be substantially more complicated than the alternatives for little or no benefit.
A third option would be a materialized view. That might be easier to deal with if you want to have different indexing strategies for current and historical records or if the historical data is queried often enough and updated infrequently enough that it ends up being cheaper to do the calculation once during the update rather than every time the query is run.
A fourth option would be to use stored procedures to maintain the data and have that stored procedure expire the current row and add the new row.
Finally, you might consider version-enabling your table using Workspace Manager rather than writing your own code since Oracle has already written all this code for you.
Justin -
List of indexes and columns for a database.
Hi
Do you know the SQL command to get the list of indexes and associated columns for all tables for a given database ?
The following only shows me the table and index name but I would also like to get the colums for each index
SELECT o.name, i.name FROM sysobjects o JOIN sysindexes i ON (o.id = i.id)
Can you pls help
Thanks
H.There isn't a single command that will do that.
There is the sp_helpindex stored procedure which will give you the information on indexes one table at a time, you could call it in a loop, but there is other information in there as well, so the output would be messy.
You can look at the source code for sp_helpindex to find out how it decodes the key column names.
use sybsystemprocs
go
sp_helptext sp_helpindex
go
The core of it is this loop, which builds up a list of the column names in @keys, a varchar(1024) declared earlier.
** First we'll figure out what the keys are.
declare @i int
declare @thiskey varchar(255)
declare @sorder char(4)
declare @lastindid int
declare @indname varchar(255)
select @keys = "", @i = 1
set nocount on
while @i <= 31
begin
select @thiskey = index_col(@objname, @indid , @i)
if (@thiskey is NULL)
begin
goto keysdone
end
if @i > 1
begin
select @keys = @keys + ", "
end
/*select @keys = @keys + index_col(@objname, @indid, @i)*/
select @keys = @keys + @thiskey
** Get the sort order of the column using index_colorder()
** This support is added for handling descending keys.
select @sorder = index_colorder(@objname, @indid, @i)
if (@sorder = "DESC")
select @keys = @keys + " " + @sorder
** Increment @i so it will check for the next key.
select @i = @i + 1
end
** When we get here we now have all the keys.
keysdone:
set nocount off
-bret -
How to implement line selectability for a table control using table Wizard?
Hello SDN Community,
I have created a table control using the Table Wizard. I found my exact question in this forum, but unfortunately it had not been andsered. While I cannot paste a screen-print into this plane-text area, here are the steps I followed...
1) SE51
2) Create new screen 0100
3) Click Layout button
4) Clidk Table Control (with Wizard) and draw box on canvas.
5) Step is "Start" - click Continue
6) Step is "Name of Table Control" - provided name
7) Step is "Table Name" - provided name of dictionary table (AUFK)
8) Step is "Definition of Columns" - selected order numver and order text
9) Step is "Table Control Attributes" - Line Selectability is in display mode - cannot set it.
I would like to have a selectability column for my table. Would appreciate any insight into how to do this.
Thank you,
Dean Atteberry.This is a puzzling...
For the table control wizard, in the Table Control Attributes step, I was able to get line selectability to open up by declaring a char01 data element at the beginning of my type.
The puzzling is in regards to the "Selection col. fld" entry field.
If I leave it blank and try to go to the next step, I get message "Enter the name of the selection column if you are using a program table"
So it looked like it wanted to know the name of my selection column. So I type in "CHAR1". and got the message "The field "CHAR1" for the selection column is already contained in the table."
Hmmmmm.... don't understand............
Dean Atteberry.
Maybe you are looking for
-
Active Directory 2012 R2: SMB1 Access for XP / Server 2003
Hi there Experts I'm currently planning the migration of our 2008 R2 Domain Controller to 2012 R2. We also have a few XP / Server 2003 Clients in our Environment. I read on a few blog posts that there is a problem with XP and Server 2003 to access e.
-
I am really not very good with PC's and all of my pics are on a DVD I want to save them to my PC so i can have a printable version. Also i Do not knnow how to link my email address to the carousel it keeps saying something about a pop and I have no c
-
Can't start GarageBand. "GarageBand requires QuickTime 7.3.0 or higher"
Can't start GarageBand. "GarageBand requires QuickTime 7.3.0 or higher". Mac Pro early 2009, 8-core, RAID, 32GB RAM.I reinstalled twice (Mac OSX 10.8 clean install). Using latest version of all multimedia programs; Final Cut X, Motion, Compressor, L
-
Outbound Seeburger AS2 setup problem
Hello, I am trying to setup Seeburger AS2 adapter in the way that I can post documents from our SAP system to the external server that is sitting in the internet. I was following the SAPXI30_AS2Adapter.pdf guide but it is still not working. When I in
-
Hi All, I have used 'ON VALUE-REQUEST' event for a variable S_CNTRY in the select-options. SELECT-OPTIONS: S_CNTRY FOR ADRC-REGION OBLIGATORY. AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNTRY-LOW. PERFORM SEARCH_HELP_REGION CHANGING S_CNTRY. AT SEL