Application Development 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: 

transfer application server data to a data base table

Former Member
0 Kudos

hai all,

how to transfer application server data to a data base table, i am using this code

iF V_FILE = 'X'.

OPEN DATASET V_FILE2 FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC = 0.

DO.

READ DATASET V_FILE2 INTO DATA1.

SPLIT DATA1 AT C_COMMA INTO V_MATNR V_MTART V_WERKS V_LGORT.

IF SY-SUBRC = 0.

APPEND IT_MARA.

ELSE.

EXIT.

ENDIF.

ENDDO.

ENDIF.

CLOSE DATASET V_FILE2.

but the data is not splitting from data1 to the defined variables.

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

by debug, check that data1 contains commas

former_member209217
Active Contributor
0 Kudos

Hi Kpsgoutam,

Check whether the data present in file in application server is comma delimited .It might be a tab separated one.check it in debugging mode whether its getting splitted or not

regards,

Lakshman.

Former Member
0 Kudos

check whats the separator in al11 or in debug mode..

it can be #, * , ',', or any other thing...

ThomasZloch
Active Contributor
0 Kudos

Where is your code to move V_MATNR etc. to IT_MARA?

Also, SPLIT could change SY-SUBRC to 4, so it might exit your loop even before the file was processed completely.

Thomas