‎2006 Nov 08 9:32 AM
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.
‎2006 Nov 08 9:39 AM
Hi Ravi,
Record the transaction you want tpo write BDC for using Tcode:SHDB.
Check out the link:
http://help.sap.com/saphelp_erp2005/helpdata/en/fa/097119543b11d1898e0000e8322d00/frameset.htm
http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
http://www.sap-img.com/abap/learning-bdc-programming.htm
http://www.sap-img.com/bdc.htm
www.sappoint.com/abap/bdcconcept.pdf
http://www.sap-img.com/abap/learning-bdc-programming.htm
http://www.sapdevelopment.co.uk/bdc/bdchome.htm
http://www.planetsap.com/bdc_main_page.htm
Reward points if this Helps.
Manish