Excel inplace, fill excel templates
Hey everybody!
Do anyone have documentation or links to it how to fill in templates and mayby abap code examples about exporting data and making kind of headers and footers in Excel inplace from ALV?
I have sap_om.xls and sap_mm.xls, but they are empty when I push 'export to excel' buttom. I couldn't find the way how to reference data from ALV or from abap report to Excel inplace. Maybe I have to fill any exact internal tables to export information (like 'xxx_data_table' or something).
Hi,
Hope you have Excel installed on the PC. THis excel view displays the data you have in the excel workbook instead of the display of tabular display in SAP. YOu can save these files and use them for any purpose.
Also you can get more about this on SAP help with string "displaying data in excel inplace view".
Details are available there.
Regards
Prasanna
Similar Messages
-
Leaving excel Inplace, the excel session is still active
I all,
I use the Excel Inplace method to format data in PivotTables. I use a template based on sap_MM.xls with the procedure Public Sub ALV_CUS_Exit (). It is working correctly.
My problem happens when I leave the transaction and return to the initial screen. The excel session is still active causing blockages in the Excel application itself
I looked at the OSS note 122539: it describes functions which do not yet exist in the SAP delivery for certain events. I have tried those functions with the SAP declaration like :
public sub customer_workbook_deactivate()
Me.Application.Quit
End Sub
Either I use the wrong syntax or I do not set the code in the correct place of the VBA project, I have never activated these functions while leaving the screen excel inplace.
Can you guide me to a solution ?
In advance thank you very much.Thanks, but my first problem is that I do not pass through the procedure. Once I pass through it I'll try "me.quit()".
Regards. -
WebDynpro Call Excel and fill Excel
Hi together,
I've nearly read all postings in the forum about excel and webdynpro. But I have no solution for my problem yet.
Please help me. I want to call Excel with the SAP OfficeControl. This works with the Sample in the SAP-Onlinedoku.
But I cannot fill the existing Exceldocument. I want to fill my existing document like "row1 and column5" = "Hasso".
Can anyone help me. I am just a Java Newbie.
Here my Code to fill the Excel-Control from an file.
Additional, I want to change some cells.
I think after the line "element.setDocumentContent(bytes);"
I've to code !!
thy for your response
greetings
Example-Code:
public void fillNode(IPrivateTestViewOfficeControl.IDocumentSourceNodeNode node, IPrivateTestViewOfficeControl.IContextElement parentElement)
//@@begin fillNode(IWDNode,IWDNodeElement)
ISimpleTypeModifiable mod = node.getNodeInfo().getAttribute("DocumentContent").getModifiableSimpleType();
ModifiableBinaryType bin = (ModifiableBinaryType)mod;
bin.setMimeType(new WebResourceType("doc", "application/msword", false));
IPrivateTestViewOfficeControl.IDocumentSourceNodeElement element = node.createDocumentSourceNodeElement();
node.addElement(element);
try
byte[] bytes = getBytesFromFile(new
File("C:
temp
example.doc"));
element.setDocumentContent(bytes);
catch (IOException e)
// do something
//@@end
public void onActiongetDocument(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActiongetDocument(ServerEvent)
WDOfficeControlMethods.showDocument(this.wdThis.wdGetAPI(),"OfficeControl1");
//@@end
//@@begin others
public static byte[] getBytesFromFile(File file)
throws IOException
FileInputStream is = new FileInputStream(file);
long length = file.length();
byte[] bytes = new byte[(int)length];
long bytesRead = is.read(bytes);
if (bytesRead < length)
throw new IOException("Could not completely read
file "+file.getName());
is.close();
return bytes;
//@@endtry this: this is simple
First You have to download the jxl.jar file. You can get this file from the Below site
JExcelApi v2.6.4 (1747kbytes)
It will be in Compressed Fromat So Unzip it to get the Contents
After Unzipping The File You will get a Folder (jexcelapi/jxl.jar)
Now in NWDS open web dynpro explorer, Right Click Your Project, a popup menu will appear and in that click Properties
You will get window displaying your Project Properties
On Left Side of the window You Will Find "Java Build Path"
Click That "Java Build Path" and you will get 4 Tabs Showing ( Source,Projects,Libraries,Order and Export)
Click Libraries Tab
You will find options many options buttons
In that click the Button "Add External Jars"
You will get Window in order to fecth the jxl.jar file from the location you had stored
After selecting the jxl.jar i will get displayed and click ok
Now Open Navigator
Open Your Project
You will find Lib folder
Copy the jxl.jar to that lib folder
Note : You cannot Read the Content from the excel file directly
First You Have to copy that file to the Server,
And from the Server you can get the file absolute path
With the absolute path you can read the contents of the Excel file
You have to save the Excel file as .xls Format and Not as xlsx format i will not accept that...
You have Upload the Excel file from the Server Using the File Upload UI Element
This Coding will extract 3 columns from the Xls File
Coding
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import com.sap.fileupload.wdp.IPrivateFileUpload_View;
import com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource;
public void onActionUpload_File(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionUpload_File(ServerEvent)
IPrivateFileUpload_View.IContextElement element1 = wdContext.currentContextElement();
IWDResource resource = element1.getFileResource();
element1.setFileName(resource.getResourceName());
element1.setFileExtension(resource.getResourceType().getFileExtension());
//@@end
public void onActionUpload_File_in_Server(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionUpload_File_in_Server(ServerEvent)
InputStream text=null;
int temp=0;
try
File file = new File(wdContext.currentContextElement().getFileResource().getResourceName().toString());
FileOutputStream op = new FileOutputStream(file);
if(wdContext.currentContextElement().getFileResource()!=null)
text=wdContext.currentContextElement().getFileResource().read(false);
while((temp=text.read())!=-1)
op.write(temp);
op.flush();
op.close();
path = file.getAbsolutePath();
wdComponentAPI.getMessageManager().reportSuccess(path);
catch(Exception e)
e.printStackTrace();
//@@end
public void onActionUpload_Data_into_Table(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionUpload_Data_into_Table(ServerEvent)
try
Workbook wb =Workbook.getWorkbook(new File(path));
Sheet sh = wb.getSheet(0);
//wdComponentAPI.getMessageManager().reportSuccess("Columns = "+sh.getColumns());
//wdComponentAPI.getMessageManager().reportSuccess("Rows = "+sh.getRows());
int columns = sh.getColumns();
int rows = sh.getRows();
int i=0;
for(int j=1;j<=rows;j++)
ele=wdContext.nodeTable_Data().createTable_DataElement();
Cell c1 = sh.getCell(i,j);
ele.setTab_Name(c1.getContents());
Cell c2 = sh.getCell(i+1,j);
ele.setTab_Degree(c2.getContents());
Cell c3 = sh.getCell(i+2,j);
ele.setTab_Percentage(c3.getContents());
wdContext.nodeTable_Data().addElement(ele);
catch(Exception ex)
wdComponentAPI.getMessageManager().reportSuccess(ex.toString());
//@@end
The following code section can be used for any Java code that is
not to be visible to other controllers/views or that contains constructs
currently not supported directly by Web Dynpro (such as inner classes or
member variables etc.). </p>
Note: The content of this section is in no way managed/controlled
by the Web Dynpro Designtime or the Web Dynpro Runtime.
//@@begin others
String path;
IPrivateFileUpload_View.ITable_DataElement ele;
//@@end
make sure that the cardinality of the node i.e. upload node is 1:1 -
In my system, when i open ALV report in Excel inplace. Excel opens report but button "Close and Return to ALV (1)" and "Exit excel" is disabled, how can it appear enabled?
When i press key "ALT+TAB" excel menus and icons desapear, and when press "/" SAP menus appear in strange mode.
If Excel is open in windows with one worksheet before open Excel in SAP ALV inplace, sometimes an error occured.
Excel 2007
SAP ECC6.0
SAP GUI for Windows - file version 7100.2.8.1039 or 7100.2.9.1039
Anyone help me.hello
This program checks the paths, installation, and Registry keys of the desktop office applications and OCX files used in SAP Desktop Office Integration. Its results are useful to SAP if you report problems using Desktop Office Integration.
"C:\Archivos de programa\SAP\FrontEnd\SapGui\Testtools\Check_DOI.exe"
Hernando -
Opening external Excel file by VBA in Excel Inplace template
Hi all experts,
I am working on a sq01 query which used an Excel inplace template. Inside the template, I have written the code to open another Excel file by absolute path, and it works when I run it in my computer. However, when I uploaded the template to the SAP and run the code, the external Excel file did not open. May I ask how I can open an external Excel file when the template is inside SAP server? Thanks a lot for your help.
Best regards,
LeonDo you have a language pack installed? I assume your computer language is set to French?
Maurice -
How to open ALV Excel Inplace in new window
Hi everybody,
I have an ALV report which is used in Excel Inplace mode. However, I'd like to have Excel to be opened in a new window and not in the ALV container. I do not want to manually export my data to Excel as described in many discussions here on SCN, but I want to have exactly the same xls document opened that is generated by the ALV control. This is because I want to open the default XLS template uploaded into BDS filled with the data of the ALV grid.
I thought that getting the generated XLS using the Desktop Office Integration, i_oi_document_proxy->repoen_document would work (using open_inplace = space), but unfortunately this opens the excel template without data.
Does anyone have a soulution for this?
Thanks and BR,
Tamasvar url:URLRequest = new URLRequest("http://www.adobe.com"); navigateToURL(url, "_blank");
getURL/navigateToURLThis method uses the getURL (ActionScript 2.0) or navigateToURL (ActionScript 3.0) command to create a new browser window by targeting a new, blank window. This method is simple, works on all browsers, and requires no JavaScript. This method, however, it does not provide control over window location, size, scrollbars, or toolbars. I guess something like this you needed? -
Excel Inplace - Update SAP R/3 tables from Excel Data
Hi,
I developed a report displaying using Excel inplace. After user finished editing the Excel workingsheet, I called method get_ranges_data of interface I_OI_SPREADSHEET to get data contents. But this method or almost all the methods of this interface requires user hit a enter key after edit a cell. Without hit a enter key or click different cell, this method will not be able to get any data contents.
Is there a way I can force a user click or enter event?
An example is apprieciated.I have not tested this, but you might try the following.
The inline excel should be created from a template. And in the excel VB code should exists which call a customer event in Workbook_SheetChange. This code is executed each time a change occurs on the worksheet.
so in you r worksheet you should have the following code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Source As Range)
' runs when a sheet is changed
Call ThisWorkbook.Container.SendCustomEvent("DATA_CHANGE")
End Sub
this event you can catch in SAP, and reread the data from excel.
so now each change in excel triggers an event in SAP.
Not sure it works, but worth a try.
Joris. -
Still no data in Excel InPlace
Hi.
No data is being displayed when I use the Excel view in an ALV from 'REUSE_ALV_GRID_DISPLAY', but this is not the usual problem.
I have the recommended settings in Excel in Tools > Macro > Security.
The View tab of Change Layout in the ALV lists the templates sap_om.xls and sap_mm.xls.
Trying Excel InPlace for different users and different PCs seems to show that the problem lies with the PC and not the user.
I have re-installed Excel and SAPgui on my PC, but the fault remains.
My SAPgui is 6.20 patch level 42.
My Excel is 2002 SP-2.
What could be the problem?
Thanks,
JohnI have a possible answer to my own question.
I have re-installed my Kaspersky Anti-Virus for Windows Workstations software.
It is now version 5.0.712. I don't know what it was before.
Now when I try to use Excel InPlace, I get a Kaspersky dialog box four times, warning about a potentially dangerous macro, and advising me not to execute it. If I allow the execution of each macro, then Excel InPlace works.
So it seems possible that Excel InPlace was not working before because my anti-virus software was silently preventing the execution of the macros.
Can anyone confirm that this can happen?
Thanks,
John -
No "file - send to" with excel inplace
In excel (Version excel 97) I can send files via "file - send to - email" which starts my email client and attaches the xls file to the mail.
When I use excel inplace in an abap program this option is not available. I still can see it, but it is grey and I cannot choose it
Is it possible to activate this options? I use the methods of desktop office integration to get excel inplace and fill it with data (i_oi_container_control, i_oi_document_proxy, i_oi_spreadsheet).
regards
HerbertUSB Thumb drive?
Patrick -
Hello,
I am can also display data in an Excel view. The data is transferred to Excel and displayed there in an Excel sheet within the window instead of the grid. The ALV Grid Control toolbar is still visible and you can use its functions in the Excel view in my computer. But when it is run in another different equipment not it generates. It open Excell with each Shets but the data do not displayed.
Any guide to solve to this problem.
thanksInfo collected from search..
To create the template you do:
1) Run the report.
2) When you see the result (the AVL GRID report), you go to change layout - the view tab - mark the excel radio button, choose template sap_om.xls by double click and press enter.
3) Now you see the report as 'excel Inplace'
4) In the excel menu you choose 'Save as' to save your file - and now you have a template ready to be modified.
Try to modify template :
1) The template has 15 sheets (Format, Header, Pivot etc. etc.) - don't delete any of these! (If you do the template won't work) (I would normally call these sheets 'tabs', but in excel they are sheets of an excel-book).
2) Add your own sheet or sheets
3) In your own sheet you make links to the data in the standard sheets Format or RawData.
You now have and modified template. In your own sheet you can add any formatting or calculations you want. Finally to clean the template I would clear the contents of the standard sheets Format and RawData
you can upload the template :
Refer the Oss note 358644 and 548409
You will have to build your own templates by creating modified copies of the SAP standard templates SAP_OM.XLS and SAP_MM.XLS. If you can find these see note 316728 to copy them from client 000.
You will have to work with transaction OAOR to administrate the templates and program BC_BDS_UPLOAD to upload new templates.
And finally run the report and choose the new layout instead of sap_om.xls.
Basis guys might able to help you.
regards
Vivek
award points for useful answers -
Hi,
Could anyone tell me the reason why some Excel functions are not available when using Excel Inplace?
For example, the print preview. You have the button in the tool bar but it does not work.
Another questions is: How many other excel functions are not available and we still don't know?
ThanksI have not tested this, but you might try the following.
The inline excel should be created from a template. And in the excel VB code should exists which call a customer event in Workbook_SheetChange. This code is executed each time a change occurs on the worksheet.
so in you r worksheet you should have the following code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Source As Range)
' runs when a sheet is changed
Call ThisWorkbook.Container.SendCustomEvent("DATA_CHANGE")
End Sub
this event you can catch in SAP, and reread the data from excel.
so now each change in excel triggers an event in SAP.
Not sure it works, but worth a try.
Joris. -
BPS + Excel Inplace = Macro + Digital Signature (Certificate)
Hi, "All"
To achieve some goals in formatting planning layout, I changed Modul1 module (subs SAPAfterDataPut() and SAPBeforeDataGet()). Because of this SAP certificate doesn't work. To avoid annoying message about macros in opening Excel, I create certificate by Selfcert.exe in office10 folder of MS Office. And I tryed to protect BPS modul with this certificate (In VBA Editor: Tools->Digital Signature...). But after saving modified template there is no cerification record in template.
This works correctly when I protect usual excel files, but doesn't work with BPS. Why? Did anybody try to do something like that?
PS: How can end users use Excel InPlace BPS Layouts? I don't find any method except BPS0...Hallo
Actually the end user can use Excel by building a planning folder and choose the option Folder without Separate output not web Enabled. Then the front-end is Excel.
You can also build a WEB application Excel Enabled which give you Web Excel as layout but it is not so user friendly (only copy nad paste).
With the planning folder you still have all Excel Functionality.
I hope this can help you.
Regards
Mike -
Excel empty with 'excel inplace' option
Hi everyone,
in order to show my alv data in an excel format, with 'excel inplace' option, this sheet appears empty. However, if i choose to download the data into a excel file, it appears right.
Do you know the reason of this?
ThanksImplement OSS Note 782922 - Excel Inplace: Header Sheet contains garbage characters.
This will require installation of SAP GUI Patch Level 8.
Also , You can try be installing SAP GUI with all options checked. -
Is it possible to display a date as (DD-MON-YYYY) in excel output using excel template in xml publisher where date should be displayed as date only not string.
I've tried to use hierarchy node variables, but it seems like you can't specify a attribute of the hierarchy such as level. So with the WBS hierarchy, if you create a hierarchy node variable, you specify the WBS value to select (If I understand this correctly). I wish I could instead specify "give me all the WBS nodes that happen to have the value of the level attribute greater or equal to 3. If I understand Juergens post, he is saying make security access so that only certain WBS levels can be returned in the query. I suppose we can try that, but that would then preclude getting the level 1 and 2 in the future if the authorization is global.
-
Hi,
I am having a report which is being shown in ALV grid. I am having one checkbox in selection-screen namely 'Excel Inplace'.If this checkbox is checked then report should be shown in excel-inplace format.
Please guide me how to achieve this.
I am having below constraints:
1. Here I can't save variant in excel-inplace format and use it while execution, because user can save other variants too(may be with less fields) and use it.
2. I have copied the standard program RFBILA10 and modifying according to my needs. This program is using FM 'REUSE*. So going for ABAP-OO will be difficult here.
Thanks,
Vinod.You need to use method SET_VIEW_EXCEL.
Call this right after SET_TABLE_FOR_FIRST_DISPLAY.
PS pl remember this is protected method you need to inherit this
a®
Maybe you are looking for
-
Multiple Data in selection tab of infopackage
Hello, I need to select in a InfoPackage from a InfoObject multiple values, which means I need to implement a logical OR in the selection of an InoObject in a InfoPackage. How to set up L_T_RANGE ? Thank You ! Martin Sautter
-
How come my device is not showing up in the summary pane?
I am trying to restore my device because I have a black screen. I signed into my account but my device is not showing up in the summary pane. Why not?
-
Error in the Portal 9.0
Someone can help me solve this problem, this message is when I invoke a Web portal services since 9.0 Integration Gateway - Http TargetConnector:ExternalApplicationException. Http status code HttpStatusCode returned: 500.(158,10623) WebServices_01.Ac
-
How do I find all of the photos that do NOT contain a specific person tag?
I am scanning my old photos and slides and organizing them with Photoshop Elements 12. I have recently started taging the pictures with family names. I see from this forum that I can search for untagged pictures but how can I find all the picture
-
HOW DO I MAKE A FOLder FOR DIFFERENT GROUPS IN MY EMAIL ACCOUNTS
as above and how do i make the letter bigger for the email coming in without having to click on them