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: 

Upload/download files via a BAPI?

shilpa_mukerjee
Explorer
0 Kudos

good noon ABAPERS,

        IS there any remote function modules(BAPI) for uploading and downloading file concept can be used for 3rd party tool ie other than sap..

note : ws_upload,f4_filename can be used in sap.i need non sap funtion module.

can anyone helpme for this please....

                                             thankyou.

Message was edited by: Matthew Billingham

1 ACCEPTED SOLUTION

former_member182915
Active Contributor
0 Kudos

Hello Abaper,

I am unable to understand your req.  if need any FM to acessed from NON SAP side make ur own BAPI and acess that.

15 REPLIES 15

former_member182915
Active Contributor
0 Kudos

Hello Abaper,

I am unable to understand your req.  if need any FM to acessed from NON SAP side make ur own BAPI and acess that.

0 Kudos

thanks for your reply sir....

Actually can i able to create customized bapi for this scenario whic must be  similar like

GUI_UPLOAD and GUI_DOWNLOAD...

0 Kudos

First of all you mention which type of file you need to upload . and after upload what to do (mean a brief about scenario )So that i clear about issues.

shilpa_mukerjee
Explorer
0 Kudos

hi sir i need to upload flat file such as text document and .XLS. i have designed the java application  i need to upload and download flat file using jco(java connector).is there any remote enabled function module available?

matt
Active Contributor
0 Kudos

I have edited your subject as "BAPI ISSUES" wasn't meaningful. In future please use meaningful titles and not in ALL CAPITALS. Otherwise your thread will be rejected.

Former Member
0 Kudos

Hello

Did you check this FM : BAPI_DOCUMENT_CREATE2

        CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'

          EXPORTING

            documentdata         = it_bapi_documentdata

          IMPORTING

            documenttype         = it_bapi_documentdata-documenttype

            documentnumber       = it_bapi_documentdata-documentnumber

            documentpart         = it_bapi_documentdata-documentpart

            documentversion      = it_bapi_documentdata-documentversion

            return               = it_return

          TABLES

            characteristicvalues = it_char

            classallocations     = it_class

            documentdescriptions = it_drat

            documentfiles        = it_files

            longtexts            = it_longtexts.

u can even attached classification to the document to be created..

Hope it helps.

Kind Regards.

Harsh9
Participant
0 Kudos

Hello,

I had built similar kind of application before few months. But I need to know which sap system are you communicating with? Is it ECC?

Regards,

Harsh

Harsh9
Participant
0 Kudos

This message was moderated.

mauriciolauffer
Contributor
0 Kudos

You can create your own BAPI/RFC which could call the methods:

CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD

CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

0 Kudos

That won't work. RFCs and therefore BAPIs don't have a SAPGui, and don't have a frontend, and so can't call CL_GUI_FRONTEND_SERVICES!

0 Kudos

That's true!
He should upload the file as binary and than use the functions to convert or to save into a table.
Create a BAPI/RFC with a parameter RAW to receive the binary file.

Jelena
Active Contributor
0 Kudos

But from where to where is this upload/download and what is supposed to happen in SAP exactly? Could you possibly disclose all the details of this rather strange requirement?

Former Member
0 Kudos

HI,

It depends on where you want to store the documents.

for ex; In SAP we have a functionality called GOS. using this functionality you can upload/view the documents.

If you take SAP SD module, you can upload documents to SAP sales documents. To enable this option maintain a user parameter SD_SWU_ACTIVE as X in SU3 tcode. Then access Va01/02/21/22 to upload the documents to sales documents. In SAP application  tool bar you will see a Icon like this. click on this button and select create-store business document.

Similarly like this, if the requirement is to attach the docs to SAP sales documents then you can get the document content in binary or xstring format from third party system and use FM  ARCHIVOBJECT_CREATE_TABLE to create the archive id. Then link the created to archive id to SAP sales documents.

I hope you get an idea with this. Please let me know still if you have any queries on this.

Thanks

0 Kudos

hi jellena ,

thanks for your reply....i have to upload master records for example material master from flat file ie .xls file to internal table ..and from internal table to SAP material master table

arthur_alvesteixeira
Active Participant
0 Kudos

Shilpa,

it's possible to call any function in SAP,
if this function (generate file) isn't a RFC function,
so you can create a Z RFC function and insert a function (that works with file)
inside your Z RFC function.

So the process is:

External System -> Z RFC function -> Standard funcion (not RFC) -> Generate File -> Server