04-30-2006 8:50 AM
Hi all,
I am tring to open a pdf file from my desktop using open dataset p_fname for input in text mode encoding default.
But sy-subrc is 8. How do i open the file ?
How do I open any kind of file irrespective of their type (pdf or doc or txt..etc) by open dataset ?
Thanks in advance.
Regards,
Ananya
Message was edited by: Ananya Mukherjee
04-30-2006 8:53 AM
Hi Ananya,
Use GUI_UPLOAD while trying to upload data from your desktop.
Open dataset is used of application server.
Check out the file type parameter of GUI_UPLOAD. I think if you want you can use type 'RAW' to upload any type of file.
You can also upload it as 'BIN' in binary format.
Do a search in the forum, you will find many links which gives useful information.
Cheers
VJ
Message was edited by: Vijayendra Rao
Message was edited by: Vijayendra Rao
04-30-2006 8:57 AM
you want to open it or upload into a itab in program for further processing.
for openning it =>
CL_GUI_FRONTEND_SERVICES=>EXECUTE
for uploading => GUI_UPLOAD with file type BIN
Regards
Raja
Message was edited by: Durairaj Athavan Raja
04-30-2006 11:11 AM
Hi Ananya,
open dataset p_fname for input in text mode encoding default.
is giving you sy-subrc = 8 bcoz..
there aint any such file on the application server..
The file is on your desktop..
U need to use GUI_UPLOAD for that purpose.. with file type as BIN.
OPEN DATASET is used for files on application server..
Hope that solves the problem
Regards,
Tanveer.
If your query is solved, please close the thread and please mark helpful answers.
04-30-2006 12:22 PM
Hi,
I am using GUI_UPLOAD now.But only text files are getting properly uploaded now.Other uploade files when viewed ,show just junk values.What to do for other types of files ?(doc,pdf etc ?)
Regards,
Ananya
04-30-2006 12:28 PM
the file type for text files shoudl be ASC and for DOC and PDF it should be BIN
when the file type is BIN the uploaded content will be in binary format.
what are you intending to do with the uploaded content?
Regards
Raja
04-30-2006 12:35 PM
Hi,
The file is uploaded as an attachment to a ticket.
From the ticket I can open the attachment.For text files it is opening fine but problem is for DOC and PDF files.
I have tried with 'BIN' but no use. When I am trying to see the ticket,message is coming that 'export needed for this type'.Please help
Regards,
Ananya
04-30-2006 12:42 PM
<i><b>attachment to a ticket</b></i>? what ticket? what happens when you open DOC or PDF
Regards
Raja
04-30-2006 12:45 PM
Hi,
Message come that 'export needed for this type' and pop-up comes for saving. But I am only trying to see the document.
This is happening after I am using 'BIN'.
Regards,
Ananya