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

Strange Error ! For Reading Application Server File

Former Member
0 Likes
500

Hi Friends,

I am getting very strange error while compliling my code. As I am reading a text file for input from Application server for further processing. But my system is giving me an error.

As the file and the path is not yet configured on the application server but i believe

it has to allow me to compile the program and when i execute it then it will give an error as I have tracked.

Kindly help.

I have pasted the code below for reference.

===============================

TYPES : BEGIN OF ty_file,

line(1055) TYPE c,

end of ty_file.

data : gs_file type ty_file.

data : g_file4 TYPE string VALUE '\usr\sap\CISCO\SP\CISCO_SP_CHG.TXT'.

OPEN DATASET g_file4 IN TEXT MODE FOR INPUT

ENCODING DEFAULT

WITH SMART LINEFEED.

IF sy-subrc NE 0.

MESSAGE e012.

LEAVE LIST-PROCESSING.

ENDIF.

CLEAR : gs_file.

DO.

READ g_file4 INTO gs_file.

IF sy-subrc NE 0.

EXIT.

ENDIF.

APPEND gs_file into gt_cust_tmp.

clear gs_file.

ENDDO.

CLOSE DATASET g_file4.

ERROR i am getting

Unable to interpret g_file4. Possible cause of error "Incorrect Spelling or Comma error".

=======================

Regards,

pradeep

1 ACCEPTED SOLUTION
Read only

former_member219399
Active Participant
0 Likes
420

TYPES : BEGIN OF ty_file,

line(1055) TYPE c,

end of ty_file.

data : gs_file type ty_file.

data gt_cust_tmp type table of ty_file.

data : g_file4 TYPE string VALUE '\usr\sap\CISCO\SP\CISCO_SP_CHG.TXT'.

OPEN DATASET g_file4 IN TEXT MODE FOR INPUT

ENCODING DEFAULT

WITH SMART LINEFEED.

IF sy-subrc NE 0.

MESSAGE e012.

LEAVE LIST-PROCESSING.

ENDIF.

CLEAR : gs_file.

DO.

READ dataset g_file4 INTO gs_file.

IF sy-subrc NE 0.

EXIT.

ENDIF.

APPEND gs_file to gt_cust_tmp.

clear gs_file.

ENDDO.

CLOSE DATASET g_file4.

check this coding. in the read statement dataset is missing.

with regards,

Vamsi

2 REPLIES 2
Read only

former_member219399
Active Participant
0 Likes
421

TYPES : BEGIN OF ty_file,

line(1055) TYPE c,

end of ty_file.

data : gs_file type ty_file.

data gt_cust_tmp type table of ty_file.

data : g_file4 TYPE string VALUE '\usr\sap\CISCO\SP\CISCO_SP_CHG.TXT'.

OPEN DATASET g_file4 IN TEXT MODE FOR INPUT

ENCODING DEFAULT

WITH SMART LINEFEED.

IF sy-subrc NE 0.

MESSAGE e012.

LEAVE LIST-PROCESSING.

ENDIF.

CLEAR : gs_file.

DO.

READ dataset g_file4 INTO gs_file.

IF sy-subrc NE 0.

EXIT.

ENDIF.

APPEND gs_file to gt_cust_tmp.

clear gs_file.

ENDDO.

CLOSE DATASET g_file4.

check this coding. in the read statement dataset is missing.

with regards,

Vamsi

Read only

former_member189059
Active Contributor
0 Likes
420

Ensure that you are using the correct case and that it doesnt get converted automatically to uppercase since UNIX is case sensitive

Also, im not sure if \ or / is used in the filepath

Run transaction CG3Y to find out