Skip to Content
0
Former Member
Jul 10, 2007 at 12:42 PM

Spliting the line read from the application server

18 Views

Hi All,

REPORT zu5 .

DATA: names(90) TYPE c,

*VALUE 'WW03/h/0000000501/h//h/200507/h//h//h//h/0/h/ 22.22',

rbukrs(30) TYPE c,

racct(10) TYPE n,

actyp(11) TYPE c,

prodcode(6) TYPE c,

vbund(6) TYPE c,

fdgrv(8) TYPE c,

land1(3) TYPE c,

arcod(2) TYPE c,

hsl(16) TYPE c,

delimiter(3) VALUE '/h/',

names2 TYPE string.

PARAMETERS: p_unix LIKE rlgrap-filename

DEFAULT

'/sony/sap/abapfiles/GT10A.XXXX.T400.XPHDO017.T200707100822290843968'.

OPEN DATASET p_unix FOR INPUT IN TEXT MODE.

IF sy-subrc NE 0.

WRITE:/ 'Unable to open file'.

ELSE.

DO.

CLEAR: names.

READ DATASET p_unix INTO names.

IF sy-subrc NE 0.

EXIT.

ENDIF.

SPLIT names AT delimiter INTO rbukrs racct actyp prodcode vbund fdgrv

land1 arcod hsl.

WRITE:/ rbukrs,

racct,

actyp,

prodcode,

vbund,

fdgrv,

land1,

arcod,

hsl.

ENDDO.

ENDIF.

CLOSE DATASET p_unix.

In the above code spliting is not happening when read from the application server and assign to a variable names.But when i directly assign within the programusing the value option to the variable names spliting at the delimiter is happening.

Why it is so?

I couldn't understand?

How to split the line read from the application using delimiter and put in the internal table?

Any can help me out.

Thanks

Shri