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

error while uploading a textfile into internal table.

Former Member
0 Likes
758

Hello,

i am uploading a textfile into an internal table and i have used the 'CALL METHOD cl_gui_frontend_services=>gui_upload' for uploading of the file into the internal table. But instead i am getting sumthing lyke

CTTL#1001#BANK-0014393-PP-LHR#|#2000#112312#CCL00#29.08.2006#|Cash In </b>. I have the following internal table,

[code]
 begin of ls_cashrec,
     bukrs type char30,        " company code
     cjnr type char30,         " cash journal number
     cjtranstxt type char30,   " business transaction
     cjamount type wrbtr,      " amount
     dzuonr type char30,       " assignment
     prctr type char6,         " profit center
     budat type sy-datum,      " posting date
     cjpostext type char30,    " text
  end of ls_cashrec.

and

DATA:

gt_cashrec TYPE STANDARD TABLE OF ls_cashrec.

where am i wrong ?

Regard and Thanks,

Shehryar

1 ACCEPTED SOLUTION
Read only

dani_mn
Active Contributor
0 Likes
728

HI,

Use the paramter <b>HAS_FIELD_SEPARATOR = 'X'</b> of gui_upload

to get in correct format.

REgards,

Message was edited by: HRA

7 REPLIES 7
Read only

Former Member
0 Likes
728

and the textfile contains sumthing lyke,


CTTL	1001	BANK-1234567-PP-XX	2000	112312	CCL00	29.08.2006	Cash In

Read only

Former Member
0 Likes
728

Hi shehryar,

1. Date format

2. The date in text file is

dd.mm.yyyy

3. Hence, upload it in a varaiable

of type c and length 10.

4. Then transfer it in your final internal table

with field datum.

regards,

amit m.

Read only

dani_mn
Active Contributor
0 Likes
729

HI,

Use the paramter <b>HAS_FIELD_SEPARATOR = 'X'</b> of gui_upload

to get in correct format.

REgards,

Message was edited by: HRA

Read only

Former Member
0 Likes
728

You have to pass the exporting parameter:

HAS_FIELD_SEPARATOR = 'X'

Regards,

Ravi

Read only

0 Likes
728

Hello,

Thanks.. I'll get back to soon .!

Read only

0 Likes
728

Hello,

Should the date in my textfile be like 08.09.2006 or 08.09.06 or 08092006 or 080906

Note: The textfile which i will upload into the internal table..

Thanks,

Shehryar

Read only

0 Likes
728

Hi again,

1. The best thing is that the

data format in text file is

YYYYMMDD (8 characters only)

(Then in that case, we can directly

declare our field in internal table type sy-datum.

)

2. Other wise,

we have to declare the field in internal table

as character format and length

(based upon the text file field length,

including DOTS / etc)

Then we have to finally convert in YYYYMMDD

format in to other field,

which we will finally use as sy-datum field.

regards,

amit m.