SAP Function Modules

BAPI_TRADINGCONTRACT_HISTORY SAP Function module - Trading Contract: Changes to a Contract







BAPI_TRADINGCONTRACT_HISTORY is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name BAPI_TRADINGCONTRACT_HISTORY into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: 2124
Released Date: 04.02.2000
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM BAPI_TRADINGCONTRACT_HISTORY - BAPI TRADINGCONTRACT HISTORY





CALL FUNCTION 'BAPI_TRADINGCONTRACT_HISTORY' "Trading Contract: Changes to a Contract
  EXPORTING
    tradingcontractno =         " bapitckey-document_number  Trading contract: Trading contract number
* TABLES
*   headdataout =               " bapitchheado  Communication Structure: Header Data Versions Trading Contract:
*   itemdataout =               " bapitchitemo  Communication Structure: Trading Contract Versions, Item
*   scheduledataout =           " bapitchshlo   Comm. Structure: Trading Contract Versions, Schedule Line Data
*   businessdataout =           " bapitchbuso   Comm. Structure: Trading Contract Versions, Business Data
*   buspartyout =               " bapitchpartyo  Comm. Structure: Trading Contract Versions, Partner
*   changeout =                 " bapitchchange  Change Document Header
*   extensionout =              " bapiparex     Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
*   return =                    " bapiret2      Return parameter
*   headtextout =               " bapitchheadctext  Trading Contract: Header Text Versions in Case of Change
*   itemtextout =               " bapitchitemctext  TC: Item Texts in Case of Change Including Version
    .  "  BAPI_TRADINGCONTRACT_HISTORY

ABAP code example for Function Module BAPI_TRADINGCONTRACT_HISTORY





The ABAP code below is a full code listing to execute function module BAPI_TRADINGCONTRACT_HISTORY including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
it_headdataout  TYPE STANDARD TABLE OF BAPITCHHEADO,"TABLES PARAM
wa_headdataout  LIKE LINE OF it_headdataout ,
it_itemdataout  TYPE STANDARD TABLE OF BAPITCHITEMO,"TABLES PARAM
wa_itemdataout  LIKE LINE OF it_itemdataout ,
it_scheduledataout  TYPE STANDARD TABLE OF BAPITCHSHLO,"TABLES PARAM
wa_scheduledataout  LIKE LINE OF it_scheduledataout ,
it_businessdataout  TYPE STANDARD TABLE OF BAPITCHBUSO,"TABLES PARAM
wa_businessdataout  LIKE LINE OF it_businessdataout ,
it_buspartyout  TYPE STANDARD TABLE OF BAPITCHPARTYO,"TABLES PARAM
wa_buspartyout  LIKE LINE OF it_buspartyout ,
it_changeout  TYPE STANDARD TABLE OF BAPITCHCHANGE,"TABLES PARAM
wa_changeout  LIKE LINE OF it_changeout ,
it_extensionout  TYPE STANDARD TABLE OF BAPIPAREX,"TABLES PARAM
wa_extensionout  LIKE LINE OF it_extensionout ,
it_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_return  LIKE LINE OF it_return ,
it_headtextout  TYPE STANDARD TABLE OF BAPITCHHEADCTEXT,"TABLES PARAM
wa_headtextout  LIKE LINE OF it_headtextout ,
it_itemtextout  TYPE STANDARD TABLE OF BAPITCHITEMCTEXT,"TABLES PARAM
wa_itemtextout  LIKE LINE OF it_itemtextout .


DATA(ld_tradingcontractno) = some text here

"populate fields of struture and append to itab
append wa_headdataout to it_headdataout.

"populate fields of struture and append to itab
append wa_itemdataout to it_itemdataout.

"populate fields of struture and append to itab
append wa_scheduledataout to it_scheduledataout.

"populate fields of struture and append to itab
append wa_businessdataout to it_businessdataout.

"populate fields of struture and append to itab
append wa_buspartyout to it_buspartyout.

"populate fields of struture and append to itab
append wa_changeout to it_changeout.

"populate fields of struture and append to itab
append wa_extensionout to it_extensionout.

"populate fields of struture and append to itab
append wa_return to it_return.

"populate fields of struture and append to itab
append wa_headtextout to it_headtextout.

"populate fields of struture and append to itab
append wa_itemtextout to it_itemtextout. . CALL FUNCTION 'BAPI_TRADINGCONTRACT_HISTORY' EXPORTING tradingcontractno = ld_tradingcontractno * TABLES * headdataout = it_headdataout * itemdataout = it_itemdataout * scheduledataout = it_scheduledataout * businessdataout = it_businessdataout * buspartyout = it_buspartyout * changeout = it_changeout * extensionout = it_extensionout * return = it_return * headtextout = it_headtextout * itemtextout = it_itemtextout . " BAPI_TRADINGCONTRACT_HISTORY
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_tradingcontractno  TYPE BAPITCKEY-DOCUMENT_NUMBER ,
it_headdataout  TYPE STANDARD TABLE OF BAPITCHHEADO ,
wa_headdataout  LIKE LINE OF it_headdataout,
it_itemdataout  TYPE STANDARD TABLE OF BAPITCHITEMO ,
wa_itemdataout  LIKE LINE OF it_itemdataout,
it_scheduledataout  TYPE STANDARD TABLE OF BAPITCHSHLO ,
wa_scheduledataout  LIKE LINE OF it_scheduledataout,
it_businessdataout  TYPE STANDARD TABLE OF BAPITCHBUSO ,
wa_businessdataout  LIKE LINE OF it_businessdataout,
it_buspartyout  TYPE STANDARD TABLE OF BAPITCHPARTYO ,
wa_buspartyout  LIKE LINE OF it_buspartyout,
it_changeout  TYPE STANDARD TABLE OF BAPITCHCHANGE ,
wa_changeout  LIKE LINE OF it_changeout,
it_extensionout  TYPE STANDARD TABLE OF BAPIPAREX ,
wa_extensionout  LIKE LINE OF it_extensionout,
it_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_return  LIKE LINE OF it_return,
it_headtextout  TYPE STANDARD TABLE OF BAPITCHHEADCTEXT ,
wa_headtextout  LIKE LINE OF it_headtextout,
it_itemtextout  TYPE STANDARD TABLE OF BAPITCHITEMCTEXT ,
wa_itemtextout  LIKE LINE OF it_itemtextout.


ld_tradingcontractno = some text here

"populate fields of struture and append to itab
append wa_headdataout to it_headdataout.

"populate fields of struture and append to itab
append wa_itemdataout to it_itemdataout.

"populate fields of struture and append to itab
append wa_scheduledataout to it_scheduledataout.

"populate fields of struture and append to itab
append wa_businessdataout to it_businessdataout.

"populate fields of struture and append to itab
append wa_buspartyout to it_buspartyout.

"populate fields of struture and append to itab
append wa_changeout to it_changeout.

"populate fields of struture and append to itab
append wa_extensionout to it_extensionout.

"populate fields of struture and append to itab
append wa_return to it_return.

"populate fields of struture and append to itab
append wa_headtextout to it_headtextout.

"populate fields of struture and append to itab
append wa_itemtextout to it_itemtextout.

SAP Documentation for FM BAPI_TRADINGCONTRACT_HISTORY


You use this method to provide the trading contract history.
You use the document number to select the trading contract you want to ...See here for full SAP fm documentation

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BAPI_TRADINGCONTRACT_HISTORY or its description.