Application Development and Automation 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: 
Read only

Opening a file in Application Server

Former Member
0 Likes
750

Hi Friends,

I have a file 'abc' in application server, and i don't know the extension of it . while trying to open it using OPEN DATASET statement, it fails because of no extension.

I have tried using 'abc.*' in the open dataset statement but it doesnt work....so is there any function module or is there any other way to open and read it.........

Hi Friends,

I have a file 'abc' in application server, and i don't know the extension of it . while trying to open it using OPEN DATASET statement, it fails because of no extension.

I have tried using 'abc.*' in the open dataset statement but it doesnt work....so is there any function module or is there any other way to open and read it.........

3 REPLIES 3
Read only

Former Member
0 Likes
564

Hi Shylaja,

could you able to open the file abc in application layer.

Regards

Rasheed

Read only

Former Member
0 Likes
564

Hi,

Use the function module open_dataset and pass the parameter using abc.txt and check it out

Thanks,

Thiru.r

Read only

Sougata
Active Contributor
0 Likes
564

>

> I have a file 'abc' in application server, and i don't know the extension of it . while trying to open it using OPEN DATASET statement, it fails because of no extension.

Its totally wrong to say OPEN DATASET statement failed because of no extension of the file! Actually, the ABAP run-time does not care whether the file has an extension or not. In most cases, the app server (file system) datasets/files are stored without any extension.

Here's how to approach your issue:

1. Read the Keyword Documentation of OPEN DATASET

2. Check the Sy-Subrc after OPEN DATASET statement and if its unequal to 0;

a. Check the file name/path you are passing is correct

b. Check you are using OPEN DATASET for READ

c. Depending you are in a Unicode/Non-Unicode system, check the file is not already open

d. Make sure the file you are trying to open physically exists in the app server!

Once you are able to OPEN the file then use READ DATASET command to read it.

Hope this helps.

Cheers,

Sougata.