Excel download problem :--- Header data duplicating in unexpected columns
Guys,
I am able to download the data onto Excel with Header data but the Header data duplicating in unexpected columns RHS upto all the line item columns below....Below is partial excerpt...
Please help....
DATA:
BEGIN OF excel_wa,
posnr TYPE vbap-posnr, "Line Item
matnr TYPE vbap-matnr, "Mat#
pmatn TYPE vbap-pmatn, "Pric Mat
zansicat TYPE zmarall-zansicat, "AnsiCat#
zansigrd TYPE zmarall-zansigrd, "Grade
zcurrvaltnarea TYPE zco002-zcurrvaltnarea,"Val Area
zcurrcstusd TYPE zco002-zcurrcstusd, "Cost$
zzbrndnm TYPE mara-zzbrndnm, "Brand
zqedscgrp TYPE zglbprc-zqedscgrp, "QE Disc Grp
mstav TYPE mara-mstav, "Status
prodh TYPE vbap-prodh, "Prod Heir
kwmeng TYPE vbap-kwmeng, "Qty
lprc TYPE konv-kbetr, "List Price ZBP1
sprc TYPE konv-kbetr, "Std Pric ZNAA,ZNAX
netpr TYPE vbap-netpr, "Quot price
mrgn TYPE konv-kbetr, "margin%
END OF excel_wa,
BEGIN OF sema_wa,
posnr LIKE ws-xxlt VALUE 'STRDFT',
matnr LIKE ws-xxlt VALUE 'STRDFT',
pmatn LIKE ws-xxlt VALUE 'STRDFT',
zansicat LIKE ws-xxlt VALUE 'STRDFT',
zansigrd LIKE ws-xxlt VALUE 'STRDFT',
zcurrvaltnarea LIKE ws-xxlt VALUE 'STRDFT',
zcurrcstusd LIKE ws-xxlt VALUE 'STRDFT',
zzbrndnm LIKE ws-xxlt VALUE 'STRDFT',
zqedscgrp LIKE ws-xxlt VALUE 'STRDFT',
mstav LIKE ws-xxlt VALUE 'STRDFT',
prodh LIKE ws-xxlt VALUE 'STRDFT',
kwmeng LIKE ws-xxlt VALUE 'N00ADD',
lprc LIKE ws-xxlt VALUE 'N02ADD',
sprc LIKE ws-xxlt VALUE 'N03ADD',
netpr LIKE ws-xxlt VALUE 'N02ADD',
mrgn LIKE ws-xxlt VALUE 'N00ADD',
END OF sema_wa,
BEGIN OF clhd_wa,
posnr LIKE ws-xxlt VALUE 'LineItem#',
matnr LIKE ws-xxlt VALUE 'Mat#',
pmatn LIKE ws-xxlt VALUE 'VC Mat#',
zansicat LIKE ws-xxlt VALUE 'AnsiCat',
zansigrd LIKE ws-xxlt VALUE 'Grade',
zcurrvaltnarea LIKE ws-xxlt VALUE 'ValnArea',
zcurrcstusd LIKE ws-xxlt VALUE 'Currency',
zzbrndnm LIKE ws-xxlt VALUE 'Brand',
zqedscgrp LIKE ws-xxlt VALUE 'QE disc',
mstav LIKE ws-xxlt VALUE 'Status',
prodh LIKE ws-xxlt VALUE 'Prod Heir',
kwmeng LIKE ws-xxlt VALUE 'Qty',
lprc LIKE ws-xxlt VALUE 'List Pric',
sprc LIKE ws-xxlt VALUE 'St.Disc',
netpr LIKE ws-xxlt VALUE 'Quote Price',
mrgn LIKE ws-xxlt VALUE 'Margin%',
END OF clhd_wa,
BEGIN OF hdtxt1_wa,
vbeln LIKE ws-xxlt VALUE 'Quotation#',
kunnr LIKE ws-xxlt VALUE 'Quote Date',
kvgr3 LIKE ws-xxlt VALUE 'Rep Date',
pltyp LIKE ws-xxlt VALUE 'Pric List Typ & Currency',
waers LIKE ws-xxlt VALUE 'Sold To',
knuma LIKE ws-xxlt VALUE 'Ship To',
datab LIKE ws-xxlt VALUE 'Top Parent',
datbi LIKE ws-xxlt VALUE 'Sales Org/Sales Dist/CPA',
note LIKE ws-xxlt VALUE 'Net Sales',
END OF hdtxt1_wa,
BEGIN OF hdtxt2_wa,
vbeln LIKE ws-xxlt VALUE '',"Quotation#',
kunnr LIKE ws-xxlt VALUE '',"Quote Date',
kvgr3 LIKE ws-xxlt VALUE '',"Rep Date',
pltyp LIKE ws-xxlt VALUE '',"Pric List Typ & Currency',
waers LIKE ws-xxlt VALUE '',"Sold To',
knuma LIKE ws-xxlt VALUE '',"Ship To',
datab LIKE ws-xxlt VALUE '',"Top Parent',
datbi LIKE ws-xxlt VALUE '',"Sales Org/Sales Dist/CPA',
note LIKE ws-xxlt VALUE '',"Net Sales',
END OF hdtxt2_wa.
DATA:
ivbap LIKE STANDARD TABLE OF ivbap_wa,
imat LIKE STANDARD TABLE OF mat_wa,
icurr LIKE STANDARD TABLE OF curr_wa,
ikonv LIKE STANDARD TABLE OF konv_wa,
ivbpa LIKE STANDARD TABLE OF ivbpa_wa,
ikna1 LIKE STANDARD TABLE OF kna1_wa,
iresult LIKE STANDARD TABLE OF result_wa,
*Excel tables
iexcel LIKE STANDARD TABLE OF excel_wa,
isema_wa LIKE gxxlt_s,
it_sema LIKE STANDARD TABLE OF gxxlt_s,
ihkey_wa LIKE gxxlt_h,
it_hkey LIKE STANDARD TABLE OF gxxlt_h,
iotxt_wa LIKE gxxlt_o,
it_otext LIKE STANDARD TABLE OF gxxlt_o,
iptxt_wa LIKE gxxlt_p,
it_ptext LIKE STANDARD TABLE OF gxxlt_p,
ivkey_wa LIKE gxxlt_v,
it_vkey LIKE STANDARD TABLE OF gxxlt_v.
*Field-Symbols
FIELD-SYMBOLS:
<vbap> LIKE ivbap_wa,
<vbpa> LIKE ivbpa_wa,
<mat> LIKE mat_wa,
<sema_wa>,
<clhd_wa>,
<hdtxt1_wa>,
<hdtxt2_wa>.
*Constants
CONSTANTS:
c_auart TYPE vbak-auart VALUE 'AG', "AG = Quotn
c_parvw1 TYPE vbpa-parvw VALUE 'AG',
c_parvw2 TYPE vbpa-parvw VALUE 'WE',
c_parvw3 TYPE vbpa-parvw VALUE 'ZT',
c_kappl TYPE konv-kappl VALUE 'V',
c_kschl1 TYPE konv-kschl VALUE 'ZBP1',
c_kschl2 TYPE konv-kschl VALUE 'ZNAX',
c_kschl3 TYPE konv-kschl VALUE 'ZNAA',
c_psize TYPE i VALUE 65535.
*& SELECTION-SCREEN.
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
SELECT-OPTIONS:
s_vbeln FOR ws-vbeln NO INTERVALS NO-EXTENSION OBLIGATORY.
SELECTION-SCREEN END OF BLOCK a.
*& AT SELECTION-SCREEN.
AT SELECTION-SCREEN.
PERFORM validate_screen_entries.
START-OF-SELECTION.
PERFORM gather_quot_data.
PERFORM gather_mat_data.
PERFORM gather_ansi_data.
PERFORM gather_customer_data.
PERFORM gather_price_data.
PERFORM process_consolidate_data.
TOP-OF-PAGE.
PERFORM write_header_data.
PERFORM write_column_heading.
END-OF-SELECTION.
SET PF-STATUS 'XLS'.
PERFORM display_output.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'XLS'.
LOOP AT iresult INTO result_wa.
CLEAR excel_wa.
excel_wa-posnr = result_wa-posnr.
excel_wa-matnr = result_wa-matnr.
excel_wa-pmatn = result_wa-pmatn.
excel_wa-zansicat = result_wa-zansicat.
excel_wa-zansigrd = result_wa-zansigrd.
excel_wa-zcurrvaltnarea = result_wa-zcurrvaltnarea.
excel_wa-zcurrcstusd = result_wa-zcurrcstusd.
excel_wa-zzbrndnm = result_wa-zzbrndnm.
excel_wa-zqedscgrp = result_wa-zqedscgrp.
excel_wa-mstav = result_wa-mstav.
excel_wa-prodh = result_wa-prodh.
excel_wa-kwmeng = result_wa-kwmeng.
excel_wa-lprc = result_wa-lprc.
excel_wa-sprc = result_wa-sprc.
excel_wa-netpr = result_wa-netpr.
excel_wa-mrgn = result_wa-mrgn.
APPEND excel_wa TO iexcel.
ENDLOOP.
PERFORM set_up_xxl_structures.
PERFORM download_xxl.
WHEN OTHERS.
ENDCASE.
FREE: ivbpa, imat, ikna1, ivbap, ikonv, iresult, ws.
*& Form set_up_xxl_structures
text
FORM set_up_xxl_structures.
REFRESH: it_otext, it_sema, it_hkey, it_vkey.
CLEAR: result_wa, ivbpa_wa, it_otext, ws.
MOVE sy-repid TO ws-title-repid.
MOVE 'Section' TO ws-title-reppart.
WRITE sy-uzeit TO ws-title-uzeit USING EDIT MASK '__:__'.
MOVE ws-title TO ws-xxl-title.
READ TABLE iresult INTO result_wa
WITH KEY vbeln = s_vbeln-low.
READ TABLE ivbpa INTO ivbpa_wa
WITH KEY vbeln = s_vbeln-low
parvw = 'AG'.
CONCATENATE ivbpa_wa-kunnr '/'
ivbpa_wa-name1 INTO ws-soldto.
CLEAR ivbpa_wa.
READ TABLE ivbpa INTO ivbpa_wa
WITH KEY vbeln = s_vbeln-low
parvw = 'WE'.
CONCATENATE ivbpa_wa-kunnr '/'
ivbpa_wa-name1 INTO ws-shipto.
CLEAR ivbpa_wa.
READ TABLE ivbpa INTO ivbpa_wa
WITH KEY vbeln = s_vbeln-low
parvw = 'ZT'.
IF ivbpa_wa-kunnr EQ space.
CLEAR ivbpa_wa.
READ TABLE ivbpa INTO ivbpa_wa
WITH KEY vbeln = s_vbeln-low
parvw = 'AG'.
ENDIF.
CONCATENATE ivbpa_wa-kunnr '/'
ivbpa_wa-name1 INTO ws-tparent.
DO.
CLEAR: isema_wa, ihkey_wa, iotxt_wa, iptxt_wa, ivkey_wa.
ASSIGN COMPONENT sy-index OF STRUCTURE hdtxt1_wa TO <hdtxt1_wa>.
ASSIGN COMPONENT sy-index OF STRUCTURE hdtxt2_wa TO <hdtxt2_wa>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
CASE <hdtxt1_wa>.
WHEN 'Quotation#'.
<hdtxt2_wa> = 'Quotation#'.
WHEN 'Quote Date'.
<hdtxt2_wa> = 'Quote Date'.
WHEN 'Rep Date'.
<hdtxt2_wa> = 'Rep Date'.
WHEN 'Pric List Typ & Currency'.
<hdtxt2_wa> = 'Pric List Typ & Currency'.
WHEN 'Sold To'.
<hdtxt2_wa> = 'Sold To'.
WHEN 'Ship To'.
<hdtxt2_wa> = 'Ship To'.
WHEN 'Top Parent'.
<hdtxt2_wa> = 'Top Parent'.
WHEN 'Sales Org/Sales Dist/CPA'.
<hdtxt2_wa> = 'Sales Org/Sales Dist/CPA'.
WHEN 'Net Sales'.
<hdtxt2_wa> = 'Net Sales'.
ENDCASE.
MOVE : 1 TO ihkey_wa-col_no,
sy-index TO ihkey_wa-row_no,
<hdtxt2_wa> TO ihkey_wa-col_name.
APPEND ihkey_wa TO it_hkey.
CLEAR ihkey_wa.
CASE <hdtxt1_wa>.
WHEN 'Quotation#'.
<hdtxt2_wa> = result_wa-vbeln.
WHEN 'Quote Date'.
WRITE result_wa-erdat TO ws-dat1.
<hdtxt2_wa> = ws-dat1.
WHEN 'Rep Date'.
WRITE result_wa-repdt TO ws-dat2.
<hdtxt2_wa> = ws-dat2.
WHEN 'Pric List Typ & Currency'.
CONCATENATE result_wa-pltyp '/'
result_wa-waers INTO <hdtxt2_wa>.
WHEN 'Sold To'.
<hdtxt2_wa> = ws-soldto.
WHEN 'Ship To'.
<hdtxt2_wa> = ws-shipto.
WHEN 'Top Parent'.
<hdtxt2_wa> = ws-tparent.
WHEN 'Sales Org/Sales Dist/CPA'.
CONCATENATE result_wa-vkorg '/'
result_wa-bzirk '/'
ivbpa_wa-kvgr3
INTO <hdtxt2_wa>.
WHEN 'Net Sales'.
<hdtxt2_wa> = result_wa-netwr.
ENDCASE.
MOVE : 2 TO ihkey_wa-col_no,
sy-index TO ihkey_wa-row_no,
<hdtxt2_wa> TO ihkey_wa-col_name.
APPEND ihkey_wa TO it_hkey.
ENDDO.
DO.
CLEAR: isema_wa, ihkey_wa, iotxt_wa, iptxt_wa, ivkey_wa.
ASSIGN COMPONENT sy-index OF STRUCTURE sema_wa TO <sema_wa>.
IF sy-subrc NE 0.
ASSIGN COMPONENT sy-index OF STRUCTURE clhd_wa TO <clhd_wa>.
IF sy-subrc EQ 0.
MESSAGE e193 WITH 'OFIL Structures out of synch-Contact IT'.
ENDIF.
EXIT.
ENDIF.
ASSIGN COMPONENT sy-index OF STRUCTURE clhd_wa TO <clhd_wa>.
IF NOT <sema_wa> EQ 'NOSHOW'.
ADD 1 TO ws-xxl-tabix.
MOVE: ws-xxl-tabix TO isema_wa-col_no,
<sema_wa>(3) TO isema_wa-col_typ,
<sema_wa>+3(3) TO isema_wa-col_ops,
ws-xxl-tabix TO isema_wa-col_src.
APPEND isema_wa TO it_sema.
IF ws-xxl-tabix LE ws-xxl-vrtkeys.
MOVE: ws-xxl-tabix TO ivkey_wa-col_no,
<clhd_wa> TO ivkey_wa-col_name.
APPEND ivkey_wa TO it_vkey.
ELSE.
ADD 1 TO ws-xxl-attcols.
MOVE: ws-xxl-attcols TO ihkey_wa-col_no,
10 TO ihkey_wa-row_no,
<clhd_wa> TO ihkey_wa-col_name.
APPEND ihkey_wa TO it_hkey.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. " set_up_xxl_structures
*& Form download_xxl
text
-->P_IHQEXCEL text
FORM download_xxl. "TABLES iexcel STRUCTURE excel_wa.
DESCRIBE TABLE iexcel LINES ws-xxl-count.
ws-xxl-from = 1.
ws-xxl-to = c_psize.
DO.
IF ws-xxl-from GT ws-xxl-count.
EXIT.
ENDIF.
IF ws-xxl-to GT ws-xxl-count.
MOVE ws-xxl-count TO ws-xxl-to.
ENDIF.
ADD 1 TO ws-xxl-suffix.
MOVE ws-xxl-suffix TO: ws-xxl-name+6(2),
ws-xxl-title+36(2).
CALL FUNCTION 'XXL_FULL_API'
EXPORTING
n_vrt_keys = ws-xxl-vrtkeys
n_att_cols = ws-xxl-attcols
n_hrz_keys = ws-xxl-hrzkeys
data_starting_at = ws-xxl-from
data_ending_at = ws-xxl-to
filename = ws-xxl-name
header_1 = space
sema_type = 'X'
so_title = ws-xxl-title
TABLES
data = iexcel
hkey = it_hkey
online_text = it_otext
print_text = it_ptext
sema = it_sema
vkey = it_vkey
EXCEPTIONS
data_too_big = 1
file_open_error = 2
file_write_error = 3
inv_winsys = 4
inv_xxl = 5.
CASE sy-subrc.
WHEN 1.
MESSAGE e193 WITH 'dim_mismatch_data'.
WHEN 2.
MESSAGE e193 WITH 'file_open_error'.
WHEN 3.
MESSAGE e193 WITH 'file_write_error'.
WHEN 4.
MESSAGE e193 WITH 'inv_winsys'.
WHEN 5.
MESSAGE e193 WITH 'inv_xxl'.
ENDCASE.
ADD c_psize TO: ws-xxl-from,
ws-xxl-to.
ENDDO.
ENDFORM. " download_xxl
Hello Friend,
You can use GUI_DOWNLOAD FM to get the excel header if that's the only specific requirement.
[Download Excel including header |Download Excel including header;
Hope this helps.
BR,
Suhas
Similar Messages
-
ALV Excel Download problem ( Special Character)
Hi,
I am unable to download completely in XLS format from ALV grid. When i tried in couple of ways there is a special character( " ) in one of the filed. Due to the same Excel download has some problem. I tested by removing those and it worked fine,
Please suggest me to solve the issue.
Thanks,
Bhanu Gattu,Data strings with special characters can not be downloaded into XLS format from ALV grid. In my case, I replaced the special character " with space and I could download the data into excel.
-
ALV to excel download problem through standard tool bar
I am downloading data into excel from ALV , When there are 128 column data in execl coming as 2 row for 1 row of data in alv. This problem is not there for 78 columns report.
Kindly suggest some solution.i think there is a limit to the number of columns for ALV and which is i think 92 ..this can be the cause of the issue
amit -
Hi,
I am trying to download ALV report to excel but the columns in the o/p is appearing in two rows.
THe ALV report has 82 columns in o/p.Is there any restriction on the no of columns that can be downloaded in excel.Please help.
Thanks,
Sutapa.Hi Sutapa,
Kindly go through this link below for ALV Excel Download:
Re: how to view alv grid output in excel format(not downloading to pc)
Hope it helps
Regrds
Mansi -
ALV -Excel download -header & data comming in Different columns
Hi,
I have an ALV report with FM.When I download it to excel through LIST/EXPORT/LOCALFILE some columns are getting messed up (ex: header is in one column and data is comming in different column).
When i do with LIST/EXPORT/SPREADSHEET option it is working fine.
but users want to use the first option only.
I am use FM's in this report.
Regards
PraveenHi
What is the statement you used to dowload data .Check the field catalog that u are passing to downloaad function module.
or check in the debuging mode..
change these options in excel sheet and checkout if it can help u
1. Go to Tools -> Macro -> Security in Excel
2. Select the Trusted Sources tab and ensure that the checkbox titled Trust access to Visual Basic Project is ticked.
3. With the feature switched on, the data is passed to Excel.
check this sample one
TABLES : MAST , "Material to BOM Link
STKO , "BOM Header
MARA . "General Material Data
* Types Begin with TY_ *
TYPES : BEGIN OF TY_MASTER ,
MATNR TYPE MAST-MATNR , "Material Number
WERKS TYPE MAST-WERKS , "Plant
STLAN TYPE MAST-STLAN , "BOM Usage
STLNR TYPE MAST-STLNR , "Bill of material
STLAL TYPE MAST-STLAL , "Alternative BOM
ANDAT TYPE MAST-ANDAT , "Date record created on
AEDAT TYPE MAST-AEDAT , "Date of Last Change
AENAM TYPE MAST-AENAM , "Name of Person Who Changed Object
STLST TYPE STKO-STLST , "BOM status
ZPLP1 TYPE MBEW-ZPLP1 , "Future Planned Price 1
DWERK TYPE MVKE-DWERK , "Delivering Plant (Own or External)
END OF TY_MASTER .
TYPES : MY_TYPE(20) TYPE C.
* Constants Begin with C_ *
* Internal tables Begin with IT_ *
DATA : IT_MASTER TYPE STANDARD TABLE OF TY_MASTER,
WA_MASTER TYPE TY_MASTER .
DATA : IT_HEADER TYPE TABLE OF MY_TYPE.
* Data Begin with W_ *
DATA : W_PTH TYPE RLGRAP-FILENAME.
DATA : W_FILE TYPE RLGRAP-FILENAME.
* Field Symbols Begin with FS_ *
* Select Options Begin with SO_ *
* Parameter Begin with PR_ *
* I N I T I A L I Z A T I O N *
*--- Add Header Fields to Header Table ---
APPEND 'Material Number' TO IT_HEADER .
APPEND 'Plant' TO IT_HEADER .
APPEND 'BOM Usage' TO IT_HEADER .
APPEND 'Bill Code' TO IT_HEADER .
APPEND 'Alternative BOM' TO IT_HEADER .
APPEND 'Created On' TO IT_HEADER .
APPEND 'Changed On' TO IT_HEADER .
APPEND 'Changed By' TO IT_HEADER .
APPEND 'BOM Status' TO IT_HEADER .
APPEND 'Planned Price' TO IT_HEADER .
APPEND 'Delivery Plant' TO IT_HEADER .
IF SY-MANDT = '700'.
W_PTH = '\lkdb01ISDISSoftware DevelopmentsDevelopmentsData FilesSAP DumpsBOM_Available'.
ELSE.
W_PTH = 'C:'.
ENDIF.
* A T S E L E C T I O N S C R E E N *
* s t a r t o f s e l e c t i o n
START-OF-SELECTION.
*--- Load Data to Internal Table ---
* SELECT MAST~MATNR MAST~WERKS MAST~STLAN MAST~STLNR MAST~STLAL MAST~ANDAT MAST~AEDAT MAST~AENAM STKO~STLST
* INTO TABLE IT_MASTER
* FROM MAST
* INNER JOIN STKO ON STKO~STLNR EQ MAST~STLNR
* AND STKO~STLAL EQ MAST~STLAL
* INNER JOIN MARA ON MARA~MATNR EQ MAST~MATNR
* WHERE MARA~MTART LIKE 'ZFG%'
* AND STKO~LKENZ NE 'X'
* AND STKO~LOEKZ NE 'X'
* AND STKO~STLST EQ '1'.
SELECT MAST~MATNR MAST~WERKS MAST~STLAN MAST~STLNR MAST~STLAL MAST~ANDAT MAST~AEDAT MAST~AENAM STKO~STLST MBEW~ZPLP1 MVKE~DWERK
INTO TABLE IT_MASTER
FROM MAST
INNER JOIN STKO ON STKO~STLNR EQ MAST~STLNR
AND STKO~STLAL EQ MAST~STLAL
INNER JOIN MARA ON MARA~MATNR EQ MAST~MATNR
INNER JOIN MBEW ON MBEW~MATNR EQ MAST~MATNR
AND MBEW~BWKEY EQ MAST~WERKS
INNER JOIN MVKE ON MVKE~MATNR EQ MAST~MATNR
WHERE MARA~MTART LIKE 'ZFG%'
AND STKO~LKENZ NE 'X'
AND STKO~LOEKZ NE 'X'
AND STKO~STLST EQ '1'.
IF SY-SUBRC <> 0.
MESSAGE I014(ZLOAD).
ENDIF.
*--- Set Path to Function Module ---
CONCATENATE W_PTH SY-DATUM ' - ' 'BOM_AVAILABLE_PLANT.XLS' INTO W_FILE.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = W_FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = IT_MASTER
FIELDNAMES = IT_HEADER
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_EIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC = 0.
SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N.
MESSAGE I023(ZLOAD) WITH text-001.
ELSE.
MESSAGE I022(ZLOAD) WITH W_FILE. "Errors while downloading.
ENDIF.
END-OF-SELECTION.
SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N.
Reward all helpfull answers
Regards
Pavan
Message was edited by:
Pavan praveen -
Excel download problem.
Hi,
i have developed a report using Dynamic ALV, when i used to save the output to excel, data in the output is matched with the excel. while executing the report in SAP screen it works fine. i have used REUSE_ALV_GRID.for this.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_bypassing_buffer = 'X'
i_buffer_active = ' '
i_callback_program = lv_repid
is_layout = gs_layout
it_fieldcat = gt_fieldcat
it_sort = gt_sort[]
it_events = gt_event
TABLES
t_outtab = <dyn_table>
EXCEPTIONS
program_error = 0
OTHERS = 0.
is there any settings to be done in the excel or should we add any additional parameters for local file?
pointers for this will be helpful.
Regards,
DineshHi,
What is your problem ?
If you don't see anything in Excel after download :
In Excel
first step
- Menu : Tools ->Macros->scurity
go to tab Trusted Publishers and flag Trust acces to Visual Basic Project
second step
allow execution of macro
- Menu : Tools ->Macros->scurity
go to tab security Level and choise medium or Low
Rgds -
ALv to excel download problems
HI friends,
Probelm I'm facing while saving an ALV report to Excel Sheet by clicking
on the 'Save as File Icon' button on the ALV output.=0D
Here data is going into a new Line after 65 columns.I've used Function
Module 'RSAQ_ALV'.This function module is ultimately using
'REUSE_ALV_GRID_DISPLAY' and 'REUSE_ALV_LIST_DISPLAY' function
modules.ALV output I'm getting correctly but when I save this ALV output
to Excel,columns are getting wrapped and going into 2nd row after 65
columns.=0D
Could anybody tell me what could be the reason ?=0D
Thanks,
Sreekanth.G
Moderator message: duplicate post locked.
Edited by: Thomas Zloch on Jul 9, 2010 12:36 PMch_alv_layout-info_fieldname = 'COLOR'. "infofield for listoutput
ch_alv_layout-colwidth_optimize = 'X'.
try commenting the above values.and also check the Fieldcatlog.
Check the issue similar issue was resolve by checking catalog and layout:
[ALV Issue solution|Re: Problem when export ALV.]
Regards,
Gurpreet -
Excel Download problem - Urgent please
Hi All,
I am using 4.6C version.
The user is downloading the ALV output to excel from the output menu
List > Save > File > Spreadsheet >
User tried saving a file to the Local drive and got a "Disk is full" error.
User realized that the export didn't complete (Partial download)
because there wasn't enough disk space to export the report.
User stated that if he had received an error message of some sort, he might have realized the problem.
He didn't receive any kind of errors.
User would like some kind of error message to come up in those situations.
Without an error message, he assumes the reports are acurate and trusts them.
<b>I have analysied and found a exit EXIT_SAPLGRAP_001 which triggres after the popup asking the file path. However this exit doesnot give me the file path</b>.
After this i think i can make use of the class CL_GUI_FRONTEND_SERVICES and method GET_FREE_SPACE_FOR_DRIVE and FILE_GET_SIZE to check for disk space full.
Kindly let me know how to get the file path given in the popup to get it in the exit EXIT_SAPLGRAP_001. Also there was no parameter id for the field.
Thanks for your help.
SenthilSenthil,
"However in this case the sap didnot uses GUI_DOWNLOAD to download instead it uses download FM. "
What "download FM" is 4.6 using then?
The GUI_DOWNLOAD does check for a disk_full situation... I find it hard to believe that SAP made an oversight here.
I believe that the user is not telling the truth to you... or something else happened in that they have not conveyed to you. -
Hi Experts,
I display around 15 fields(columns) in ALV output. When I download it to Excel, it downloads exactly.
Then dynamically, when I increase the number of fields to be displayed in ALV it is displaying correctly. But when I download
to excel, half of the fields are coming in one line of excel sheet and remaining fields are coming in the second line of excel.
Why am I not getting all the fields in one line itself in the excel sheet?
Is it a problem in standard ALV?
I am using cl_gui_alv_grid class to display ALV output.
Thanks and regards,
Venkat.Hi!
Which function module you are using for downloading? -
hi,
i am trying to download my report'soutput to excel sheet which is not usual Microsoft excel buit it is OPEN OFFICE.the date format in report is DDMMYY but when downloading to OPEN OFFICE its taking as MMDDYY.so what can be done to retain the date format?
Thanks in advance.hi,
before coming to output change the date format in program dd.mm.yy, so you can down load that.
Regards,
Arjun. -
HS Services vs Excel. Problem with data format.
Hi,
I'm facing a problem after trying to use HS Services to connect an Excel Sheet with Oracle 10G.
I got several columns and I expect all of them to be varchar2 type, whereas Oracle is showing a table using float types in some of them. I am trying to find any difference in excel sheet but haven't seen one yet.
So, this is a brief example of what I am facing in the excel sheet:
Excel Col A B C D E F G H
Data FAMIY COMMON NAME SCIENTIFIC NAME CATEGORY L F C T
Data ANATIDAE Barnacla carinegra Branta bernicla I 0 0 0 0
Data Tarro blanco Tadorna tadorna I 0 1/N 1 1
So, i'm getting columns from E to H like Float(49) in Oracle. They DO contain a 90% of numbers, but it's possible to find some literals like '1/N' or '0/N'.
Any clue?
Thanks in advance and ask for any extra information if needed.HI BluShadow. First of all thank you for the answer.
I've been working on this today and I have reached the solution.
[http://support.microsoft.com/kb/141284/en-us] you can check about the problems that ODBC causes when reading mixed data types in excel.
So solution is, in this case, re-creating (not copying) a new sheet and after making sure all cells have been selected as Text number format, allocate data inside.
In my case, i have decided to make a macro for the process.
Edited by: JSaenz on 14-nov-2011 7:07 -
Problems getting data into a SET Column
I am having a problem with the SET Column storing multiple days of the week. When I submit the form, a link that says function.implode shows up at the top of the page and enters NULL in my Column. Any ideas why? I also had a lot of server side validation that was in this code. I removed all of it thinking that might be the problem, but the same thing is happening either way.
Here is the code:
mysql_select_db($database_connRegister, $connRegister);
$query_getusers = "SELECT * FROM users";
$getusers = mysql_query($query_getusers, $connRegister) or die(mysql_error());
$row_getusers = mysql_fetch_assoc($getusers);
$totalRows_getusers = mysql_num_rows($getusers);
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "sign_form")) {
if (isset($_POST['days_to_play'])) {
$_POST['days_to_play'] = implode(',', $_POST['days_to_play']);
} else {
$_POST['days_to_play'] = 'Monday';
$insertSQL = sprintf("INSERT INTO users (user_name, password, first_name, last_name, address, city, `state`, zip, phone_number, member_since, email, days_to_play, handicap, home_course, play_in_tournaments, casual_compet, hear_about_us, confirm_pass, site_city, text) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['user_name'], "text"),
GetSQLValueString($_POST['password2'], "text"),
GetSQLValueString($_POST['first_name'], "text"),
GetSQLValueString($_POST['last_name'], "text"),
GetSQLValueString($_POST['address'], "text"),
GetSQLValueString($_POST['city'], "text"),
GetSQLValueString($_POST['state'], "text"),
GetSQLValueString($_POST['zip'], "int"),
GetSQLValueString($_POST['phone_number'], "text"),
GetSQLValueString($_POST['member_since'], "defined", 'NOW()'),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['days_to_play'], "text"),
GetSQLValueString($_POST['handicap'], "int"),
GetSQLValueString($_POST['home_course'], "text"),
GetSQLValueString($_POST['play_in_tournaments'], "text"),
GetSQLValueString($_POST['casual_compet'], "text"),
GetSQLValueString($_POST['hear_about_us'], "text"),
GetSQLValueString($_POST['confirm_pass'], "text"),
GetSQLValueString($_POST['site_city'], "text"),
GetSQLValueString($_POST['text'], "text"));
mysql_select_db($database_connRegister, $connRegister);
$Result1 = mysql_query($insertSQL, $connRegister) or die(mysql_error());
$insertGoTo = "golferstats.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));Yes, I had actually already caught my mistake before you sent this. It is
working now. I have 2 more unrelated questions that can't seem to find in
your book.
#1 - I have an updated page separate from the user input page and I want it
to populate the days_to_play record when they open update so they can edit
these days if they want. I can't get it to show what is already selected.
#2 - I have quotes that appear on the page and it works fine and selects
them randomly when the page is accessed, but I want to add a picture(s).
How can I add pictures to a database table and get them to display randomly
with the text I already have?
Thanks for your help. I am enjoying the book! -
Repetition of header in ALV output once excel download is selected
Hi Experts,
I have alv report where I use FM as below
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
is_layout = l_layout
it_fieldcat = lt_fieldcat
it_sort = l_sort
i_save = 'X'
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2. IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
and top of page as below
FORM top-of-page.
* Title
w_header-typ = 'H'.
w_header-info = text-033.
APPEND w_header TO t_header.
CLEAR w_header.
* Report Name
w_header-typ = 'S'.
w_header-key = text-034.
w_header-info = sy-repid.
APPEND w_header TO t_header.
CLEAR w_header.
* Date
w_header-typ = 'S'.
w_header-key = text-035.
CONCATENATE sy-datum6(2) '.'+
sy-datum4(2) '.'+
sy-datum(4) INTO w_header-info.
APPEND w_header TO t_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
ENDFORM. "top-of-page
Its displaying well in output, but when I select excel download, the header is getting printed 4 times in the alv output and in the excel download it is printing twice. Please advise how to keep the header once. Note : I am not using any paging concept, simple header at the top.
Please advise.
Regards,
Kiran.Hi kiran,
While creating top-of-page,
You have to refresh your header internal table before populating it with data i.e,
FORM TOP.
Refresh IT_HEADER -->with this the header text will not get repeatedly printed
WA_HEADER-TYP = 'S'.
WA_HEADER-KEY = TEXT-001.
WA_HEADER-INFO = SY-REPID.
APPEND WA_HEADER TO IT_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'S'.
WA_HEADER-KEY = TEXT-002.
WA_HEADER-INFO = SY-UNAME.
APPEND WA_HEADER TO IT_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'S'.
WA_HEADER-KEY = TEXT-003.
WA_HEADER-INFO = SY-DATUM.
APPEND WA_HEADER TO IT_HEADER.
CLEAR WA_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = IT_HEADER
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM.
Hope it helps you
Regards
Mansi -
Download header data to excell
Hi guru,
I am using gui_download for downloading header data to excell.The probleam i am facing that the field length(so many descriptions) exceeds more than 256 char. so iam unable to download some of data .I want it should display in one line in the excell.
pl..this is my below code.I am only getting up to length 256 char..only.
form DOWNLOAD_COSTS .
TYPES:
BEGIN OF ty_xlhead,
fld(1000) TYPE c, "For header name
END OF ty_xlhead.
DATA: l_name TYPE string.
l_type type char10.
l_name = wk_filename.
l_type = wk_filetype.
Data: l_filename TYPE string,
l_path TYPE string.
l_filename = space.
DATA:
it_xlhead TYPE STANDARD TABLE OF ty_xlhead,
wa_xlhead TYPE ty_xlhead.
data:x_type type string.
data:x_type1 type string.
data:w_type type string.
data:x_tab like table of x_type.
concatenate 'MATERIAL' 'DESCRIPTION' 'STATUS(1)' 'TOTAL COST(1)'
'MATERIAL(1)'
'SUB CONTRACT(1)'
'FREIGHT(1)'
'DUTY(1)'
'MATERIAL HANDLING(1)'
'VOLUME SUPPLY(1)'
'SLIT LOSS(1)'
'SCRAP(1)'
'DIRECT LABOR(1)'
'VARIABLE OVERHEAD(1)'
'FIXED OVERHEAD(1)'
'STATUS(2)'
'TOTAL COST(2)'
'MATERIAL(2)'
'SUB CONTRACT(2)'
'FREIGHT(2)'
'DUTY(2)'
'MATERIAL HANDLING(2)'
'VOLUME SUPPLY(2)'
'SLIT LOSS(2)'
'SCRAP(2)'
'DIRECT LABOR(2)'
'VARIABLE OVERHEAD(2)'
'FIXED OVERHEAD(2)'
into x_type separated by ' '.
*append x_type to x_tab.
CLEAR wa_xlhead.
wa_xlhead-fld = x_type.
APPEND wa_xlhead TO it_xlhead.
CLEAR wa_xlhead.
wa_xlhead-fld = x_type1.
APPEND wa_xlhead TO it_xlhead.
CALL method CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
exporting
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILE_NAME = l_name
WITH_ENCODING =
FILE_FILTER =
INITIAL_DIRECTORY =
prompt_on_overwrite = 'X'
CHANGING
filename = l_filename
PATH = L_PATH
fullpath = l_name
USER_ACTION =
FILE_ENCODING =
EXCEPTIONS
cntl_error = 1
ERROR_NO_GUI = 2
not_supported_by_gui = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL function 'GUI_DOWNLOAD'
exporting
BIN_FILESIZE =
filename = l_name
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
SHOW_TRANSFER_STATUS = ABAP_TRUE
IMPORTING
FILELENGTH =
tables
data_tab = t_down
FIELDNAMES = it_xlhead[]
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
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.I think the only way to achieve this is via OLE (object link enabling).
Look at this:
[SAP OLE|http://help.sap.com/saphelp_nw70/helpdata/EN/59/ae3c98488f11d189490000e829fbbd/content.htm]
Edited by: Micky Oestreich on May 27, 2008 2:42 PM -
Download transparent table data in excel
Hi all
I have ECC 6.0 system. I have a transparent table with 112 fields. Sufficient amount of data is present in that table. I need to download this data into an excel file. But I found there are some inconsistencies:
1. I used SE16. But we know that list output of the SE16 screen is limited to 1023 characters. Hence all the columns are not displayed. In my case it is displaying only 52 columns. Eventhough if we download this using System->List->Save->Local File->Spreadsheet, only those 52 columns are displayed in excel. So this SE16 was out of option.
2. I used SE16n. Here I could see all the 112 columns in the screen. But if I go for Export->Local File->Spreadsheet , each row gets splitted into two rows in excel. Also last few columns are not downloaded. All in all, it is an incomplete download and is not readable. Hence this method is out of option.
3. I used a manual method. In SE16n I copied all the data to the clip board using Ctrl+A and pasted them in a new excel document. The data got copied fully and properly. But the header line was missing.
What could be the solution other than writing a separate ABAP program?
Thanks,
PrasadHi Ankur,
Thanks for the reply.
I agree that there is ALV grid option. But that would result in point (2) I mentioned above. Evnthough, all columns are displayed, the rows gets splitted in excel. Also, last few columns does not get downloaded.
Thanks,
Prasad
Maybe you are looking for
-
Hi, Whenever I try to export the release build I get error from COmpiler during the process that "Error copying application.xml icons: Resource '/Project_Name/bin-release/assets/icons' does not exist." I have specified 4 icons in the -app.xml file o
-
How to terminate guest vm with in progress status in oem 11g
in grid control 11g -->virtual central show: name type status ovm_build1 Guest VM Editing guest :gvm11 status is alway "Editing". but in fact gvm22 status is Runing. virsh # list Id Name State 0 Domain-0 running 3 52_OVM_BUILD1 blocked becaus
-
Hi, I've to extract big volume of data (millions of records) into an ODS. But the problem is, I cannot give selections in the infopackage as there are no fields in data selection tab. If I extract all the data, then ods activation would definately fa
-
I need help in how to open this up@
-
Saved psd file as jpg by accident and closed photoshop.
hi, I have saved my logo as a jpg file instead of psd and closed photoshop, now I do not have any layers to edit my project. Please help me if this is possible to fix.