Excel icon in alv ouput
Hi,
after executing alv report iam not getting the excel icon in the alv toolbar.
please guide me.and the spreadsheet icon is greyed out in the list->expo
HI prakash,
Is that the standard menu you are using or you have set your own pf-status?
In standard menu->list->export->local file->select spread sheet radiobutton.
This will download your data to excel sheet.
Cheers!!
VEnk@
Edited by: Venkat Reddy on Oct 31, 2008 10:25 AM
Similar Messages
-
Microsoft Excel Icon in ALV Grid Report
Hi all,
We have a customized report. When we execute that reports, it open in ALV Grid format. When we choose "Microsoft Excel" Icon to change layout to Excel, it then shows the report in excel without any data.
Can any one please tell me that why there is no data? should i need to do any settings in excel for this?
Please respond.
Best Regards,
AIHi,
Refer these:
Microsoft Excel Icon in ALV Grid Report
Re: Not able display the Excel Icon in ALV List Display
Hope it helps
Regards
Mansi -
ALV toolbar excel icon using REUSE_ALV_GRID_DISPLAY
Hi!
Ive created an ALV with using REUSE_ALV_GRID_DISPLAY. In ALV out put on toolbar Ive excel, sort default icons.
If I sort my ALV on some column and press excel icon one row has got deleted and some column I dont get data in rows (where my rows are more than 20).
If anyone know any SAP not or patch or has faced this problem before please let me know on priority basis.
Please find below SAP support pack info. We are running on ECC6.0.
Software component Release Level Highest Suppost Package Short description of softwar componenet
SAP_BASIS 700 13 SAPKB70013 SAP Basis Component
SAP_ABA 700 13 SAPKA70013 Cross-Application Component
PI_BASIS 2006_1_700 2 SAPKIPYM02 Basis Plug-In (PI_BASIS) 2006_1_700
ST-PI 2005_1_700 5 SAPKITLQI5 SAP Solution Tools Plug-In
SAP_BW 700 15 SAPKW70015 SAP NetWeaver BI 7.0
SAP_AP 700 11 SAPKNA7011 SAP Application Platform
SAP_APPL 600 11 SAPKH60011 Logistics and Accounting
SAP_HR 600 22 SAPKE60022 Human Resources
EA-IPPE 400 11 SAPKGPID11 SAP iPPE
EA-APPL 600 11 SAPKGPAD11 SAP Enterprise Extension PLM, SCM, Financials
EA-DFPS 600 11 SAPKGPDD11 SAP Enterprise Extension Defense Forces & Public Security
EA-FINSERV 600 11 SAPKGPFD11 SAP Enterprise Extension Financial Services
EA-GLTRADE 600 11 SAPKGPGD11 SAP Enterprise Extension Global Trade
EA-HR 600 22 SAPKGPHD22 SAP Enterprise Extension HR
EA-PS 600 11 SAPKGPPD11 SAP Enterprise Extension Public Services
EA-RETAIL 600 11 SAPKGPRD11 SAP Enterprise Extension Retail
FINBASIS 600 11 SAPK-60011INFINBASIS Fin. Basis
MDM_TECH 555_700 4 SAPK-57004INMDMTECH MDM_TECH 555 : Add-On Installation
ECC-DIMP 600 11 SAPK-60011INECCDIMP DIMP
ERECRUIT 600 11 SAPK-60011INERECRUIT E-Recruiting
FI-CA 600 11 SAPK-60011INFICA FI-CA
FI-CAX 600 11 SAPK-60011INFICAX FI-CA Extended
INSURANCE 600 11 SAPK-60011ININSURANC SAP Insurance
IS-CWM 600 11 SAPK-60011INISCWM Industry Solution Catch Weight Management
LSOFE 600 11 SAPK-60011INLSOFE SAP Learning Solution Front-End
IS-UT 600 11 SAPK-60011INISUT SAP Utilities/Telecommunication
IS-PS-CA 600 11 SAPK-60011INISPSCA IS-PUBLIC SECTOR CONTRACT ACCOUNTING
IS-OIL 600 11 SAPK-60011INISOIL IS-OIL
SEM-BW 600 11 SAPKGS6011 SEM-BW: Strategic Enterprise Management
IS-M 600 11 SAPK-60011INISM SAP MEDIA
IS-H 600 11 SAPK-60011INISH SAP Healthcare
ST-A/PI 01J_ECC600 0 - Application Servicetools for ECC 600
Warm Regards
NKMuse grid display instead of list display
in grid you have an icon which display the data in excel-sheet
Regards
Phani -
Downloading records in in excel sheet from ALV.
Hi,
I am downloading Records from ALV GRID DIsplay to Excel sheet but i am unable to get all records that are displayed in ALV report.
I am getting only 73 records if i have only 180
Any inputs please for correctine the error
Regards
Rasheed.hi
you can follow these stapes and get ur work done
go to List > select Export > Spreadsheet or just click the excel icon from the tool bar.This would download the data to excel.
hope this helps
regards
Aakash Banga -
Dear Freinds,
I have a requirement when i have updated the data coming from alv ( using the function module 'REUSE_ALV_GRID_DISPLAY' or REUSE_ALV_LIST_DISPLAY ) . i want to select the checboxes on ALV ouput and execute( i want an additonal standard button) so that the data which is there on the alv output will be updated . Some times i dont want some data for that reason i require some cheboxes .
Could any please help me how to get an additional button on alv Tool bar and the checkboxes along withe the cells.
i have tried using the below code but iam not getting any new icon additonal to that
of the standard icons which are there from the below FM. If iam passing
CALLBACKPF_STATUS_SET = 'PROCESS_USER_COMMANDS' "'ZBUTTON'
i can seen none of the buttons on the tool bar, including the standard buttons are going
please help me .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_interface_check = ' '
i_callback_program = sy-repid
I_CALLBACK_PF_STATUS_SET = 'PROCESS_USER_COMMANDS' "'ZBUTTON'
i_callback_top_of_page = l_c_top_of_page
i_structure_name = c_i_final
is_layout = l_wa_layout
it_fieldcat = l_i_fieldcat
it_sort = l_i_sort[]
it_events = l_i_get_event
TABLES
t_outtab = fp_it_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e131. " Displaying the ALV GRID has failed
ENDIF.
FORM PROCESS_USER_COMMANDS USING RT_EXTAB TYPE SLIS_T_EXTAB
systucomm LIKE syst-ucomm
selfield TYPE slis_selfield.
data : wa_fianl_alv type ty_final.
CASE systucomm.
WHEN '&IC1'.
get cursor field fieldname.
READ TABLE IT_FINAL into wa_fianl_alv INDEX selfield-tabindex.
SET PARAMETER ID 'EMPNP' FIELD wa_fianl_alv-empno .
call Transaction 'PA30' and skip first screen.
SET PF-STATUS 'ZSTANDARD'. " EXCLUDING RT_EXTAB.
ENDCASE.
ENDFORM. " PROCESS_USER_COMMANDS
In the addtion to this i want cheboxes along with the cells so that i can check and then execute ( the additonal button which i want along with ALV Grid).
regards
sriniHi Kumar,
you can get the solution by doing the following way.
This internal has data and will be passed to the ALV function module later.
DATA:BEGIN OF tbl_output OCCURS 0,
check TYPE charx, "-----------CHECK BOX APPEARENCE-----
vbeln LIKE vbak-vbeln, "Sales Doc
posnr LIKE vbap-posnr, "Item-sales Doc
omeng LIKE vbbe-omeng, "Open qty
color_line(04) TYPE c,
END OF tbl_output.
CONSTANTS: c_standard(20) TYPE c VALUE 'STANDARD',
c_user_command TYPE slis_formname VALUE 'USER_COMMAND',
c_pfstatus TYPE slis_formname VALUE 'PF_STATUS_SET',
c_bcgrd LIKE bapibds01-objkey VALUE 'ALV_BACKGROUND'.
Start-of-selection.
Perform get_data. " fetch data from datbase depending on the selection screen params
Perform begin_alv_process.
FORM begin_alv_prcoess.
gv_repid = sy-repid.
* initialize layout
PERFORM initialize_layout USING gs_layout.
* Subroutine to build events
PERFORM f_build_events.
* fill fields to be output
PERFORM fill_field_catalog.
* call ALV function module
PERFORM alv_grid_display.
ENDFORM. " begin_Alv_prcoess }
FORM initialize_layout USING rs_layout TYPE slis_layout_alv.
rs_layout-zebra = c_x. "Striped Pattern
rs_layout-no_keyfix = c_x. "Fix Key columns
rs_layout-max_linesize = 855.
* Name of the field with color
rs_layout-info_fieldname = 'COLOR_LINE'.
ENDFORM. " initialize_layout
FORM fill_field_catalog.
PERFORM build_catalog USING:
'CHECK' 'TBL_OUTPUT' 'CHECK' 'TBL_OUTPUT' 'X' ' ',
'VBELN' 'TBL_OUTPUT' 'VBELN' 'TBL_OUTPUT' ' ' text-005,
'OMENG' 'TBL_OUTPUT' 'OMENG' 'TBL_OUTPUT' 'E' text-008.
ENDFORM. " fill_field_catalog
FORM build_catalog USING p_ref_fieldname
p_ref_table
p_fieldname
p_table
p_check
p_short.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
ls_fieldcat-fieldname = p_fieldname.
ls_fieldcat-tabname = p_table.
ls_fieldcat-seltext_m = p_short.
ls_fieldcat-seltext_l = p_short.
ls_fieldcat-outputlen = p_short.
IF p_check = c_x.
ls_fieldcat-checkbox = c_x.
ls_fieldcat-input = c_x.
ENDIF.
IF p_check = c_e.
ls_fieldcat-input = c_x.
ENDIF.
APPEND ls_fieldcat TO gt_fieldcat.
CLEAR ls_fieldcat.
ENDFORM. " build_catalog
FORM alv_grid_display.
* The order quantities in output report can be edited to print datasheet
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = gv_repid
i_background_id = c_bcgrd
i_callback_pf_status_set = c_pfstatus
i_callback_user_command = c_user_command
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
i_save = 'U'
it_events = tbl_alv_events[]
TABLES
t_outtab = tbl_output
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. " alv_list_display
FORM pf_status_set USING extab TYPE slis_t_extab .
REFRESH extab. CLEAR extab.
SET PF-STATUS 'ZDATASHEET'.
ENDFORM. " PF_STATUS_SET
FORM user_command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
CASE ucomm.
WHEN 'SALL'.
LOOP AT tbl_output.
tbl_output-check = c_x.
MODIFY tbl_output TRANSPORTING check omeng.
ENDLOOP.
WHEN 'DSEL'.
LOOP AT tbl_output.
CLEAR tbl_output-check.
MODIFY tbl_output TRANSPORTING check omeng.
ENDLOOP.
WHEN 'PRNT'.
PERFORM After_output_data.
ENDCASE.
selfield-refresh = c_x.
ENDFORM. " USER_COMMAND
FORM f_build_events.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = tbl_alv_events
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
Add event name for User Command
READ TABLE tbl_alv_events WITH KEY name = slis_ev_user_command
INTO s_evts.
IF sy-subrc = 0.
s_evts-form = c_user_command.
MODIFY tbl_alv_events FROM s_evts
TRANSPORTING form
WHERE name = slis_ev_user_command.
CLEAR s_evts.
ENDIF.
ENDFORM. " f_build_events
Regds
Parvathi -
User unable to view Excel button in ALV grid. Has full authorization
Hi All,
A user in our copany is unable to view Excel button in ALV grid. Has full authorization to S_BDS_DS, S_ALV_LAYOUT.
Please note that this is not the export to Excel button. Its the excel icon which enables the users to view the output in excel format on screen.
I am able to view the Excel Button. can you pls advise what might be the possible root cause.
Are there any authorization objects as well that govern ALV Grid buttons (excel) display.
Please help.
Can we add/delete the buttongs in the ALV grid from somewhere..
Thanks,PhaniHi,
oic, only specific user, not all user.
I have a similar problem with you, but not excel button but inbox button on initial screen (session_manager)
deleting this user and re-create this user solved my problem.
hope it help you.
rgds,
Alfonsus Guritno -
Hi All,
I am displaying a list using FM, "REUSE_ALV_GRID_DISPLAY". In the list when I press the Excel icon, an excel file opens without any data in it. Do I need to take care of data download in my User command during the FM call? If yes, how do I do that?
Thanks.
Pankaj.Hi,
Look at the following sample code...........
CALL FUNCTION <b>'REUSE_ALV_GRID_DISPLAY'</b>
EXPORTING
i_callback_program = i_repid
i_callback_user_command = 'USER_COMMAND_PERNR'
it_fieldcat = header
is_layout = gt_layout
i_callback_top_of_page = 'TOP-OF-PAGE1'
i_grid_title = text-t06
it_sort = gt_sort[]
i_default = 'X'
i_save = 'U'
is_variant = gt_variant
it_events = gt_events
TABLES
t_outtab = ITAB.
clear itab.
endif.
Form TOP-OF-PAGE1
form top-of-page1.
data: header type slis_t_listheader,
wa type slis_listheader. "infield like wa-info, nline type n.
wa1 type slis_listheader,
wa2 type slis_listheader.
TITLE AREA
wa-typ = 'S'.
wa-info = text-t04.
append wa to header.<<<----Header text
******Here you can fill it***********
wa-typ = 'S'.
wa1-typ = 'S'.
wa2-typ = 's'.
write <your field-low> to wa1-info.
write <your field-high> to wa2-info.
concatenate 'Date' wa1-info 'to' wa2-info into wa-info separated by space.
append wa to header.<<<<---Date range i think
wa-typ = 'S'.
concatenate text-t02 sy-UNAME into wa-info separated by space.
append wa to header.<<<--User name
wa-typ = 'S'.
concatenate text-t01 sy-repid into wa-info separated by space.
append wa to header.<<<<---Report name
call function 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = header
i_logo = 'ENJOYSAP_LOGO1'.<<<<---LOGO if needed
endform.
You can check the below links also......
http://www.sapdevelopment.co.uk/reporting/alvhome.htm
ALV
http://www.geocities.com/mpioud/Abap_programs.html
Cheers
ALfred
If this helps you reward with points. -
How to write ICONS in ALV TOP of Page
Hai experts,
How to ICON in ALV Top of PAGE
i want to wrire
ICON_LED_RED for cancellation Invioce
ICON_LED_GREEN for Invioce
but i pass this values to wa_header-info it comes @5C@ @5B@
thanks
sitaramHi...
I think this code is help full for u....
*& Report ZFI_TEST *
REPORT ZFI_ICON_TEST MESSAGE-ID zz .
*& TABLES DECLARATION *
TABLES: vbak.
*& TYPE POOLS DECLARATION *
TYPE-POOLS: slis.
*& INTERNAL TABLE DECLARATION *
DATA: BEGIN OF itab OCCURS 0,
icon TYPE icon-id, "itab-icon = '@08@' -> Green ; '@09@' -> Yellow ; '@0A@' -> Red
vbeln LIKE vbak-vbeln,
audat LIKE vbak-audat,
vbtyp LIKE vbak-vbtyp,
auart LIKE vbak-auart,
augru LIKE vbak-augru,
netwr LIKE vbak-netwr,
waerk LIKE vbak-waerk,
END OF itab.
*INTERNAL TABLE FOR FIELD CATALOG
DATA: wa_fieldcat TYPE slis_fieldcat_alv,
it_fieldcat TYPE slis_t_fieldcat_alv.
IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV
WITH HEADER LINE,
*INTERNAL TABLE FOR EVENTS
DATA: it_event TYPE slis_t_event,
wa_event TYPE slis_alv_event,
*INTERNAL TABLE FOR SORTING
it_sort TYPE slis_t_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv,
*INTERNAL TABLE FOR LAYOUT
wa_layout TYPE slis_layout_alv.
*& VARIABLE DECLARATION *
DATA : v_repid TYPE sy-repid,
v_pagno(4) TYPE n,
v_date(8) TYPE c.
*& CONSTANTS *
CONSTANTS: c_x TYPE c VALUE 'X'.
*& SELECTION SCREEN *
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
s_vbtyp FOR vbak-vbtyp DEFAULT 'C'.
SELECTION-SCREEN: END OF BLOCK b1.
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECTION-SCREEN : BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text-003.
PARAMETERS: p_list RADIOBUTTON GROUP rad1 DEFAULT 'X'.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text-004.
PARAMETERS: p_grid RADIOBUTTON GROUP rad1.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN: END OF BLOCK b2.
AT SELECTION-SCREEN.
PERFORM validate_screen.
*& START OF SELECTION *
START-OF-SELECTION.
CLEAR: itab, itab[].
V_REPID = SY-REPID.
PERFORM get_data.
PERFORM display_data.
*& END OF SELECTION *
END-OF-SELECTION.
*--DO ALV Process
v_repid = sy-repid.
*--Sort the Output Fields
PERFORM sort_fields.
*--Build Field catalog for the Output fields
PERFORM BUILD_FIELDCAT.
*--Set the Layout for ALV
PERFORM set_layout.
*& Form GET_DATA
text
TO GET THE DATA FROM TABLES INTO ITAB
FORM get_data .
SELECT vbeln
audat
vbtyp
auart
augru
netwr
waerk
INTO CORRESPONDING FIELDS OF TABLE itab
FROM vbak
WHERE vbeln IN s_vbeln AND
audat > '04.04.2005'
AND netwr > 0.
LOOP AT itab.
IF itab-netwr < 10000.
itab-icon = '@08@'.
ELSEIF itab-netwr > 10000 AND itab-netwr < 100000.
itab-icon = '@09@'.
ELSEIF itab-netwr > 100000.
itab-icon = '@0A@'.
ENDIF.
MODIFY itab INDEX sy-tabix.
ENDLOOP.
ENDFORM. " GET_DATA
*& Form sort_fields
FORM sort_fields .
CLEAR wa_sort.
wa_sort-fieldname = 'VBTYP'.
wa_sort-spos = '1'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
wa_sort-fieldname = 'NETWR'.
wa_sort-spos = '2'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO it_sort.
ENDFORM. " sort_fields
*& Form set_layout
FORM set_layout .
IF p_list = c_x .
wa_layout-window_titlebar = 'LIST DISPLAY'(016).
wa_layout-zebra = 'X'.
+
+
ALV LIST DISPLAY
PERFORM list_display TABLES itab.
o
+
+ ALV GRID DISPLAY
ELSEIF p_grid = c_x.
wa_layout-window_titlebar = 'GRID DISPLAY'(017).
wa_layout-zebra = 'X'.
PERFORM grid_display TABLES itab.
ENDIF.
ENDFORM. " set_layout
*& Form list_display
FORM list_display TABLES p_itab .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
is_layout = wa_layout
it_fieldcat = it_fieldcat[]
it_sort = it_sort[]
i_save = 'U'
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.
ENDFORM. " list_display
*& Form GRID_DISPLAY
FORM grid_display TABLES p_itab .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
is_layout = wa_layout
it_fieldcat = it_fieldcat[]
it_sort = it_sort[]
it_events = it_event
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.
ENDFORM. " GRID_DISPLAY
*& Form VALIDATE_SCREEN
text
--> p1 text
<-- p2 text
FORM validate_screen .
DATA: lv_vbeln LIKE vbak-vbeln.
IF NOT s_vbeln IS INITIAL.
SELECT vbeln
INTO lv_vbeln
UP TO 1 ROWS
FROM vbak
WHERE vbeln IN s_vbeln.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'INVALID SALES DOC'.
ENDIF.
ENDIF.
ENDFORM. " VALIDATE_SCREEN
*& Form display_data
text
--> p1 text
<-- p2 text
FORM display_data .
DEFINE m_fieldcat.
add 1 to wa_fieldcat-col_pos.
wa_fieldcat-fieldname = &1.
wa_fieldcat-ref_tabname = 'VBAK'.
wa_fieldcat-do_sum = &2.
wa_fieldcat-cfieldname = &3.
append wa_fieldcat to it_fieldcat.
END-OF-DEFINITION.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv.
m_fieldcat 'ICON' '' ''.
m_fieldcat 'VBELN' '' ''.
m_fieldcat 'AUDAT' '' ''.
m_fieldcat 'VBTYP' '' ''.
m_fieldcat 'AUART' '' ''.
m_fieldcat 'AUGRU' '' ''.
m_fieldcat 'NETWR' 'C' 'WAERK'.
m_fieldcat 'WAERK' '' ''.
ENDFORM. " display_data[/code]
Regards,
Rahul
Edited by: Rahul Reddy on Apr 14, 2008 12:33 PM -
How to add Icons to ALV Reprt?
Hi,
I need to display icons (red, yellow) in my ALV Report in the first column in my report.
In my field catalog fieldcat-icon = 'X' has been taken into consideration, but still I am not able to see in my report. In the final internal table that is to display I created a field for this Icon type ICON_D. Is this the correct procedure to work with or else kindly let me know how to proceed?
Regards,
Raghu Ram.This is the code that has been incorporated in order to display Icon in the ALV Report.
* TABLES Declarations *
Tables: PROJ, " Project definition
PRPS, " WBS (Work Breakdown Structure) Element Master Data
ICON.
* TYPE POOLS *
TYPE-POOLS: SLIS, " Globale Typen für generische Listbausteine
ICON.
* ALV Data Declarations *
DATA:
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
GT_REPID TYPE SY-REPID.
* Type Declarations *
TYPES:
* STRUCTURE OF TABLE PROJ
BEGIN OF TY_PROJ,
PSPNR TYPE PROJ-PSPNR,
PSPID TYPE PROJ-PSPID,
POST1 TYPE PROJ-POST1,
OBJNR TYPE PROJ-OBJNR,
VERNR TYPE PROJ-VERNR,
VERNA TYPE PROJ-VERNA,
END OF TY_PROJ,
* STRUCTURE OF TABLE PRPS
BEGIN OF TY_PRPS,
PSPNR TYPE PRPS-PSPNR,
POSID TYPE PRPS-POSID,
POST1 TYPE PRPS-POST1,
OBJNR TYPE PRPS-OBJNR,
PSPHI TYPE PRPS-PSPHI,
VERNR TYPE PRPS-VERNR,
END OF TY_PRPS,
BEGIN OF TY_FINAL,
LIGHT TYPE ICON_D,
PSPNR TYPE PROJ-PSPNR,
PSPID TYPE PROJ-PSPID,
POST1 TYPE PROJ-POST1,
OBJNR TYPE PROJ-OBJNR,
VERNR TYPE PROJ-VERNR,
VERNA TYPE PROJ-VERNA,
PSPNR_1 TYPE PRPS-PSPNR,
POSID TYPE PRPS-POSID,
POST1_1 TYPE PRPS-POST1,
OBJNR_1 TYPE PRPS-OBJNR,
PSPHI TYPE PRPS-PSPHI,
VERNR_1 TYPE PRPS-VERNR,
END OF TY_FINAL.
* Internal Table Declarations *
DATA:
IT_PROJ TYPE STANDARD TABLE OF TY_PROJ,
IT_PRPS TYPE STANDARD TABLE OF TY_PRPS,
IT_FINAL TYPE STANDARD TABLE OF TY_FINAL.
* Work Area Declarations *
DATA:
WA_PROJ TYPE TY_PROJ,
WA_PRPS TYPE TY_PRPS,
WA_FINAL TYPE TY_FINAL.
* Selection Screen *
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME.
SELECT-OPTIONS: S_PSPNR FOR PROJ-PSPNR.
SELECTION-SCREEN END OF BLOCK BLK.
* Start Of Selection *
START-OF-SELECTION.
PERFORM DATA_RETREVIAL.
PERFORM BUILD_FIELDCAT.
PERFORM DISPLAY_ALV.
* Data Retrevial Logic *
*& Form DATA_RETREVIAL
form DATA_RETREVIAL .
DATA: status_icon TYPE icons-text,
icon_name(20) TYPE c,
icon_text(10) TYPE c.
ICON_NAME = 'ICON_RED_LIGHT'.
ICON_TEXT = 'RED'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = ICON_NAME
TEXT = ICON_TEXT
* INFO = ' '
ADD_STDINF = 'X'
IMPORTING
RESULT = STATUS_ICON
EXCEPTIONS
ICON_NOT_FOUND = 1
OUTPUTFIELD_TOO_SHORT = 2
OTHERS = 3
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SELECT PSPNR
PSPID
POST1
OBJNR
VERNR
VERNA
FROM PROJ
INTO TABLE IT_PROJ
WHERE PSPNR IN S_PSPNR.
SELECT PSPNR
POSID
POST1
OBJNR
PSPHI
VERNR
FROM PRPS
INTO TABLE IT_PRPS
FOR ALL ENTRIES IN IT_PROJ
WHERE PSPHI EQ IT_PROJ-PSPNR.
LOOP AT IT_PROJ INTO WA_PROJ.
LOOP AT IT_PRPS INTO WA_PRPS.
WA_FINAL-PSPNR = WA_PROJ-PSPNR.
WA_FINAL-PSPID = WA_PROJ-PSPID.
WA_FINAL-POST1 = WA_PROJ-POST1.
WA_FINAL-OBJNR = WA_PROJ-OBJNR.
WA_FINAL-VERNR = WA_PROJ-VERNR.
WA_FINAL-VERNA = WA_PROJ-VERNA.
WA_FINAL-PSPNR_1 = WA_PRPS-PSPNR.
WA_FINAL-POSID = WA_PRPS-POSID.
WA_FINAL-POST1_1 = WA_PRPS-POST1.
WA_FINAL-OBJNR_1 = WA_PRPS-OBJNR.
WA_FINAL-PSPHI = WA_PRPS-PSPHI.
WA_FINAL-VERNR_1 = WA_PRPS-VERNR.
WA_FINAL-light = STATUS_ICON.
APPEND WA_FINAL TO IT_FINAL.
CLEAR: WA_FINAL.
ENDLOOP.
ENDLOOP.
endform. " DATA_RETREVIAL
* Field Catalog *
*& Form BUILD_FIELDCAT
form BUILD_FIELDCAT .
* DATA: FIELDCAT TYPE GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'LIGHTS'.
GT_FIELDCAT-SELTEXT_M = 'STAUTS'.
GT_FIELDCAT-COL_POS = 0.
GT_FIELDCAT-ICON = 'X'.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'PSPNR'.
GT_FIELDCAT-SELTEXT_M = 'PROJECT DEFINITION(INTERNAL)'.
GT_FIELDCAT-COL_POS = 1.
GT_FIELDCAT-OUTPUTLEN = 8.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'PSPID'.
GT_FIELDCAT-SELTEXT_M = 'PROJECT DEFINITION'.
GT_FIELDCAT-COL_POS = 2.
GT_FIELDCAT-OUTPUTLEN = 24.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'POST1'.
GT_FIELDCAT-SELTEXT_M = 'PROJECT DESC'.
GT_FIELDCAT-COL_POS = 3.
GT_FIELDCAT-OUTPUTLEN = 40.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'OBJNR'.
GT_FIELDCAT-SELTEXT_M = 'Object number'.
GT_FIELDCAT-COL_POS = 4.
GT_FIELDCAT-OUTPUTLEN = 22.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'VERNR'.
GT_FIELDCAT-SELTEXT_M = 'Responsible Person'.
GT_FIELDCAT-COL_POS = 5.
GT_FIELDCAT-OUTPUTLEN = 8.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'VERNA'.
GT_FIELDCAT-SELTEXT_M = 'Responsible Person Desc'.
GT_FIELDCAT-COL_POS = 6.
GT_FIELDCAT-OUTPUTLEN = 25.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'PSPNR_1'.
GT_FIELDCAT-SELTEXT_M = 'WBS Element'.
GT_FIELDCAT-COL_POS = 7.
GT_FIELDCAT-OUTPUTLEN = 8.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'POSID'.
GT_FIELDCAT-SELTEXT_M = 'WBS Element'.
GT_FIELDCAT-COL_POS = 8.
GT_FIELDCAT-OUTPUTLEN = 24.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'POST1_1'.
GT_FIELDCAT-SELTEXT_M = 'WBS DESC'.
GT_FIELDCAT-COL_POS = 9.
GT_FIELDCAT-OUTPUTLEN = 40.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'OBJNR_1'.
GT_FIELDCAT-SELTEXT_M = 'Object number'.
GT_FIELDCAT-COL_POS = 10.
GT_FIELDCAT-OUTPUTLEN = 22.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'PSPHI'.
GT_FIELDCAT-SELTEXT_M = 'Currnet Projct'.
GT_FIELDCAT-COL_POS = 11.
GT_FIELDCAT-OUTPUTLEN = 8.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
GT_FIELDCAT-FIELDNAME = 'VERNR_1'.
GT_FIELDCAT-SELTEXT_M = 'Responsible Person'.
GT_FIELDCAT-COL_POS = 12.
GT_FIELDCAT-OUTPUTLEN = 8.
APPEND GT_FIELDCAT TO GT_FIELDCAT.
CLEAR GT_FIELDCAT.
endform. " BUILD_FIELDCAT
* Display ALV Grid *
*& Form DISPLAY_ALV
form DISPLAY_ALV .
GT_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = GT_REPID
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT =
IT_FIELDCAT = GT_FIELDCAT[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_FINAL
* 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.
endform. " DISPLAY_ALV -
Exporting SAP report to Excel 2003 - cannot use Excel icon
Good morning folks
We have recently installed Excel 2003 and since then we are unable to export reports from SAP (eg ad hoc query) directly into Excel by clicking on the Excel icon - a blank Excel screen is displayed. Any assistance please.
We are still able to export to Excel by clicking on the Print Preview icon and then clicking on the Excel icon.
many thanks
DawnMy users misled me! They were not exporting directly to Excel at all but instead to Excel embedded in the SAP Gui! I have managed to get them to do this again by changing the security settings on Excel as follows: Tools > Macro > security settings - changed from Low to Medium and ticked both boxes in Trusted Publishers.
-
Need help in attaching Excel files to emails......Excel spreadsheet created yesterday cannot be located to attach? The file can be located by entering the Excel icon but not visable when creating an email and attempting to attach.....seems to only inpact newly created files?
Support - Office.com - Microsoft
-
Download to Excel Function in ALV
Hai Friends,
I am using the following methods to download the report to an Excel Sheet from ALV.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
CALL FUNCTION 'GUI_DOWNLOAD'
The report is downloaded to Excel but the Column names are not displayed. It is displaying as F1, F2, F3..................
How can i solve this?.Hi,
Please check with the sample code below:
*"Excel sheet header
CLEAR e_excel.
MOVE text-001 TO e_excel-var1.
MOVE text-002 TO e_excel-var2.
APPEND e_excel TO t_excel.
CLEAR e_excel.
UNASSIGN <fs_t_final>.
REFRESH t_excel.
LOOP AT t_final
ASSIGNING <fs_t_final>.
CHECK <fs_t_final> IS ASSIGNED.
*"Data continued after the header part
MOVE <fs_t_final>-var1 TO e_excel-var1.
MOVE <fs_t_final>-var2 TO e_excel-var2.
APPEND e_excel TO t_excel.
CLEAR e_excel.
data: w_savetitle TYPE string,
w_filname TYPE string,
w_filename TYPE string,
w_path TYPE string,
w_fpath TYPE string.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = w_savetitle
CHANGING
filename = w_filname
path = w_path
fullpath = w_fpath
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = w_filename
filetype = ASC
write_field_separator =
codepage =
TABLES
data_tab = t_excel
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. -
Excel download from ALV not working inproduction
Hi all,
I am using "set_table_for_first_display" for alv display. the excel download from alv is woking fine in development and quality stystem but in production only first 3-4 rows are getting downloaded. Other rows donot appear in excel.
Any Idea !!!
Thanks
MadhuHi Experts,
I have noticed that same problem is occuring in development system also with same set of data . The ascii file created has some missing rows. I guess its due to some special characters though i am not able to see any special character . Any solution for this.
Regs
madhu -
How to show icons in ALV grid ...
Hi guyz ,
A lill query ....
In an ALV gird ,if i need to display icons in one of the columns , say i have
a field called Status , where i need show some icons like green , yellow and
red circles , depending on some other fileds say invoice reciept date .
So can i get icons in ALV colums.
Please advise .
Thanks
JahanThis is very easy. IN your status field in your internal table, you simply write the icon to it. Make sure that the status field is defined as a character field with a length of 4. Then write the icon to it.
Type-pools: icon.
write icon_green_light as icon to itab-status.
Then when filling the field catalog, set the ICON flag. This puts the icon in the center of the cell in ALV.
xfc-icon = 'X'.
append xfc to ifc.
Regards,
Rich Heilman -
Addiing additional data in header of excel output of alv excel dowload.
Hi Experts,
I want to set(print) some additional data in header(with table header) of excel output of alv standard functionality(Export to Microsoft Excel) in webdynpro abap.
any suggesions...
Reg,
Rajesh.OLE is the solution but not very performance oriented. Search for details in SDN
Maybe you are looking for
-
Sales Order No is not accepting when we doing down Payment through F-29
Hi All, when we are doing customer down Payment thru F-29, system is not accepting sales order number in sales order feild itself. if we enter quation or enqiry number system is accepting and posting, if we put sales order number feild empty also it
-
I have been having a problem with my IPOD mini since 2007 and figured since it was past warranty why bother. But I now want to know the answer since my other IPODs are doing it now. It indicates that it needs to be charged, I charge it until it reac
-
I am new to SAP and BW. A goal of mine, straight from my GEM form, is to "Increase my knowledge of the security in the SAP application by understanding SAP roles and how they apply to Business Warehousing". Please point me to websites, books, white
-
Lead Status Field Updation Using Workflows
Hi, Could anyone suggest me how to update Lead Status field using workflows since that field not visible at the workflow level. we can update using Lead Qualification Script . Is there any other way other then qualification script. Any help would be
-
While i am posting asset purchase i am getting the following error?what could be reason? Quantity and unit of measurement are not consistent Message no. F5638 Diagnosis Quantity was entered without a unit of quantity or vice versa. System Response In