Skip to Content
0
Oct 19, 2012 at 10:04 AM

Code required for uploading xls in XK02 Tcode using BCD Call Transaction

178 Views

hello,


I need the code to upload an excel file with 2 columns (Vendor id of type RF02K-LIFNR & Mail-id of type LFA1-LFURL) in XK02 T-code using BDC Call transaction method. I know that we need to use 'ALSM_EXCEL_TO_INTERNAL_TABLE' FM to upload an excel. I've used a check loop to see if the values are being populated properly or not as follows :

*Source table

data : begin of itab occurs 1,

f1 type RF02K-lifnr,

f2 type LFA1-lfurl,

end of itab.

*Target table

data : bdcdata type bdcdata occurs 1 with header line.


CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = 'E:\My Documents\Downloads\Vendor Email_1.xls'

I_BEGIN_COL = 1

I_BEGIN_ROW = 1

I_END_COL = 2

I_END_ROW = 1480

TABLES

INTERN = itab

EXCEPTIONS

INCONSISTENT_PARAMETERS = 1

UPLOAD_OLE = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

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

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

ENDIF.


**********************

Check loop

**********************

loop at itab.

write : / itab-f1,

itab-f2.

endloop.



It shows syntactically correct. But throwing run-time error PERFORM_CONFLICT_TAB_TYPE (Exception : CX_SY_DYN_CALL_ILLEGAL_TYPE). Please help me out with the correct code. Would really appreciate if code is a complete solution, but otherwise I know the remaining process of running SHDB to record XK02 and generate the required subroutines and use the "Call Transaction" feature.

Thanks in advance to all for your time and patience.