Skip to Content
0
Apr 09, 2008 at 07:46 PM

help for data upload

14 Views

hii friends,

i have written this bdc program to upload the address data from flat file to the sap system but whenever i process the session i get the result like W_MAT-NAME,W_MAT-STREET etc instead of the data in the flat file.

i have pasted my program here..plzz site the error.

report ZADDRESS1

no standard page heading line-size 255.

TABLES : ztable.

include bdcrecx1.

DATA : BEGIN OF ITAB,

NAME like ztable-name,

street LIKE ZTABLE-STREET,

MOBILE LIKE ZTABLE-MOBILE,

FIXED LIKE ZTABLE-FIXEDLINE,

CITY LIKE ZTABLE-CITY,

STATE LIKE ZTABLE-STATE,

COUNTRY LIKE ZTABLE-COUNTRY,

MAIL LIKE ztable-email,

END OF ITAB.

data : i_mat type table of ITAB.

data : w_mat type ITAB.

start-of-selection.

call function 'UPLOAD'

EXPORTING

  • CODEPAGE = ' '

  • FILENAME = ' '

FILETYPE = 'ASC'

  • HEADLEN = ' '

  • LINE_EXIT = ' '

  • TRUNCLEN = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • DAT_D_FORMAT = ' '

  • IMPORTING

  • FILELENGTH =

tables

data_tab = I_MAT

  • 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

  • NO_AUTHORITY = 10

  • OTHERS = 11

.

if sy-subrc <> 0.

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

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

endif.

perform open_group.

LOOP AT I_MAT INTO w_mat.

perform bdc_dynpro using 'ZADDRESS' '0100'.

perform bdc_field using 'BDC_OKCODE'

'=S'.

perform bdc_field using 'BDC_CURSOR'

'ZTABLE-EMAIL'.

perform bdc_field using 'ZTABLE-NAME'

'W_MAT-NAME'.

perform bdc_field using 'ZTABLE-STREET'

'W_MAT-STREET'.

perform bdc_field using 'ZTABLE-MOBILE'

'W_MAT-MOBILE'.

perform bdc_field using 'ZTABLE-FIXEDLINE'

'W_MAT_FIXED'.

perform bdc_field using 'ZTABLE-CITY'

'W_MAT-CITY'.

perform bdc_field using 'ZTABLE-STATE'

'W_MAT-STATE'.

perform bdc_field using 'ZTABLE-COUNTRY'

'W_MAT-COUNTRY'.

perform bdc_field using 'ZTABLE-EMAIL'

'W_MAT-MAIL'.

perform bdc_dynpro using 'ZADDRESS' '0100'.

perform bdc_field using 'BDC_OKCODE'

'=E'.

perform bdc_field using 'BDC_CURSOR'

'ADDRESS'.

perform bdc_field using 'ZTABLE-NAME'

'W_MAT-NAME'.

perform bdc_field using 'ZTABLE-STREET'

'W_MAT-STREET'.

perform bdc_field using 'ZTABLE-MOBILE'

'W_MAT-MOBILE'.

perform bdc_field using 'ZTABLE-FIXEDLINE'

'W_MAT-FIXED'.

perform bdc_field using 'ZTABLE-CITY'

'W_MAT-CITY'.

perform bdc_field using 'ZTABLE-STATE'

'W_MAT-STATE'.

perform bdc_field using 'ZTABLE-COUNTRY'

'W_MAT-COUNTRY'.

perform bdc_field using 'ZTABLE-EMAIL'

'W_MAT-MAIL'.

perform bdc_transaction using 'ZADD'.

ENDLOOP.

perform close_group.

thanks in adv

abhinab