SAP BAPI_TRADINGCONTRACT_CREATE Function Module for Trading Contract: Create from Template Data









BAPI_TRADINGCONTRACT_CREATE is a standard bapi tradingcontract create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Trading Contract: Create from Template Data 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 bapi tradingcontract create FM, simply by entering the name BAPI_TRADINGCONTRACT_CREATE into the relevant SAP transaction such as SE37 or SE38.

Function Group: 2124
Program Name: SAPL2124
Main Program: SAPL2124
Appliation area: W
Release date: 04-Feb-2000
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_TRADINGCONTRACT_CREATE 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 'BAPI_TRADINGCONTRACT_CREATE'"Trading Contract: Create from Template Data
EXPORTING
HEADDATAIN = "Communication Structure: Trading Contract Header Data:

IMPORTING
HEADDATAOUT = "Communication Structure: Trading Contract Header Data:
TRADINGCONTRACTNO = "Trading Contract: Trading Contract Number

TABLES
ITEMDATAIN = "Communication Structure: Trading Contract Item
* BUSINESSDATAOUT = "Communication Structure: Trading Contract Business Data
* BUSPARTYOUT = "Communication Structure: Trading Contract Partner
* HEADTEXTOUT = "Trading Contract: Header Text in Case of Change
* ITEMTEXTOUT = "Trading Contract: Item Texts in Case of Change
* EXTENSIONOUT = "Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
* RETURN = "Return parameter
* PARTNERADDRESSES = "BAPI Reference Structure for Addresses (Organization/Company)
* VENDORCONDIN = "Conditions: Trading Contract Vendor-Side
* CUSTOMERCONDIN = "Conditions: Trading Contract Customer-Side
* CONDITIONKEYDATAIN = "BAPI: Trading Contract: Fields Condition Structures
SCHEDULEDATAIN = "Communication Structure: Trading Contract Sched. Line Data
* CONDITIONKEYDATAINX = "BAPI: Trading Contract: Condition Structures Changes
* CONDITIONITEMDATAIN = "BAPI: Trading Contract: Conditions Item
* CONDITIONITEMDATAINX = "BAPI: Trading Contract: Conditions Item Changes
* CONDITIONKEYDATAOUT = "BAPI: Trading Contract: Fields Condition Structures
* CONDITIONITEMDATAOUT = "BAPI: Trading Contract: Conditions Item
* SCALEDATAIN = "BAPI: Trading Contract: Conditions Scale
* SCALEDATAOUT = "BAPI: Trading Contract: Conditions Scales
* VENDORCONDOUT = "Kommunikationsstruktur: Konditionen Trading-Kontrakt (KOMV)
* CUSTOMERCONDOUT = "Kommunikationsstruktur: Konditionen Trading-Kontrakt (KOMV)
BUSINESSDATAIN = "Communication Structure: Trading Contract Business Data
* BUSPARTYIN = "Communication Structure: Trading Contract Partner
* EXTENSIONIN = "Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
* HEADTEXTIN = "Trading Contract: Header Text in Case of Creation
* ITEMTEXTIN = "Trading Contract: Item Texts in Case of Creation
* ITEMDATAOUT = "Communication Structure: Trading Contract Item
* SCHEDULEDATAOUT = "Communication Structure: Trading Contract Sched. Line Data
.



IMPORTING Parameters details for BAPI_TRADINGCONTRACT_CREATE

HEADDATAIN - Communication Structure: Trading Contract Header Data:

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

EXPORTING Parameters details for BAPI_TRADINGCONTRACT_CREATE

HEADDATAOUT - Communication Structure: Trading Contract Header Data:

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

TRADINGCONTRACTNO - Trading Contract: Trading Contract Number

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

TABLES Parameters details for BAPI_TRADINGCONTRACT_CREATE

ITEMDATAIN - Communication Structure: Trading Contract Item

Data type: BAPITCITEM
Optional: No
Call by Reference: Yes

BUSINESSDATAOUT - Communication Structure: Trading Contract Business Data

Data type: BAPITCBUSO
Optional: Yes
Call by Reference: Yes

BUSPARTYOUT - Communication Structure: Trading Contract Partner

Data type: BAPITCPARTYO
Optional: Yes
Call by Reference: Yes

HEADTEXTOUT - Trading Contract: Header Text in Case of Change

Data type: BAPITCHEADCTEXT
Optional: Yes
Call by Reference: Yes

ITEMTEXTOUT - Trading Contract: Item Texts in Case of Change

Data type: BAPITCITEMCTEXT
Optional: Yes
Call by Reference: Yes

