‎2011 Aug 11 7:18 AM
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.
‎2011 Aug 11 7:38 AM
Have you checked the function module ARCHIVFILE_CLIENT_TO_SERVER ? Is it available in CRM system?
Regards, Vinod
‎2011 Aug 11 7:28 AM
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
‎2011 Aug 11 7:34 AM
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.
‎2011 Aug 11 7:41 AM
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
‎2011 Aug 11 7:37 AM
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.
‎2011 Aug 11 7:38 AM
Have you checked the function module ARCHIVFILE_CLIENT_TO_SERVER ? Is it available in CRM system?
Regards, Vinod
‎2011 Aug 11 7:55 AM
‎2011 Aug 11 7:57 AM
You can use this function module to upload the files from Presentation server to to application server.
Regards, Vinod
‎2011 Aug 11 8:38 AM
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!
‎2011 Aug 11 8:46 AM
May be something wrong with the application server path. I think it should be
TARGETPATH = '/usr/sap/tmp/OPPTEST.docx'Regards, Vinod
‎2011 Aug 11 8:49 AM
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)"
‎2011 Aug 11 8:51 AM
MHO instead of trying to find these fancy, unreleased FMs develope a custom app & upload the files
‎2011 Aug 11 8:59 AM
‎2011 Aug 11 10:06 AM
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
‎2014 Mar 14 12:32 PM