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

regarding BDC coding

Former Member
0 Likes
272

I HV WRITTEN the half of the part to upload data from excel sheet(fields are posting key,cmpy code,gl a/c,vendor code,vendor name,business area n amount) to sap system now i m facing problem how to pass records to bdc using perform statement...here i m giving half of the coding.....

tables:rf02k,addr1_data,bseg,bkpf,cobl,rf05a.

data:begin of itab occurs 0,

lifnr(10) type c, " like rf02k-lifnr,

name1(10) type c, " like addr1_data,

hkont(07) type c, " like bseg-hkont,

bukrs(06) type c, " like bkpf-bukrs,

wrbtr(10) type c, " like bseg-wrbtr,

gsber(10) type c, " like cobl-gsber,

newbs(07) type c, " like rf05a-newbs,

end of itab.

data:begin of jtab occurs 0.

include structure bdcdata.

data:end of jtab.

data:begin of i_excel occurs 0.

include structure alsmex_tabline.

data:end of i_excel.

parameters:fname like rlgrap-filename.

  • ftype like rlgrap-filetype,

  • start type i, end type i.

*at selection-screen on value-request for fname.

*

*call function 'F4_FILENAME'

      • EXPORTING

      • PROGRAM_NAME = SYST-CPROG

      • DYNPRO_NUMBER = SYST-DYNNR

      • FIELD_NAME = ' '

  • IMPORTING

  • FILE_NAME = fname.

call function 'WS_UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = 'C:\WINDOWS\DESKTOP\HIGH'

FILETYPE = 'DAT'

  • HEADLEN = ' '

  • LINE_EXIT = ' '

  • TRUNCLEN = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • DAT_D_FORMAT = ' '

  • IMPORTING

  • FILELENGTH =

tables

DATA_TAB = ITAB

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.

1 REPLY 1