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

Upload file into application server

Former Member
0 Likes
6,104

Hi,

How to upload .pdf/.doc/.docx file formats into application server from presentation server?

Please note:cg3z/cg3y t-codes are not available as I am using CRM system.

Please help.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,366

Have you checked the function module ARCHIVFILE_CLIENT_TO_SERVER ? Is it available in CRM system?

Regards, Vinod

14 REPLIES 14
Read only

SureshRa
Active Participant
0 Likes
3,366

You can directly execute Function Module C13Z_FRONT_END_TO_APPL from SE37 - if this FM exists in CRM system. This is what is being called from the CG3Z TCode. Thanks.

Regards

Suresh

Read only

Former Member
0 Likes
3,366

Hi Suresh,

Thanks for the reply. But my system doesnt support CG3Z t-code and it's function modules. Can you please provide me some abap code to achieve the same?

Thanks.

Read only

SureshRa
Active Participant
0 Likes
3,366

Hi Ginger,

If you have access to ECC system, ask an ABAP developer to copy the function group C13Z into your CRM system (some Z-Function group say ZC13Z). The copy should ensure that the FM C13Z_FRONT_END_TO_APPL is also copied. The dependent dictionary structure RCGFILETR should also be copied.

You can adopt the same program logic as in that FM but change references to your Z-Function group and dictionary structures. The programming logic inside that function group is not specific to any SAP system. So it should work with CRM also.

But if you want core logic of upload, look into the PAI of Screen 1020 of program SAPLC13Z of ECC system. Thanks.

Regards

Suresh

Read only

Former Member
0 Likes
3,366

Hi,

Use DATASET concept. Follow the syntax as below...

DATA: e_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.

open dataset e_file for output in text mode.

lOOP AT it_datatab......

transfer it_datatab to e_file.

ENDLOOP.

close dataset e_file.

Ram.

Read only

Former Member
0 Likes
3,367

Have you checked the function module ARCHIVFILE_CLIENT_TO_SERVER ? Is it available in CRM system?

Regards, Vinod

Read only

0 Likes
3,366

Hi Vinod,

This Fm is there in CRM.

Please explain.

Thanks.

Read only

0 Likes
3,366

You can use this function module to upload the files from Presentation server to to application server.

Regards, Vinod

Read only

0 Likes
3,366

Hi Vinod,

I used teh FM as below. It dint give any error, but did nothing.I checked the application server path, there is no file uploaded:

CALL FUNCTION 'ARCHIVFILE_CLIENT_TO_SERVER'

EXPORTING

path = 'C:\Desktop\Attachment\OPPTEST.docx'

TARGETPATH = '\usr\sap\tmp\OPPTEST.docx'

EXCEPTIONS

ERROR_FILE = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Please help!

Read only

0 Likes
3,366

May be something wrong with the application server path. I think it should be

TARGETPATH = '/usr/sap/tmp/OPPTEST.docx'

Regards, Vinod

Read only

0 Likes
3,366

Hi Vinod....If I use '/' it says error 1 from the function module.

i.e "Error in opening file /USR/SAP/TMP/OPPTEST.docx for writing (No such file or directory)"

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,366

MHO instead of trying to find these fancy, unreleased FMs develope a custom app & upload the files

Read only

Former Member
0 Likes
3,366

Suhas,

Can you please tell me how?

Thanks.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,366

I think this is too obvious

1. Upload "any type" of file as a binary stream using the resp. GUI FMs, methods.

2. Write this binary stream to the app server.

Forum RoE don't allow me to elaborate any more, since this has been discussed many times!

BR,

Suhas

Read only

Former Member
0 Likes
3,366

This message was moderated.