2012 Dec 21 7:32 AM
Hi,
How to create a New Folder , while Working in RFC . For example , i need a path like this 'D:\sy-datum\Programname.txt' .
If my drive doesn't contains a Folder name( Sy-datum ) , then my RFC is Stops working , Please Guys help me on this.
Thanks and Regards ,
Ramkumar R.
2012 Dec 21 8:34 AM
data: dat like RLGRAP-FILENAME .
concatenate 'D:\ ' sy-datum into dat .
CALL FUNCTION 'TMP_GUI_CREATE_DIRECTORY'
EXPORTING
DIRNAME = dat
NO_FLUSH = ' '
EXCEPTIONS
FAILED = 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.
Regard's
Smruti
2012 Dec 21 9:11 AM
2012 Dec 21 10:04 AM
Yes Ramkumar it is working in Background Mode . Please test .
1 : Create a Z program and call Ur RFC where u used this "TMP_GUI_CREATE_DIRECTORY"
and pass your Import Parameter's , then check ur Respective Drive.
SE38 Test Code
data: dat like RLGRAP-FILENAME .
concatenate 'G:\ ' sy-datum into dat .
CALL FUNCTION 'ZTEST1'
EXPORTING
DAT1 = dat
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*************************************************************************************************
SE37 RFC Code
****************************************************************
FUNCTION ZTEST1.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(DAT1) LIKE RLGRAP-FILENAME DEFAULT 121
*"----------------------------------------------------------------------
*break-point.
CALL FUNCTION 'TMP_GUI_CREATE_DIRECTORY'
EXPORTING
DIRNAME = dat1
NO_FLUSH = ' '
EXCEPTIONS
FAILED = 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.
ENDFUNCTION.
Regard's
Smruti
2012 Dec 21 11:05 AM
HI Ranjan ,
i Checked ur code, its working fine in Foreground , but it is failing in RFC while Executing this in Background .
2012 Dec 21 11:16 AM
is ur RFC Linked with third party application ? (Yes/No)
how you test ur RFC in Background mode plz give the steps , let me check .
check ur authorization is properly given by that user ID where u test ur RFC in Background Mode .
Regard's
Smruti
2012 Dec 21 11:40 AM
Dear Ranjan ,
Actually my Requirement is to download a file in Background job , and this file to be downloaded in a folder for the present date , I used the RFC to download the file( I execute the RFC as Shown in the below Screen), its working fine , but i need to download a file in a Folder and that folder should be created automatically for the present date. this Background job should work daily , so that each and every day , new folder should be created as per the present date.
2012 Dec 22 10:48 AM
Got the Solution , I created a Batch File , and i execute it through RFC_REMOTE_EXEC , so that the new folder is created .
Thanks and Regards,
Ramkumar R.