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

read a file from application server

Former Member
0 Likes
466

Hi

I want to read a file from application server which is in seperated by '|' symbol.

Please give me some sample coding

3 REPLIES 3
Read only

Former Member
0 Likes
392

Hi,

Check this sample code...

DATA:

len TYPE i,

text(30) type c,

dir(30) TYPE c VALUE '/tmp/test.txt'.

DATA: begin of data OCCURS 0,

matnr type matnr,

werks type werks_d,

end of data.

START-OF-SELECTION.

CLEAR: text.

OPEN DATASET dir FOR INPUT IN TEXT MODE.

DO.

READ DATASET dir INTO text.

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

SPLIT TEXT AT '|' INTO DATA-MATNR DATA-WERKS.

APPEND DATA.

ENDDO.

WRITE: / text.

CLOSE DATASET dir.

Thanks,

Naren

Read only

0 Likes
392

Thanks a lot naren. I appreciate your help

Read only

Former Member
0 Likes
392

solved