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

Tab delimited files in background processing

Former Member
0 Likes
588

Is there a way to process tab delimited files if my program is to be run in background? Thanks

Hi,

Do a 'read dataset' to read one record in a string, and use 'SPLIT' verb to split it into individual fields of your itab before appending the itab (assuming you want it in an itab).

In SPLIT, you can say 'AT <CH>' where 'CH' shall have the char value of TAB.

cheers,

Ajay

3 REPLIES 3
Read only

Former Member
0 Likes
509

Hi,

Do a 'read dataset' to read one record in a string, and use 'SPLIT' verb to split it into individual fields of your itab before appending the itab (assuming you want it in an itab).

In SPLIT, you can say 'AT <CH>' where 'CH' shall have the char value of TAB.

cheers,

Ajay

Read only

andreas_mann3
Active Contributor
0 Likes
509

Hi,

-> here's an example to split file by tab:

DATA: BEGIN OF tabulator,

x(1) TYPE x VALUE '09',

END OF tabulator.

data tabilator_c.

...

CALL FUNCTION 'SYSTEM_CODEPAGE'

IMPORTING

codepage = c_to.

tabulator_c = tabulator.

TRANSLATE tabulator_c FROM CODE PAGE c_from TO CODE PAGE c_to.

open dataset file for input in text mode.

do.

read dataset file into wa.

if sy-subrc <> 0.

exit.

endif.

split wa at tabulator_c into table itab.

....

enddo.

regards <a href="https://www.sdn.sap.com:443/irj/servlet/prt/porta

l/prtroot/com.sap.sdn.businesscard.SDNBusinessCard?u=i

Wo3ssHlIihvCrADIEGqaw%3D%3D">Andreas</a>

Message was edited by: Andreas Mann

Read only

Former Member
0 Likes
509

Hi,

To process file in background, you have to go for processing on application server i.e. use dataset. Because presentation server does not allow background processing of files,.

cheers,

-Tejal