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: 

read / write file on a NETWORK share. how to access?

Former Member
0 Kudos

Hi guys!

Can somebody help me out with some FMs for accessing a network share

192.168.1.1 older ile.txt

Is it possible to access this share ìn an abap report?

and how can i write a file in there?

thanks!

1 ACCEPTED SOLUTION

former_member589029
Active Contributor
0 Kudos

Take a look at class 'cl_gui_frontend_services'. It provides all kind of tools to access file shares.

E.g. methods GUI_DOWNLOAD and GUI_UPLOAD to down/upload files.

If you are not familiar with OO you can use FM GUI_DOWNLOAD or GUI_UPLOAD instead.

Hope that helps,

Michael

9 REPLIES 9

former_member589029
Active Contributor
0 Kudos

Take a look at class 'cl_gui_frontend_services'. It provides all kind of tools to access file shares.

E.g. methods GUI_DOWNLOAD and GUI_UPLOAD to down/upload files.

If you are not familiar with OO you can use FM GUI_DOWNLOAD or GUI_UPLOAD instead.

Hope that helps,

Michael

messier31
Active Contributor
0 Kudos

Hi

Map
192.168.1.1 as drive on your local system and then use this and any other drive like C:\file.txt.

Enjoy SAP.

Pankaj Singh.

Former Member
0 Kudos

the abap report runs in a batch job every 10 minutes.

can you use FM gui_upload in a batch job?

0 Kudos

The main thing is that you should have access to the network share, only then ABAP will be able to do so.

Try creating a file/folder in the specified network share from your Windows explorer, if you dont have access for that you cannot do it through abap also

Regards

Karthik D

0 Kudos

> can you use FM gui_upload in a batch job?

no you cannot.

The drive would need to be mounted into the SAP application server file system (not sure how, not my area), then you can access in background via OPEN DATASET etc. commands.

Thomas

karol_seman
Active Participant
0 Kudos

Hi Thomas,

because you need to do it in the background please have a look at https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9831750a-0801-0010-1d9e-f8c64efb... . This solution should be exactly what you need ...

Or second chance is as was mentioned above to connect remote computer to your unix system (this is question to basis if it is possible) and then access it via dataset.

Regards,

Karol

Former Member
0 Kudos

Is there another way as well (without mounting the network drive to the application server.

the FM RFC_REMOTE_FILE is not available in our systems.

0 Kudos

RFC_REMOTE_FILE is present in an rfc sdk which can be downloaded from sap marketplace and not in your SAP system

You can write to a presentation server using this FM

For that you require

1. TCP/IP RFC connection in your SAP System to connect to your front end

2. The RFC SDK installed and running on your front end

Revert back if you need more details

To download the SDK,

1. Go to http://service.sap.com/swdc. Note that you must have a valid account.

2.

In the menu on the left hand side, choose below items step by step.

SAP Software Distribution Center

Download

Support Packages and Patches

Entry by Application Group

3.

You have 3 choices here.

1.

Follow below submenu and you will find SAP RFC SDK 6.40.

Additional Components

SAP RFC SDK

SAP RFC SDK 6.40

2.

Follow below submenu and you will find SAP RFC SDK 6.40.

Additional Components

SAP RFC SDK UNICODE

SAP RFC SDK 6.40 UNICODE

3.

Follow below submenu to find both SAP RFC SDK 6.40 and SAP RFC SDK 6.40 UNICODE

SAP NetWeaver

Technology components releases prior to SAP NetWeaver

SAP Web AS

SAP Web AS 6.40

SAP RFC SDK 6.40 or SAP RFC SDK 6.40 UNICODE

It depends on your SAP R/3 setting, unicode or non-unicode. You have to choose the right one.

Former Member
0 Kudos

hi,

Its very simple if you are going with ALV report then, then copy the standard GUI and put a button defining in your GUI.

And when you click the button trigger the path of your 'File'

I have used

CALL METHOD cl_gui_frontend_services=>execute

EXPORTING

document = V_FILE.

Where V_FILE will be your file path.

Hope my answer helps you.

Cheers!!