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

Reading a File from a shared folder in BAPI

biju_john
Explorer
0 Likes
2,811

I have a .net Application calling a BAPI which will read a file from a shared folder into abap internal tables and process it.

i tried using the function module  GUI_UPLOAD from within the BAPI and found that i cannot use GUI services in non-gui operations

from the forum i learned the we  can use OPEN DATASET TO achieve this but only if the application server is hosted on windows and

the server can access  shared folder UNC. But our System status shows the OS as HP-UX , and i am not sure the server can access

the shared folder via UNC .

Another Option We tried Was using FTP but the client does not want to use FTP.

So is there any other approach to read files from shared folder using a bapi ?

8 REPLIES 8
Read only

Former Member
0 Likes
1,697

Hi Biju ,

Check for the encoding format for this file.

http://help.sap.com/abapdocu_702/en/abapopen_dataset.htm

http://scn.sap.com/thread/304478

These two above links can help you please go through.

Hope this will help .....

Regards,

AKS

Read only

0 Likes
1,697

hi Amith,

according to the documentation

OPEN DATASET dset FOR access IN mode [position]

                                     [os_additions]

                                     [error_handling].

'dest ' is a path on the appliaction server , but i need to access path on the local network and read  a file from it.

Regards

Biju

Read only

0 Likes
1,697

hi bro,

if your file is in presentation server means , no need to go for dataset concepts,

straight away you can use some FM and classes to import it to SAP.

if you have your file in Application server means, you have to go for datasets concepts..

provide some detailed info about your requirement, so that it ll be easy to solve your issue..

where exactly your file is???

thanks,

Mathan R.

Read only

0 Likes
1,697

hi Mathanagopalan R,

                       The exact requirent is mentioned in my question , i an nutshell a .Net application is calling a BAPI which in turn reads a file from a shared folder on the network , There is no GUI Process involved so no presentation side read is possible , and the shared folder is not in the application server either.

Regards

Biju

Read only

Former Member
0 Likes
1,697

Hi John,

You can  read the file from share folder through dot net application, and create the exact BAPI structure in SAP and pass the values from your application to your custom BAPI.

BTW how to read the file and pass values to BAPI in dot net you might know i understand?

--

Jack

Read only

0 Likes
1,697

Hi Jack Pawar,

                 I believe what you are saying is let the .net read the data from a shared folder ans then call a bapi and pass the data to sap. but i am being told that there might be lisence issues, since the data is captured using .net and passed on to SAP , .net application will have to get a user lisence .

Regards

Biju

Read only

0 Likes
1,697

Hi john,

I don't know exactly , but as per my knowledge you can call SAP licensed user into your dot net application and post with that user . i don't think that might a issue . please concern with your people regarding that. if thats ok thn you got your solution i think.

--

Regards

Jack

Read only

0 Likes
1,697

hi jack Pawar,

        

Under SAP's licensing terms, an indirect access scenario occurs when a company's employees or business partners, who are not licensed SAP users, accesses SAP software via a third-party application interface

a company might capture customer orders and enter the data into a SAP system using a non-SAP application. Under a strict interpretation of SAP licensing terms, such access would require each user of the non-SAP application, to also get a named SAP user license.

http://www.upperedge.com/blog/2012/05/sap-and-indirect-access-is-sap-taking-advantage-of-its-custome...

Regards

Biju