Displaying the column names in a spreadsheet
Hello All,
I am downloading data from SAP into a spreadsheet using the FM MS_EXCEL_OLE_STANDARD_DAT. The data is coming fine.
But I need to display the column names too in the spreadsheet. Could anyone please tell me how to do that.
Thanks in advance.
Regards
Indrajit
Hi Pawan,
I am using the following piece of code.
TYPES: BEGIN OF ty_fieldname,
text(20) TYPE c,
END OF ty_fieldname.
DATA: gs_fieldname TYPE ty_fieldname.
gt_fieldname TYPE STANDARD TABLE OF ty_fieldname.
gs_fieldname-text = 'Material'.
APPEND gs_fieldname TO gt_fieldname.
gs_fieldname-text = 'Ad Size'.
APPEND gs_fieldname TO gt_fieldname.
gs_fieldname-text = 'Classification Group'.
APPEND gs_fieldname TO gt_fieldname.
gs_fieldname-text = 'Old Ceiling'.
APPEND gs_fieldname TO gt_fieldname.
gs_fieldname-text = 'Message Type'.
APPEND gs_fieldname TO gt_fieldname.
gs_fieldname-text = 'Message'.
APPEND gs_fieldname TO gt_fieldname.
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
EXPORTING
file_name = p_file
data_sheet_name = text-014
TABLES
data_tab = gt_rate
fieldnames = gt_fieldname
EXCEPTIONS
file_not_exist = 1
filename_expected = 2
communication_error = 3
ole_object_method_error = 4
ole_object_property_error = 5
invalid_pivot_fields = 6
download_problem = 7
OTHERS = 8.
I am getting a short dump on this which says -
"Only flat, character-type data objects are supported at the argument
position "dest" for the statement
"WRITE src TO dest".
In this case, the operand "dest" has the non-character-type or deep type
"P". The current program is flagged as a Unicode program. In the Unicode
context, type X fields are seen as non-character-type, as are
structures that contain non-character-type components."
Indrajit
Similar Messages
-
How to display the column names of a table in the output
Hi,
I want to display the name of the columns of the table without using literals in a abap report.
EX: Consider the table KNA1
KUNNR NAME ADDRESS
I want to display the column names in the above fashion without using hardcoded write statements.
Thanking in anticipationYou can use this FM <b>DDIF_FIELDINFO_GET</b> It gives you all the names related to fields in a table -:)
Greetings,
Blag. -
Hi,
I am using OCCI to interact with DB through code, which means I am writing a vc++ file to interact with Data Base and execute the Stored Procedure which I am calling from the C++ Code. And also displaying the output of the Stored Procedures to the Front End. I am succeeded in this, but now I should be able to display the Column names of the output to Front End. Can any one help me on this.
Example:
Sno | Sname
------- |-------------
1 ABC
2 DEF
I am getting (1,ABC) and (2,DEF) as the output of the Stored Procedure but I need the Column names also to display. How to get them.
Thanks in Advance..:)Look at Re: exporting csv via pl/sql - select statement?
It has an example how to extract the column name from a cursor. You have to check, whether you can use DBMS_SQL.DESCRIBE_COLUMNS
Your procedure might need another out parameter, that returns the column names , e.g. as comma separated list or as varray. -
Hi experts,
I have used tableview in BSP . In the output it displays the column name as per the table which i have referred. I want to change the name of the column. How Should i do that.. anyone plz explain me with an example.
Thanks in Advance
Edited by: Vijay Babu Dudla on Apr 28, 2009 12:59 AMHi ,
If you want to change the column name, you can put your code following:
<htmlb:tableViewColumn columnName = " "
*title = " put the cloumn name here"*
</htmlb:tableViewColumn>
Please try.
Any doubt let me know.
Regards,
Chris Gu
Edited by: Gu Chris on Apr 28, 2009 5:26 AM
Edited by: Gu Chris on Apr 28, 2009 5:26 AM
Edited by: Gu Chris on Apr 28, 2009 5:27 AM -
Help to extract the Column Name depending on the row values
Hello All,
I have a table with below format
Table Name: Employees
Emp Name Monday Tuesday Wednesday Thursday Friday Saturday
John yes NULL yes yes NULL NULL
Michael NULL yes NULL yes yes NULL
Smith NULL yes yes NULL yes yes
In the above I have explicitly mentioned NULL just for better understanding.
I am trying to send an email using HTMLDB_MAIL.SEND which will have the body as following
"John is absent on Tuesday, Friday and Saturday
Michael is absent on Monday, Wednesday and Saturday
Smith is absent on Monday and Thursday"
I am trying to do this using cursor, fetching each row and matching the value with NULL. But I am not able to display the column name.
Can somebody please help me?
Regards,
RS.
Edited by: user8966924 on Jan 24, 2013 4:35 AMHi,
just use Peter's query, collect into a nested table the output and create one CLOB variable from collection to use it as a body:
create or replace function getbodyemp
return clob
is
p_body_out clob;
type tp_tbemp is table of varchar2 (100);
v_tbemp tp_tbemp;
begin
-- collect the output into a nested table
with employees as
select 'John' Emp_Name , 'yes' Monday, null Tuesday, 'yes' Wednesday, 'yes' Thursday, null Friday, null Saturday from dual union all
select 'Michael' Emp_Name , null Monday, 'yes' Tuesday, null Wednesday, 'yes' Thursday, 'yes' Friday, null Saturday from dual union all
select 'Smith' Emp_Name , null Monday, 'yes' Tuesday, 'yes' Wednesday, null Thursday, 'yes' Friday, 'yes' Saturday from dual
select
e.emp_name || ' is absent on ' ||
replace (trim( ',' from nvl2(monday,null, 'Monday')
|| nvl2(Tuesday,null, ',Tuesday')
|| nvl2(Wednesday,null, ',Wednesday')
|| nvl2(Thursday,null, ',Thursday')
|| nvl2(Friday,null, ',Friday')
|| nvl2(Saturday,null, ',Saturday')), ',', ', ') txt
bulk collect into v_tbemp
from
employees e
where
monday is null
or tuesday is null
or wednesday is null
or thursday is null
or friday is null
or saturday is null
for i IN 1 .. v_tbemp.count
loop
p_body_out := p_body_out || v_tbemp(i) || chr(10);
end loop;
return p_body_out;
end getbodyemp;
select getbodyemp() from dual;
GETBODYEMP()
John is absent on Tuesday, Friday, Saturday
Michael is absent on Monday, Wednesday, Saturday
Smith is absent on Monday, Thursday
1 row selected.Regards.
Al -
JTable : How to display an icon near the column name ?
Hi all,
I'd like to display an icon near the column name of my JTable when an user click on the column; the icon specify the sorting applied to the data of JTable.
I know that i have to write a render, but how ?
Cheers.
StefanoHi all,
I found the solution at http://exampledepot.com/egs/javax.swing.table/IconHead.html
Cheers anyway.
Stefano -
How to change the column names in display
Hi,
I want to change the columns names and give the display names as more User friendly..
How should I acheive this in WebI reports.
Regards,
BOBHi,
the columns names are normal text fields. Just selecdt to edit your report , go to the editor panel and select the column header you want to modify. You can enter the text you want to display
Regards,
Stratos -
Changing the column names displayed via an ODBC driver
Hi we are just starting to used Crystal Reports to improve the reporting capabaility of a legacy application, we can access the data fine using an ODBC driver. What we want to do is change the column names that are displayed within Crystal Reports so they are more user friendly and not in techno speak,, so that the users can create their own reports. Do we need to used Business Objects to setup a Universe to do this, is their a simple cheaper method sorry if this post is in the wrong section
Can you set up "views" in your database? That would probably be the easiest way to do this.
-Dell
- A computer only does what you told it to, not what you thought you told it to!</p> -
Displaying only the column names
hi there,
is there any query to fetch only the column names from a table, excluding the datas from that particular column?
Thanks,
Balu.SQL> select * from dual
2 where rownum < 1;
no rows selected -
How to select even the column names of a table?
Hello All,
Is there a way to select even the column names of a table in the select statement?
My select from a table (say X) is in a SQL* Plus script that gets invoked by application tier and displays data in the application tier window. User's can then copy the data into a spreadsheet and do their processing. However, I need to give them the column names too along with the data.
Thanks,
ChiruIf there is a middle tier that is selecting and
displaying the data, and that's what the users are
copying from, the middle tier would have to address
its presentation of the data to allow users to
include column names. If this is a common task, the
application should probably be modified to give users
the option of downloading the data in a spreadsheet
directly rather than forcing them to copy and paste
data.Thanks for the reply.
The users don't have to copy paste. The application tier has an options in the "Tools" menu item which allows them to copy the entire output to a file (in my case a txt file which is a pipe delimited). Then they have to do text to columns to get the data into each column of the spreadsheet. I could have directly called the stored procedures from the application tier and created ".csv" files and FTP'd them to the user's folders. However, I am having to go this round about because, I am not getting enough support from the LAN team in FTP'ing etc.
OK I'll think of another workaround.
Thanks,
Chiru -
Changing the Column names / alias
Hi,
I have an oracle query and it works fine.
select q.sname,
SUM( decode(p.nprofile1,10,1,0)) as "0 - 5",
SUM( decode(p.nprofile1,9,1,0)) as "6 - 10",
SUM( decode(p.nprofile1,8,1,0)) as "11 - 15",
SUM( decode(p.nprofile1,7,1,0)) as "16 - 19",
SUM( decode(p.nprofile1,6,1,0)) as "20 - 20",
SUM( decode(p.nprofile1,5,1,0)) as "21 - 27",
SUM( decode(p.nprofile1,4,1,0)) as "28 - 30",
SUM( decode(p.nprofile1,3,1,0)) as "31 - 40",
SUM( decode(p.nprofile1,2,1,0)) as "41 - 45",
SUM( decode(p.nprofile1,1,1,0)) "46 - Over",
COUNT(q.sname) "TOTAL"
from task_core@cds t, cor_queue q, profile_core@crb p
where t.nmboxid = q.nmboxid
and p.ncodaid = t.nobjectid
and p.ntype=2
GROUP BY q.sname
ORDER BY q.sname
It generates a Cross-tab sort of result and I am using the decode function to generate the result.
My problem is that right now I am using hardcoded column names or alias for the columns generated by the decode function. eg. "0-5", "6-10" etc.
I have another table which contains these values ("0-5","6-10"). I would like to know instead of hard coding the column names like
SUM( decode(p.nprofile1,10,1,0)) as "0 - 5"
can we retrieve the values from the Other table that contains the values "0-5","6-10" etc and display it there in the decode function?
Pls help me with this issue
Thanks
Gilleshi,
the column names are always fixed. You can try dynamic sql in pl/sql or spool then execute, but in pure sql, it is not possible -
How to get the column names of the table into the Dashboard prompt
how to get the column names of the table into the Dashboard prompt
Thanks & Regards
Kishore PHey john,
My requirement is as follows
I have created a Rank for Total sales by Region wise i.e RANK(SUM(Dollars By Region)) in a pivot table.
My pivot table looks like this
COLUMN SELECTOR: TOTAL US , REGION , DISTRICT , MARKET
---------------------------------------------------- JAN 2009 FEB 2009 MAR 2009
RANK REGION DOLLARS DOLLARS DOLLARS DOLLARS
1 CENTRAL 10 20 30 40
2 SOUTHERN 10 30 30 70
3 EASTERN 20 20 20 60
4 WESTERN 10 20 30 40
When i select the District in column selector
Report has to display rank based on Total Sales by District. i.e
------------------------------------------------- JAN 2009 FEB 2009 MAR 2009
RANK DISTRICT DOLLARS DOLLARS DOLLARS DOLLARS
for this i need to change the fx of rank i.e RANK(SUM(Dollars By Region)) to RANK(SUM(Dollars By District)) and fx of Region i.e Markets.Region to Markets.District dynamically.
so , i need to capture column name of the value selected from the column selector and dynamically i need to update the fx 0f RANK & fx of region.
do you have any solution for this?
http://rapidshare.com/files/402337112/Presentation1.jpg.html
Thanks & Regards
Edited by: Kishore P on Jun 24, 2010 7:24 PM
Edited by: Kishore P on Jun 24, 2010 7:28 PM -
Hi
I am using jdev 11.1.1.3
.i i dragged an adf table from data control.it has got 3 columns.i changed the name of first column as Lang grades.when i run that it is showing the column name as lang grades.then in that table two fields r mandatory.so in the property inspector i put the show required as true.but after that on running it is not showing the column name as lang grades.there is only the star sign for showing the attribute as required only.Hi,
not enough information. So from your description, a column that is not marked required on its cell renderer component is not displayed at runtime. I am not aware of such a problem and suggest to try a later version of 11g R1 (11.1.1.6) to see if this reproduces. This allows you to exclude a probelm with 11.1.1.3 only
Frank -
How to display the column header in two rows?
Hi Experts,
I am using ALV_LIST_DISPLAY i neeed to display the column header in two rows.. How can i do that?
Ex: purchase order i need to display "purchase" in one row and "order" in second row.
Thanks in advance,
Sarath.jREPORT zpwtest .
TYPE-POOLS slis .
DATA : layout TYPE slis_layout_alv .
CONSTANTS : c_len TYPE i VALUE 20 .
TYPES : BEGIN OF ty_t100 ,
sprsl TYPE t100-sprsl ,
arbgb TYPE t100-arbgb ,
msgnr TYPE t100-msgnr ,
text TYPE t100-text ,
fline TYPE t100-text ,
END OF ty_t100 .
TYPES : BEGIN OF ty_wrd ,
text TYPE char20 ,
END OF ty_wrd .
DATA : it_t100 TYPE TABLE OF ty_t100 ,
it_sentence TYPE TABLE OF ty_wrd ,
wa_t100 TYPE ty_t100 ,
wa_word TYPE ty_wrd ,
v_repid TYPE syst-repid ,
v_tabix TYPE syst-tabix .
DATA : it_fld TYPE slis_t_fieldcat_alv ,
it_evt TYPE slis_t_event ,
wa_fld TYPE slis_fieldcat_alv ,
wa_evt TYPE slis_alv_event .
INITIALIZATION .
v_repid = sy-repid .
START-OF-SELECTION .
* Get data
SELECT *
INTO TABLE it_t100
FROM t100
WHERE sprsl = 'EN'
AND arbgb = '00' .
LOOP AT it_t100 INTO wa_t100 .
v_tabix = sy-tabix .
CLEAR : it_sentence .
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = wa_t100-text
outputlen = c_len
TABLES
out_lines = it_sentence.
IF NOT it_sentence IS INITIAL .
READ TABLE it_sentence INTO wa_word INDEX 1 .
wa_t100-fline = wa_word-text .
MODIFY it_t100 FROM wa_t100 INDEX v_tabix .
ENDIF.
ENDLOOP.
* Prepare fieldcatelog
CLEAR wa_fld .
wa_fld-fieldname = 'SPRSL' .
wa_fld-ref_tabname = 'T100' .
wa_fld-ref_fieldname = 'SPRSL' .
APPEND wa_fld TO it_fld .
CLEAR wa_fld .
wa_fld-fieldname = 'ARBGB' .
wa_fld-ref_tabname = 'T100' .
wa_fld-ref_fieldname = 'ARBGB' .
APPEND wa_fld TO it_fld .
CLEAR wa_fld .
wa_fld-fieldname = 'MSGNR' .
wa_fld-ref_tabname = 'T100' .
wa_fld-ref_fieldname = 'MSGNR' .
APPEND wa_fld TO it_fld .
CLEAR wa_fld .
wa_fld-fieldname = 'FLINE' .
wa_fld-inttype = 'CHAR' .
wa_fld-outputlen = 20 .
wa_fld-intlen = 20.
wa_fld-seltext_l = 'Text' .
wa_fld-ddictxt = 'L' .
APPEND wa_fld TO it_fld .
* Get event.. we will handle BOFORE and AFTER line output
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
IMPORTING
et_events = it_evt.
READ TABLE it_evt INTO wa_evt
WITH KEY name = slis_ev_after_line_output .
wa_evt-form = slis_ev_after_line_output .
MODIFY it_evt FROM wa_evt INDEX sy-tabix .
READ TABLE it_evt INTO wa_evt
WITH KEY name = slis_ev_top_of_page .
wa_evt-form = slis_ev_top_of_page .
MODIFY it_evt FROM wa_evt INDEX sy-tabix .
layout-no_colhead = 'X' .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
it_fieldcat = it_fld
is_layout = layout
it_events = it_evt
TABLES
t_outtab = it_t100.
* FORM top_of_page *
FORM top_of_page .
uline .
WRITE: / sy-vline ,
10 sy-vline ,
11 'line1' ,
31 sy-vline ,
37 sy-vline ,
58 sy-vline .
WRITE: / sy-vline ,
10 sy-vline ,
11 'line2' ,
31 sy-vline ,
37 sy-vline ,
58 sy-vline .
WRITE: / sy-vline ,
10 sy-vline ,
11 'line3' ,
31 sy-vline ,
37 sy-vline ,
58 sy-vline .
ENDFORM.
* FORM AFTER_LINE_OUTPUT *
FORM after_line_output USING rs_lineinfo TYPE slis_lineinfo .
CLEAR : it_sentence ,
wa_t100 .
READ TABLE it_t100 INTO wa_t100 INDEX rs_lineinfo-tabindex .
CHECK sy-subrc = 0 .
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = wa_t100-text
outputlen = c_len
TABLES
out_lines = it_sentence.
DESCRIBE TABLE it_sentence LINES v_tabix .
CHECK v_tabix > 1 .
LOOP AT it_sentence INTO wa_word FROM 2 .
WRITE: / sy-vline ,
10 sy-vline ,
31 sy-vline ,
37 sy-vline ,
38 wa_word-text ,
58 sy-vline .
ENDLOOP.
ENDFORM . -
How to put the column name and variable value in the alert message.
Dear,
how can i put the column name and variable value in the alert message text. i want to display an alert which tell the user about the empty textboxes. that these textboxes must be filled.
Regards:
Muhammad Nadeem
CHIMERA PVT. LTD.
LAHORE
[email protected]Hello,
The name of the item that fires the current trigger is stored in the :SYSTEM.TRIGGER_ITEM system variable.
The value contained in this item can be retrived with the Name_In() built-in
value := Name_In( 'SYSTEM.TRIGGER_ITEM') ;
LC$Msg := 'The item ' || :SYSTEM.TRIGGER_ITEM || ' must be entered' ;
Set_Alert_Property('my_alert_box', ALERT_MESSAGE_TEXT, LC$Msg ) ;
Ok := Show_Alert( 'my_alert_box' ) ;
...Francois
Maybe you are looking for
-
Help on GR/IR GL Account Clearing
Hi Experts, We are having problem with clearing GR/IR Account. Following is the scenario; PO - Item 10 - MXN 4700 (Amt in LC USD 3500) & Item 20 - MXN 2300 (Amt in LC USD 175) Entries at GR Debit GL (Exp) - MXN 4700 (Amt in LC USD 3500) Credit
-
Hi , My version of iMac (Os X 10.6.8) seems to be rejecting my Mail programme (4.5) and I'm forced to use Entourage. All my eMails are gone and I have to retrieve them by going into the Hard drive. Very disconcerting. Why did it happen and what can I
-
My screen is dead-I had to buy a new phone. I want to recover my photos (and other things, if I can) but when I plug my phone in to iTunes it asks me to unlock my screen, which I can't do. I haven't updated to my computer or iCloud lately. Is there a
-
Hi All, I have this requirement. On ALV Tree node, when user places cursor then i should display some text as quick info. while create node i have used ICON <- left arrow, i cannot use other ICOn as functional person need this icon only. During Add_N
-
ORA-33292 while attaching.
Hi, I am maintaining the cubes from pl/sql procedures. Now my requirement is if 1st person has fired one cube and after some time 2nd person fires one more cube lying in the same AW then second has to wait till the first one is completed. this we hav