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

not able to read file from application server

former_member211589
Participant
0 Likes
387

Hello All,

I am not able to transfer the contents of application server into internal table.The READ statement returns sy-subrc as 4.please let me know wats wrong in the below code.

DATA: file TYPE string VALUE `/usr/sap/tmp/PO.TXT`,

hex_container TYPE x LENGTH 10000,

len TYPE i.

FIELD-SYMBOLS <mbepoh> TYPE mbepoh.

START-OF-SELECTION.

DESCRIBE FIELD <mbepoh> LENGTH len IN BYTE MODE.

OPEN DATASET file FOR INPUT IN BINARY MODE.

ASSIGN hex_container TO <mbepoh> CASTING.

DO.

READ DATASET file INTO hex_container MAXIMUM LENGTH len.

IF sy-subrc = 0.

ELSE.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET file.

Thanks,

Rakesh.

Hello All,

I am not able to transfer the contents of application server into internal table.The READ statement returns sy-subrc as 4.please let me know wats wrong in the below code.

DATA: file TYPE string VALUE `/usr/sap/tmp/PO.TXT`,

hex_container TYPE x LENGTH 10000,

len TYPE i.

FIELD-SYMBOLS <mbepoh> TYPE mbepoh.

START-OF-SELECTION.

DESCRIBE FIELD <mbepoh> LENGTH len IN BYTE MODE.

OPEN DATASET file FOR INPUT IN BINARY MODE.

ASSIGN hex_container TO <mbepoh> CASTING.

DO.

READ DATASET file INTO hex_container MAXIMUM LENGTH len.

IF sy-subrc = 0.

ELSE.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET file.

Thanks,

Rakesh.

1 REPLY 1
Read only

Former Member
0 Likes
345

Hi,

Do you test if after OPEN DATASET sy-subrc = 0 ? (it´s really opening the file?)

Best regards,

Leandro Mengue