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

Function Module

Former Member
0 Likes
780

Hi,

Does anybody knows a standard FM that creates a text file in the local hard drive in the given path.

Please Help...

Thank you...

regards,

mae

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
760

FMs are

GUI_DOWNLOAD

WS_DOWNLOAD

Hope dis helps

Reward if it does

9 REPLIES 9
Read only

Former Member
0 Likes
760

FM: GUI_DOWNLOAD can download required data to local hard drive

Kind Regards

Eswar

Read only

0 Likes
760

this will call a .bat or .exe which is the one who will create the text file..

So a FM that will will trigger a file to create a text file..

Do you have any idea regarding with this?

thank you..

regards,

mae

Read only

0 Likes
760

Mae,

Your requirement is not clear, do you need to create text file with data or invoke a batch file that creates text file?

Check below sample code, it creates a text file "DOWNLOAD.TXT" in local hard disk.


data: i_dat type table of string.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename                        = 'C:\download.txt'
  tables
    data_tab                        = i_dat
 EXCEPTIONS
   FILE_WRITE_ERROR                = 1
   NO_BATCH                        = 2
   GUI_REFUSE_FILETRANSFER         = 3
   INVALID_TYPE                    = 4
   NO_AUTHORITY                    = 5
   UNKNOWN_ERROR                   = 6
   HEADER_NOT_ALLOWED              = 7
   SEPARATOR_NOT_ALLOWED           = 8
   FILESIZE_NOT_ALLOWED            = 9
   HEADER_TOO_LONG                 = 10
   DP_ERROR_CREATE                 = 11
   DP_ERROR_SEND                   = 12
   DP_ERROR_WRITE                  = 13
   UNKNOWN_DP_ERROR                = 14
   ACCESS_DENIED                   = 15
   DP_OUT_OF_MEMORY                = 16
   DISK_FULL                       = 17
   DP_TIMEOUT                      = 18
   FILE_NOT_FOUND                  = 19
   DATAPROVIDER_EXCEPTION          = 20
   CONTROL_FLUSH_ERROR             = 21
   OTHERS                          = 22.

Populate internal table I_DAT with data that has to be download to the file.

Kind Regards

Eswar

Read only

Former Member
0 Likes
760

Hi,

Use function module GUI_EXEC and in parameter give notepad.exe.

Regards,

Renjith Michael.

Read only

Former Member
0 Likes
761

FMs are

GUI_DOWNLOAD

WS_DOWNLOAD

Hope dis helps

Reward if it does

Read only

0 Likes
760

hi,

what i mean to say is that i need to trigger an executable program .exe or .bat...and this executable program will just responsible on creating the text file...

i have 3 parameter the PATH, ID, and Code..

does anybody knows a function module that will trigger an executable program?

Please help..

Thank you..

regards,

mae

Read only

0 Likes
760

Hi Mae,

Think you can use FM: SXPG_COMMAND_EXECUTE. I guess you can find few samples here in SDN. Please check.

Regards

Eswar

Read only

0 Likes
760

hi,

it seems that the examples from this forum makes me confused on using this FM...

can you explain how to use this FM?

please.......

thank you..

regards,

mae

Read only

0 Likes
760

hii,

check it step by step.

1) you fill the internal table for which you want to generate the file.

2) store the file name with the file type in a variable

3) call the function by pressing 'Pattren' button on the tool bar and write function name and it ll load code into your window.

4) set the parameter as shown below and execute the code.

it will generate file according to your specified file location and type.

call function 'GUI_DOWNLOAD'

exporting

BIN_FILESIZE =

filename = txtfile

filetype = 'ASC'

APPEND = ' '

write_field_separator = 'X'

confirm_overwrite = 'X'

tables

data_tab = it2_oh

.

reply if not clear

or

Reward if helpful

-Maharshi