Skip to Content

If SAP Class system for Securities & Listed Derivatives is not enough for you and you still need some custom fields to classify your Securities and to store some data – starting from ERP6.0 Enhancement Package 5 you have such possibility.

Badi TPM_SEC_CUST_DATA will help you. (Not to be confused with TPM_SEC_ADD_DATA)

Let’s create simple characteristics of the bond

/wp-content/uploads/2014/08/characteristics_523058.jpg

Step 1. Create structure according to our scheme.

tr. SE11 -> Data type: ZCUSTOM_TAB_INCL -> Button “Create”.

You’ll be asked to enter Package and transport request.

/wp-content/uploads/2014/08/include_522926.jpg

/wp-content/uploads/2014/08/include2_522927.jpg

You have to create Data elements and domains. You can do it right from structure screen.

Enter data element ZPRIORITY in “Component type” field of the structure and double click on it. You’ll be asked to save structure and whether you want to create data element. Save and Create.

Now enter Domain ZPRIORITY into you data element and double click on it. You’ll be asked to save data element and whether you want to create domain. Save and Create.

/wp-content/uploads/2014/08/element_522931.jpg

Don’t forget to enter labels (Field label tab) for data element.

/wp-content/uploads/2014/08/element2_522947.jpg

Now you have to enter parameters for domain.

/wp-content/uploads/2014/08/domain_522928.jpg

/wp-content/uploads/2014/08/domain2_522929.jpg

Create data elements and domain for each field. Follow the table below.

Domain Data type Number characters /
Output length
Data
ZPRIORITY CHAR 7
JUN/SUB Junior or Subordinated
SEN/SUB Senior or Subordinated
ZISSUER CHAR 4
CORP Corporation
MUNI Municipal
GOV Government
INT International
ZCOUPONRATE CHAR 2
FI Fixed income
FL Floater
IF Inverse floater
ZC Zero coupon
ZREDEMFEATURES CHAR 3
CAL Callabel
CON Convertable
PUT Puttable

Don’t forget to activate each domain, each data element and the structure.

Let’s add our structure to SECURITYV structure.

First of all create Append structure ZZCUSTOM_TAB

/wp-content/uploads/2014/08/append1_522948.jpg

And add our structure ZCUSTOM_TAB_INCL as include into append structure ZZCUSTOM_TAB

/wp-content/uploads/2014/08/append2_522949.jpg

Repeat the same for VWPT_FREE_ATTR table.

Step 2. Let’s make a copy of FunctionPool  /TRMKR/SAPLSEC_CUST_DATA

tr. SE38

Don’t forget to copy all function modules in Z*

/wp-content/uploads/2014/08/pool_523077.jpg

You will find SAPLZCUSTOM_TAB program and ZCUSTOM_TAB function group. But nevertheless it’s absolutely the same.

We have to make corrections to our copied function group:

