Excel sheet - Planning function
Hello,
I don't know if this is the best place to put this topic but i don't know where to put it.
It's like this, i have a planning function in SAP BW that shows some data in a excel worksheet. i pass a month and he makes that worksheet. What i want is to in the excel sheet i have a line that says all the months and in lhe line under i have a value for each month. I want to lock the cells of the values that are associated to the months that have passed.
like this:
i pass to the planning folder the month 4(Apr) and i want that when the excel sheet shows up, the values corresponding to month 1(jan),2(fev) and 3(mar) appers locked.
thanks,Ricardo
You can use data slices to create this functionality. Simply create a data slice on 0FISCPER 001.2006-003.2006 and you're done. Everything that falls under a data slice can only be displayed but not changed by BPs functionality.
P.S.: Next time you should use the BPS forum for this kind of question.
Best regards
Dirk
Similar Messages
-
Function types for Balance Sheet Planning missing in SEM-BPS 6.0
Hi BPS experts,
After upgrading our BI-system from SEM 4.0 to SEM 6.0 (level 10) as part of the upgrade from BW 3.5 to BI 7.0 (level 15), the BPS function types for balance sheet planning are not available in the planning environment (Transaction code BPS0).
According to the SAP Library the balance sheet planning functions in SEM-BPS comprises of 6 standard function types - one of them is "Depreciation":
<a href="http://help.sap.com/saphelp_sem60/helpdata/en/0a/242537cedf2056e10000009b38f936/frameset.htm">help.sap.com -> Business Planning and Simulation (BW-BPS)</a>
Menu path: Business Planning Functions -> Functions for Balance Sheet Planning
In our existing SEM 4.0 we are using "Depreciation" and the functions based on this function type are of course short dumping when executed in our upgraded system (SEM 6.0) as the function type does not exist here.
Odd though - we do have the function type "Allocation" available in SEM 6.0, which should be delivered with SEM together with the Balance Sheet Planning function types (It is listed directly under "Business Planning Functions" in the SAP Library) .
I have tried to figure out whether we missed out on activating something during or after the system installation, but our basis consultant has not found anything in the installation guides related to this issue. Also I was wondering whether it could be a simple matter of activating some Business Content but without any luck.
Does anybody know why the Balance Sheet Function Types are not available in SEM-BPS 6.0?
Kind regards,
Lars
PS: Our system status is:
SAP_ABA 700 0013 SAPKA70013 Cross-Application Component
SAP_BASIS 700 0013 SAPKB70013 SAP Basis Component
PI_BASIS 2005_1_700 0013 SAPKIPYJ7D PI_BASIS 2005_1_700
ST-PI 2005_1_700 0005 SAPKITLQI5 SAP Solution Tools Plug-In
SAP_BW 700 0015 SAPKW70015 SAP NetWeaver BI 7.0
FINBASIS 600 0010 SAPK-60010INFINBASIS FINBASIS 600 : Add-On Supplement
SEM-BW 600 0010 SAPKGS6010 SEM-BW 600 : Add-On Supplement
BI_CONT 703 0007 SAPKIBIIP7 Business Intelligence Content
Message was edited by:
Lars B RasmussenHi Lars,
It seems not all the planning function from SEM BPS are available in BW BPS. Please check the links below: -
what is the difference between BW 3.5 BPS and SEM BPS 4.0
BW- BPS and SEM- BPS
SEM-BPS VS BW-BPS
BCS Doc
Regards,
SK -
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 -
Encountering problems with exporting complex excel sheets to SWF
Please help me with this problem:
I have a complex Excel sheet, with functions like VERT.LOOKUP, INDEX etc. This should work in Xcelsius, but I have problems when having a preview in SWF. In the Xcelsius Present 2008 drawing window, all buttons work perfectly, but when I preview it, all outcomes are gone (buttons do work).
When removing VERT.LOOKUP and table shortnames (see example) it sometimes does work. So my guess is that SWF does not support VERT.LOOKUP and/or table shortnames. Does anyone know anything about this problem and maybe can help me? I use the 30-day trial version of Xcelsius Present.
Table example:
_______PROD1____PROD2____PROD3
YEAR1___10________20________30
YEAR2___20________15________50
YEAR3___30________10________100
In Excel, when you give names to this table (Insert/Name/Make --> columns & rows), you can get info out of this table with the simple function =YEAR1 PROD2. --> 20.
Thank you very much!Yeah, I know. But VERT.LOOKUP is supported. The strange thing about this is dat Xcelsius is displaying is well when not in the preview mode.
-
Hi everyone,
I am downloading an internal table into an excel sheet using function module using GUI_DOWNLOAD . Now i need to have a heading line in the excel sheet. How should i do this? I kindly request you to help me in this issue. Thanks in advance.hiii
yes you right..that is the only problem you are having..without using FIELDNAMES you can get header like following program..just check follwoing program it will solve your problem...as that parameter is not used in FM gui_download
TABLES:
mara.
* T Y P E S *
TYPES:
BEGIN OF type_a090,
kschl TYPE a090-kschl, " Condition type
vbeln TYPE a090-vbeln, " Sales document number
posnr TYPE a090-posnr, " Item number
matnr TYPE a090-matnr, " Material number
datbi TYPE a090-datbi, " Valid from
datab TYPE a090-datab, " Valid to
END OF type_a090.
TYPES:
BEGIN OF type_mara,
matkl TYPE mara-matkl, " Material group
matnr TYPE mara-matnr, " Material number
END OF type_mara.
TYPES:
BEGIN OF type_makt,
maktx TYPE makt-maktx, " Material description
matnr TYPE makt-matnr, " Material number
END OF type_makt.
TYPES:
BEGIN OF type_output,
kschl TYPE a090-kschl, " Condition type
vbeln TYPE a090-vbeln, " Sales document number
posnr TYPE a090-posnr, " Item number
matnr TYPE a090-matnr, " Material number
datbi(10) TYPE c, " Valid from
datab(10) TYPE c, " Valid to
matkl TYPE mara-matkl, " Material group
maktx TYPE makt-maktx, " Material description
END OF type_output.
TYPES:
BEGIN OF type_final,
string TYPE string,
END OF type_final.
* D A T A *
DATA:wa_a090 TYPE type_a090,
i_a090 TYPE STANDARD TABLE OF type_a090,
wa_mara TYPE type_mara,
i_mara TYPE STANDARD TABLE OF type_mara,
wa_makt TYPE type_makt,
i_makt TYPE STANDARD TABLE OF type_makt,
wa_output TYPE type_output,
i_output TYPE TABLE OF type_output,
wa_final TYPE type_final,
i_final TYPE STANDARD TABLE OF type_final. "#EC NEEDED
* S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK sel1 WITH FRAME TITLE text-se1.
SELECT-OPTIONS:
s_matnr FOR mara-matnr, " Material Number
s_mtart FOR mara-mtart. " Material Type
PARAMETERS p_kschl TYPE konp-kschl DEFAULT text-000.
" Condition Type
SELECTION-SCREEN END OF BLOCK sel1.
SELECTION-SCREEN BEGIN OF BLOCK sel2 WITH FRAME TITLE text-se2.
SELECTION-SCREEN BEGIN OF BLOCK sel3 WITH FRAME TITLE text-se3.
PARAMETERS:
p_app_a RADIOBUTTON GROUP file,
p_filea type rlgrap-filename,
" Local file for upload/download
p_app_p RADIOBUTTON GROUP file,
p_filep type rlgrap-filename.
" Local file for upload/download
SELECTION-SCREEN END OF BLOCK sel3.
SELECTION-SCREEN BEGIN OF BLOCK sel4 WITH FRAME TITLE text-se4.
PARAMETERS:
p_price type rlgrap-filename OBLIGATORY
DEFAULT text-001.
SELECTION-SCREEN END OF BLOCK sel4.
SELECTION-SCREEN END OF BLOCK sel2.
* Selection screen processing
AT SELECTION-SCREEN ON p_filea.
IF NOT p_app_a IS INITIAL.
IF p_filea IS INITIAL.
MESSAGE e398
WITH text-002 '' '' ''.
ENDIF. " IF p_filea IS INITIAL
ENDIF. " IF NOT p_app_a IS INITIAL
AT SELECTION-SCREEN ON p_filep.
IF NOT p_app_p IS INITIAL.
IF p_filep IS INITIAL.
MESSAGE e398
WITH text-003 '' '' ''.
ENDIF. " IF p_filep IS INITIAL
ENDIF. " IF NOT p_app_p
START-OF-SELECTION.
PERFORM get_data.
PERFORM output_data.
PERFORM header.
*& Form get_data *
* Fetching data from the tables.
* There are no interface parameters to be passed. *
FORM get_data .
SELECT kschl " Condition type
vbeln " Sales document number
posnr " Item number
matnr " Material number
datbi " Valid from
datab " Valid to
FROM a090
INTO TABLE i_a090
WHERE matnr IN s_matnr AND
kschl EQ p_kschl
AND datab LE syst-datum
AND datbi GE syst-datum.
IF sy-subrc EQ 0.
SELECT matkl " Material group
matnr " Material number
FROM mara
INTO TABLE i_mara
FOR ALL ENTRIES IN i_a090
WHERE matnr = i_a090-matnr.
ENDIF.
IF sy-subrc EQ 0.
SELECT maktx " Material description
matnr " Material number
FROM makt
INTO TABLE i_makt
FOR ALL ENTRIES IN i_mara
WHERE matnr = i_mara-matnr
AND spras = 'EN'.
ENDIF.
ENDFORM. " get_data
*& Form output_data *
* Populating the final output table.
* There are no interface parameters to be passed. *
FORM output_data .
DATA:
w_date2(10) TYPE c, " For date formate
w_date1(10) TYPE c. " For date formate
LOOP AT i_a090 INTO wa_a090.
CONCATENATE wa_a090-datbi+6(2) wa_a090-datbi+4(2) wa_a090-datbi+0(4)
INTO w_date1 SEPARATED BY '/'.
CONCATENATE wa_a090-datab+6(2) wa_a090-datab+4(2) wa_a090-datab+0(4)
INTO w_date2 SEPARATED BY '/'.
wa_output-kschl = wa_a090-kschl.
wa_output-vbeln = wa_a090-vbeln.
wa_output-posnr = wa_a090-posnr.
wa_output-matnr = wa_a090-matnr.
wa_output-datbi = w_date1.
wa_output-datab = w_date2.
READ TABLE i_mara INTO wa_mara WITH KEY matnr = wa_a090-matnr.
IF sy-subrc EQ 0.
wa_output-matkl = wa_mara-matkl.
ENDIF.
READ TABLE i_makt INTO wa_makt WITH KEY matnr = wa_a090-matnr.
IF sy-subrc EQ 0.
wa_output-maktx = wa_makt-maktx.
ENDIF.
APPEND wa_output TO i_output.
CLEAR wa_output.
ENDLOOP. " LOOP AT i_a090
DELETE ADJACENT DUPLICATES FROM i_output COMPARING ALL FIELDS.
LOOP AT i_output INTO wa_output.
CONCATENATE wa_output-kschl
wa_output-vbeln
wa_output-posnr
wa_output-matnr
wa_output-datbi
wa_output-datab
wa_output-matkl
wa_output-maktx
INTO wa_final-string
SEPARATED BY ','.
APPEND wa_final TO i_final.
ENDLOOP. " LOOP AT i_output...
ENDFORM. " output_data
*& Form header *
* Formating the header. *
* There are no interface parameters to be passed. *
FORM header .
CONCATENATE text-004
text-005
text-006
text-007
text-008
text-009
text-010
text-011
INTO wa_final-string
SEPARATED BY ','.
INSERT wa_final
INTO i_final INDEX 1.
PERFORM f901_output.
ENDFORM. " header
*& Form f901_output *
* Downloading the final output table to the presentation server or *
* application server. *
* -->P_I_OUTPUT text *
* -->P_P_PRICE text *
FORM f901_output .
IF p_app_p = 'X'.
PERFORM f903_file_to_presentation
USING p_price.
ELSE.
PERFORM f904_file_to_application
USING p_price.
ENDIF. " IF p_app_p
ENDFORM. " f901_output
*& Form f903_file_to_presentation *
* Dowload the file to the presentation server. *
* -->P_P_PRICE text *
FORM f903_file_to_presentation USING p_p_price.
DATA:
lwa_file TYPE string. "#EC NEEDED "rlgrap-filename.
CONCATENATE p_filep p_p_price INTO lwa_file.
* Download the file
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE = BIN_FILESIZE
filename = lwa_file
filetype = 'ASC'
* APPEND = ' '
* WRITE_FIELD_SEPARATOR = ' '
* 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 = ' '
* IMPORTING
* FILELENGTH = FILELENGTH
TABLES
data_tab = i_final
* FIELDNAMES = FIELDNAMES
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
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. " f903_file_to_presentation
regards
twinkal -
Currently I am trying to bring balance sheet planning functionality into SAP. Has anyone done this before who could give me some guidance?
Message was edited by:
Mike BausHi,
Perhaps you should look at Oracle Hyperion Strategic Finance.
http://www.oracle.com/us/solutions/ent-performance-bi/hyperion-strategic-finance-066540.html
What you found is a tailored solution for Financial Services (i.e. banking, investment etc.) that is not part of Oracle EPM.
Cheers,
Alp -
BI-IP - Bex Analyser - select excel single row and aplly planning function
Hi experts,
In BI-IP (BW 7) with Bex Analyser, is it possible to select a single excel row (or a range of rows) and then apply a planning function? I know that in WAD it's possible with the binding option to select a single web item.
The purpose is to apply a revaluation factor to selected (by the user) cost elements rows in the workbook.
Thanks and regards,
MAHi
It is possibel in WAD to select one or many rows while executing Functions such as--Reposting; Revaluation etc.
However, you should be in a position to select the rows based on....unique identifier such as Require ID; Request #; Serial #; ....this is more so in case of multiple entries for the same cost element for different combinations.
Regards
Srinivas -
Function module to download to excel sheet
what is the function module to download the report into excel sheet??..
Thanks
Srihi,
use the alv list or alv grid for the report output then that functionality will be provided by default....
In general Gui_download is used and the final internal table which is used for displaying the output of the report is passed to the FM.
Regards,
Rohan. -
Oracle function to extract data into excel sheet
I have extracted data from a couple of tables onto a view. Basically I have got about 15 coloums in that view but i need to extract the data in the view into an Excel sheet.
I just want to know if their is a function in oracle whereby i can export the data in the view onto an excel sheet, because this statements is going to be scripted and run every morning for the data to be processed.
Oracle version: oracle 9i
OS : Windows 2003There are at least three options.
One is to use UTL_FILE or spool to write the results out as a comma separated file. Excel can then read the .CSV without a hitch. Only use spool you want to overwrite the file (on create a new one) each day.
The second approach would still use UTL_FILE but use Tom Kyte's OWA_SYLK utility to write an Excel-readable file.
The third approach would be to reverse the direction. Define your database as a DNS datasource and embed your query in the Excel spreadsheet. This obviates the need for the user to pfaff around with CSV files but does require a bit more work on the OS side.
Which approach you choose rather depends upon your precise needs.
Cheers, APC -
Oracle function to extract data into excel sheet within a script
I have extracted data from a couple of tables onto a view. Basically I have got about 15 coloums in that view but i need to extract the data in the view into an Excel sheet.
I just want to know if their is a function in oracle whereby i can export the data in the view onto an excel sheet, because this statements is going to be scripted and run every morning for the data to be processed.
Oracle version: oracle 9i
OS : Windows 2003If this is a one-off then IDEs such as TOAD typically
let you export the results of a query in an
appropriate format for Excel.Note:
because this statements is going to be scripted and run
every morning for the data to be processedSo that won't be feasible in this case, but it was a good point to make. -
Planning function in layout excel
Hi,
i have attached a planning function to a layout excel with standard functionaly. If i use this layout in a planning folder doesn't work. If i use layout from bps0 it's everything ok.
Is there any reason ?
Thanks in advanceTo perform Automatic execution of a function the planning function must be below the Layout and the layout must be an input layout.
If you open the Input layout hierarchy in the Tcode UPSPM, it will show as Input layout-> Your Layout-> Your planning function.Right mouse click on the planning function in UPSPM, select 'Function Attributes' and select the one of the 5 options which is appropriate for you.
Hope this helps
NS -
ALV FUNCTION MODLE FOR GETTING DATA IN EXCEL SHEET
HI ,
CAN I HAVE ALV FUNCTION MODLE FOR GETTING DATA IN EXCEL SHEET
Regards,
ArunaStandard ALV grid uses the FM <b>ALV_XXL_CALL</b> for exporting data into Excel. You can put a break-point in the FM and check it for urself.
for ur info - the above FM takes the internal table name, internal table content and the field catalog as input. -
Function module to download into excel sheet in crm
Hi,
Needed the Function module to download the data from internal table into the excel sheet in the CRM
<b></b>use
FM :- GUI_DOWNLOAD
Example Code.
lv_file_name = 'c:abcd.xls'
*----Load Detail Report Data to Excel File
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_file_name
filetype = 'DAT'
write_field_separator = 'X'
codepage = '4103'
TABLES
data_tab = lt_det_report
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.
ENDIF.
IF sy-subrc <> 0.
* 202 : Error Occurred while writing data to the file.
MESSAGE e202(zusm_gen) .
EXIT.
ELSE.
WRITE :/ text-042 , lv_file_name.
ENDIF.
:- lt_det_report---> is table for storing data .
it can be any type
<b>Please Reward Points & Mark Helpful Answers</b>
To mark Helpful Answers ;click radio Button next to the post.
RadioButtons
<b>o</b> Helpful Answer
<b>o</b> Very helpful Answer
<b>o</b> Problem Solved.
Click any of the above button next to the post; as per the anwers
<b>To close the thread; Click Probelm solved Radio Button next to the post , which u feel is best possible answers</b> -
Function output (Return sys_refcursor) to excel sheet
Hi,
Could pls anyone let me know how to export the output of a function returning sys_refcursor to excel sheet
with headers.
Tried with file handling but no luck.
Below is my function.
create or replace function fn1 return sys_refcursor as
cv_1 SYS_REFCURSOR;
begin
open cv_1 for select * from tab;
return cv_1;
end;Small example will hlp me a lot.
Thanks in advanceunique wrote:
Hi,
Could pls anyone let me know how to export the output of a function returning sys_refcursor to excel sheet
with headers.
Tried with file handling but no luck.
Below is my function.
create or replace function fn1 return sys_refcursor as
cv_1 SYS_REFCURSOR;
begin
open cv_1 for select * from tab;
return cv_1;
end;Small example will hlp me a lot.
Thanks in advance
create or replace function fn1 return sys_refcursor as
cv_1 SYS_REFCURSOR;
begin
open cv_1 for
(select 'headings for each column' from dual
union all
select to_char(all_columns) from tab);
return cv_1;
end; -
Dear Friends
I am implementing Forecast based MRP, is there any way to export Sales forescat excel sheet, insteaded of entering the forecast values in material master, we are neary 30 products. Entering one by one is a big process, laready they have sales plan in excel sheet, pl let meknow how can i export the sales plan excel sheet to the Forecast values and execute the forecast.
thanks
Shivaniplease follow below process to uplaod external data:
You use this program to transfer forecast values from external systems to your SAP system. The program works as follows:
1. The program searches for the material/plant combination defined for external forecast.
2. Using user exit EXIT_SAPLMPR1_002, you can set a filter on the materials to be forecast externally.
3. The program calls user exit EXIT_SAPLMPR1_001 and transfers information on the materials to be forecast.
4. The user exit must have the forecast values from the external system at its disposal.
5. After the user exit is run, the forecast values are posted in the SAP system.
you will need to sue custome logic to upload the excel sheet may be using GUI_UPLOAD functyion module in above user exit.
Maybe you are looking for
-
My home button is not working.. HELP!
The home button on my iPhone 4 quit working today. I tried syncing it, tried shutting it down, tried blowing air into the dock area and nothing is working. I even reset it... Does anyone know how I can fix it without having to go to the genius bar?
-
Sending WD component link in email through Workflow
Hi , I have a Web dynpro component created.The WD application would trigger a Workflow through a Business Object event. In the workflow the user would receive an email on his outlook with the WD component link. I have 2 questions: 1) How will we sen
-
How to export chapter screenshots for printing?
My office is working up a large collection of DVDs in Encore. As part of the job, our manager wants DVD cases that display thumbnails of the poster frames located at each chapter stop (chapters are set as automatic intervals in Encore). She saw that
-
I understand from reading around that when you import raw images files into iPhoto, it keeps the original raw file in it's library, but it automatically converts your edits to a saved jpeg. What's throwing me, is the filename. When it's originally im
-
DB Back to a Specific Time with Archive Logs (Until cancel or time?)
I'll try to be as clear as possible with my intended goals and the limitations of the system I'm working with: 1. We have a test instance of our Oracle DB that I would like to be able to refresh with data from the production instance at any time, wit