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

file error

Former Member
0 Likes
434

Hi Experts,

Here my problem i am trying to get the data from flatfile which contains material number, average price, standard price, valutation type.... to update the records in MR21 Transaction.

when i used gui_upload function module to get that data into my internal table, it is fetching only first record, and comeout of the program then showing file error message.

can any one help me ...

it is very urgent

3 REPLIES 3
Read only

Former Member
0 Likes
414

HI,

check that the file which you are uploading is not open .. and also check the sy-subrc value to get the exact problem.

Thanks

Mahesh

Read only

0 Likes
414

Hi,

Thanks for your reply, but here i have giving DAT format in gui_download while downloading the data into flatfile..

now i am taking that file into gui_upload function module by specifying that ASC format.

it is uploading only one record into my internal table. then it is showing sy-subrc value 8 and giving error message.

Suppose if i given ASC format in Gui_Download function Moudule i am unable to get the file tab delimited format. so only i have given DAT format there.

so plz..can anybody can help me in this.

Thanks & REgards,

Venakt N

Read only

Former Member
0 Likes
414

Hi venkat,

Try using following Concept... I gave contents of the .txt file in comments... Copy and Paste those contents in the file TEST.TXT on desktop.

REPORT zssr_bdc .

DATA: BEGIN OF g_t_itab OCCURS 0,

matnr LIKE mara-matnr,

maktx LIKE makt-maktx,

END OF g_t_itab.

DATA: g_t_bdcdata TYPE TABLE OF bdcdata.

DATA: path TYPE string,

path1 type string.

path = 'C:\Documents and Settings\ssr3kor\Desktop\test.txt'.

path1 = 'C:\Documents and Settings\ssr3kor\Desktop\test1.txt'.

**************************

*contents of test.txt *

*

*TEST1 ,BOT *

*TEST2 ,BOT *

*TEST3 ,BUT *

**************************

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = path

TABLES

data_tab = g_t_itab.

LOOP AT g_t_itab.

WRITE:/1(18) g_t_itab-matnr, 20(40) g_t_itab-maktx.

ENDLOOP.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = path1

filetype = 'ASC'

TABLES

data_tab = g_t_itab.

Reward If Helpful.

Regards

--

Sasidhar Reddy Matli.