SAP TPM_PIN_CREATE Function Module for Create Position Indicator
TPM_PIN_CREATE is a standard tpm pin 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 Create Position Indicator 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 tpm pin create FM, simply by entering the name TPM_PIN_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: TPM_PIN_APPL
Program Name: SAPLTPM_PIN_APPL
Main Program: SAPLTPM_PIN_APPL
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TPM_PIN_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 'TPM_PIN_CREATE'"Create Position Indicator.
EXPORTING
* IM_MAINTAIN_FLG = TPMCO_XTRUE "'X'=UI zur Pflege
* IM_SECURITY_ACCOUNT = "Securities Account
* IM_PORTFOLIO = "Portfolio
* IM_LOANS_CONTRACT = "Contract Number
* IM_CLASS_ID = "Security ID Number
* IM_POSITION_ACCOUNT = "Futures Account for Listed Options and Futures
* IM_FLAG_LONG_SHORT = "Long- oder Shortposition
* IM_DEAL_NUMBER = "Financial Transaction
* IM_VALUATION_AREA = "Valuation Area
* IM_TAB_PS_TERMS = "Table with Position-Differentiating PS Acct Assignments
* IM_ACTIVE_PASSIVE = "Indicator: Assets/Liabilities Position
* IM_SAVE_FLG = "'X'=Show SAVE Button
* IM_SBILK = "Balance Sheet Indicator
* IM_SKWG14NEU = "Bestandseingruppierung nach §14 KWG (WP und Darlehen)
* IM_POS_MAN_PROC = "Position Management Procedure
* IM_AA_REF = "Account Assignment Reference of Position Management
* IM_TRANSACTION_TYPE = "Financial Transaction Type
* IM_VTBFHA = "Financial Transaction
* IM_EXTERNAL_ACCOUNT = "External Account
* IM_DIFF_CURRENCY = "Currency as Differentiation Term
* IM_TRUST_SELECTION = TPMCO_XFALSE "'X'=no check of selection, ' '=selection will be checked
* IM_PROTOCOL_HANDLER = "Protocol Manager
IM_PRODUCT_GROUP = "Product Group
IM_COMPANY_CODE = "Company Code
IM_COM_VAL_CLASS = "General Valuation Class
* IM_PRODUCT_TYPE = "Product Type
* IM_SECURITY_ID = "Security ID Number
IMPORTING
EX_PROTOCOL_HANDLER = "Protocol Manager
EX_CANCEL = "'X'=Abbruch
EX_ERROR = "'X'=Fehler
EXCEPTIONS
FAILED = 1 ALL_PINS_EXIST = 2 NO_PINS_FOUND = 3 LOCKING_FAILED = 4
IMPORTING Parameters details for TPM_PIN_CREATE
IM_MAINTAIN_FLG - 'X'=UI zur Pflege
Data type: CHAR1Default: TPMCO_XTRUE
Optional: Yes
Call by Reference: Yes
IM_SECURITY_ACCOUNT - Securities Account
Data type: RLDEPOOptional: Yes
Call by Reference: Yes
IM_PORTFOLIO - Portfolio
Data type: RPORTBOptional: Yes
Call by Reference: Yes
IM_LOANS_CONTRACT - Contract Number
Data type: RANLOptional: Yes
Call by Reference: Yes
IM_CLASS_ID - Security ID Number
Data type: VVRANLWOptional: Yes
Call by Reference: Yes
IM_POSITION_ACCOUNT - Futures Account for Listed Options and Futures
Data type: TPM_POS_ACCOUNT_FUTOptional: Yes
Call by Reference: Yes
IM_FLAG_LONG_SHORT - Long- oder Shortposition
Data type: TPM_FLAG_LONG_SHORTOptional: Yes
Call by Reference: Yes
IM_DEAL_NUMBER - Financial Transaction
Data type: TB_RFHAOptional: Yes
Call by Reference: Yes
IM_VALUATION_AREA - Valuation Area
Data type: TPM_VAL_AREAOptional: Yes
Call by Reference: Yes
IM_TAB_PS_TERMS - Table with Position-Differentiating PS Acct Assignments
Data type: TRGY_PS_TERMSOptional: Yes
Call by Reference: Yes
IM_ACTIVE_PASSIVE - Indicator: Assets/Liabilities Position
Data type: TPM_ACTIVE_PASSIVEOptional: Yes
Call by Reference: Yes
IM_SAVE_FLG - 'X'=Show SAVE Button
Data type: CHAR1Optional: Yes
Call by Reference: Yes
IM_SBILK - Balance Sheet Indicator
Data type: SBILKOptional: Yes
Call by Reference: Yes
IM_SKWG14NEU - Bestandseingruppierung nach §14 KWG (WP und Darlehen)
Data type: VVSKWG14Optional: Yes
Call by Reference: Yes
IM_POS_MAN_PROC - Position Management Procedure
Data type: TPM_POS_MAN_PROCOptional: Yes
Call by Reference: Yes
IM_AA_REF - Account Assignment Reference of Position Management
Data type: TPM_AA_REFOptional: Yes
Call by Reference: Yes
IM_TRANSACTION_TYPE - Financial Transaction Type
Data type: TB_SFHAARTOptional: Yes
Call by Reference: Yes
IM_VTBFHA - Financial Transaction
Data type: VTBFHAOptional: Yes
Call by Reference: Yes
IM_EXTERNAL_ACCOUNT - External Account
Data type: TPM_EXT_ACCOUNTOptional: Yes
Call by Reference: Yes
IM_DIFF_CURRENCY - Currency as Differentiation Term
Data type: TPM_DIFF_CURRENCYOptional: Yes
Call by Reference: Yes
IM_TRUST_SELECTION - 'X'=no check of selection, ' '=selection will be checked
Data type: CHAR1Default: TPMCO_XFALSE
Optional: Yes
Call by Reference: Yes
IM_PROTOCOL_HANDLER - Protocol Manager
Data type: CL_PROTOCOL_HANDLER_TRPOptional: Yes
Call by Reference: Yes
IM_PRODUCT_GROUP - Product Group
Data type: TPM_PRODUCT_GROUPOptional: No
Call by Reference: Yes
IM_COMPANY_CODE - Company Code
Data type: BUKRSOptional: No
Call by Reference: Yes
IM_COM_VAL_CLASS - General Valuation Class
Data type: TPM_COM_VAL_CLASSOptional: No
Call by Reference: Yes
IM_PRODUCT_TYPE - Product Type
Data type: VVSARTOptional: Yes
Call by Reference: Yes
IM_SECURITY_ID - Security ID Number
Data type: VVRANLWOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for TPM_PIN_CREATE
EX_PROTOCOL_HANDLER - Protocol Manager
Data type: CL_PROTOCOL_HANDLER_TRPOptional: No
Call by Reference: Yes
EX_CANCEL - 'X'=Abbruch
Data type: CHAR1Optional: No
Call by Reference: Yes
EX_ERROR - 'X'=Fehler
Data type: CHAR1Optional: No
Call by Reference: Yes
EXCEPTIONS details
FAILED - Fehler aufgetreten (Fehler nicht spezifiert)
Data type:Optional: No
Call by Reference: Yes
ALL_PINS_EXIST - alle Bestandskennzeichen vorhanden
Data type:Optional: No
Call by Reference: Yes
NO_PINS_FOUND - keine Bestandskennzeichen gefunden
Data type:Optional: No
Call by Reference: Yes
LOCKING_FAILED - Lock failed
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for TPM_PIN_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_failed | TYPE STRING, " | |||
| lv_im_maintain_flg | TYPE CHAR1, " TPMCO_XTRUE | |||
| lv_ex_protocol_handler | TYPE CL_PROTOCOL_HANDLER_TRP, " | |||
| lv_im_security_account | TYPE RLDEPO, " | |||
| lv_im_portfolio | TYPE RPORTB, " | |||
| lv_im_loans_contract | TYPE RANL, " | |||
| lv_im_class_id | TYPE VVRANLW, " | |||
| lv_im_position_account | TYPE TPM_POS_ACCOUNT_FUT, " | |||
| lv_im_flag_long_short | TYPE TPM_FLAG_LONG_SHORT, " | |||
| lv_im_deal_number | TYPE TB_RFHA, " | |||
| lv_im_valuation_area | TYPE TPM_VAL_AREA, " | |||
| lv_im_tab_ps_terms | TYPE TRGY_PS_TERMS, " | |||
| lv_im_active_passive | TYPE TPM_ACTIVE_PASSIVE, " | |||
| lv_ex_cancel | TYPE CHAR1, " | |||
| lv_im_save_flg | TYPE CHAR1, " | |||
| lv_all_pins_exist | TYPE CHAR1, " | |||
| lv_im_sbilk | TYPE SBILK, " | |||
| lv_im_skwg14neu | TYPE VVSKWG14, " | |||
| lv_im_pos_man_proc | TYPE TPM_POS_MAN_PROC, " | |||
| lv_im_aa_ref | TYPE TPM_AA_REF, " | |||
| lv_im_transaction_type | TYPE TB_SFHAART, " | |||
| lv_im_vtbfha | TYPE VTBFHA, " | |||
| lv_im_external_account | TYPE TPM_EXT_ACCOUNT, " | |||
| lv_im_diff_currency | TYPE TPM_DIFF_CURRENCY, " | |||
| lv_ex_error | TYPE CHAR1, " | |||
| lv_no_pins_found | TYPE CHAR1, " | |||
| lv_im_trust_selection | TYPE CHAR1, " TPMCO_XFALSE | |||
| lv_locking_failed | TYPE CHAR1, " | |||
| lv_im_protocol_handler | TYPE CL_PROTOCOL_HANDLER_TRP, " | |||
| lv_im_product_group | TYPE TPM_PRODUCT_GROUP, " | |||
| lv_im_company_code | TYPE BUKRS, " | |||
| lv_im_com_val_class | TYPE TPM_COM_VAL_CLASS, " | |||
| lv_im_product_type | TYPE VVSART, " | |||
| lv_im_security_id | TYPE VVRANLW. " |
|   CALL FUNCTION 'TPM_PIN_CREATE' "Create Position Indicator |
| EXPORTING | ||
| IM_MAINTAIN_FLG | = lv_im_maintain_flg | |
| IM_SECURITY_ACCOUNT | = lv_im_security_account | |
| IM_PORTFOLIO | = lv_im_portfolio | |
| IM_LOANS_CONTRACT | = lv_im_loans_contract | |
| IM_CLASS_ID | = lv_im_class_id | |
| IM_POSITION_ACCOUNT | = lv_im_position_account | |
| IM_FLAG_LONG_SHORT | = lv_im_flag_long_short | |
| IM_DEAL_NUMBER | = lv_im_deal_number | |
| IM_VALUATION_AREA | = lv_im_valuation_area | |
| IM_TAB_PS_TERMS | = lv_im_tab_ps_terms | |
| IM_ACTIVE_PASSIVE | = lv_im_active_passive | |
| IM_SAVE_FLG | = lv_im_save_flg | |
| IM_SBILK | = lv_im_sbilk | |
| IM_SKWG14NEU | = lv_im_skwg14neu | |
| IM_POS_MAN_PROC | = lv_im_pos_man_proc | |
| IM_AA_REF | = lv_im_aa_ref | |
| IM_TRANSACTION_TYPE | = lv_im_transaction_type | |
| IM_VTBFHA | = lv_im_vtbfha | |
| IM_EXTERNAL_ACCOUNT | = lv_im_external_account | |
| IM_DIFF_CURRENCY | = lv_im_diff_currency | |
| IM_TRUST_SELECTION | = lv_im_trust_selection | |
| IM_PROTOCOL_HANDLER | = lv_im_protocol_handler | |
| IM_PRODUCT_GROUP | = lv_im_product_group | |
| IM_COMPANY_CODE | = lv_im_company_code | |
| IM_COM_VAL_CLASS | = lv_im_com_val_class | |
| IM_PRODUCT_TYPE | = lv_im_product_type | |
| IM_SECURITY_ID | = lv_im_security_id | |
| IMPORTING | ||
| EX_PROTOCOL_HANDLER | = lv_ex_protocol_handler | |
| EX_CANCEL | = lv_ex_cancel | |
| EX_ERROR | = lv_ex_error | |
| EXCEPTIONS | ||
| FAILED = 1 | ||
| ALL_PINS_EXIST = 2 | ||
| NO_PINS_FOUND = 3 | ||
| LOCKING_FAILED = 4 | ||
| . " TPM_PIN_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM TPM_PIN_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.| DATA(ld_im_maintain_flg) | = TPMCO_XTRUE. | |||
| DATA(ld_im_trust_selection) | = TPMCO_XFALSE. | |||
Search for further information about these or an SAP related objects