EXTENSIONOUT - Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT

Data type: BAPIPAREX
Optional: Yes
Call by Reference: Yes

RETURN - Return parameter

Data type: BAPIRET2
Optional: Yes
Call by Reference: Yes

PARTNERADDRESSES - BAPI Reference Structure for Addresses (Organization/Company)

Data type: BAPIADDR1
Optional: Yes
Call by Reference: Yes

VENDORCONDIN - Conditions: Trading Contract Vendor-Side

Data type: BAPITCCOND
Optional: Yes
Call by Reference: Yes

CUSTOMERCONDIN - Conditions: Trading Contract Customer-Side

Data type: BAPITCCONDD
Optional: Yes
Call by Reference: Yes

CONDITIONKEYDATAIN - BAPI: Trading Contract: Fields Condition Structures

Data type: BAPITCCONDITIONKEY
Optional: Yes
Call by Reference: Yes

SCHEDULEDATAIN - Communication Structure: Trading Contract Sched. Line Data

Data type: BAPITCSHL
Optional: No
Call by Reference: Yes

CONDITIONKEYDATAINX - BAPI: Trading Contract: Condition Structures Changes

Data type: BAPITCCONDITIONKEYX
Optional: Yes
Call by Reference: Yes

CONDITIONITEMDATAIN - BAPI: Trading Contract: Conditions Item

Data type: BAPITCCONDITIONITEM
Optional: Yes
Call by Reference: Yes

CONDITIONITEMDATAINX - BAPI: Trading Contract: Conditions Item Changes

Data type: BAPITCCONDITIONITEMX
Optional: Yes
Call by Reference: Yes

CONDITIONKEYDATAOUT - BAPI: Trading Contract: Fields Condition Structures

Data type: BAPITCCONDITIONKEYO
Optional: Yes
Call by Reference: Yes

CONDITIONITEMDATAOUT - BAPI: Trading Contract: Conditions Item

Data type: BAPITCCONDITIONITEMO
Optional: Yes
Call by Reference: Yes

SCALEDATAIN - BAPI: Trading Contract: Conditions Scale

Data type: BAPITCSCALE
Optional: Yes
Call by Reference: Yes

SCALEDATAOUT - BAPI: Trading Contract: Conditions Scales

Data type: BAPITCSCALEO
Optional: Yes
Call by Reference: Yes

VENDORCONDOUT - Kommunikationsstruktur: Konditionen Trading-Kontrakt (KOMV)

Data type: BAPITCCONDOV
Optional: Yes
Call by Reference: Yes

CUSTOMERCONDOUT - Kommunikationsstruktur: Konditionen Trading-Kontrakt (KOMV)

Data type: BAPITCCONDOC
Optional: Yes
Call by Reference: Yes

BUSINESSDATAIN - Communication Structure: Trading Contract Business Data

Data type: BAPITCBUS
Optional: No
Call by Reference: Yes

BUSPARTYIN - Communication Structure: Trading Contract Partner

Data type: BAPITCPARTY
Optional: Yes
Call by Reference: Yes

EXTENSIONIN - Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT

Data type: BAPIPAREX
Optional: Yes
Call by Reference: Yes

HEADTEXTIN - Trading Contract: Header Text in Case of Creation

Data type: BAPITCHEADTEXT
Optional: Yes
Call by Reference: Yes

ITEMTEXTIN - Trading Contract: Item Texts in Case of Creation

Data type: BAPITCITEMTEXT
Optional: Yes
Call by Reference: Yes

ITEMDATAOUT - Communication Structure: Trading Contract Item

Data type: BAPITCITEMO
Optional: Yes
Call by Reference: Yes

SCHEDULEDATAOUT - Communication Structure: Trading Contract Sched. Line Data

Data type: BAPITCSHLO
Optional: Yes
Call by Reference: Yes

