Skip to Content
0
Former Member
Jun 06, 2013 at 05:34 AM

BDC SEESION ERROR

38 Views

Sir/mam,

I am getting a short dump error after executing this bdc session program

Runtime error: raise exception


short text: exception condition"upload_ole" raised.

The following program is given below:

report ZBDC_SESSION3

no standard page heading line-size 255.

*include bdcrecx1.

TYPES : BEGIN OF TY_MARA,

MATNR TYPE MATNR,

MBRSH TYPE MBRSH,

MTART TYPE MTART,

MAKTX TYPE MAKTX,

MEINS TYPE MEINS,

END OF TY_MARA.

DATA : IT_MARA TYPE STANDARD TABLE OF TY_MARA,

WA_MARA TYPE TY_MARA.

DATA : IT_EXCEL TYPE STANDARD TABLE OF ALSMEX_TABLINE,

WA_EXCEL TYPE ALSMEX_TABLINE.

DATA : BDCDATA TYPE BDCDATA OCCURS 0 WITH HEADER LINE.

start-of-selection.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = 'C:\Documents and Settings\Administrator\Desktop\BDC_SESSION3.XLS'

I_BEGIN_COL = 1

I_BEGIN_ROW = 2

I_END_COL = 5

I_END_ROW = 3

TABLES

INTERN = IT_EXCEL

* 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.

  1. ENDIF.

*perform open_group.

LOOP AT IT_EXCEL INTO WA_EXCEL.

CASE WA_EXCEL-COL.

WHEN '0001'.

WA_MARA-MATNR = WA_EXCEL-VALUE.

WHEN '0002'.

WA_MARA-MBRSH = WA_EXCEL-VALUE.

WHEN '0003'.

WA_MARA-MTART = WA_EXCEL-VALUE.

WHEN '0004'.

WA_MARA-MAKTX = WA_EXCEL-VALUE.

WHEN '0005'.

WA_MARA-MEINS = WA_EXCEL-VALUE.

AT END OF ROW.

APPEND WA_MARA TO IT_MARA.

  1. ENDAT.
  2. ENDCASE.

  1. ENDLOOP.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

* DEST = FILLER8

GROUP = 'ZKUMAR'

* HOLDDATE = FILLER8

KEEP = 'X'

USER = SY-UNAME

* RECORD = FILLER1

PROG = SY-CPROG

* DCPFM = '%'

* DATFM = '%'

* IMPORTING

* QID =

* EXCEPTIONS

* CLIENT_INVALID = 1

* DESTINATION_INVALID = 2

* GROUP_INVALID = 3

* GROUP_IS_LOCKED = 4

* HOLDDATE_INVALID = 5

* INTERNAL_ERROR = 6

* QUEUE_ERROR = 7

* RUNNING = 8

* SYSTEM_LOCK_ERROR = 9

* USER_INVALID = 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.

  1. ENDIF.

LOOP AT IT_MARA INTO WA_MARA.

CLEAR BDCDATA.

REFRESH BDCDATA.

performbdc_dynpro using 'SAPLMGMM' '0060'.

performbdc_field using 'BDC_CURSOR'

'RMMG1-MTART'.

performbdc_field using 'BDC_OKCODE'

'/00'.

performbdc_field using 'RMMG1-MATNR'

WA_MARA-MATNR.

"'MIRINDA'.

performbdc_field using 'RMMG1-MBRSH'

WA_MARA-MBRSH.

"'F'.

performbdc_field using 'RMMG1-MTART'

WA_MARA-MTART.

"'FGTR'.

performbdc_dynpro using 'SAPLMGMM' '0070'.

performbdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

performbdc_field using 'BDC_OKCODE'

'=ENTR'.

performbdc_field using 'MSICHTAUSW-KZSEL(01)'

'X'.

performbdc_dynpro using 'SAPLMGMM' '4004'.

performbdc_field using 'BDC_OKCODE'

'=BU'.

performbdc_field using 'MAKT-MAKTX'

WA_MARA-MAKTX.

"' COLD DRINK'.

performbdc_field using 'BDC_CURSOR'

'MARA-MEINS'.

performbdc_field using 'MARA-MEINS'

WA_MARA-MEINS.

"'L'.

performbdc_field using 'MARA-MTPOS_MARA'

'NORM'.

*perform bdc_transaction using 'MM01'.

*perform close_group.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'MM01'

* POST_LOCAL = NOVBLOCAL

* PRINTING = NOPRINT

* SIMUBATCH = ' '

* CTUPARAMS = ' '

TABLES

DYNPROTAB = BDCDATA

* EXCEPTIONS

* INTERNAL_ERROR = 1

* NOT_OPEN = 2

* QUEUE_ERROR = 3

* TCODE_INVALID = 4

* PRINTING_INVALID = 5

* POSTING_INVALID = 6

* OTHERS = 7

.

IF SY-SUBRC <> 0.

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

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

  1. ENDIF.
  2. ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'

* EXCEPTIONS

* NOT_OPEN = 1

* QUEUE_ERROR = 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.

  1. ENDIF.

*----------------------------------------------------------------------*

* Start new screen *

*----------------------------------------------------------------------*

FORM BDC_DYNPRO USING PROGRAM DYNPRO.

CLEAR BDCDATA.

BDCDATA-PROGRAM = PROGRAM.

BDCDATA-DYNPRO = DYNPRO.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA.

  1. ENDFORM.

*----------------------------------------------------------------------*

* Insert field *

*----------------------------------------------------------------------*

FORM BDC_FIELD USING FNAM FVAL.

* IF FVAL <> NODATA.

CLEAR BDCDATA.

BDCDATA-FNAM = FNAM.

BDCDATA-FVAL = FVAL.

APPEND BDCDATA.

* ENDIF.

  1. ENDFORM.

someone help me for this bdc session program

Message was edited by: Matthew Billingham - removed virulent formatting