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: 

doubt in data transfer

Former Member
0 Kudos

can anybody tell

wat type of interface or which method can be used to move datas or table from flat file struciture

to one particular server

wat method we can use

eg:material master

sales order

4 REPLIES 4

Former Member
0 Kudos

hi,

if flat file is present in appln server then

uset the FM gui_upload

or else if present in appln server use dataset operations

regards,

Navneeth.K

Message was edited by:

Navneeth Bothra

0 Kudos

u didnt get my ques

Former Member
0 Kudos

hi,

can u be clear with the question "move datas or table from flat file" where is this flat file located.

regards,

Navneeth.K

Former Member
0 Kudos

Hi

u can call many function modules 2 load data into a flat file on presentation server.

gui_download.

*"Table declarations...................................................

tables: kna1.

*"Selection screen elements............................................

select-options: s_kunnr for kna1-kunnr. " Customer Number 1

"----


  • Type declaration of the structure to hold Customer master *

"----


data:

begin of fs_kna1,

kunnr type kna1-kunnr, " Customer Number 1

adrnr type kna1-adrnr, " Address

anred type kna1-anred, " Title

erdat type kna1-erdat, " Date on which Record Was reated

ernam type kna1-ernam, " Name of Person who Created

end of fs_kna1.

"----


  • Internal table to hold Customer master *

"----


data:

t_kna1 like standard table

of fs_kna1.

"----


  • Type declaration of the structure to hold file data *

"----


data:

begin of fs_table,

str type string,

end of fs_table.

"----


  • Internal table to hold file data *

"----


data:

t_table like standard table

of fs_table.

field-symbols: <fs>.

*" Data declarations...................................................

"----


  • Work variables *

"----


data:

w_char(50) type c.

select kunnr " Customer Number 1

adrnr " Address

anred " Title

erdat " Date on which Record Was reated

ernam " Name of Person who Created

from kna1

into table t_kna1

where kunnr in s_kunnr.

if sy-subrc eq 0.

loop at t_kna1 into fs_kna1.

do.

assign component sy-index of structure fs_kna1 to <fs>.

if sy-subrc ne 0.

exit.

else.

move <fs> to w_char.

if sy-index eq 1.

fs_table-str = <fs>.

else.

concatenate fs_table-str ',' w_char into fs_table-str.

endif. " IF SY-INDEX...

endif. " IF SY-SUBRC...

enddo. " DO...

append fs_table to t_table.

endloop. " LOOP AT T_KNA1...

endif. " IF SY-SUBRC...

call function 'GUI_DOWNLOAD'

exporting

  • BIN_FILESIZE =

filename = 'C:\Assign\kna1'

  • FILETYPE = 'ASC'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • IMPORTING

  • FILELENGTH =

tables

data_tab = t_table

  • FIELDNAMES =

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

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

reward if helpful.

regards,

kiran kumar k