1. Look through all function modules and correct all  /TRMKR/* function modules to Z*

2. FM ZINITIALISE_CUST_DATA: replace code

    SECURITYVCOVERAGE_ELIG   = im_securityCOVERAGE_ELIG .

     SECURITYVEMBD_DERIVATIVE = im_securityEMBD_DERIVATIVE .

     SECURITYVORIG_ISSUE_CURR = im_securityORIG_ISSUE_CURR .

     SECURITYVQUOT_BREAKDOWN  = im_securityQUOT_BREAKDOWN .


with your code

    SECURITYVZZPRIORITY   = im_securityZZPRIORITY .

     SECURITYVZZISSUER = im_securityZZISSUER .

     SECURITYVZZCOUPONRATE = im_securityZZCOUPONRATE .

     SECURITYVZZREDEMFEATURES  = im_securityZZREDEMFEATURES .

3. You can add code to ZCHECK_CUST_DATA function module if you want to check something.

Step 3. Add fields to screen

tr. SE51 -> Program SAPLZCUSTOM_TAB, screen 0100

/wp-content/uploads/2014/08/screen1_523085.jpg

Then press the button/wp-content/uploads/2014/08/layout_523086.jpg

Add (as on the screen below):

1. Box. Enter the name of the box – Characteristics

2. Four text fields. Enter the names of the fields – Priority, etc.

3. Input field. Use structure SECURITYV to enter fields data. You’ll be asked: Do you want the element to refer to the dictionary definition? Agree and press “Yes” button.

4. Activate the screen.

/wp-content/uploads/2014/08/fields123_523091.jpg

Step 4. Create implementation for BADI TPM_SEC_CUST_DATA

Start tr. SE19. In “Create implementation” block in “New BADI, enchancement spot” field enter BADI  TPM_SEC_CUST_DATA  and press “Create implementation” button.

1. create_implem.jpg

Enter Enchancement implementation Id and text.

2. create_implem_2.jpg

3. create_implem_3.jpg

In the “Screen Enchancement” menu enter Program Id and Subscreen from step 3 – Program SAPLZCUSTOM_TAB, screen 0100

/wp-content/uploads/2014/08/screenencha_523101.jpg

In the “Implementation class” menu you can find all BADI methods.

/wp-content/uploads/2014/08/badimethod_523796.jpg


Make a double click to any of it to implement method and you’ll get message

6. create method.jpg

Press “Yes” to create implementation of the method.

For each method enter the following code.

method INITIALISE (Initialize Local Structures)


CALL FUNCTION 'ZINITIALISE_CUST_DATA'
     EXPORTING
       IM_SECURITY          = im_security
     IMPORTING
       EX_MESSAGE           = ex_message
     EXCEPTIONS
       NO_DATA_FOUND        = 1
       OTHERS               = 2.
   IF SY-SUBRC = 1.
     raise NO_CUST_DATA_FOUND.
   ENDIF.









method DATA_EDIT (Change Additional Data)


if im_mode = 'DISP'.
     CALL FUNCTION 'ZDISPLAY_CUST_DATA'
       EXPORTING
         IM_SECURITY       = im_security
       IMPORTING
         EX_MESSAGE        = ex_message
       EXCEPTIONS
         DATA_ERROR        = 1
         others            = 9.
   else.
     CALL FUNCTION 'ZEDIT_CUST_DATA'
       EXPORTING
         IM_SECURITY       = im_security
       IMPORTING
         EX_MESSAGE        = ex_message
       EXCEPTIONS
         DATA_ERROR        = 1
         DAtA_DELETED      = 2
         others            = 9.
   endif.
   case sy-subrc.
     when 1. RAISE DATA_ERROR.
     when 2. RAISE DATA_DELETED.
   endcase.









method DATA_CHECK (Check Data)

function module  ZCHECK_CUST_DATA is empty. But you can write your code there in order to check some data.


CALL FUNCTION 'ZCHECK_CUST_DATA'
     EXPORTING
       IM_SECURITY_ID       = im_security_id
     IMPORTING
        EX_MESSAGE          = ex_message.









method DATA_SAVE (Save Data)


CALL FUNCTION 'ZSAVE_CUST_DATA'
     EXPORTING
       IM_SECURITY       = im_security.









method DATA_DELETE (Delete Data)


CALL FUNCTION 'ZDELETE_CUST_DATA'
     EXPORTING
       IM_SECURITY_ID       = im_security_id.









method GET_TABNAME (Get Name for Additional Tab Page)


You can set tab name in 5.1.


CALL FUNCTION 'ZGET_CUST_TAB_NAME'
     IMPORTING
       IM_TAB_NAME       = im_tab_name.









method PUT_DATA_TO_SCREEN (Transfer Data to Subscreen)

here you have to Add you custom fields.

*MOVE-CORRESPONDING CUST_SECURITYV TO SECURITYV.


In our case the code will be:


  ATTR_SECURITYV-ZZPRIORITY = CUST_SECURITYV-ZZPRIORITY.
   ATTR_SECURITYV-ZZISSUER = CUST_SECURITYV-ZZISSUER.
   ATTR_SECURITYV-ZZCOUPONRATE = CUST_SECURITYV-ZZCOUPONRATE.
   ATTR_SECURITYV-ZZREDEMFEATURES = CUST_SECURITYV-ZZREDEMFEATURES.









method GET_DATA_FROM_SCREEN (Get Data from Subscreen)

the same as method PUT_DATA_TO_SCREEN

here you have to Add you custom fields.

*MOVE-CORRESPONDING ATTR_SECURITYV TO CUST_SECURITYV.


  CUST_SECURITYV-ZZPRIORITY = ATTR_SECURITYV-ZZPRIORITY.
   CUST_SECURITYV-ZZISSUER = ATTR_SECURITYV-ZZISSUER.
   CUST_SECURITYV-ZZCOUPONRATE = ATTR_SECURITYV-ZZCOUPONRATE.
   CUST_SECURITYV-ZZREDEMFEATURES = ATTR_SECURITYV-ZZREDEMFEATURES.









method DATA_CHANGED (Check for New Entry)


CALL FUNCTION 'ZCHANGED_DATA'
     IMPORTING
       EX_CHANGED       = ex_changed.








method FILL_NEW_FIELDS_DATA (Fill New Fields Data)

here you have to Add you custom fields.

*MOVE-CORRESPONDING  IM_SECURITYV_FROM TO  C_SECURITYV.


C_SECURITYV-ZZPRIORITY    = IM_SECURITYV_FROM-ZZPRIORITY.
C_SECURITYV-ZZISSUER  = IM_SECURITYV_FROM-ZZISSUER.
C_SECURITYV-ZZCOUPONRATE  = IM_SECURITYV_FROM-ZZCOUPONRATE.
C_SECURITYV-ZZREDEMFEATURES   = IM_SECURITYV_FROM-ZZREDEMFEATURES.








When all code entered into method – activate each method and BADI implementation.

Step 5. Additional configuration

5.1. Tab text can be entered through view /TRMKR/TB_NAME_V

13. view name.jpg

14. tab name.jpg

5.2. Only one active implementation must exsist.

Somtimes when you begin creating your custom tab, standart implementation is active and you are not able to activate yours.If you don’t turn off standard implementation and do not activate yours – custom tab and data won’t be available.

You can switch between active implementation in IMG.

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Transaction Manager -> Securities -> Master Data -> Specific Class Data -> Additional Tab Pages in Class Data -> User-Defined Tab Page -> BAdI: Additional Tab Page in Class Data (tr. S_E5V_35000103)

Uncheck “Active (IMG)” checkmark for active badi implementation

23. how deactivate std badi.jpg

Quit from configuration. Open transaction once again and you will see that only your implementation is active

24. active.jpg

5.3. If you want to manipulate the status of your custom fields – apply note 1911821

———————————————————————————–

As the result in FWZZ transaction you will find custom tab “Additional data” with custom fields: Priority, Issuer, Coupon rate and Redempton feature.

/wp-content/uploads/2014/08/tab_523132.jpg

Enjoy!

P.S. I will be very glad to hear all your comments and suggestions.

To report this post you need to login first.

26 Comments

You must be Logged on to comment or reply to a post.

  1. Igor Spitzer

    Привет Григорий, спасибо за этот пост!
    документации по этой теме от SAP кот наплакал.
    Подскажи пожалуйста, я сделал все как написано у тебя, но не появился мой регистр, вообще ничего не изменилось FWZZ.

    а так же нет в SPRO возможности выключить пример от SAP, но я в своей имплементации поставил Default, по идее моя имплементация должна сработать. Но не видно все равно..

    и еще вопрос, где можно найти, какие регистры к определленному продукттипу могут показываться?

    Спасибо!

    (0) 
    1. Grigoriy Babitskiy Post author

      Приветствую Игорь,

      попробуй запустить вот эту транзакцию – S_E5V_35000103 – и сделать так, как я описал в инструкции. Т.к. если не отключить правильно стандартное внедрение, то твое не заработает.

      (0) 
    2. Grigoriy Babitskiy Post author

      и еще вопрос, где можно найти, какие регистры к определленному продукттипу могут показываться?

      Не совсем понимаю про какие регистры идет речь.

      (0) 
      1. Igor Spitzer

        Спасибо Григорий, огромное за ответ!

        убрал галочку, но мой таб все равно не появляется…
        но у нас как я понял Бизнесфункции, не активны? т.е. без них вообще не будет работать?

        FIN_TRM_LR_FI_AN_3_.png

        (0) 
      1. Karthik Anumalasetty

        HI,

        Want to validate the field in additional tab with the percentage maintained in Conditions Tab.

        Ex: Some Calculation between Nominal Val in Basic Data Tab and Int % maintained in Conditions Tab.

        But, I was unable to get the Conditions Tab Data to do calculation.

        (0) 
  2. Ramesh P

    Hi,

    When i am trying to copy entire function group system is showing status message, function group /TRMKR/SEC_CUST_DATA does not exist.

    (0) 
  3. saritha nagaraju

    hi Grigoriy babitskiy

    I have got requirement to add additional data tab in FWZZ transaction

    I am implementing badi TPM_SEC_CUST_DATA not able to activate my custom implementation since the standard badi is active

    I have tried to search in img to deactivate the standard on as per your post

    IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Transaction Manager -> Securities -> Master Data -> Specific Class Data -> Additional Tab Pages in Class Data -> User-Defined Tab Page -> BAdI: Additional Tab Page in Class Data

    not able to see this in IMG please guide me

     

    Thanks in Advance

     

    (0) 
  4. saritha nagaraju

    Thanks a lot for your information Grigoriy babitskiy.

    EHP of my system is EHP7 and the Buisness function FIN_TRM_LR_FI_AN_3. is not active in my system . Please guide me is EHP7 is supported or not . and how to activate FIN_TRM_LR_FI_AN_3

     

    (0) 
  5. saritha nagaraju

    HI Grigoriy babitskiy,

    Custom tab is working fine after the activation of business function FIN_TRM_LR_FI_AN_3. Thanks a lot for your help and guidance .

    with regards

    Saritha

     

    (0) 
  6. saritha nagaraju

    HI Grigoriy Babitskiy,

    Need one more help from you . i need to display or Hide the custom tab depends on product Type field . Please let me know how to handle the custom tab display and hide in transaction FWZZ

    with regards

    saritha .

     

    (0) 
  7. saritha nagaraju

    hi Grigoriy Babitskiy ,

    Thanks for reply, My requirement is to disable the custom tab depends on product type not the custom fields.  I have tried to download the sap note 1911821 but the status is showing as cannot be implemented. Please let me know how to proceed to hide the custom tab.

    Thanks in advance

    Saritha

    (0) 
    1. Grigoriy Babitskiy Post author

      I haven’t met this in standard, but you can adjust method IF_EX_TPM_SEC_CUST_DATA~DATA_EDIT “Change Additional Data” to do what you need.

      (0) 

Leave a Reply