Downloaded data in Excel from SAP table data to have the macro and control?
We know that in SE16 screen to display SAP table data, there is a menu item or button to download the table data to excel sheet, but in the excel sheet, the data is for display only and some calculation functions (e.g. sum) are not be able to be downloaded to the excel sheet as macro.
Our customers would like us to see if there is a way that in the excel sheet with the download SAP table data, only some certain rows/columns of data are allowed to be changed by customers or in other words, other areas in the excel sheet should be frozen and users can not even insert a column and do the copy/paste rows/columns. And also the original calculated column in SAP table (e.g., sum) would be in the corresponding column in the excel sheet, but with macro to do the same function (e.g., sum). After the customers perform some changes in some allowed certain rows/columns in the excel file, then the changed data can be uploaded back to SAP.
Wonder if there are such ABAP program to fullfill the above task to download SAP table data to an excel file and to make the downloaded data in the excel with only some certain row/columns to be changeable and all other areas frozen?
Thanks and we will give you reward points for valuable answers!
Hi,
This scenario can be met with the FM : RH_START_EXCEL_WITH_DATA
This is available in Older versions. Starts Excel with a macro.
I have never tried using this FM.
However, I came across : http://www.jt77.com/development1/programming-23850.html
Showing the use of it.
To get useful hints, also refer :
1) Transaction : DWDM
2) MS EXCEL as OLE Client :
http://help.sap.com/saphelp_nw04/helpdata/en/40/b297f3c32711d194ac00a0c94260a5/frameset.htm
3) Read the content at any table + Defined Macros used to call Function Modules
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c043d836-166c-2910-b99e-ae3633dec547
Once you get a solution, would appreciate a mail to me @ <REMOVED BY MODERATOR>
Cheers,
Remi
Edited by: Alvaro Tejada Galindo on Feb 29, 2008 5:41 PM
Similar Messages
-
How to delete master data of materials from sap tables
how to delete master data of materials from sap tables...its needed now.
i know its not recommended but still we need to do this. give me the best possible approach.
regards,
suneethaHi,
I would suggest you not to write your own code to delete the entries.
BAPI_MATERIAL_DELETE, this would mark all materials selected for deletion. But still the material would exist in SAP.
Another solution: Delete a material manually and in another session execute the transaction SM04. This would display the tables which get locked when you do the operation, Then you can write your own code to delete the material numbers from all the related tables.
Regards
Subramanian -
From which tables i would find the delivery and billing document field..??
I need to create an ALV report which displays the following details in the output.
Order No Item No Material Order Qty Item Category Plant Delivery Billing Document Sales Org Dist Channel Division Created By Created On Changed On
For(Order No Item No Material Order Qty Item Category Plant) i took the fields from vbap and
for(Sales Org Dist Channel Division Created By Created On Changed On)i took the fields from vbak..
From which tables i would find the delivery and billing document field related to sales document.??
need help...
Moderator message : Requirements dumping not allowed, thread locked.
Edited by: Vinod Kumar on Mar 6, 2012 2:53 PMi am new to abap...so i dont have idea about sd table relationship.
so please reply how to add delivery and billing doc in my coding below..
*& Report ZINAA_SD
REPORT zinaa_sd.
TABLES: vbap, vbak, vbfa.
TYPE-POOLS: slis.
CONSTANTS: c_x TYPE char1 VALUE 'X'.
TYPES:
BEGIN OF st_vbap,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
pstyv TYPE vbap-pstyv,
kwmeng TYPE vbap-kwmeng,
werks TYPE vbap-werks,
END OF st_vbap,
BEGIN OF st_vbak,
vbeln TYPE vbak-vbeln,
erdat TYPE vbak-erdat,
ernam TYPE vbak-ernam,
vkorg TYPE vbak-vkorg,
vtweg TYPE vbak-vtweg,
spart TYPE vbak-spart,
aedat TYPE vbak-aedat,
END OF st_vbak,
BEGIN OF st_final,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
pstyv TYPE vbap-pstyv,
kwmeng TYPE vbap-kwmeng,
werks TYPE vbap-werks,
erdat TYPE vbak-erdat,
ernam TYPE vbak-ernam,
vkorg TYPE vbak-vkorg,
vtweg TYPE vbak-vtweg,
spart TYPE vbak-spart,
aedat TYPE vbak-aedat,
END OF st_final.
DATA:
lt_vbap TYPE TABLE OF st_vbap,
ls_vbap TYPE st_vbap,
lt_vbak TYPE TABLE OF st_vbak,
ls_vbak TYPE st_vbak,
lt_final TYPE TABLE OF st_final,
ls_final TYPE st_final,
lt_fieldcat TYPE slis_t_fieldcat_alv,
ls_fieldcat TYPE slis_fieldcat_alv,
layout TYPE slis_layout_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_vbeln FOR vbap-vbeln,
s_erdat FOR vbap-erdat.
SELECTION-SCREEN END OF BLOCK b1.
PERFORM select_data.
PERFORM loop_final.
PERFORM sort.
PERFORM a USING:
'VBELN' TEXT-002,
'POSNR' TEXT-003,
'MATNR' TEXT-004,
'KWMENG' TEXT-005,
'PSTYV' TEXT-006,
'WERKS' TEXT-007,
'VKORG' TEXT-008,
'VTWEG' TEXT-009,
'SPART' TEXT-010,
'ERNAM' TEXT-011,
'ERDAT' TEXT-012,
'AEDAT' TEXT-013.
PERFORM display.
*& Form SELECT_DATA
text
FORM select_data.
SELECT
vbeln
vkorg
vtweg
spart
ernam
erdat
aedat
INTO CORRESPONDING FIELDS OF TABLE lt_vbak
FROM vbak
WHERE vbeln IN s_vbeln AND erdat IN s_erdat.
IF sy-subrc = 0.
SORT lt_vbak by vbeln.
ENDIF.
SELECT
vbeln
posnr
matnr
kwmeng
pstyv
werks
INTO CORRESPONDING FIELDS OF TABLE lt_vbap
FROM vbap
FOR ALL ENTRIES IN lt_vbak
WHERE vbeln = lt_vbak-vbeln.
IF sy-subrc = 0.
SORT lt_vbap by vbeln.
ENDIF.
ENDFORM. "SELECT_DATA
*& Form LOOP_FINAL
text
FORM loop_final.
LOOP AT lt_vbap INTO ls_vbap.
ls_final-vbeln = ls_vbap-vbeln.
ls_final-posnr = ls_vbap-posnr.
ls_final-matnr = ls_vbap-matnr.
ls_final-kwmeng = ls_vbap-kwmeng.
ls_final-pstyv = ls_vbap-pstyv.
ls_final-werks = ls_vbap-werks.
READ TABLE lt_vbak INTO ls_vbak WITH KEY vbeln = ls_vbap-vbeln BINARY SEARCH.
ls_final-vkorg = ls_vbak-vkorg.
ls_final-vtweg = ls_vbak-vtweg.
ls_final-spart = ls_vbak-spart.
ls_final-ernam = ls_vbak-ernam.
ls_final-erdat = ls_vbak-erdat.
ls_final-aedat = ls_vbak-aedat.
APPEND ls_final TO lt_final.
CLEAR ls_final.
ENDLOOP.
ENDFORM. "LOOP_FINAL
*& Form SORT
text
FORM sort.
ls_sort-spos = '01' .
ls_sort-fieldname = 'VBELN'.
ls_sort-tabname = 'LT_FINAL'.
ls_sort-up = c_x.
ls_sort-subtot = c_x.
APPEND ls_sort TO lt_sort .
ENDFORM. "SORT
*& Form A
text
-->FNAME text
-->SELTEXT text
-->EMPHA text
FORM a USING fname TYPE string seltext TYPE string.
IF fname = 'KWMENG'.
ls_fieldcat-do_sum = c_x.
ENDIF.
ls_fieldcat-fieldname = fname.
ls_fieldcat-seltext_m = seltext.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat.
ENDFORM. "A
*& Form ALV
text
FORM display.
layout-zebra = c_x.
layout-colwidth_optimize = c_x.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-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 = layout
it_fieldcat = lt_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = lt_sort
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = C_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 = lt_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. "ALV -
Regarding downloading data into excel from internal table
hi all ,
i'm using the function module SAP_CONVERT_TO_XLS_FORMAT to download data of internal table into excel . now i need to know . when user presses the button for downlading it should download after downloading if he again tries to download it in the same should not allow him to download or it should refresh the excel of the speecific path and then it should downlaod . please let me know how make it.Hi,
Use below FM
call function 'MS_EXCEL_OLE_STANDARD_DAT'
exporting
file_name = p_file " path offile where u need to download
CREATE_PIVOT = 0
DATA_SHEET_NAME = ' '
PIVOT_SHEET_NAME = ' '
PASSWORD = ' '
PASSWORD_OPTION = 0
tables
PIVOT_FIELD_TAB =
data_tab = <dyn_table> "internal table with data
*fieldnames = int_head "internal table with header
exceptions
file_not_exist = 1
filename_expected = 2
communication_error = 3
ole_object_method_error = 4
ole_object_property_error = 5
invalid_filename = 6
invalid_pivot_fields = 7
download_problem = 8
others = 9
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Regards,
Prashant -
Populate Combobox in Excel from SQL Table
I have a requirement to populate a combobox in excel from a table in SQL when the user opens the excel workbook. Can you help me on how I can do that. I have a supplier column in the table which I like to appear in the combobox and has around 1500 records.
Excel Version 2010
SQL Server Version 2008
Thanks in advance.Hi Jaggy99,
According to your description, you want to implement a combobox for the supplier column when open a SQL Server table in Microsoft Excel, right?
I have tested it on my local environment, when we connect to a SQL Server database and display the table data in Excel, the excel will populate a drop-down list for each columns as the filter. Here is the screenshot for you reference.
Regards,
Charlie Liao
TechNet Community Support -
How to download data in excel from web report in sap ?
how to download data in excel from web report made in sap abap?
through tcode smw0.for exemple using
MS_EXCEL_OLE_STANDARD_DAT -
How to access data from SAP Tables from a Webi report
hi all,
I have a webi report for financial data and from a Bex query which is build on a Cube (this has data from 2 SAP ECC systems)
i want to build a functionality where in i can call some SAP Table data from this webi report. i should be able to pass information or some hard code where it can understand the source system it has to pick data from.
in SAP BI, we have this ption wherein we can achieve this through RRI..
is this possible in Webi ?
Thanks
SKSHi.
Create a universe on top of SAP Tables and create a webi report.
Using hyper link /open doc we can call this report from the webi report created on top of your Cube .
@Sri -
Transfer data from SAP TABLES to a SQL table
Hi,
I need to transfer data from SAP tables to a SQL table. Please suggest the best way as well as the steps please.
Regards,
KamleshHi
Step 1: Create an entry for the External database in DBCON table using Trxn: DBCA.
Field Name Description Value (For: E.g.:)
CON_NAME Logical name
for database con RAJ
DBMS Database system MSS
USER_NAME Database user <username>
PASSWORD Password for setting up
the connection
to the database <pwd>/<pwd>
CON_ENV Database-specific MSSQL_SERVER=depotserver MSSQL_DBNAME=HOF_INDORE
DB_RECO Availability type for an open database connect
Then, you can define internal table and code the following way:
DATA: BEGIN OF wa,
c_locid(3),
c_locname(50),
c_locstate(5),
END OF wa.
EXEC SQL.
CONNECT TO 'RAJ' AS 'V'
ENDEXEC.
EXEC SQL.
SET CONNECTION 'V'
ENDEXEC.
< Populate SAP data into an internal table >
Loop on itab.
EXEC SQL.
< code here for populating data into MS-SQL Server table>
ENDEXEC.
Endloop.
Regards,
Raj -
Download data as excel from master-detail form.
Hi All,
I have created master-detail form with two tables(i.e orders and items). how can i import data of specific order into excel using single button click. Can any one help me.
I am using apex 4.1 version
Regards,
Vijay. JI have created master detail form. when i click on the button then the would downloaded to excel like below format. when we open the order and click the download button it fetch the line items of that order and display in below format (This like normal invoice form).
CompanyName
Bill to Address Shift to address
Item code qty item price
1 1 2000
2 1 3000
total 50000
------------------------------------------------------------------------------------------- -
ABAP program to output data from SAP table to an XML format file?
hello ABAP experts,
Does anyone know how to output data from SAP table to an XML format file? Would be appreciated if someone show the detailed sample codes and we will give you reward points!
Thanks!Edited by: Jose Hugo De la cruz on Aug 19, 2009 8:23 PM
-
How to get data from COSP table, field HRKFT as the key to data from PM?
Dear ladies and gentlemen!
I need to get data from COSP table, field HRKFT as the key to data from PM tables (AFKO and AUFK).
The problem is that it is a key field to the COSP, and all non-key fields as an alternative to HRKFT are not suitable for this task.
All this is necessary for the extractor, which loads the data from the R \ 3 systems in the BW-system. I need to perform SELECT from a table COSP and maybe also JOIN, most likely between tables COSP and AUFK.
What should I do in this case?
Thank you very much in advance!From information on help.sap.com I've made a conclusion that one of possible solutions in theory is to modify standard extractor PM_OM_OPA_1 in order to make HRKFT field available for work, because by default it is hidden by SAP and not available for use as a key field.
Of course, it's not a very good solution, but for now I know no other way to solve this problem.
Maybe someone knows better ways? In this case I will be very grateful for any help!
Moderator: You'd better post it on BI forums -
How to find that from which table data is coming in datasource?
Hi friends
I want to find that from which tables data is coming into datasource 2LIS_04_P_COMP,2LIS_04_P_MATNR..
I have searched in forums.. I also have checked in sap.help.. but I didnt get any tablename in field "Table of origin"..
Please tell me how can I find that data is coming from which table into these datasources..
I dont want name of the setup tables.. I want name of the original tables (in R/3)which has data..
Regards
SwatiHi......
For data source 2LIS_04_P_COMP............MCAFKO, MCAFPO, MCCOMP are the R3 communication structures...........
Check these commonication Structure in SE11............I think u will get the required information........
2LIS_04_P_MATNR is Material View from PP/PP-PI ..........check this..........
http://help.sap.com/saphelp_nw70/helpdata/EN/88/7fc73c0c52085be10000000a114084/frameset.htm
Check this each field in SE11....from there try to find out these fields belongs to which table..........as I hav explained u in another thread..........
May be the extractor is using these fields from different tables.....
Regards,
Debjani........ -
Read SAP table data outside of SAP, without a SAP license
Hello all,
I have been asked to allow people within my company to directly access vendor information, but of course they don't want to purchase a SAP license.
Yes, yes, I know that directly reading from SAP tables at the Oracle database level is generally frowned upon.
I can envision creating an external application that presents the user with a screen of searchable fields, uses these fields to create SQL for the oracle tables LFA1, LFB1, ADRC, and ADR6, and returns a report of vendors that match the selection criteria. The report could have drill down capability to give additional detail per vendor This application would be executed with a user that has read only table access to the aforementioned tables.
I just started to use the Oracle tool SQL Developer for a project that has nothing to do with SAP and that gave me the idea I described in the previous paragraph.
Is anyone doing something like this? Or what other methods are being used to allow on demand access to SAP tables, without a SAP license .
We are using SAP Enterprise Edition version 4.7and Basis 620.
Thanks
BruceHello,
You can use an RFC to extract data from SAP.
Depending on the language you can extract data, for example if it is on .NET, you can use the .Net SAP conector, and create a RFC function on SAP, that returns the data you need.
To extract the data you will need a valid SAP user and password.
Hope this helps
Gabriel P. -
How to handle data that got from SAP by Webservice?
Hi, Gurus.
I am working on IFbA with ABAP and Adobe LiveCycle Designer.
I've developed a function module in R/3 system and created webservice, connected the WSDL address to the form. The problem is how can i handle data that got from SAP by Webservice?
It's Ok if i bind the dataconnection node to the form element, but how can i handle data without binding to the form element? I mean that how can i use the data retrieved from Webserivce in the Javascript, please give me some sample code or script method.
Thanks.Hi Yang,
If you are using Web Service, then the binding will be done automatically.
It can't grow automatically, what else should i do to achieve this?
1.Select the table(make sure you are not selecting subform) in Hierarchy view
2. Under table select the Row which is having the required fileds for data
3. In the Binding of that row, check the checkbox "Repeat Row for each item data" and under that check the Min Count which will set the default row **** to 1
Regards,
Sachin -
How to check from which table data is picking by datasource 0CDCY_ACT_ATTR
Hi Experts,
Could you please help me in finding out of the table from which datasource 0CDCY_ACT_ATTR is extracting.
As per my knowledge is should be extract from tables(infotypes) HRP5135 - 5141.If i am wrong please correct me.
Issue : My extractor(0cdcy_ACT_ATTR) is bringing wrong ACT_TYPE (Eg :5010) where as in table HRP5141 for that particular OBJID it is 9180( different).
Please help me why my extractor is bringing ACT_TYPE 5010.
This standard datasource and using Function Module : RCF_BIW_GET_ACTIVITY, How can i check from which table it is picking the data
Thanks in Advanve
SreeHi Sree,
In RSA3 on the first screen, you have the option to start debugging by marking the debug check box, once you put all the selections, click on execute and it will go to debug mode, then keep on pressing F5. It will debug your code line by line, then you can check for all the select statements.
Or once the debugging is started you will have the option to put break point on all the select statements in one shot, you can get in touch with your ABAP team.
Regards,
Durgesh.
Edited by: Durgesh Gandewar on Jul 24, 2011 8:20 PM
Maybe you are looking for
-
Error message on start up "Lightroom encountered an error when reading from its preview cache and needs to quit" I uninstalled and downloaded it again and still get the same error. At this rate I won't have any chance to use the 30 day trial period
-
I am unable to cancel a print document?
-
Printing AnyGantt creates black background color
I use a customized AnyGantt chart. When I try to print it on a page A3 I get a mean issue with the background color. It becomes black. The Chart itself looks good. When I try the same with examples from AnyChart.com the no black background appears. I
-
Compile error "table or view does not exist"
When I run the following code, I get a compile error: Error(5,33): PL/SQL: ORA-00942: table or view does not exist I can run the select statement by itself as an SQL query, so why does this not work in PL/SQL? CREATE OR REPLACE PROCEDURE PREPTEST AS
-
Automate Clearing of SPGL GL Item(not DP/BOE)
Hello, We are trying to automatically clear a underpayment deemed as deduction assigned to SPL GL Ind with a normal credit memo. F,13 doesnt clear SPL GL Items. we are using FOAPPROC01 and 2 and they seem to be not working either. would anyone know s