Any FM or other ways to open the Excel file with data
Please provide some Help, where I need to open the excel File with some static data (header data) from the Selection screen application Toolbar on clicking the button
Thanks
Ravindra
Hi here is good example.
Satish
Reads an existing Idoc and dispays the contents in a spreadsheet format
REPORT Z_DISPLAY_IDOC_AND_DATA line-size 275.
This tool reads an existing Idoc and dispays the contents in a *
spreadsheet format. The spreadsheet (MS-EXCEL) will be automatically *
created if D_EXCEL = 'X'. *
data: idoc_control like EDIDC,
NUMBER_OF_DATA_RECORDS like sy-dbcnt,
NUMBER_OF_STATUS_RECORDS like sy-dbcnt,
INT_EDIDS like edids occurs 0 with header line,
INT_EDIDD like edidd occurs 0 with header line.
TYPE-POOLS : LEDID.
data: STRUCT_TYPE TYPE LEDID_STRUCT_TYPE ,
IDOC_STRUCT TYPE LEDID_T_IDOC_STRUCT,
SEGMENTS TYPE LEDID_T_SEGMENT,
SEGMENT_STRUCT TYPE LEDID_T_SEGMENT_STRUCT,
excel_tab(2000) occurs 0 with header line.
parameter: DOCNUM like edidc-docnum obligatory, ""Idoc Number
sap_rel like SY-SAPRL default SY-SAPRL obligatory,
pi_ver like EDI_VERREC-VERSION default '3' obligatory,
d_excel as checkbox default 'X'. ""Download ?
start-of-selection.
perform read_idoc.
perform process_idoc.
if d_excel = 'X'.
perform download_to_excel.
endif.
end-of-selection.
FORM read_idoc.
CALL FUNCTION 'IDOC_READ_COMPLETELY'
EXPORTING
DOCUMENT_NUMBER = docnum
IMPORTING
IDOC_CONTROL = idoc_control
NUMBER_OF_DATA_RECORDS = NUMBER_OF_DATA_RECORDS
NUMBER_OF_STATUS_RECORDS = NUMBER_OF_STATUS_RECORDS
TABLES
INT_EDIDS = INT_EDIDS
INT_EDIDD = INT_EDIDD
EXCEPTIONS
DOCUMENT_NOT_EXIST = 1
DOCUMENT_NUMBER_INVALID = 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.
ENDFORM. "" read_idoc
FORM process_idoc.
perform read_idoc_structure.
perform display_data_records.
ENDFORM. "" process_idoc
FORM display_data_records.
data: PE_seg_HEADER like EDI_SAPI01,
segname like EDI_IAPI12-SEGMENTTYP,
prev_segname like EDI_IAPI12-SEGMENTTYP value ' ',
pt_fields2 like EDI_IAPI12 occurs 0 with header line,
PT_FVALUES2 like EDI_IAPI14 occurs 0 with header line,
byte_first type i,
byte_last type i,
field_val(50),
tmp_str(15),
tmp_str3(15),
seg_repeats type i value 0,
tmp_str2(15),
tab_cr(1) type x value '09',
tot_ctr type i value 0,
ctr type i value 0,
msg(40) type c.
data: IDOC_STRUCT_wa TYPE LEDID_IDOC_STRUCT.
sort int_edidd by segnum.
describe table int_edidd lines tot_ctr.
loop at int_edidd.
move int_edidd-segnam to segname.
clear msg.
concatenate 'Reading segment ' segname
into msg separated by space.
if tot_ctr <> 0.
ctr = ( 100 * sy-tabix ) / tot_ctr.
endif.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = ctr
TEXT = msg.
add 1 to seg_repeats.
clear tmp_str2.
if int_edidd-segnam <> prev_segname.
seg_repeats = 1.
clear: pe_seg_header, pt_fields2, pt_fvalues2.
refresh: pt_fields2, pt_fvalues2.
CALL FUNCTION 'SEGMENT_READ_COMPLETE'
EXPORTING
PI_SEGTYP = segname
PI_RELEASE = sap_rel
PI_VERSION = pi_ver
IMPORTING
PE_HEADER = pe_seg_header
TABLES
PT_FIELDS = pt_fields2
PT_FVALUES = pt_fvalues2
EXCEPTIONS
SEGMENT_UNKNOWN = 1
SEGMENT_STRUCTURE_UNKNOWN = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
prev_segname = int_edidd-segnam.
endif.
read table idoc_struct into idoc_struct_wa with key
segment_type = int_edidd-segnam.
if sy-subrc = 0.
IF IDOC_STRUCT_WA-SYNTAX_ATTRIB-MUSTFL = 'X'.
TMP_STR = 'Mandatory'. ""Mandatory
ELSE.
TMP_STR = 'Optional'. ""Optional
ENDIF.
if IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-QUALIFIER = 'X'.
tmp_str3 = 'Qualified'.
else.
tmp_str3 = 'Non-Qualified'.
endif.
shift IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX
left deleting leading '0'.
move seg_repeats to tmp_str2.
condense: IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX, tmp_str2.
concatenate tmp_str2 'of' IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX
into tmp_str2 separated by space.
write :/ IDOC_STRUCT_wa-SEGMENT_TYPE,
tmp_str,
TMP_STR3,
tmp_str2,
IDOC_STRUCT_wa-SYNTAX_ATTRIB-HLEVEL,
IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-plast,
IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-DESCRP.
if d_excel = 'X'.
concatenate 'Segment Name' tab_cr
'Mand / Opt ' tab_cr
'Qual / non-Qual' tab_cr
'Seq of Max' tab_cr
'Level' tab_cr
'Owner' tab_cr
'Description'
into excel_tab.
append excel_tab.
concatenate IDOC_STRUCT_wa-SEGMENT_TYPE tab_cr
tmp_str tab_cr
TMP_STR3 tab_cr
tmp_str2 tab_cr
IDOC_STRUCT_wa-SYNTAX_ATTRIB-HLEVEL tab_cr
IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-plast tab_cr
IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-DESCRP
into excel_tab.
append excel_tab.
concatenate tab_cr
'Field Nma' tab_cr
'Type' tab_cr
'Length' tab_cr
'Byte From' tab_cr
'Byte To' tab_cr
'Description' tab_cr
'Value' tab_cr
'Qualifier Meaning'
into excel_tab.
append excel_tab.
endif.
endif.
sort pt_fields2 by field_pos.
byte_first = 0.
loop at pt_fields2.
clear: field_val.
byte_last = pt_fields2-EXTLEN.
write int_edidd-sdata+byte_first(byte_last) to
field_val left-justified.
shift pt_fields2-EXTLEN left deleting leading '0'.
shift pt_fields2-byte_first left deleting leading '0'.
shift pt_fields2-byte_last left deleting leading '0'.
write:/ ' ', pt_fields2-fieldname,
pt_fields2-datatype,
pt_fields2-EXTLEN,
pt_fields2-byte_first ,
pt_fields2-byte_last,
pt_fields2-descrp,
field_val.
read table pt_fvalues2 with key fieldname = pt_fields2-fieldname
fldvalue_l = field_val.
add byte_last to byte_first.
if sy-subrc = 0.
write : pt_fvalues2-descrp.
else.
clear pt_fvalues2-descrp.
endif.
if d_excel = 'X'.
concatenate tab_cr pt_fields2-fieldname tab_cr
pt_fields2-datatype tab_cr
pt_fields2-EXTLEN tab_cr
pt_fields2-byte_first tab_cr
pt_fields2-byte_last tab_cr
pt_fields2-descrp tab_cr
field_val tab_cr
pt_fvalues2-descrp
into excel_tab.
append excel_tab.
endif.
endloop.
endloop.
ENDFORM. "" display_data_records
FORM read_idoc_structure.
data: idoctype type LEDID_IDOCTYPE.
if not idoc_control-cimtyp is initial.
STRUCT_TYPE = 'E'. ""Extended
idoctype = idoc_control-cimtyp.
else.
STRUCT_TYPE = 'B'. ""Basic
idoctype = idoc_control-idoctp.
endif.
CALL FUNCTION 'IDOC_TYPE_COMPLETE_READ'
EXPORTING
RELEASE = sap_rel
STRUCT_TYPE = STRUCT_TYPE
IDOCTYPE = idoctype
VERSION = pi_ver
IMPORTING
IDOC_TYPE = idoctype
TABLES
IDOC_STRUCT = idoc_struct
SEGMENTS = segments
SEGMENT_STRUCT = segment_struct
EXCEPTIONS
IDOCTYPE_UNKNOWN = 1
IDOCSTRUCT_UNKNOWN = 2
SEGMENT_DATA_MISSING = 3
ILLEGAL_STRUCT_TYPE = 4
OTHERS = 5.
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. "" read_idoc_structure
FORM download_to_excel.
data: name like RLGRAP-FILENAME.
shift docnum left deleting leading '0'.
concatenate docnum '-' idoc_control-idoctp '.xls'
into name.
CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
EXPORTING
DATA_NAME = name
DATA_TYPE = 'ASC'
WAIT = ' '
TABLES
DATA_TAB = excel_tab
EXCEPTIONS
NO_BATCH = 1
EXCEL_NOT_INSTALLED = 2
WRONG_VERSION = 3
INTERNAL_ERROR = 4
INVALID_TYPE = 5
CANCELLED = 6
DOWNLOAD_ERROR = 7
OTHERS = 8
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. "" download_to_excel
Similar Messages
-
Any one succeeded in CLIENT_OLE2 to open an excel file at the client side??
Hi
Any one succeeded in CLIENT_OLE2 to open an excel file at the client side, if so plz share the code, it would be very much appreciated, i already spend two days for that, but it is not opening , I am using forms 10g, OC4J, Jacob 18, Webutil 10.2. Other methods of the webutil are working fine.
Thanks in advance.Hi
Any one succeeded in CLIENT_OLE2 to open an excel file at the client side, if so plz share the code, it would be very much appreciated, i already spend two days for that, but it is not opening , I am using forms 10g, OC4J, Jacob 18, Webutil 10.2. Other methods of the webutil are working fine.
Thanks in advance. -
I get my emails sent to my Ipad 1 and when I try to open the excel files, they come up in a sort of word doc. how can I get them to come over on excel
I was still typing my first post while you had already responded.
Maybe I am taking your last post the wrong way but reread your post. If I am taking it the wrong way - please accept my apology in advance.
lisaadele123 wrote:
I get my emails sent to my Ipad 1 and when I try to open the excel files, they come up in a sort of word doc. how can I get them to come over on excel
Where do you state that you need to email the files to someone else?
Where do you state that you need to edit them?
This was my response ....
You can't edit any of these files without a compatible iPad app like Documents to Go (Excel, Word) or Pages (Word files).
You can open and view the files as mail attachments but you will not be able to edit them. Explain exactly what you are doing and maybe you can get meaningful instructions.
Basically I said the same thing as Julian and I thought that maybe if you explained EXACTLY what you were trying to do, it would be helpful.
Sorry for not being a mind reader. Your second post ...
I thought I had already explained, I get excel spreadsheets emailed to me I need to open them, read them, edit them and send them on to another person,
That is not what you asked the first time around.
Message was edited by: Demo -
Problem while opening the excel files
Hi
In my system , i have excel reports in my server disk . And i am opening the excel files through an action class like /viewReport.do?id=23 .....and thus from the action class i open my excel file .
After opening one excel file , i try to open another excel by clicking that link , then my system often hangs else excel shows an error saying "a report with name viewReport.do is already open " even though both of these files are different on the server
How can i avoid this ??
The reason why i am opening the excel file through an action class is , i need to perform some operations before opening that excel report
i tried by setting the
response.setHeader("Content-disposition","attachment; filename=myWorksheet.xls");
and i kept on changing the names but that doesnt work
Can any one let me know how to go abt this ??Hi Sir,
I found you posted the issue in the
APS.NET forum, and you seems use some code to open the file. Have you tried the last link in the thread?
Then, let's do some test to narrow down the issue.
I notice that you are using Office 2010, does the issue occur only with 'Reachlocal.xlsx' or every existed file?
If every Excel file has the issue, please try the following methods:
Open the file in
safe mode.
Repair Office 2010.
On the other hand, this problem might be caused by malware on the affected machine. There are now two known variants of malware which causes this problem: Win32/Crilock.A and
Win32/Buma!rts. They have both been identified as a new family of
ransomware.
http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2013/09/07/quot-cannot-open-the-file-because-the-file-format-or-extension-is-invalid-quot-opening-office-files.aspx
If you have any further assistance about code/program, I recommend you post the question to MSDN forum:
http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
Regards,
George Zhao
TechNet Community Support -
Hello, I am trying to send an email where the recipient opens the PDF file with a password, can anybody show me how to do that
Hi surez,
To password protect a PDF file, you need to use Acrobat. If you don't have Acrobat, you can try it for free for 30 days. See www.adobe.com/products/acrobat.html for more information.
In Acrobat, you choose File > Properties when the document is open, and then click the Security tab to set up a password.
Please let us know how it goes.
Best,
Sara -
How to open an excel file with password in Crystal Reports XI Release 2
I have a problem when i try to open an excel 2003 file with password that i know
i recevived an error code 0xc59
How can I open a file in excel 2003 protected by password to create the report?
Thanks in advancedHi Pierluigi,
It looks like you have to open the excel file and use the data.
A few informative links.
http://support.microsoft.com/kb/257819#RetrieveExcel
http://support.microsoft.com/kb/211378/EN-US/
Hope this helps.
Regards,
Abhijeet Taskar. -
Need to generate the excel file with diffrent sheets using utl_file package
Hi,
Sorry for previous message in which I had missed the usage of " UTL_FILE " package
I need to generate the excel file with diffrent sheets . Currently I am generating the data in three diffrent excel files using
" UTL_File " package and my requirement is to generate this in a single excel file with diffrent sheets.
Please help on this
Thanks & Regards,
Krishna VyavahareHello 10866107,
at Re: How to save a query result and export it to, say excell? you can find links to different solutions. At least the packages behind second and fourth link support more than one worksheet.
Regards
Marcus -
I have a MacBook Air, and have purchased individually Numbers and Pages. I was sent an Excel file on a thumb drive but cannot open the file. The message states that the Excel file is encryeted. Is ther any way to open a PC file on my Mac Book Air?
Pat and BobExcel does not use the .xcl extension for any of its native file formats? The only files I've ever seen with xcl as the file extension were associated with embedded application code projects.
If this is in fact an Excel file, but an encrypted one, you cannot open it (in excel or any compatible application) without the decryption password. -
I want to create a shortcut (Win7) that will automatically open the last file I used in the above apps when I open the app. Is there a command line switch like /r or /l that does that?
Thanks, your point is well taken... It would be nice, though, to have the ability to sort a "Last Used" column in iTunes and select a bunch of apps to remove in one shot.
-
Microsoft Forms and Microsoft Visual Basic while opening the Excel file
Hello,
I have issues with 2010 64 bit Office Pro Plus Excel. Whenever I open an Excel file (97-2003 worksheet) which has macros then I get below 2 errors in sequence.
Please note that all macro settings are enabled and below are my system configs.
Win 7 Ultimate 64 bit,
MS Office Pro Plus 2010 64 bit with SP2.
Googled all and tried but in vein and also note that I dont have any .exd files under ../forms to delete. Please help.
Please note that for others with same system config/office versions and same 97-2003 worksheet it works so issues is only in my system.
First Error
Microsoft Forms
Could not load an object because it is not available on this machine.
Second Error
Microsoft Visual Basic for Applications
Compile error in hidden module: MainUtilities2.
This error commonly occurs when code is incompatible with the version, platform, or architecture of this application. Click "Help" for information on how to correct this error.
Thanks.Your macro's will not run in a Office 64 environment only in a 32bit environment. The 64bit environment has a whole different setup and macro's created in an earlier 32 bit environment will stop working.
So if you want to use them in a 64 Office environment you have to rewrite the macro's.
have a look here:
http://msdn.microsoft.com/en-us/library/gg264421.aspx
Maurice -
Opening the Excel file from Application server
Hi All,
I had uploaded an excel file on the application server for using it in my program .
But when i am opening the uploaded file on the Application server it shows some special characters and those are also displayed on my report output while reading the file from the application server.
Please suggest how to get rid of those special characters.
my open data set statement is
OPEN DATASET pg_out2 FOR INPUT IN TEXT MODE ENCODING NON-UNICODE.Hi ,
if it a Excel file ..
do the following..
OPEN DATASET pg_out2 "appl file
FOR INPUT IN TEXT MODE
ENCODING DEFAULT.
IF sy-subrc EQ 0.
DO.
READ DATASET p_infile INTO w_temp.
* Condition To check when cursor reaches End Of file
IF sy-subrc EQ 0.
PERFORM f_split_appl_data.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET p_infile.
ELSE.
MESSAGE 'Error in opening file' type 'E'.
ENDIF.
FORM f_split_appl_data .
SPLIT w_temp AT ',' INTO : wa_inputfile-plannum ...... "Split at , for excel or CSV file formats at appl files
APPEND wa_inputfile TO t_inputfile.
ENDFORM. " F_SPLIT_APPL_DATA
Prabhudas -
After I Update to IOS 7.1 I can't open the excel file attached in my email
After I updated my Iphone 5s from IOS7.0.6 to IOS7.1 when i check my email i can't open excel file attached in my email i check with my frineds phone thy have same issoue
David_PDX wrote:
Hi Alex,
The trick to this whole thing is to scroll to the bottom of the message. There should be a dashed line at the bottom of the email message with text underneath it that says, "This message was downloaded as plain text." Underneath that it should say (in blue hyperlink text) "Download full message". Select that hyperlink, and the Excel file should download completely. You should then be able to select the document and have it open correctly.
I have had the same concern regardless of file format that is sent, so I do not believe your issue is with file format. Hope this helps.
I've seen the same thing happen with images, which it displays in a corrupted form. It's fixed by downloading the full message.
There's a more serious side effect of this, which I've now seen with several types of files. If one FORWARDS the email to someone else, the attached files it sends them are CORRUPTED and unopenable too. In the case of a Word files I looked at, it had dropped the last two bytes of the file.
The workaround for that is to download the full message before forwarding.
I'm seeing this happening with so many types of attachments that I'm assuming it affects them all. Please everyone report this to Apple feedback (http://www.apple.com/feedback/). It's one thing not being able to open a file on your device, it's another to have files corrupted permanently just by forwarding. -
I'm getting an 'invalid signature' in excel 2007 when i try to open the excel file
In sharePoint 2010. i'm trying to open the Excel 2007, Here i got issue "Invalid
Signature".
Still the certificate
of the user is valid.Hi,
What's the extension of this file? And what happens if you download the Excel file to your local driver, then open this file using Excel 2007, did you still get the same error message? If you didn't get the same error message, you can take
a look at the article below:
http://support.microsoft.com/kb/2417395/en-us
In addition, as your request is related to SharePoint, you can submit a new case here:
http://social.technet.microsoft.com/Forums/sharepoint/en-US/home?forum=sharepointgeneralprevious
Thanks for your understanding.
Wind Zhang
TechNet Community Support -
RT
Here is an example of a sequence opening an excel document and creating a table. You have to slightly modify it, to save Serialnumber, high limit, test result etc. But this will be a good start.
Hope this helps
SijinK
National Instruments
Attachments:
Write_Table_to_XL_and_Create_Chart.zip 9 KB -
Hard to add more detail... I open Firefox Applications preferences, assign "iBank" to Content Type "qfx file", yet every time I download a .qfx file Firefox opens a "Opening stmt.qfx" window asking what should Firefox do with it. Every time I select iBank and check the "Do this automatically from now on." box I also re-open Firefox preferences, and sure enough it says it will open qfx files with iBank, but it doesn't ever do it...AUGGH!
If it affects multiple different FIs, then I wouldn't rule out a problem with Firefox. The problem is that the mimeTypes.rdf file has a messy structure, so I don't recommend editing it manually. Hopefully someone will have an alternative solution.
Maybe you are looking for
-
Esic contribution is not deducting on seperation cases in retro run.
Dear Experts, Employee was got seperated in previous month (for example Oct) and now while executing retro run (Dec) for those employee ESIC is not contributing even though they comes in esic eligibility. Please advise.
-
Admin login not accepted when shutting down multiple users
Hi all This one is curious. I have a client with a MacBook Pro, 10.5.7, on which she has an admin account and a standard account for guests. I also have created an admin account so I can run updates without needing her password. Both admin accounts w
-
Macbook Silver display to vga doubler
I have a Macbook silver and I bought a SIIG VGA 2 port video splitter and I cannot get the signal to carry through. I have an old macbook the white one and that works fine. I want to use the new macbook with a QIT 300 tablet and a projector at the sa
-
Error 4261 in attemp to burn a CD
I'm getting this message just after disc burn starts " An attempt to burn a disc failed.An unknown error occurred ( 4261 ) and cancels the disc burn.If anyone knows what it means and can help id really appreciate it.Thanks.
-
CRIO-9068 time synchronization and data timestamping - the Big Picture
I'm working with a number of cRIO-9068 chassis that are distributed over a large physical area. I wish to timestamp data acquired be these chassis with microsecond resolution and relative accuracy. The various documents that I've run across hint at h