‎2009 May 07 9:37 AM
Hi Expert,
My program read file from application server. And I use statement
OPEN DATASET path_file FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE errormsg.path_file = '/inf/HR/100/INCOMING/ZSHRPA_1000000020090421.TXT'.When I process program by foreground.It's no error message.
But If I process program by background.It's return error "No such file or directory".
My production server has two Server.(I user Tcode SM51).
How can I read file?
Best regards,
Sasitha k.
‎2009 May 07 11:04 AM
Hi Sasitha,
You set Job Schedule with Tcode SM36 and SM37.
You should to select Exec.Target that content your file.
Regards,
‎2009 May 07 9:53 AM
Hello Sasitha,
You first check the server whether this file really exists or not.
for this you can use tcode AL11.
if not available then contact the basis consultant to create such path.
if available then send me the code where you are reading the path n data.
Have a Nice Day,
Regards,
Sujeet
‎2009 May 07 9:59 AM
File exist in app server path.(use tcode AL11)
my code:
OPEN DATASET path_file FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE errormsg.
IF sy-subrc = 0.
DO.
READ DATASET path_file INTO gw_file.
IF sy-subrc = 0.
APPEND gw_file TO it_file.
ELSE.
EXIT.
ENDIF.
ENDDO.
IF it_file[] IS INITIAL.
status = 'E'.
ENDIF.
ELSE.
status = 'E'.
CONCATENATE errormsg path_file text-e01 into errormsg.
ENDIF.
CLOSE DATASET path_file.
‎2009 May 07 11:04 AM
Hi Sasitha,
You set Job Schedule with Tcode SM36 and SM37.
You should to select Exec.Target that content your file.
Regards,
‎2009 May 07 11:07 AM
Hello,
Use this Fm
TXW_FILE_OPEN_FOR_READ
if sy-subrc eq 0.
DO.
CLEAR gi_text.
READ DATASET lv_filename INTO gi_text.
IF gi_text IS NOT INITIAL.
APPEND gi_text.
ENDIF.
ENDDO.
CLOSE DATASET lv_filename.
ENDIF.
Try this it will work.