2011 Jun 23 6:05 PM
Hi,
I am working on inbound idoc to read file from application server and post to SAP. After reading the file, how can we archive the file on the application server?I am using IDOC_INBOUND_FROM_FILE to move file data to SAP. I am not sure how to archive the file after the idoc is posted?
Thanks,
Prem
Hi,
I am working on inbound idoc to read file from application server and post to SAP. After reading the file, how can we archive the file on the application server?I am using IDOC_INBOUND_FROM_FILE to move file data to SAP. I am not sure how to archive the file after the idoc is posted?
Thanks,
Prem
2011 Jun 23 6:39 PM
Check the below code to move the file from Source path to Target path in the application server.
CALL FUNCTION 'ARCHIVFILE_SERVER_TO_SERVER'
EXPORTING
SOURCEPATH = LV_SOURCEPATH
TARGETPATH = LV_TARGETPATH
EXCEPTIONS
ERROR_FILE = 1
OTHERS = 2.
IF SY-SUBRC EQ 0.
DELETE DATASET LV_SOURCEPATH.
ENDIF.
2011 Jun 24 3:40 AM
Thanks Suman but i am not using any custom code for this. I use the FM idoc_inbound_from_file to convert it into idoc and then use the standrd FM to post it into application. Do you say that i need to map it to a custom code so that i can incporporate this FM of yours?
Thanls,
Prem
2011 Jun 24 4:33 AM
Hi,
If you want to archive the files and put it to App. Layer. Try to explore the following:
1. Get the file path via FM: FILE_GET_NAME_USING_PATH
2. Then get all the the files via FM: SUBST_GET_FILE_LIST
3. Move/copy the files to the path via FM: SXPG_CALL_SYSTEM
2011 Dec 20 5:14 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |