SAP BDC_INSERT Function Module for Insert batch input transactions in batch input session









BDC_INSERT is a standard bdc insert SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Insert batch input transactions in batch input session processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for bdc insert FM, simply by entering the name BDC_INSERT into the relevant SAP transaction such as SE37 or SE38.

Function Group: SBDC
Program Name: SAPLSBDC
Main Program: SAPLSBDC
Appliation area: S
Release date: 02-Mar-2005
Mode(Normal, Remote etc): Normal Function Module
Update:



Function BDC_INSERT pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'BDC_INSERT'"Insert batch input transactions in batch input session
EXPORTING
* TCODE = FILLER4 "Transaction code
* POST_LOCAL = NOVBLOCAL "
* PRINTING = NOPRINT "
* SIMUBATCH = ' ' "Simulate Background Processing (SY-BATCH='X')
* CTUPARAMS = ' ' "CTU Recording Parameter

TABLES
DYNPROTAB = "Table for screens of a transaction

EXCEPTIONS
INTERNAL_ERROR = 1 NOT_OPEN = 2 QUEUE_ERROR = 3 TCODE_INVALID = 4 PRINTING_INVALID = 5 POSTING_INVALID = 6
.



IMPORTING Parameters details for BDC_INSERT

TCODE - Transaction code

Data type: TSTC-TCODE
Default: FILLER4
Optional: Yes
Call by Reference: No ( called with pass by value option)

POST_LOCAL -

Data type: BDCTH-MTYPE
Default: NOVBLOCAL
Optional: Yes
Call by Reference: No ( called with pass by value option)

PRINTING -

Data type: BDCTH-STATE
Default: NOPRINT
Optional: Yes
Call by Reference: No ( called with pass by value option)

SIMUBATCH - Simulate Background Processing (SY-BATCH='X')

Data type: SYBATCH
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

CTUPARAMS - CTU Recording Parameter

Data type: CTU_PARAMS
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for BDC_INSERT

DYNPROTAB - Table for screens of a transaction

Data type: BDCDATA
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

INTERNAL_ERROR - Internal error of batch input (see

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NOT_OPEN - Queue was not opened (see SYSLOG)

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

QUEUE_ERROR - Error reading/writing the queue (see SYSLOG)

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

TCODE_INVALID - Transaction code is not known

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PRINTING_INVALID -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

POSTING_INVALID -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for BDC_INSERT Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_tcode  TYPE TSTC-TCODE, "   FILLER4
lt_dynprotab  TYPE STANDARD TABLE OF BDCDATA, "   
lv_internal_error  TYPE BDCDATA, "   
lv_not_open  TYPE BDCDATA, "   
lv_post_local  TYPE BDCTH-MTYPE, "   NOVBLOCAL
lv_printing  TYPE BDCTH-STATE, "   NOPRINT
lv_queue_error  TYPE BDCTH, "   
lv_simubatch  TYPE SYBATCH, "   SPACE
lv_tcode_invalid  TYPE SYBATCH, "   
lv_ctuparams  TYPE CTU_PARAMS, "   SPACE
lv_printing_invalid  TYPE CTU_PARAMS, "   
lv_posting_invalid  TYPE CTU_PARAMS. "   

  CALL FUNCTION 'BDC_INSERT'  "Insert batch input transactions in batch input session
    EXPORTING
         TCODE = lv_tcode
         POST_LOCAL = lv_post_local
         PRINTING = lv_printing
         SIMUBATCH = lv_simubatch
         CTUPARAMS = lv_ctuparams
    TABLES
         DYNPROTAB = lt_dynprotab
    EXCEPTIONS
        INTERNAL_ERROR = 1
        NOT_OPEN = 2
        QUEUE_ERROR = 3
        TCODE_INVALID = 4
        PRINTING_INVALID = 5
        POSTING_INVALID = 6
. " BDC_INSERT




ABAP code using 7.40 inline data declarations to call FM BDC_INSERT

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single TCODE FROM TSTC INTO @DATA(ld_tcode).
DATA(ld_tcode) = FILLER4.
 
 
 
 
"SELECT single MTYPE FROM BDCTH INTO @DATA(ld_post_local).
DATA(ld_post_local) = NOVBLOCAL.
 
"SELECT single STATE FROM BDCTH INTO @DATA(ld_printing).
DATA(ld_printing) = NOPRINT.
 
 
DATA(ld_simubatch) = ' '.
 
 
DATA(ld_ctuparams) = ' '.
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!