Excel Column Header
Hello all.
I am creating 7 columns data for every itteration from for loop.
My materialnumbers isnt constant. So`its can be 10 or 3. I can write all datas to spreadsheet without headers.
I need save my datas like attachment to excel.
In this excel file headers creating automaticly.
Every for itteration i creating 1 material and 7 values (array values).
Thanks.
Kerem.
Solved!
Go to Solution.
Attachments:
Capture.JPG 29 KB
Bob_Schor wrote:
Unfortunately, ActiveX is no longer so well documented -- I had to struggle to get the ActiveX Help document to do anything in Windows 7 (worked much better in XP). The Horizontal Alignment Property, according to Microsoft, can be any of the following xlHAlign constants:
xlHAlignCenter
xlHAlignCenterAcrossSelection
xlHAlignDistributed
xlHAlignFill
xlHAlignGeneral
xlHAlignJustify
xlHAlignLeft
xlHAlignRight
I couldn't get values for these. However, I did find, on the Web, a reference for Office 2007 with values (and no explanation):
xlHAlignCenter -4108
xlHAlignCenterAcrossSelection 7
xlHAlignDistributed -4117
xlHAlignFill 5
xlHAlignGeneral 1
xlHAlignJustify -4130
xlHAlignLeft -4131
xlHAlignRight -4152
Note that the numbers are either three-bit positive numbers or 6 bit numbers with the higher 10 bits all set (I'm assuming this is intended to be a U16 quantity). On the other hand, it really only needs the lower six bits -- I wonder what would happen if you tried 52 instead of -4108 ... Ahh, the wonders of Microsoft Abandonware ...
Bob Schor
You can find the values here.
Ben64
Similar Messages
-
How can I change excel column header using Labile.
Dear Experts,
How can i change excel column header using LabVIEW.
Thanks for any and all help!
M.S.Sivaraj.
Sivaraj M.S
CLDAs I said in my previous post, column headers in Excel are merely row 1 cells. May be I missing something here, so please be more explicit with your question.
I guess you are using the Excel Report tools, and you want to modify an existing sheet. From my limited experience with the Excel Report tools, it is not possible to open an existing woorkbook (except as template...), so the answer to your question should be "Forget it"...
The work around is to use the example I pointed for you before, and either to write the whole new colum headers as a string array, starting in A1, or to write a single string to a given cell in row 1.
Hope this helps
Chilly Charly (aka CC)
E-List Master - Kudos glutton - Press the yellow button on the left... -
How to avoid WRAP of EXCEL Column HEADER Fields
We have 3 tablix in the rdl file with 11 inch * 8.5 inch (to print in A4)
Tablix 1 - HTML viewer
Tablix 2 - EXCEL
Tablix 3 - PDF
The size of the rdl is fixed , if size altered then printing becomes an issue.
So we have to keep the rdl size fix
but at the same time the WRAP of column header of the EXCEL need to be avoided ,
because if the size of the column header is not reduced then we cannot be able to accomodate in the defined page size
Eaxmple of SOme Header Field Name
1.OccupationCode
2.ChargeJobPhase which are quiet large fields, so it need to be wrapped(to reduce the length of the column to accomodate ) to fit in the page.
So as an Alternative option I use the COncept of Subreport and called it by adding row outside group otherwise the
Report Server treats subreport as new report for each instance of the parent report.
The challenge we faced is when export to EXCEL some of the columns is getting merged , I believe the size of the child report (sub report) is having the length
greater than the parent report (Called Report ) and the size has to be large otherwise the COLUMN HEADER need to reduced which makes it Wrapped
So is there any alternative without changing the parent report size and without WRAPPING the HEADER text of CHild report the MERGING of cell can be avoided.
Since MERGING is happening which is not allowing us to PUT FILTER in EXCEL but we need to have FILTER applicable since the END user use it to sort, find the records.Hi SubhadipRoy,
In Reporting Services, whether to wrap text or not is depended on the CanGrow property. If we set the CanGrow property of tablix header row to true, then the header row of tablix will be expanded. If we set the CanGrow property of tablix header row
to false, the header row will be shrunk as the designed size.
So if we want to avoid wrap text, we can try to set the CanGrow property of tablix header row to false in Reporting Services level. Alternatively, we can click the Wrap Text button to enable the expended extra-long text property in Excel level.
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
No column heading in second page in alv report when save in excel file
Hi Expert,
How can i remove the column header from Alv report when program execute in background and save in excel file right now
its comming column header in each page. Client dont want header column in excel from second page. is this possible?
with regards
chandan_vijiHi Ravi,
thanks for reply i have solved this problm throug line count and NEW-PAGE LINE COUNT 10000 bcoz client want output in excel file only one page header.
with regards
chandan_viji -
Internal Table to Excel with Column Header line
Hello everyone,
I need to download Internal table data to excel with a column header line.
My Code is as follows:
TYPES: BEGIN OF y_hdr,
head(30) TYPE c,
END OF y_hdr.
Data: t_hdr TYPE STANDARD TABLE OF y_hdr.
Fill internal table t_adrcdata
fill the header table t_hdr
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = C:\test.xls
filetype = 'DBF'
IMPORTING
TABLES
data_tab = t_adrcdata
fieldnames = t_hdr
EXCEPTIONS
file_write_error = 1
no_batch = 2
This code gives me a row with column headers.
However they are all truncated after 10 chars.
The truncation is independent of column data length. Data could be of length 2,5 or 40 but the header always displays upto 10 chars.
Keeping the filename as test.xls, when I download it in ASC format instead of DBF the headers are of proper length.
What could I be doing wrong?
I know this topic has been discussed before but my question is pertaining to DBF Format download. The reason I chose DBF format is because it downloads the data in DB format and does not give in to Excel formatting.
FOr example in ASC format:
1, A field of type Char(12) used to get downloaded into excel without the leading zeros. 000012345678 --> 12345678
2. Date in format dd-MMM-yyyy in a char(11) field used to get downloaded to excel in dd-MMM-yy format.
When I chose DBF, this issue was resolved. However, the column headers got truncated at 10 chars.
Please feel free to recommend any other way of downloading to Excel and preserving format if this method is incorrect/ there is a better way.Hi,
Take 'ASC' format for file type.
But when you declare your internal table to pass for FM you have to create all the fields with char.
Example:
data: begin of it_exl occurs 0,
bukrs(04) type c,
belnr(10) type c,
buzei(03) type c,
end of ut_exl.
You need to manipulate your date format and other stuff before appending to this internal table.
Thanks,
Deepak. -
How can i bring the column heading downloaded in excel sheet?
hi all,
I am using FM SAP_CONVERT_TO_XLS_FORMAT to downloading populated internal table data into excel sheet by using filename type rlgrap-filename.
Now I need the column heading(field name) for downloaded data in excel sheet.
pls tell me how can i merge the col heading with data perfectly. Is there any FM fulfills this requirement.
pls give me a suitable approch.
Thanks
PRRHI,
Go thru this code.
REPORT ZRMM0056 NO STANDARD PAGE HEADING
MESSAGE-ID ZZ
LINE-SIZE 300
LINE-COUNT 65.
Program : ZRMM0056
Title : Non Inventory PO's
Description : Non Inventory Purchase Orders details with
Vendor and Invoice Receipts and Goods Receipts.
Input :
Select-options : 1. G/L Account No
Parameters : 1.File Paths for the Excel sheet
Others (Specify):
Output : Extract Files in the application server
Report :
Hear Ticket # : 113392
Created by : Srinivas Rao.M
Created on : 12/15/2005
Version : 1
Request : D10K944304
Transaction Code : Z420
Change History *
Date Programmer Search String Description *
12/19/2005 Srinivas D10K944316 Removed Purchasing document
Company code and Plant from
Select-Options and Inculded
G/L Account No and changed
code accordingly.
T A B L E S *
TABLES: EKBE, " History of Purchasing Document
EKPO, " Purchasing Document Item
EKKO, " Purchasing Document Header
LFA1, " Vendor master (general section)
EKKN. " Account Assignment in Purchasing Doc
INTERNAL TABLES
*--Internal table to store Purchasing document header data
DATA : BEGIN OF IT_POHEADER OCCURS 0,
EBELN LIKE EKKO-EBELN, "Purchasing document
AEDAT LIKE EKKO-AEDAT, "Created on
ERNAM LIKE EKKO-ERNAM, "Created by
LIFNR LIKE EKKO-LIFNR, "Vendor
END OF IT_POHEADER.
*--Internal table to store Purchasing document Item data
DATA : BEGIN OF IT_POITEM OCCURS 0,
EBELN LIKE EKPO-EBELN, "Purchasing document
EBELP LIKE EKPO-EBELP, "Item Number
MATNR LIKE EKPO-MATNR, "Material number
BUKRS LIKE EKPO-BUKRS, "Company code
WERKS LIKE EKPO-WERKS, "Plant
MATKL LIKE EKPO-MATKL, "Material Group
MENGE LIKE EKPO-MENGE, "Order Quantity
NETPR LIKE EKPO-NETPR, "Net Price
PEINH LIKE EKPO-PEINH, "Price unit
NETWR LIKE EKPO-NETWR, "Net Value
END OF IT_POITEM.
*--Internal table to hold final display data.
DATA : BEGIN OF IT_FINAL OCCURS 0,
EBELN LIKE EKKO-EBELN, "Purchasing document
EBELP LIKE EKPO-EBELP, "Item Number
AEDAT LIKE EKKO-AEDAT, "Created on
ERNAM LIKE EKKO-ERNAM, "Created by
MATNR LIKE EKPO-MATNR, "Material number
BUKRS LIKE EKPO-BUKRS, "Company code
WERKS LIKE EKPO-WERKS, "Plant
MATKL LIKE EKPO-MATKL, "Material Group
MENGE LIKE EKPO-MENGE, "Order Quantity
NETPR LIKE EKPO-NETPR, "Net Price
PEINH LIKE EKPO-PEINH, "Price unit
NETWR LIKE EKPO-NETWR, "Net Value
LIFNR LIKE EKKO-LIFNR, "Vendor
NAME1 LIKE LFA1-NAME1, "Vendor Name
GSBER LIKE EKKN-GSBER, "Business area
*--IR details
IR_BELNR LIKE EKBE-BELNR, "IR-Number of Material Document
IR_BUZEI LIKE EKBE-BUZEI, "IR-Item in material Document
IR_BUDAT LIKE EKBE-BUDAT, "IR-Posting date
IR_MENGE LIKE EKBE-MENGE, "IR-Quantity
*--GR details
GR_BELNR LIKE EKBE-BELNR, "GR-Number of Material Document
GR_BUZEI LIKE EKBE-BUZEI, "GR-Item in material Document
GR_BUDAT LIKE EKBE-BUDAT, "GR-Posting date
GR_MENGE LIKE EKBE-MENGE, "GR-Quantity
END OF IT_FINAL.
*--Internal table to store History per Purchasing Document data
DATA : BEGIN OF IT_HISTORY OCCURS 0,
EBELN LIKE EKBE-EBELN, "Purchasing document
EBELP LIKE EKBE-EBELP, "Item
VGABE LIKE EKBE-VGABE, "Trans/Event type
BELNR LIKE EKBE-BELNR, "Number of Material Document
BUZEI LIKE EKBE-BUZEI, "Item in material Document
BUDAT LIKE EKBE-BUDAT, "Posting date
MENGE LIKE EKBE-MENGE, "Quantity
BEWTP LIKE EKBE-BEWTP, "Posting history category
END OF IT_HISTORY.
*--Internal table to store vendor name.
DATA : BEGIN OF IT_VENDOR OCCURS 0,
LIFNR LIKE LFA1-LIFNR, "Vendor Number
NAME1 LIKE LFA1-NAME1, "Vendor Name
END OF IT_VENDOR.
*--Internal table to store Business area for Purchasing document
DATA : BEGIN OF IT_BUSINESS OCCURS 0,
EBELN LIKE EKKN-EBELN, "Purchasing document
EBELP LIKE EKKN-EBELP, "Purchasing Item
SAKTO LIKE EKKN-SAKTO, "G/L Account No
GSBER LIKE EKKN-GSBER, "Business area
END OF IT_BUSINESS.
DATA : BEGIN OF FIELDNAMES OCCURS 0,
TEXT(40),
END OF FIELDNAMES.
VARIABLES DECLARATION *
DATA: V_FILE LIKE IBIPPARMS-PATH, "File path
V_FLD LIKE DYNPREAD-FIELDNAME, "Dynpread fieldname
V_FLAG(1) VALUE SPACE. "FLAG VARIABLE
SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK S1 WITH FRAME TITLE TEXT-001.
*--Begin of change D10K944316
SELECT-OPTIONS : S_SAKTO FOR EKKN-SAKTO. "G/L Accoun no.
*--End of change D10K944316
SELECTION-SCREEN END OF BLOCK S1.
SELECTION-SCREEN BEGIN OF BLOCK S2 WITH FRAME TITLE TEXT-002.
PARAMETERS : P_EXCEL AS CHECKBOX DEFAULT ' ' . " download to excel
PARAMETERS : C_FILE(128) DEFAULT : 'C:\ZRMM0056.xls'.
SELECTION-SCREEN END OF BLOCK S2.
A T S E L E C T I O N - S C R E E N *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR C_FILE.
*-Form to get file path for download of data
PERFORM GET_FILE_PATH.
AT SELECTION-SCREEN.
PERFORM SCREEN_VALIDATIONS.
START-OF-SELECTION
START-OF-SELECTION.
*--Extract Purchasing document header data.
PERFORM GET_PO_HEADER_DATA.
*--Extract Purchasing document Item data.
IF NOT IT_BUSINESS[] IS INITIAL.
PERFORM GET_PO_ITEM_DATA.
*--Get complete required data in final internal table
PERFORM GET_FINAL_DATA.
ENDIF.
END-OF-SELECTION
END-OF-SELECTION.
IF V_FLAG IS INITIAL.
*--Display Purchasing document details
IF NOT IT_FINAL[] IS INITIAL.
PERFORM DISPLAY_PODATA.
IF P_EXCEL = 'X'.
*--To down load data to excel sheet
PERFORM DOWN_LOAD_TO_EXCEL.
ENDIF.
ENDIF.
ELSE.
MESSAGE I001(ZZ) WITH 'No data found'(003).
ENDIF.
TOP-OF-PAGE
TOP-OF-PAGE.
*--To display page header
PERFORM PAGE_HEADER.
*& Form GET_PO_HEADER_DATA
To Get Purchasing header data
FORM GET_PO_HEADER_DATA .
*--To extract Business Area details
CLEAR IT_BUSINESS.
REFRESH IT_BUSINESS.
SELECT EBELN "Purchasing document
EBELP "Purchasing document item
SAKTO "G/L Account no
GSBER "Business area
FROM EKKN
INTO TABLE IT_BUSINESS
WHERE SAKTO IN S_SAKTO.
IF SY-SUBRC <> 0.
V_FLAG = 'X'.
MESSAGE I001(ZZ) WITH
'No data selected for the given selection criteria'(004).
STOP.
ELSE.
*--To extract Purchasing document details with respect
to G/L Account no
CLEAR IT_POHEADER.
REFRESH IT_POHEADER.
SELECT EBELN "Purchasing document
AEDAT "Created on
ERNAM "Created by
LIFNR "Vendor
FROM EKKO
INTO TABLE IT_POHEADER
FOR ALL ENTRIES IN IT_BUSINESS
WHERE EBELN = IT_BUSINESS-EBELN.
IF NOT IT_POHEADER[] IS INITIAL.
CLEAR IT_VENDOR.
REFRESH IT_VENDOR.
*--Extracting Vendor details
SELECT LIFNR "Vendor #
NAME1 "Name
FROM LFA1
INTO TABLE IT_VENDOR
FOR ALL ENTRIES IN IT_POHEADER
WHERE LIFNR = IT_POHEADER-LIFNR.
ENDIF.
ENDIF.
ENDFORM. " GET_PO_HEADER_DATA
*& Form GET_PO_ITEM_DATA
To extract Purchasing document item data
FORM GET_PO_ITEM_DATA .
CLEAR IT_POITEM.
REFRESH IT_POITEM.
SELECT EBELN "Purchasing document
EBELP "Item Number
MATNR "Material number
BUKRS "Company code
WERKS "Plant
MATKL "Material Group
MENGE "Order Quantity
NETPR "Net Price
PEINH "Price unit
NETWR "Net Value
FROM EKPO
INTO TABLE IT_POITEM
FOR ALL ENTRIES IN IT_BUSINESS
WHERE EBELN = IT_BUSINESS-EBELN
AND EBELP = IT_BUSINESS-EBELP.
IF NOT IT_POITEM[] IS INITIAL.
CLEAR IT_HISTORY.
REFRESH IT_HISTORY.
SELECT EBELN "Purchasing document
EBELP "Item
VGABE "Trans/Event type
BELNR "Number of Material Document
BUZEI "Item in material Document
BUDAT "Posting date
MENGE "Quantity
BEWTP "Posting history category
FROM EKBE
INTO TABLE IT_HISTORY
FOR ALL ENTRIES IN IT_POITEM
WHERE EBELN = IT_POITEM-EBELN
AND EBELP = IT_POITEM-EBELP
AND ( VGABE = '1' OR VGABE = '2' ) "1 = GR , 2 = IR
AND ( BEWTP = 'Q' OR BEWTP = 'E' ). "Q = GR , R = IR
IF SY-SUBRC = 0.
SORT IT_HISTORY BY EBELN EBELP.
ENDIF.
ENDIF.
ENDFORM. " GET_PO_ITEM_DATA
*& Form GET_FILE_PATH
Select file path
FORM GET_FILE_PATH .
CLEAR V_FILE.
MOVE 'p_flname' TO V_FLD.
MOVE C_FILE TO V_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = V_FLD
IMPORTING
FILE_NAME = V_FILE
EXCEPTIONS
OTHERS = 1.
MOVE V_FILE TO C_FILE.
ENDFORM. " GET_FILE_PATH
*& Form PAGE_HEADER
To Print page header and other details
FORM PAGE_HEADER .
*--Page Header
ULINE AT /1(300).
FORMAT COLOR 1.
WRITE:/ 'Run Date:'(005), SY-DATUM, 45 'Stanley Works'(006),
100 'Page No:'(007), SY-PAGNO LEFT-JUSTIFIED, 298 ''.
WRITE:/ 'Run Time:'(008), SY-UZEIT, 43 SY-TITLE, 100 SY-UNAME, 298 ''.
WRITE:/ 'Source :'(009), SY-SYSID, 100 SY-CPROG, 298 ''.
FORMAT COLOR OFF.
ULINE AT /1(300).
FORMAT COLOR 4.
WRITE : / SY-VLINE , (10) 'Purchasing Doc'(010),
SY-VLINE, (5) 'Item'(011),
SY-VLINE, (10) 'Created On'(012),
SY-VLINE, (7) 'Crea By'(013),
SY-VLINE, (10) 'Material'(014),
SY-VLINE, (6) 'Com cd'(015),
SY-VLINE, (5) 'Plant'(016),
SY-VLINE, (10) 'Mat Group'(017),
SY-VLINE, (13) 'Order Qty'(018),
SY-VLINE, (11) 'Net Price'(019),
SY-VLINE, (10) 'Price Unit'(020),
SY-VLINE, (13) 'Net Value'(021),
SY-VLINE, (8) 'Bus Area'(022),
SY-VLINE, (10) 'Vendor'(023),
SY-VLINE, (28) 'Vendor Name'(024),
*--IR details
SY-VLINE, (10) 'IR-Mat Doc'(025),
SY-VLINE, (5) 'IR-It'(026),
SY-VLINE, (9) 'IR-Post dt'(027),
SY-VLINE, (13) 'IR-Quantity'(028),
*--GR details
SY-VLINE, (10) 'GR-Mat Doc'(029),
SY-VLINE, (5) 'GR-It'(030),
SY-VLINE, (9) 'GR-Post dt'(031),
SY-VLINE, (13) 'GR-Quantity'(032), SY-VLINE.
FORMAT COLOR OFF.
ULINE AT /1(300).
ENDFORM. " PAGE_HEADER
*& Form SCREEN_VALIDATIONS
Selection screen validations
FORM SCREEN_VALIDATIONS .
*--Validation for G/L Account No
IF NOT S_SAKTO IS INITIAL.
SELECT SAKNR UP TO 1 ROWS
INTO EKKN-SAKTO
FROM SKA1 WHERE
SAKNR IN S_SAKTO.
ENDSELECT.
IF SY-SUBRC <> 0.
MESSAGE E001(ZZ) with 'Please enter a valid G/L Account no'(048).
ENDIF.
ENDIF.
*--Validation for Excel file path
IF P_EXCEL = 'X'.
IF C_FILE = ' '.
MESSAGE E001(ZZ) with 'Please enter a valid Excle Path'(035).
ENDIF.
ENDIF.
ENDFORM. " SCREEN_VALIDATIONS
*& Form DISPLAY_PODATA
To Display Purchasing Document details
FORM DISPLAY_PODATA .
FORMAT COLOR 2.
SORT IT_FINAL BY EBELN EBELP AEDAT BUKRS WERKS.
LOOP AT IT_FINAL.
WRITE : / SY-VLINE ,(10) IT_FINAL-EBELN, "Purchasing Doc
SY-VLINE, (5) IT_FINAL-EBELP, "Item
SY-VLINE, (10) IT_FINAL-AEDAT, "Created On
SY-VLINE, (7) IT_FINAL-ERNAM, "Created By
SY-VLINE, (10) IT_FINAL-MATNR, "Material
SY-VLINE, (6) IT_FINAL-BUKRS, "Company code
SY-VLINE, (5) IT_FINAL-WERKS, "Plant
SY-VLINE, (10) IT_FINAL-MATKL, "Material Group
SY-VLINE, (13) IT_FINAL-MENGE, "#EC UOM_IN_MES
"Order Qty
SY-VLINE, (11) IT_FINAL-NETPR, "#EC UOM_IN_MES
"Net Price
SY-VLINE, (10) IT_FINAL-PEINH, "#EC UOM_IN_MES
"Price Unit
SY-VLINE, (13) IT_FINAL-NETWR, "#EC UOM_IN_MES
"Net Value
SY-VLINE, (8) IT_FINAL-GSBER, "Bus Area
SY-VLINE, (10) IT_FINAL-LIFNR, "Vendor
SY-VLINE, (28) IT_FINAL-NAME1, "Vendor name
*--IR details
SY-VLINE, (10) IT_FINAL-IR_BELNR, "IR-Mat Doc
SY-VLINE, (5) IT_FINAL-IR_BUZEI, "IR-It
SY-VLINE, (9) IT_FINAL-IR_BUDAT, "IR-Post dt
SY-VLINE, (13) IT_FINAL-IR_MENGE, "#EC UOM_IN_MES
"IR-Quantity
*--GR details
SY-VLINE, (10) IT_FINAL-GR_BELNR, "GR-Mat Doc
SY-VLINE, (5) IT_FINAL-GR_BUZEI, "GR-It
SY-VLINE, (9) IT_FINAL-GR_BUDAT, "GR-Post dt
SY-VLINE, (13) IT_FINAL-GR_MENGE, SY-VLINE.
"#EC UOM_IN_MES
"GR-Quantity
ENDLOOP.
FORMAT COLOR OFF.
ENDFORM. " DISPLAY_PODATA
*& Form DOWN_LOAD_TO_EXCEL
text
FORM DOWN_LOAD_TO_EXCEL .
<b>REFRESH FIELDNAMES.
FIELDNAMES-TEXT = TEXT-010.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = TEXT-011.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = TEXT-012.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = 'Created By'(036).
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = TEXT-014.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = 'Company Code'(037).
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = TEXT-016.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = 'Material Group'(038).
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = 'Order Quantity'(039).
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = TEXT-019.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = TEXT-020.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = TEXT-021.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = 'Business Area'(040).
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = TEXT-023.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = TEXT-024.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = 'IR Material Doc'(041).
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = 'IR Item'(042).
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = 'IR Posting Date'(043).
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = TEXT-028.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = 'GR Material Doc'(044).
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = 'GR Item'(045).
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = 'GR Posting Date'(046).
APPEND FIELDNAMES.CLEAR FIELDNAMES.
FIELDNAMES-TEXT = TEXT-032.
APPEND FIELDNAMES.CLEAR FIELDNAMES.
*--FM to download data to Excel sheet
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = C_FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = IT_FINAL
FIELDNAMES = FIELDNAMES
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
GUI_REFUSE_FILETRANSFER = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE E001(ZZ) WITH 'Data could not downloaded'(047).
ENDIF.</b>ENDFORM. " DOWN_LOAD_TO_EXCEL
*& Form GET_FINAL_DATA
To Populate required data in final internal table
FORM GET_FINAL_DATA .
CLEAR IT_FINAL.
REFRESH IT_FINAL.
LOOP AT IT_POITEM.
CLEAR IT_POHEADER.
READ TABLE IT_POHEADER WITH KEY EBELN = IT_POITEM-EBELN.
IF SY-SUBRC = 0.
MOVE : IT_POHEADER-EBELN TO IT_FINAL-EBELN, "Purchasing Doc
IT_POITEM-EBELP TO IT_FINAL-EBELP, "Item
IT_POHEADER-AEDAT TO IT_FINAL-AEDAT, "Created On
IT_POHEADER-ERNAM TO IT_FINAL-ERNAM, "Created By
IT_POITEM-MATNR TO IT_FINAL-MATNR, "Material
IT_POITEM-BUKRS TO IT_FINAL-BUKRS, "Company code
IT_POITEM-WERKS TO IT_FINAL-WERKS, "Plant
IT_POITEM-MATKL TO IT_FINAL-MATKL, "Material Group
IT_POITEM-MENGE TO IT_FINAL-MENGE, "Order Qty
IT_POITEM-NETPR TO IT_FINAL-NETPR, "Net Price
IT_POITEM-PEINH TO IT_FINAL-PEINH, "Price Unit
IT_POITEM-NETWR TO IT_FINAL-NETWR, "Net Value
IT_POHEADER-LIFNR TO IT_FINAL-LIFNR. "Vendor
*--To Insert IR details
CLEAR IT_HISTORY.
READ TABLE IT_HISTORY WITH KEY EBELN = IT_POITEM-EBELN
EBELP = IT_POITEM-EBELP
VGABE = '2'
BEWTP = 'Q'.
IF SY-SUBRC = 0.
MOVE :
IT_HISTORY-BELNR TO IT_FINAL-IR_BELNR, "IR-Number of Mat Doc
IT_HISTORY-BUZEI TO IT_FINAL-IR_BUZEI, "IR-Item in mat Doc
IT_HISTORY-BUDAT TO IT_FINAL-IR_BUDAT, "IR-Posting date
IT_HISTORY-BUDAT TO IT_FINAL-IR_MENGE. "IR-Quantity
ENDIF.
*--To insert GR details
CLEAR IT_HISTORY.
READ TABLE IT_HISTORY WITH KEY EBELN = IT_POITEM-EBELN
EBELP = IT_POITEM-EBELP
VGABE = '1'
BEWTP = 'E'.
IF SY-SUBRC = 0.
MOVE :
IT_HISTORY-BELNR TO IT_FINAL-GR_BELNR, "IR-Number of Mat Doc
IT_HISTORY-BUZEI TO IT_FINAL-GR_BUZEI, "IR-Item in mat Doc
IT_HISTORY-BUDAT TO IT_FINAL-GR_BUDAT, "IR-Posting date
IT_HISTORY-BUDAT TO IT_FINAL-GR_MENGE. "IR-Quantity
ENDIF.
*--To insert Vendor details
CLEAR IT_VENDOR.
READ TABLE IT_VENDOR WITH KEY LIFNR = IT_POHEADER-LIFNR.
IF SY-SUBRC = 0.
MOVE : IT_VENDOR-NAME1 TO IT_FINAL-NAME1.
ENDIF.
*--To insert Business area
CLEAR IT_BUSINESS.
READ TABLE IT_BUSINESS WITH KEY EBELN = IT_POITEM-EBELN
EBELP = IT_POITEM-EBELP.
IF SY-SUBRC = 0.
MOVE : IT_BUSINESS-GSBER TO IT_FINAL-GSBER.
ENDIF.
APPEND IT_FINAL.
CLEAR IT_FINAL.
ENDIF.
ENDLOOP.
ENDFORM. " GET_FINAL_DATA
thanks
Sunil -
Problem while exporting ALV column header to excel sheet.
Hi,
I am able to export an ALV grid details to an excel sheet. But the ALV column headers when exported to excel sheet are getting truncated.
For eg: if my column header in ALV grid is displayed as 'Material' then the column header in excel sheet is 'Mater' only. Remaining portion is getting truncated.
How can I view the entire column header text?
Kindly assist.
Thanks.I have the same problem with you, when user export to excel. I fixed it by using
w_layo-colwidth_optimize = 'X'. <<<<<<<<<<<<This
perform generate_fcat_reftab
using 'PRUEFLOS' 'T_INPUT' '' '' 'Inspection Lot' 0.
form generate_fcat_reftab using p_fieldname
p_tabname
p_ref_tabname
p_ref_fieldname
p_output_text
p_output_lenght.
clear w_fcat.
w_fcat-fieldname = p_fieldname.
w_fcat-tabname = p_tabname.
w_fcat-ref_fieldname = p_ref_fieldname.
w_fcat-ref_tabname = p_ref_tabname.
w_fcat-seltext_s = p_output_text.
w_fcat-seltext_m = p_output_text.
w_fcat-seltext_l = p_output_text.
w_fcat-outputlen = p_output_lenght.
w_fcat-ddictxt = 'L'. <<<<<<<<<<<<<<<<<<This
append w_fcat to t_fcat.
endform. -
Exporting to Excel - How to control Column Heading?
I'm working in SSRS 2012. I have one tablix in the report body. The tablix has both Row and Column Groups.
When rendering in the web browser the report page breaks on a row group. The Repeat Column Headers property is set to "True" so it shows the column headings from page to page.
When rendering in Excel, I want one worksheet and not separate worksheets so the page break is disabled via the Page Break->Disabled property expression "=IIf(Globals!RenderFormat.Name="EXCELOPENXML", True, False)".
This is all good but the Column Headings only show up once at the very top in the excel worksheet.
Is it possible to make the Column Headings repeat with each tablix data region as it is rendered vertically down the worksheet?
OR is there a way from SSRS to set the Excel property "Rows to Repeat at top" to include Column Heading; by default the SSRS Report's header is repeated in Excel, but can the number of rows be changed to include the Column Heading?
OR is there some other work around?
Thanks for your help.
MarkThanks for the reply Wendy.
You addressed my second question ... "is there a way from SSRS to set the Excel property "Rows to Repeat at top" to include Column Heading; by default the SSRS Report's header is repeated in Excel, but can it be changed to include the Column Heading?
Based on your response, the only way to freeze the column header in excel is to freeze or split panes AFTER export to excel. well booo but I have to accept that I guess.
My first question is what I really want to do, which is to physically repeat the Column Heading in the excel rendering. I included two pictures demonstrate what I want ...
1) the standard SSRS report rendered in Excel ... Column Headings are shown once:
Standard Export to Excel
Year
Region
Category
2011
2012
2013
Total
East
Sales
10
20
30
60
Expenses
8
20
10
38
Profit
2
0
20
22
West
Sales
8
16
24
48
Expenses
6
16
8
30
Profit
2
0
16
18
2) what I'd like to see rendered in Excel ... which is to repeat the headers as you scroll down the page
Desired Export to Excel
Year
Region
Category
2011
2012
2013
Total
East
Sales
10
20
30
60
Expenses
8
20
10
38
Profit
2
0
20
22
Year
Region
Category
2011
2012
2013
Total
West
Sales
8
16
24
48
Expenses
6
16
8
30
Profit
2
0
16
18
Thanks again for your help,
Mark -
Download internal table data into excel sheet with column heading and data
Hi,
I am having one internal table with column headings and other table with data.
i want to download the data with these tables into an excel sheet.
It should ask the user for file name to save it on their own name. They should give the file name in runtime and it should be downloaded into an excel sheet.
Can anyone tell what is the right function module for downloading these two internal table data with column heading and data.
what we have to do for storing the file name in runtime.
Can anyone help me on this.
Thanks,
Rose.Hi Camila,
Try this
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = PATH2
FILETYPE = 'XLS'
TABLES
DATA_TAB = IT_DATA
FIELDNAMES = IT_HEADINGS
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22 -
Post Author: blofrese
CA Forum: Exporting
I am using Crystal XI and need to output several columns worth of data. Do to so I attempted to have the data presented in 2 rows within the same section.
Example:Page Header b contains: 7 columns 5 columns
Details a contains: 7 columns 5 columns
When exporting to excel data only I only see the bottom 5 column header info and all the detail data in the correct order. How do I get all the Headers to display on the export file?
Thank you for your time.Post Author: jw1234
CA Forum: Exporting
I have the same problem. Have you find the solution yet??
I'm trying to export as Excel data only and have 2 page header band. It only display the 2nd band with the bottom label. None of the 1st band shows up.
Page Header a contains:Report TitleDate Range
Page Header b contains:Dept Name4 columns
Please help. Thanks! -
How to import all column heading of excel to oracle 6i forms(no rows).
hello,
I am new to oracle forms.
There are so many links for importing and exporting data from forms to excel and excel to forms.
But i want to import all column heading of excel to form (no rows). I am using forms 6i.
please help me for the same.
Thank You.
Edited by: sam8682 on Apr 9, 2013 5:48 AM
Edited by: sam8682 on Apr 9, 2013 5:50 AMReading from any file is always done in a loop through the records. So, just loop only once. That will give you the first record only.
If you have some code already you can modify it to something like:
for i in 1..1 loop
end loop; -
Excel 2013 Column Header hidden
I have deployed Office 2013 part of the Office 365 E3 package and one user can't see the column header (A,B,C,etc..). It initially shows but then gets covered up by the menu bar. If I zoom the document to >200% I can begin to see the column
headings.
http://maxiummultimedia.com/upload/normal_zoom.jpg
http://maxiummultimedia.com/upload/200pct_zoom.jpg
How can this be fixed?
Thanks,
ShawnTry View Tab > Show/Hide > Headings.
Or try File > Options > Advanced Tab > Display options for this worksheet section and untick/tick "Show row and column headers"
I notice that you've install the add-ins in Excel, please type "Excel.exe /safe" in Windows Search Bar to launch Excel without add-ins to check the result.
Besides, update the VGA Driver to the latest version is also proposed. Thanks.
Tony Chen
TechNet Community Support -
Excel like 'Freeze column header' functionality in sharepoint OOB list view webpart
Hi,
I have OOB external list dropped on a page as listview webpart. It contains many records and hence while scrolling down headers are no available, hence it should freeze all column headers while scrolling down the page. Its directly dragged and dropped
on site page hence no server side formatting can be done.
Is there any way we can apply some client side script to freeze column headers to listview webpart while scrolling down? or any settings that can be done to acheive this?
Thanks in advance.
Regards,
RahulHi Rahul,
Normal techniques for freezing the header row of an HTML table tend to fall short when it comes to SharePoint 2010 lists due to the lack of THEAD elements.
You can try something like this, although you may want to test it in various browsers in case the column heading alignment is off.
<style>
.ms-viewheadertr{background-color:white;}
</style>
<script>
/* wrap the table in a div, set its height, give it scrollbars, and move it down */
var myTable = document.querySelector(".ms-listviewtable");
var wrapperDiv = document.createElement('div');
wrapperDiv.setAttribute("ID","FreezePaneWrapper");
wrapperDiv.setAttribute("style","OVERFLOW: auto; HEIGHT: 400px; padding-top:38px;");
wrapperDiv.appendChild(myTable.cloneNode(true));
myTable.parentNode.replaceChild(wrapperDiv,myTable);
/* Freeze the header row and move it up*/
var headerRow = document.querySelector(".ms-viewheadertr");
document.getElementById("FreezePaneWrapper").style.width = "" + headerRow.scrollWidth + "px";
headerRow.style.width = "" + headerRow.scrollWidth + "px";
headerRow.style.position = "absolute";
headerRow.style.top = ""+(headerRow.offsetTop-39)+"px";
/* Tell the header's columns to be the same width as the cells in the first "alternating" row */
var columns = document.querySelector("table.ms-listviewtable tr.ms-alternating").querySelectorAll("tr>td");
headers = document.querySelectorAll("tr.ms-viewheadertr th");
for(var i = 0; i < headers.length; i++){
if(columns[i].scrollWidth > headers[i].scrollWidth){
headers[i].style.width = ""+columns[i].scrollWidth + "px";
}else{
columns[i].style.width = ""+headers[i].scrollWidth + "px";
</script>
Edit: Also, you may want to inspect the HTML attributes on the external list view to be sure the class names match up with the querySelector parameters above. Specifically, the table should have a class of "ms-listviewtable", the header row should
have a class of "ms-viewheadertr", and rows of alternating background color should have a class of "ms-alternating".
If any of those are different in your case, you may be able to adjust the above code accordingly. -
Adjusting column header length in excel
Hi,
i'm using MS_EXCEL_OLE_STANDARD_DAT to download internal table contents to a spread sheet. im passing another internal table to write headers. however, i realized that this funtion module doesnt allow the length of the column header to be more than column length .
My question may look weird but if there is any other way or FM to overcome this, please let me know.
Thanks,
ravi.Hi,
Use this FM . This looks good and also will solve your purpose. I've given it in a FORM ENDFORM. Just copy and paste it in ur code and make changes in the itab names and field names as needed.
DATA: IT_COLS LIKE GXXLT_V OCCURS 0 WITH HEADER LINE.
DATA: IT_ONLINE LIKE GXXLT_O OCCURS 0 WITH HEADER LINE.
DATA: IT_PRINT LIKE GXXLT_P OCCURS 0 WITH HEADER LINE.
1)Load the actual data into the itab it_qual_com.
2)PERFORM EXCEL_GENERATION.
Bingo this will work. Please award points for the same if this was useful.
<b>Cheers,
Sam.</b>
FORM EXCEL_GENERATION.
IND = 0.
IT_COLS-COL_NAME = 'Emp No'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Name'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Date of Joining'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Confirmed'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Role Code'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Role Description'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Job Band'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Skill'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Additional Weightage'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Progeon Experience(months)'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Prev. Relevant Experience(months)'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Total Experience(months)'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'PU/Dept'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'DU'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Location'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Age'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Date of Birth'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Gender'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Birth Place'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'State'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Nationality'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'PB'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'PSB'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
IT_COLS-COL_NAME = 'Stream Code'.
IND = IND + 1.
IT_COLS-COL_NO = IND.
Append it_cols.
<b> CALL FUNCTION 'XXL_SIMPLE_API'</b>
EXPORTING
N_KEY_COLS = 1
TABLES
COL_TEXT = IT_COLS
<b> DATA = IT_QUAL_COM</b> "data itab
ONLINE_TEXT = IT_ONLINE
PRINT_TEXT = IT_PRINT
EXCEPTIONS
DIM_MISMATCH_DATA = 1
FILE_OPEN_ERROR = 2
FILE_WRITE_ERROR = 3
INV_WINSYS = 4
INV_XXL = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "EXCEL_GENERATION -
Problem gui_download -Data looks messy without proper column header
Dear SDNers,
Scenario:
Using FM GUI_download to download excel file to Presentation server.
Excel file downloads perfecly fine on presentation server with proper column headers when the OS is not XP/Vista.
Issue:
when i run this program on my system having Windows Vista,Excel downloads but the column header is all jumbled up without proper differetation.
Kindly let me know what the the issue could be?
My Effort:
I did some googling and found that in Function Modules GUI_DOWNLOAD and GUI_UPLOAD.
The form of the file name depends on the underlying operating system.
To make your programs portable to different operating systems, we should use the function module FILE_GET_NAME.
which returns the system-dependent name for an abstract file name.
Kindly let me know if this is correct.
Reason am asking is now i dont have access to code and check the same since i dont have authorization.
Regards,
SuryaD.
Edited by: SuryaD on Jan 12, 2010 2:20 PMNo response.So closing the thread.
Maybe you are looking for
-
What's the best way to get Wireless on Satellite 2410-504?
Hi Guys, I hope someone can help...I have a Satellite 2410-504 which is nearly 4 years old pretty good spec for time. I thought it had wireless built in...it has on/off switch and LED light, however I cannot find it in device manager...on removing un
-
Because of security problems with Windows Internet Explorer and Windows XP I may be forced to upgrade to Windows 7 or 8. Are there any problems with CS 6 working with these newer version of windows? Do I have to reinstall CS 6?
-
MacMini as a Media center-questions
I am going to be getting a core solo Mini to be the centerpiece of my entertainment center and using Remote Desktop from my PB if I need to. I will also be getting an external HD to store all the torr... iTunes Music store downloads. For video, I am
-
Testing of SAP BW system after migration from OS Unix to windows
Hi Experts, I am working on a project wherein testing of BW system is required after migration from OS Unix to Windows. If any one has done same set of activities in past or has any idea of this, please share all major test steps required after migra
-
PriorityTask ignored by version 3.6.0 but working with 3.5.3
Hello, The priority task is used for a few entry processors with Coherence 3.5.3 no longer work with 3.6.0. I get a "DEBUG ... Interrupted PartitionedCache, Thread[DistributedCache:LoaderDistributedCache,5,Cluster] " 160 seconds after my processors s