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

Help!A question about abap.

Former Member
0 Likes
1,285

hi~~~I'm having some trouble about abap, I defined a method as follows:

&----


*& Form download

&----


  • text

----


FORM DOWNLOAD.

DATA: FILENAME type string.

CONCATENATE '
192.168.0.28\sap\HuaFu project\14 Report\SD\ZSDR05_' SY-DATUM '.XLS' INTO FILENAME.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = FILENAME

FILETYPE = 'DAT'

TABLES

DATA_TAB = gdt_header.

  • EXCEPTIONS

  • INVALID_FILESIZE = 1

  • INVALID_TABLE_WIDTH = 2

  • INVALID_TYPE = 3.

IF SY-SUBRC = 0.

WRITE: '文件已成功下载到',FILENAME.

ELSE.

WRITE: '下载失败'.

ENDIF.

ENDFORM. "download

Now this method runs successful in my own OS(windows),but it is fail when I define it in the Linux Server,Useing T-CODE SM37 to see , the state show it was canceled. What's wrong with my code,and how to defined the path in linux server,

help,thx.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,245

hi ,

this is about the logical path and the physical path..

you can go to the tcode file for the logical path for the unix server and give it ...there

regards,

venkat.

Dear K.P.N,

I try it .but failure. Can not find error message.

10 REPLIES 10
Read only

Former Member
0 Likes
1,245

Hi wu,

WS_DOWNLOAD,GUI_DOWNLOAD,DOWNLOAD,UPLOAD,

WS_UPLOAD,GUI_UPLOAD function modules will not work in background mode. Use open dataset ... transfer.. close dataset.. instead.

Reward points if helpful.

Regrads,

Sankar.

Read only

Former Member
0 Likes
1,245

Hi Wu,

Please check this thread on the SND and hope you getthe needed information.

Regds,

Gaurav

Read only

Former Member
0 Likes
1,245

Wu,

Try using some other statemnts like OPEN DATASET, CLOSE DATASET, to upload or download ur file from the application server. And make it a point to translate ur variable containing the file path to lower case.

Hope this helps u out.

Reward ponts if useful.

Read only

vinod_vemuru2
Active Contributor
0 Likes
1,245

Hi,

All GUI function modules will not work in back ground. U told it was worked for u in ur system. It might be because u ran it in foreground. Try running this in back ground it will not work even in ur system.

Solusion for ur problem will be first transfer the data into application server and later u have to download it using transaction CG3Y.

Check below the syntax to download data to application server.

OPEN DATASET l_file FOR OUTPUT IN TEXT MODE.

IF sy-subrc IS INITIAL.

LOOP AT gdt_header.

TRANSFER gdt_header TO l_file.

ENDLOOP.

CLOSE DATASET l_file.

ELSE.

MESSAGE ...

ENDIF.

Thanks,

Vinod.

Edited by: Vinod Kumar Vemuru on Mar 21, 2008 11:18 AM

Read only

0 Likes
1,245

Dear all,

Thanks for your replaies.

But the OPEN DATASET...TRANSFER...CLOSE DATASET function is download a exist file from Application server to the front .

Now, I hope to resolve how to create a file to application server, the file content is that I get the results.

Appreciate to get your help. Thanks

Read only

Former Member
0 Likes
1,245

Try the path in linux with backward slashes as this //

Read only

0 Likes
1,245

Dear K.P.N,

I try it .but failure. Can not find error message.

Read only

Former Member
0 Likes
1,246

hi ,

this is about the logical path and the physical path..

you can go to the tcode file for the logical path for the unix server and give it ...there

regards,

venkat.

Read only

0 Likes
1,245

Dear venkat,

Your mean is replace the file path '
192.168.0.28\...\....xls' to '/tmp/....xls'? I have tested this method, but failure. Could you give a example? thanks.

Read only

Former Member
0 Likes
1,245

Dear all,

Please help me.thanks .