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

BDC_INSERT not inserting the values in my table

Former Member
0 Likes
578

Hi Everyone,

I am trying to create a BDC program to insert values to MM01 transaction code. As far as I have debugged, I am getting the values correctly in my itab_bdc (BDCDATA)

After BDC_INSERT, I am not getting any error. It says sy-subrc is 0. But the values are not getting populated in my table.

Below is the code that I have used for BDC_INSERT.


 DATA :  itab_bdc type standard table of bdcdata with header line.

CALL FUNCTION 'BDC_INSERT'
   EXPORTING
     TCODE                  = 'MM01'
*     POST_LOCAL             = NOVBLOCAL
*     PRINTING               = NOPRINT
*     SIMUBATCH              = ' '
*     CTUPARAMS              = ' '
    TABLES
      dynprotab              = itab_bdc
   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.
    write :/ 'Error while inserting'.
  ENDIF.
  write :/ wa_xls-matnr, 'Successfully inserted into session'.

Please help me with this.

Hi Everyone,

I am trying to create a BDC program to insert values to MM01 transaction code. As far as I have debugged, I am getting the values correctly in my itab_bdc (BDCDATA)

After BDC_INSERT, I am not getting any error. It says sy-subrc is 0. But the values are not getting populated in my table.

Below is the code that I have used for BDC_INSERT.


 DATA :  itab_bdc type standard table of bdcdata with header line.

CALL FUNCTION 'BDC_INSERT'
   EXPORTING
     TCODE                  = 'MM01'
*     POST_LOCAL             = NOVBLOCAL
*     PRINTING               = NOPRINT
*     SIMUBATCH              = ' '
*     CTUPARAMS              = ' '
    TABLES
      dynprotab              = itab_bdc
   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.
    write :/ 'Error while inserting'.
  ENDIF.
  write :/ wa_xls-matnr, 'Successfully inserted into session'.

Please help me with this.

2 REPLIES 2
Read only

Former Member
0 Likes
452

Have you processed the session? What is the status in SM35?

Rob

Read only

Former Member
0 Likes
452

Resolved by myself. I had error when processing through SM35. In the error log, I noticed that I have given a wrong table name for a field.