Problem with Protected Excel sheets through OLE
Hi Friends
We are facing the problem with the protected sheets in excel, when we are accessing worksheets via SAP.
We can insert the values in the protected sheet and we can do other manupalations, but when we are trying to do the autofit for the protected sheet via SAP, then its throwing an error while making it as Visible in SAP ECC 6.0.
Though it is valid, because even when we do in the excel itself, it wont allow the user to shrink the columns, but this one is possible in ECC 5.0 and we can make excel is visible on the screen.
I would like to know is this SAP Version problem or anything else apart from this? and I would like to know is there anyway to unprotect and protect the sheet through ABAP program with out a password. Now my clients wants the autofit though its protected.
Please give me any suggestions.
Thanks
Praveen
its bug with ECC 5.0. If we want to make it auto fit we need to unprotect, then auto fit.
Later we can protect again
Similar Messages
-
Winshuttle problem with new excel sheet
Hi ,
I am getting Winshuttle problem after the excel upgraded to latest version.
when i open the winshuttle from icon, i dont get any prompt/no information.
Any ideas fromo experts ?
SivaWe solved the problem by going into the performance settings and disabling the "fade" functionality in Windows. To get to the screen to make the changes in Windows, open the Control Panel and navigate to "System". Open "System" and click on the "Advanced Settings" tab. Next, click on the button marked "Settings" in the "Performance" area. In the "Visual Affects" tab, clear the checkbox for three "Fade... " options.
I tested this successfully, even for users who have no administrative rights on their computer.
Please try this solution and see what results you receive. The strange thing in our situation is that the OS image used for laptops does not suffer the problem with Bex and WinShuttle as does the OS image used for desktop computers.
BG, are you from the UK? I ask as I watch a few UK television programs, and I notice they use "sorted" in the same manner us Americans use "taken care of" or as us Southerners say "figured out".
Cheers,
Kurt -
Smartview Problem with Protected Sheets
Hello,
We use Hyperion Smart View in our company and discovered a problem while using protected excel sheets while the addin is active. Excel asks for the password but doesnt accept it even if it is the right password. If we disable the addin the problem disappears. Has somebody else such a problem ?
Has somebody a solution or a workaround ?
Thanks for the helpThis issue was logged under Bug 6591401 - When Smart View is active and the worksheet is protected, the following error message is encountered ''Drawing Objects in one or more sheet(s) in the workbook are protected. Please unprotect them and try to save again.'' However, Bug 6591401 has been closed as not a defect.
The following is an explanation of how Smart View handles protected cells and a workaround for this issue:
Smart View needs some place to store it's own metadata within the Excel spreadsheet and it has been using a certain non-obtrusive object for the same. In versions 9.2 and prior, Smart View attempted to unprotect the Excel worksheets to be able to write it's metadata. That led to unexpected behavior when there were passwords used with the protection. This was fixed in 9.3.1.1.2 to make Smart View elegantly honor the spreadsheet protection and not touch objects which are specified as out of bounds by the user. However, when a spreadsheet is protected, this object can become inaccessible to Smart View, after which even a simple save operation cannot go through. In that sense, the current behavior is indeed the correct behavior, where the user placed restriction is honored correctly. The next question will be how can customers then work with protected sheets.
While protecting a worksheet, the following dialog appears which is where the user will have to establish what kind of operations will be allowed on this worksheet. By default the top two options are the only ones that come pre-selected. Just allowing these two options is not sufficient for Smart View to be able to work with the worksheet.
What also needs to be enabled is the option for "Edit Objects" which appears towards the end of the list. It is this option that helps Smart View to be able to persist it's own metadata within the worksheet in a non-obtrusive fashion. The guidance to all Smart View users should be to start enabling this option too, if they choose to apply worksheet protection.
Noel -
Error with Downloaded Excel Drill Through Report
Hello! Please help!
I am having problem with the excel downloaded drill through report. Downloading the report is ok, but when I open the downloaded report, it always have this error:
View Display Error
Error generating view. Error getting cursor in GenerateHead
Error Details
Error Codes: OAMP2OPY:EHWH2A7E
A numeric value was expected (received "0").
The parent report is ok. No such error is being encountered whenever I tried to open downloaded parent report.
I am using OBIEE 10.1.3.4.1 version.
Regards,
MJ
Edited by: user13803157 on Oct 12, 2011 7:34 PM
Edited by: user13803157 on Oct 12, 2011 7:34 PMThis is a known bug. Here are the Metalink details:
Cause
This is due to bug 8394579 - Numeric Input Results in Non-Numeric Error.
Solution
Download and apply patch 9492821. This includes a fix for bug 8394579, even though it is not listed in the readme as being included.
Note that the patch is password protected. Contact Oracle Support for a password.
An alternative solution is to upgrade to OBIEE 11g.
If this was helpful, please mark the response as correct. -
Password Protected Excel Sheet
Hi all,
Please specify how to save Password Protected Excel Sheet using SAP.
Thanks and Regards,
Surya.Please, just check this forum reply:
Make excel sheet password protected through ABAP codeu0085
Check FM:MS_excel_download_*
Arjun..
Pl. reward points -
How to write to a password protected excel sheet using ActiveX?
Hi all,
I would like to write to a protected Excel sheet. I protect the sheet just in case the data is not wrongly programmatically saved to other cells. These cells contained formulas.
Please help.
Thanks,
kengHi Randy,
Thank you for looking into my problem.
I have looked into the Workbook.open property node. There is "password" on the property node. Please see attached diagrams.
Is is the right way to do it?
Please advise further.
For your information, the Excel workbook and sheet 1 are password protected.
Thanks,
keng
Attachments:
Password_Excel.jpg 37 KB
Password_Sheet.jpg 23 KB -
How to upload datas in excel sheet through BDC
Hi,
I know how to upload datas in Text format through BDC...Suppose even when datas are in .xls format,I saved that file as Text(tab delimited) format...then file become text format and it can be easily uploaded....
So, I want to know How to upload datas in excel sheet through BDChi,
try this Example, hope useful to u, assign me point.
report ZMSV1_BDC_CALL
no standard page heading line-size 255.
*include bdcrecx1.
*parameters: dataset(132) lower case.
DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
If it is nessesary to change the data section use the rules:
1.) Each definition of a field exists of two lines
2.) The first line shows exactly the comment
'* data element: ' followed with the data element
which describes the field.
If you don't have a data element use the
comment without a data element name
3.) The second line shows the fieldname of the
structure, the fieldname must consist of
a fieldname and optional the character '_' and
three numbers and the field length in brackets
4.) Each field must be type C.
Generated data section with specific formatting - DO NOT CHANGE ***
data: begin of record,
data element: BUKRS
BUKRS_001(004),
data element: KTOKK
KTOKK_002(004),
data element: NAME1_GP
NAME1_003(035),
data element: SORTL
SORTL_004(010),
data element: ORT01_GP
ORT01_005(035),
data element: LAND1_GP
LAND1_006(003),
data element: SPRAS
SPRAS_007(002),
data element: BANKS
BANKS_01_008(003),
data element: BANKK
BANKL_01_009(015),
data element: BANKN
BANKN_01_010(018),
end of record.
End generated data section ***
data: itab like record occurs 0 .
data: it_bdc type bdcdata occurs 0 with header line.
data: it_msg type bdcmsgcoll occurs 0 with header line.
parameter p_file type rlgrap-filename default 'c:\vendor.txt' obligatory
start-of-selection.
perform open_dataset using p_file.
perform open_group.
*perform close_group.
*perform close_dataset using dataset.
*& Form open_dataset
text
-->P_P_FILE text
form open_dataset using p_p_file.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = p_file
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = itab
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
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. " open_dataset
*& Form open_group
text
--> p1 text
<-- p2 text
form open_group .
loop at itab into record.
perform bdc_dynpro using 'SAPMF02K' '0105'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-BUKRS'
record-BUKRS_001.
perform bdc_field using 'RF02K-KTOKK'
record-KTOKK_002.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-ORT01'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
record-NAME1_003.
perform bdc_field using 'LFA1-SORTL'
record-SORTL_004.
perform bdc_field using 'LFA1-ORT01'
record-ORT01_005.
perform bdc_field using 'LFA1-LAND1'
record-LAND1_006.
perform bdc_field using 'LFA1-SPRAS'
record-SPRAS_007.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-KOINH(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'LFBK-BANKS(01)'
record-BANKS_01_008.
perform bdc_field using 'LFBK-BANKL(01)'
record-BANKL_01_009.
perform bdc_field using 'LFBK-BANKN(01)'
record-BANKN_01_010.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02K' '0210'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-AKONT'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0215'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0220'.
perform bdc_field using 'BDC_CURSOR'
'LFB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
call transaction 'FK01' using it_bdc mode 'A' update 'S'
messages into it_msg.
write:/ sy-subrc.
perform message_formatwrite.
refresh it_bdc.
clear it_bdc.
endloop.
endform. " open_group
*& Form message_formatwrite
text
--> p1 text
<-- p2 text
form message_formatwrite .
data:l_msg(10).
loop at it_msg.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = SY-MSGID
LANG = sy-langu
NO = SY-MSGNO
V1 = SY-MSGV1
V2 = SY-MSGV2
V3 = SY-MSGV3
V4 = SY-MSGV4
IMPORTING
MSG = l_msg
EXCEPTIONS
NOT_FOUND = 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.
endloop.
endform. " message_formatwrite
*& Form bdc_dynpro
text
-->P_0112 text
-->P_0113 text
form bdc_dynpro using value(p_0112)
value(p_0113).
it_bdc-program = p_0112.
it_bdc-dynpro = p_0113.
it_bdc-dynbegin = 'X'.
append it_bdc.
clear it_bdc.
endform. " bdc_dynpro
*& Form bdc_field
text
-->P_0117 text
-->P_0118 text
form bdc_field using value(p_0117)
value(p_0118).
it_bdc-fnam = p_0117.
it_bdc-fval = p_0118.
append it_bdc.
clear it_bdc.
endform. " bdc_field
Regards
fareedas -
How to set border of excel cell through ole ?
How to set border either of left / right / top / bottom of excel cell through ole ?
Click on the outside the line above header and select all the columns and rows and set the border horz and vert this will solve your problem. if you select current data alone then it will select the current data alone borders. if you runa diff criteria then for the new values borders wont be there. so better always try selecting the column top i.e above the column header and set the border.
-
Upload data in excel sheet through BDC
Dear all,
How do we upload data in excel sheet through BDC?
Thanks in advance.
Regards,
Sandra.Hi,
The sample code is as given below:
REPORT upload_supply_area.
*include for dispaying icons in error log
INCLUDE <icon>.
*Declaration of structure.
TYPES:BEGIN OF x_struct,
werks TYPE v_pvbe-werks, "Plant
prvbe TYPE v_pvbe-prvbe, "Supply Area
pvbtx TYPE v_pvbe-pvbtx, "Production supply area description
lgort TYPE v_pvbe-lgort, "Storage Location
rgver TYPE v_pvbe-rgver, "Person responsible for one or more supply areas
END OF x_struct.
TYPES:BEGIN OF x_messages,
msgtyp(1) type c,
werks TYPE v_pvbe-werks, "Plant
prvbe TYPE v_pvbe-prvbe, "Supply Area
message(120) type c,
END OF x_messages.
DATA: it_messages TYPE STANDARD TABLE OF x_messages .
DATA: wa_messages TYPE x_messages.
DATA:it_msgtab TYPE STANDARD TABLE OF bdcmsgcoll,
wa_msgtab TYPE bdcmsgcoll.
*internal table for BDC
DATA: it_bdcdata TYPE STANDARD TABLE OF bdcdata.
DATA: wa_bdcdata TYPE bdcdata.
DATA:it_file TYPE STANDARD TABLE OF x_struct. "internal table which has same structure as file
DATA:wa_file TYPE x_struct. "work area which has same structure as file
DATA: it_excel TYPE STANDARD TABLE OF alsmex_tabline,
wa_excel TYPE alsmex_tabline.
DATA: x_ctuprms TYPE ctu_params.
DATA:nodata TYPE c VALUE '/'.
data:con(50) type c.
data:con1(50) type c.
*selection screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
*Enter file name on presentation server
PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
*Function which enables the user to browse the files on hard disk
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = syst-repid
static = 'X'
CHANGING
file_name = p_file
EXCEPTIONS
mask_too_long = 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.
START-OF-SELECTION.
*Subroutine to upload excel file and read it
PERFORM upload.
*Subroutine to upload supply area data
PERFORM fill.
*& Form bdc_dynpro
Fill the BDC table
FORM bdc_dynpro USING program dynpro. "#EC *
CLEAR wa_bdcdata.
wa_bdcdata-program = program.
wa_bdcdata-dynpro = dynpro.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
ENDFORM. "BDC_DYNPRO
*& Form bdc_field
Fill the BDC table
FORM bdc_field USING fnam fval. "#EC *
IF fval <> nodata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = fnam.
wa_bdcdata-fval = fval.
APPEND wa_bdcdata TO it_bdcdata. "#EC
ENDIF.
ENDFORM. "BDC_FIELD
*& Form collect_messages
Collect the messages from transaction
FORM collect_messages . "#EC *
DATA: w_msg(100).
LOOP AT it_msgtab INTO wa_msgtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = wa_msgtab-msgid
lang = wa_msgtab-msgspra
no = wa_msgtab-msgnr
v1 = wa_msgtab-msgv1
v2 = wa_msgtab-msgv2
IMPORTING
msg = w_msg
EXCEPTIONS
not_found = 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.
CONDENSE w_msg.
CLEAR wa_messages.
wa_messages-msgtyp = wa_msgtab-msgtyp.
wa_messages-message = w_msg.
wa_messages-werks = wa_file-werks.
wa_messages-prvbe = wa_file-prvbe.
if wa_messages-message eq 'Formatting error in the field V_PVBE-RGVER; see next message'.
wa_messages-message = 'Invalid name of the person responsible'.
endif.
if wa_messages-message eq 'Formatting error in the field V_PVBE-LGORT; see next message'.
wa_messages-message = 'Enter the storage location'.
endif.
APPEND wa_messages TO it_messages .
ENDLOOP.
REFRESH it_msgtab.
ENDFORM. "collect_messages
*& Form write_messages
Display the messages
FORM write_messages .
DELETE ADJACENT DUPLICATES FROM it_messages COMPARING werks prvbe.
LOOP AT it_messages INTO wa_messages .
WRITE:/1 sy-vline.
IF wa_messages-msgtyp = 'S'.
WRITE: 10 icon_green_light.
ELSEIF wa_messages-msgtyp = 'E'.
WRITE: 10 icon_red_light.
ELSEIF wa_messages-msgtyp = 'W'.
WRITE: 10 icon_yellow_light.
ENDIF.
WRITE: 20 sy-vline.
WRITE : 30 'Plant-', wa_messages-werks . "#EC NOTEXT
WRITE: 48 sy-vline.
WRITE : 49 'Supply Area-', wa_messages-prvbe . "#EC NOTEXT
WRITE: 79 sy-vline.
WRITE : 80 wa_messages-message .
WRITE: 180 sy-vline.
WRITE:/1 sy-vline.
ULINE 1(180).
ENDLOOP.
ENDFORM. " write_m
*& Form fill_params
Processing mode for the transaction
FORM fill_params .
x_ctuprms-dismode = 'N'.
x_ctuprms-updmode = 'A'.
x_ctuprms-defsize = 'X'.
ENDFORM. "fill_params
*& Form upload
Upload the excel file and read the data
FORM upload .
*Function to upload excel file
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 2
i_end_col = 5
i_end_row = 9999
TABLES
intern = it_excel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 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.
CLEAR wa_file.
*Read the file row-wise
LOOP AT it_excel INTO wa_excel.
CASE wa_excel-col .
*Read plant
WHEN '1'.
wa_file-werks = wa_excel-value.
*Read supply area
WHEN '2'.
wa_file-prvbe = wa_excel-value.
*Read decription
WHEN '3'.
wa_file-pvbtx = wa_excel-value.
*Read storage location
WHEN '4'.
wa_file-lgort = wa_excel-value.
*Read Person responsible
WHEN '5'.
IF STRLEN( wa_excel-value ) = 1.
CONCATENATE '00' wa_excel-value INTO con.
wa_file-rgver = con.
ELSEIF STRLEN( wa_excel-value ) = 2.
CONCATENATE '0' wa_excel-value INTO con1.
wa_file-rgver = con1.
ELSE.
wa_file-rgver = wa_excel-value.
ENDIF.
ENDCASE.
AT END OF row.
CONDENSE:wa_file-werks,wa_file-prvbe,wa_file-pvbtx,wa_file-lgort,wa_file-rgver.
APPEND wa_file TO it_file.
CLEAR wa_file.
ENDAT .
ENDLOOP.
ENDFORM. " upload
*& Form fill
Call the transaction 'PK05'
FORM fill .
*Upload the data through transaction 'PK05'
PERFORM fill_params.
LOOP AT it_file INTO wa_file.
PERFORM bdc_dynpro USING 'SAPLSVIX' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'D0100_FIELD_TAB-LOWER_LIMIT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=OKAY'.
PERFORM bdc_dynpro USING 'SAPL0PK1' '0020'.
PERFORM bdc_field USING 'BDC_CURSOR'
'V_PVBE-PVBTX(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=NEWL'.
PERFORM bdc_dynpro USING 'SAPL0PK1' '0021'.
PERFORM bdc_field USING 'BDC_CURSOR'
'V_PVBE-RGVER'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'V_PVBE-WERKS'
wa_file-werks.
PERFORM bdc_field USING 'V_PVBE-PRVBE'
wa_file-prvbe.
PERFORM bdc_field USING 'V_PVBE-PVBTX'
wa_file-pvbtx.
PERFORM bdc_field USING 'V_PVBE-LGORT'
wa_file-lgort.
PERFORM bdc_field USING 'V_PVBE-RGVER'
wa_file-rgver.
PERFORM bdc_dynpro USING 'SAPL0PK1' '0021'.
PERFORM bdc_field USING 'BDC_CURSOR'
'V_PVBE-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SAVE'.
PERFORM bdc_field USING 'V_PVBE-WERKS'
wa_file-werks.
PERFORM bdc_field USING 'V_PVBE-PRVBE'
wa_file-prvbe.
PERFORM bdc_field USING 'V_PVBE-PVBTX'
wa_file-pvbtx.
PERFORM bdc_field USING 'V_PVBE-LGORT'
wa_file-lgort.
PERFORM bdc_field USING 'V_PVBE-RGVER'
wa_file-rgver.
CALL TRANSACTION 'PK05'
USING it_bdcdata
OPTIONS FROM x_ctuprms
MESSAGES INTO it_msgtab.
REFRESH it_bdcdata.
PERFORM collect_messages.
CLEAR wa_file.
ENDLOOP.
PERFORM write_messages.
ENDFORM. " fill -
Passwort protected Excel sheet
Is there any hack to open a passwort protected excel sheet?
Numbers reports that the excel file is encrypted.Hello
As the OP asked upon Numbers, I assumed that he wasn't owning XL.
At this time I didn't find a XL unlocker app running under MacOS.
So it will continue to be unable to import it
Yvan KOENIG (from FRANCE samedi 19 janvier 2008 11:09:34) -
How to get the password of a password protected Excel Sheet using java/jxl
Hi ,
how to get the password of a password protected Excel Sheet using java / jxl program.
plz any one help me .
Ramesh P
[email protected]If they've implemented the password system correctly there probably isn't a way of getting the password at all.
-
Dear All,
I have a problem with an EXCEL file, i'm in a domain with windows server 2003 and all of the computer have windows 7, a user had open 3 weeks ago a fil excel after she gone on holiday so the file remain open (i don't know how) by she.
I've try with all unlocker program to make the file deletable, but not work... it is very strange because if i try to open it with the account of the user that open the file appears always the same error (open read only)...
Could you help me?
thanksHi,
You may end the Excel process first, the “PsTools” have a pskill command that you can use to end a process remotely.
Here’s a simple command:
pskill \\computer –u username -p password excel.exe
For more information, please see the KB below:
http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx
Best Regards -
Is it possible to create Excel Sheet using OLE automation in App server
Hi,
Is it possible to create Excel Sheet using OLE automation in Application server(Open Dataset)
Thanks in advance...Unless your application server is on Windows OS, or it is connected to a Windows server by RFC. What is the requirement exactly, I don't understand?
-
Problem in Sending mail with attachment (Excel sheet)
Hi
Iam using this FM SO_NEW_DOCUMENT_ATT_SEND_API1 for sending mail with an attachment (excel sheet).
the application is running fine , mail is going to other system . but the excel sheet attachment contain only few rows not all.
and the body of the mail is not displaying .
Can any one help me. Thanks in advance.Hi,
you can use cl_bcs classes for the same. I am using below code for same thng
CONSTANTS:c_tab TYPE c VALUE cl_bcs_convert=>gc_tab.
CONSTANTS:c_crlf TYPE c VALUE cl_bcs_convert=>gc_crlf.
DATA o_send_request TYPE REF TO cl_bcs.
DATA o_document TYPE REF TO cl_document_bcs.
DATA o_recipient TYPE REF TO if_recipient_bcs.
DATA o_bcs_exception TYPE REF TO cx_bcs.
TRY.
o_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = is_mail_text
i_subject = text-005 ).
ENDTRY.
*create file header
CONCATENATE
text-h00 c_tab text-h01 c_tab text-h02 c_tab text-h03 c_tab text-h04 c_tab
text-h52 c_tab text-h05 c_tab text-h06 c_tab text-h07 c_tab text-h08 c_tab text-h09 c_tab
c_crlf INTO w_data_string.
Loop at itab which contains data to be send as attachment
concatenate field1 field2 field3 c_crlf into your_string separated by c_tab
conatenate final string your_string into final_string.
endloop.
*Convert data into suitable excel format
TRY.
CALL METHOD cl_bcs_convert=>string_to_solix
EXPORTING
iv_string = w_data_string
iv_codepage = '4103'
iv_add_bom = 'X'
IMPORTING
et_solix = w_binary_content.
CATCH cx_bcs INTO o_bcs_exception.
IF o_bcs_exception IS NOT INITIAL.
w_exec_txt = o_bcs_exception->get_text( ).
MESSAGE w_exec_txt TYPE 'S'.
ENDIF.
ENDTRY.
add the spread sheet as attachment to document object
CONCATENATE text-006 sy-datum INTO w_attach_name SEPARATED BY space.
o_document->add_attachment(
i_attachment_type = 'xls'
i_attachment_subject = w_attach_name
i_att_content_hex = w_binary_content ).
*create persistent send request
o_send_request = cl_bcs=>create_persistent( ).
add document object to send request
o_send_request->set_document( o_document ).
create recipient object for external mail id
w_mlrec = iw_recipent.
TRY.
o_recipient = cl_distributionlist_bcs=>getu_persistent(
i_dliname = w_mlrec
i_private = space ).
CATCH cx_bcs INTO o_bcs_exception.
IF o_bcs_exception IS NOT INITIAL.
w_exec_txt = o_bcs_exception->get_text( ).
MESSAGE w_exec_txt TYPE 'S'.
ENDIF.
ENDTRY.
add recipient object to send request
o_send_request->add_recipient( o_recipient ).
---------- send document ---------------------------------------
w_sent_to_all = o_send_request->send( i_with_error_screen = 'X' ).
IF w_sent_to_all EQ abap_true.
COMMIT WORK.
ENDIF. -
Increase the column lengths of excel sheet through abap
I developed a abap program and it was displayed the output.
So i need to display this out put in excel sheet.
for that I read the out put and placed in the excel,
the only problem is the column lengths are small
after download i am dragging the each column,
But i need to increase the each column by the program
How can I ?
I am using the following code
lastline = new_line_c + 13.
DO .
READ LINE sy-index LINE VALUE INTO it_read-excel.
APPEND it_read.
IF sy-index > lastline.
EXIT.
ENDIF.
ENDDO.
lastline = new_line_c - 38.
colm = ( length - 37 ) / 18.
colm = colm + 4.
FOR THE EXCEL CONVERTION
INCLUDE ole2incl.
DATA: w_cell1 TYPE ole2_object,
w_cell2 TYPE ole2_object.
*--- Ole data Declarations
DATA: h_excel TYPE ole2_object, " Excel object
h_mapl TYPE ole2_object, " list of workbooks
h_map TYPE ole2_object, " workbook
h_zl TYPE ole2_object, " cell
h_f TYPE ole2_object, " font
gs_interior TYPE ole2_object, " Pattern
worksheet TYPE ole2_object,
h_cell TYPE ole2_object,
h_merge TYPE ole2_object,
h_cell1 TYPE ole2_object,
range TYPE ole2_object,
h_sheet2 TYPE ole2_object,
h_sheet3 TYPE ole2_object,
gs_font TYPE ole2_object,
flg_stop(1) TYPE c.
*DATA: t_excel_bckord LIKE t_excel OCCURS 0 WITH HEADER LINE,
*t_excel_bcklog LIKE t_excel OCCURS 0 WITH HEADER LINE,
*t_excel_blkord LIKE t_excel OCCURS 0 WITH HEADER LINE.
TYPES: data1(1500) TYPE c,
ty TYPE TABLE OF data1.
DATA: it TYPE ty WITH HEADER LINE,
it_2 TYPE ty WITH HEADER LINE,
it_3 TYPE ty WITH HEADER LINE,
rec TYPE sy-tfill,
deli(1) TYPE c,
l_amt(18) TYPE c.
DATA: BEGIN OF hex,
tab TYPE x,
END OF hex.
FIELD-SYMBOLS: <fs> .
CONSTANTS cns_09(2) TYPE n VALUE 09.
ASSIGN deli TO <fs> TYPE 'X'.
hex-tab = cns_09.
<fs> = hex-tab.
DATA gv_sheet_name(20) TYPE c .
M A C R O Declaration
DEFINE ole_check_error.
if &1 ne 0.
message e001(zz) with &1.
exit.
endif.
END-OF-DEFINITION.
DATA: xy TYPE i,
xz TYPE i,
yz TYPE i,
ab TYPE i,
pterm TYPE i.
IF h_excel-header = space OR h_excel-handle = -1.
start Excel
CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
ENDIF.
PERFORM err_hdl.
*--- get list of workbooks, initially empty
CALL METHOD OF h_excel 'Workbooks' = h_mapl.
PERFORM err_hdl.
SET PROPERTY OF h_excel 'Visible' = 1.
add a new workbook
CALL METHOD OF h_mapl 'Add' = h_map.
PERFORM err_hdl.
*GV_SHEET_NAME = '1st SHEET'.
gv_sheet_name = 'Price Comparison List'.
GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
index1 = 3.
LOOP AT it_read.
heading
IF sy-tabix < 4.
it_item = it_read.
IF it_item CS '-----'.
CLEAR it_item.
APPEND it_item.
ELSE.
IF sy-tabix = 1.
it_item+0(1) = deli.
ENDIF.
APPEND it_item.
ENDIF.
ENDIF.
headear data and item
IF sy-tabix > 4 AND sy-tabix < descline1.
it_item = it_read.
IF it_item CS '----'.
ELSE.
REPLACE ALL OCCURRENCES OF sy-vline IN it_item WITH deli.
APPEND it_item.
ENDIF.
ENDIF.
xy = 2.
xz = 38.
discount etc
IF sy-tabix >= descline1 AND sy-tabix < descline.
it_item = it_read.
it_item+12(1) = deli.
it_item+22(1) = deli.
it_item+43(1) = deli.
WHILE xy < colm.
xz = xz + 18.
it_item+xz(1) = deli.
xy = xy + 1.
ENDWHILE.
APPEND it_item.
ENDIF.
payment terms
xy = 2.
xz = 37.
pterm = descline + 6.
IF sy-tabix > descline AND sy-tabix < pterm.
it_item = it_read.
IF it_item CS '-----'.
CLEAR it_item.
APPEND it_item.
ELSE.
it_item+12(1) = deli.
it_item+15(1) = deli.
it_item+36(1) = deli.
WHILE xy < colm.
xz = xz + 17.
it_item+xz(1) = deli.
xy = xy + 1.
ENDWHILE.
APPEND it_item.
ENDIF.
ENDIF.
prepared by
lastline = pterm + 3.
IF sy-tabix >= pterm AND sy-tabix <= lastline.
it_item = it_read.
IF it_item CS '-----'.
ELSE.
it_item+0(1) = deli.
it_item+54(1) = ' '.
it_item+16(1) = deli.
APPEND it_item.
ENDIF.
ENDIF.
remaarks
yz = lastline + 10.
IF sy-tabix > lastline AND sy-tabix <= yz.
it_item = it_read.
it_item+0(1) = deli.
it_item+54(1) = ' '.
APPEND it_item.
ENDIF.
approved by
ab = yz + 5.
IF sy-tabix > yz AND sy-tabix < ab.
it_item = it_read.
IF it_item CS '-----'.
ELSE.
it_item+0(1) = deli.
it_item+54(1) = ' '.
it_item+14(1) = deli.
APPEND it_item.
ENDIF.
ENDIF.
ENDLOOP.
*--Formatting the area of additional data 1 and doing the BOLD
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = colm.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
*CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
*Bold for the second row
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 2
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = colm.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
*CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
*Bold for the fourth row
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 4
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = colm.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
*CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
*Bold for the fifth row
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 5
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = colm.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
*CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
*Bold for the sixth row
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 6
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = colm.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
*CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
DATA l_rc TYPE i.
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
data = it_item[]
CHANGING
rc = l_rc
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = 1.
PERFORM err_hdl.
CALL METHOD OF h_excel 'Range' = range
EXPORTING
#1 = w_cell1
#2 = w_cell2.
CALL METHOD OF range 'Select'.
PERFORM err_hdl.
CALL METHOD OF worksheet 'Paste'.
PERFORM err_hdl.
CALL METHOD OF h_excel 'QUIT'.
FREE OBJECT h_zl.
FREE OBJECT h_mapl.
FREE OBJECT h_map.
FREE OBJECT h_excel.Hello Ravi,
Thank you very much for your suggestions.. but still have some more doubts:
What i want to do is :
-->call report in background job with a selection criteria.
-->the output of the report should be trasnsfered to excel sheet
-->then the excel sheet should be sent to XI..
My doubts are:
-> is it possible with every report or we need some extra code to achieve this
-> If yes, then how exactly it should be done. can you please explain in more detail.
Thank you very much for your help.
Best Regards,
Jasmeet
Maybe you are looking for
-
Beim Laden von RAW Dateien (je ca 30MB) in der Bibliothek stürzt L5 ab. Das hat angefangen seit ich Fotos mit Nikon D7100 mache, und eine 64GB SDXC Speicherkarte benutze. Die Fotos sind auf dem PC (geladen mit einen sdxc Lesegerät) und im Explorer vo
-
Dear All Experts. I want to know that what is the use of 1KEI & 3KEH I have read some where that , 1 ) After uploading the balances through AS91 and OASV activity the user have to transfer those balances to PCA. but why we have to transfer those bal
-
Which is weblogic serevr home directory
Hi All i installed weblogic 10.3 in my system. i am deploying ADF jdev10.1.3 application on weblogic server. while installing ADF runtime libraries it is asking for weblogic server home directory. i gave F:\bea .(which is Bea home directory) but the
-
Grey Folder with Question Mark?
On Saturday afternoon April 7th I was at the Apple Store and they ran a diagnostic on my Black Mac Book. All things checked out with green check marks. I was a happy person. Well, yesterday, at start-up, a strange gray folder with a question mark app
-
Hi folks, not sure if these news are new to you and even less sure if these news actually are news at all, because I couldn't yet verify. But you might want to have a look anyway. :) http://www.directorforum.com/showthread.php?t=3758 More details to