Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

open dataset

Former Member
0 Kudos

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

8 REPLIES 8

Former Member
0 Kudos

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

athavanraja
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

<i><b>attachment to a ticket</b></i>? what ticket? what happens when you open DOC or PDF

Regards

Raja

Former Member
0 Kudos

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