Copy and paste ABAP code example for BAPI_TRADINGCONTRACT_CREATE 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_headdatain  TYPE BAPITCHEAD, "   
lt_itemdatain  TYPE STANDARD TABLE OF BAPITCITEM, "   
lv_headdataout  TYPE BAPITCHEADOS, "   
lt_businessdataout  TYPE STANDARD TABLE OF BAPITCBUSO, "   
lt_buspartyout  TYPE STANDARD TABLE OF BAPITCPARTYO, "   
lt_headtextout  TYPE STANDARD TABLE OF BAPITCHEADCTEXT, "   
lt_itemtextout  TYPE STANDARD TABLE OF BAPITCITEMCTEXT, "   
lt_extensionout  TYPE STANDARD TABLE OF BAPIPAREX, "   
lt_return  TYPE STANDARD TABLE OF BAPIRET2, "   
lt_partneraddresses  TYPE STANDARD TABLE OF BAPIADDR1, "   
lt_vendorcondin  TYPE STANDARD TABLE OF BAPITCCOND, "   
lt_customercondin  TYPE STANDARD TABLE OF BAPITCCONDD, "   
lt_conditionkeydatain  TYPE STANDARD TABLE OF BAPITCCONDITIONKEY, "   
lt_scheduledatain  TYPE STANDARD TABLE OF BAPITCSHL, "   
lv_tradingcontractno  TYPE BAPITCKEY-DOCUMENT_NUMBER, "   
lt_conditionkeydatainx  TYPE STANDARD TABLE OF BAPITCCONDITIONKEYX, "   
lt_conditionitemdatain  TYPE STANDARD TABLE OF BAPITCCONDITIONITEM, "   
lt_conditionitemdatainx  TYPE STANDARD TABLE OF BAPITCCONDITIONITEMX, "   
lt_conditionkeydataout  TYPE STANDARD TABLE OF BAPITCCONDITIONKEYO, "   
lt_conditionitemdataout  TYPE STANDARD TABLE OF BAPITCCONDITIONITEMO, "   
lt_scaledatain  TYPE STANDARD TABLE OF BAPITCSCALE, "   
lt_scaledataout  TYPE STANDARD TABLE OF BAPITCSCALEO, "   
lt_vendorcondout  TYPE STANDARD TABLE OF BAPITCCONDOV, "   
lt_customercondout  TYPE STANDARD TABLE OF BAPITCCONDOC, "   
lt_businessdatain  TYPE STANDARD TABLE OF BAPITCBUS, "   
lt_buspartyin  TYPE STANDARD TABLE OF BAPITCPARTY, "   
lt_extensionin  TYPE STANDARD TABLE OF BAPIPAREX, "   
lt_headtextin  TYPE STANDARD TABLE OF BAPITCHEADTEXT, "   
lt_itemtextin  TYPE STANDARD TABLE OF BAPITCITEMTEXT, "   
lt_itemdataout  TYPE STANDARD TABLE OF BAPITCITEMO, "   
lt_scheduledataout  TYPE STANDARD TABLE OF BAPITCSHLO. "   

  CALL FUNCTION 'BAPI_TRADINGCONTRACT_CREATE'  "Trading Contract: Create from Template Data
    EXPORTING
         HEADDATAIN = lv_headdatain
    IMPORTING
         HEADDATAOUT = lv_headdataout
         TRADINGCONTRACTNO = lv_tradingcontractno
    TABLES
         ITEMDATAIN = lt_itemdatain
         BUSINESSDATAOUT = lt_businessdataout
         BUSPARTYOUT = lt_buspartyout
         HEADTEXTOUT = lt_headtextout
         ITEMTEXTOUT = lt_itemtextout
         EXTENSIONOUT = lt_extensionout
         RETURN = lt_return
         PARTNERADDRESSES = lt_partneraddresses
         VENDORCONDIN = lt_vendorcondin
         CUSTOMERCONDIN = lt_customercondin
         CONDITIONKEYDATAIN = lt_conditionkeydatain
         SCHEDULEDATAIN = lt_scheduledatain
         CONDITIONKEYDATAINX = lt_conditionkeydatainx
         CONDITIONITEMDATAIN = lt_conditionitemdatain
         CONDITIONITEMDATAINX = lt_conditionitemdatainx
         CONDITIONKEYDATAOUT = lt_conditionkeydataout
         CONDITIONITEMDATAOUT = lt_conditionitemdataout
         SCALEDATAIN = lt_scaledatain
         SCALEDATAOUT = lt_scaledataout
         VENDORCONDOUT = lt_vendorcondout
         CUSTOMERCONDOUT = lt_customercondout
         BUSINESSDATAIN = lt_businessdatain
         BUSPARTYIN = lt_buspartyin
         EXTENSIONIN = lt_extensionin
         HEADTEXTIN = lt_headtextin
         ITEMTEXTIN = lt_itemtextin
         ITEMDATAOUT = lt_itemdataout
         SCHEDULEDATAOUT = lt_scheduledataout
. " BAPI_TRADINGCONTRACT_CREATE




ABAP code using 7.40 inline data declarations to call FM BAPI_TRADINGCONTRACT_CREATE

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 DOCUMENT_NUMBER FROM BAPITCKEY INTO @DATA(ld_tradingcontractno).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


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!