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: 

OUTBOUND PROCESS

Former Member
0 Kudos
53

HI ALL,

I want to know how to transfer a file to a unix directory in outbound process.can anyone help me with this..its urgent.

thanks bob

1 REPLY 1

Former Member
0 Kudos
33

Example:

If you want to upload the data from your desktop to UNIX

1. Upload the data into an internal table using function module 'WS_UPLOAD' or 'GUI_UPLOAD'.

call function 'WS_UPLOAD'

exporting

  • CODEPAGE = ' '

filename = v_lfilename (Your Desktop file Path)

  • FILETYPE = 'ASC'

  • HEADLEN = ' '

  • LINE_EXIT = ' '

  • TRUNCLEN = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • DAT_D_FORMAT = ' '

  • IMPORTING

  • FILELENGTH =

tables

data_tab = tbl_rawdata (Internal Table)

exceptions

conversion_error = 1

file_open_error = 2

file_read_error = 3

invalid_type = 4

no_batch = 5

unknown_error = 6

invalid_table_width = 7

gui_refuse_filetransfer = 8

customer_error = 9

others = 10

2. After above step you will be having data into internal table

3. Open the UNIX file and upload the data into the UNIX Directory

  • Open the file

open dataset v_lfilename for output in text mode message v_lmsg.

if sy-subrc ne 0.

  • Append the message output to the error tracing table!

v_lsubrc2 = 4.

message e006(zsec) with v_lfilename.

else.

  • Loop through the raw data table, transferring the data to the file

  • specified

clear v_rawdata.

loop at tbl_rawdata into v_rawdata.

transfer v_rawdata to v_lfilename.

if sy-subrc ne 0.

  • Error transferring data!

v_lsubrc2 = 4.

message e008(zsec) with v_lfilename.

endif.

clear v_rawdata.

endloop.

  • Close the file

close dataset v_lfilename.

if sy-subrc ne 0.

  • Error closing the dataset!

v_lsubrc2 = 4.

message e009(zsec) with v_lfilename.

endif.

endif.

Points please if it is useful.

Thanks,