2-SAP-Additional Tab For Vendors In BP (Business Partner) Transaction - Part II.


...Previous (Part I)                                                                                                      ...Next (Part III.)

Step 6: Next, Navigate to Business Partner->Control->Screen Layout->Field Groups. Click on New entries & create a new field group named 601.Set a description and save as shown below.


Now click on Field Group->Fields Option as shown above. Assign all the custom fields created in the structure ‘INCL_EEW_LFA1’. to fields group as shown below.


Step 7: Next, navigate to Business Partner->Control->Screen Layout->Views. Click On New Entries button and create a new view named ZLFA01. Set a description, application as ZLFA as created above & data set as ZLFA01 as created above. Also set the program name and screen number as shown below.

Note here we have to create two functions modules for PBO & PAI.

Create a function module for PBO. Copy FM ‘CVIV_BUPA_PBO_CVIV03’ to function module
named ‘ZFM_MM_LFA1_PBO’ as shown below.

FUNCTION zfm_mm_lfa1_pbo.
*"--------------------------------------------------------------------
*"*"Local Interface:
*"--------------------------------------------------------------------
  DATA: lt_lfa1   TYPE TABLE OF lfa1.

* Step 1: request data from xo for dynpro structure
  cvi_bdt_adapter=>data_pbo(
    EXPORTING
      i_table_name = table_name_lfa1
    IMPORTING
      e_data_table = lt_lfa1[] ).
  IF lt_lfa1[] IS INITIAL.
    CLEAR gs_lfa1.
  ELSE.
    READ TABLE lt_lfa1 INTO gs_lfa1 INDEX 1.
  ENDIF.

ENDFUNCTION.


Create a function module for PAI. Copy FM ‘CVIV_BUPA_PAI_CVIV03’ to function module
named ‘ZFM_MM_LFA1_PAI’ as shown below.

FUNCTION zfm_mm_lfa1_pai.
*"--------------------------------------------------------------------
*"*"Local Interface:
*"--------------------------------------------------------------------
  DATA: lt_lfa1 TYPE TABLE OF lfa1.
  FIELD-SYMBOLS: <lfa1> LIKE LINE OF lt_lfa1.

  CHECK cvi_bdt_adapter=>is_direct_input_active( ) = false.

  cvi_bdt_adapter=>get_current_bp_data(
    EXPORTING
      i_table_name = table_name_lfa1
    IMPORTING
      e_data_table = lt_lfa1[] ).

  IF lt_lfa1[] IS INITIAL.
    IF gs_lfa1 IS NOT INITIAL.
      gs_lfa1-lifnr = cvi_bdt_adapter=>get_current_vendor( ).
      APPEND gs_lfa1 TO lt_lfa1.
    ENDIF.
  ELSE.

    READ TABLE lt_lfa1 ASSIGNING <lfa1> INDEX 1.
    <lfa1>-zzforeign_vend = gs_lfa1-zzforeign_vend.
    <lfa1>-zzcertificate  = gs_lfa1-zzcertificate.
    <lfa1>-zzvalid_from   = gs_lfa1-zzvalid_from.
    <lfa1>-zzvalid_to     = gs_lfa1-zzvalid_to.
  ENDIF.

  cvi_bdt_adapter=>data_pai(
   i_table_name = table_name_lfa1
   i_data_new   = lt_lfa1[]
   i_validate   = false ).

ENDFUNCTION.


Save the view & Double click on View -> Field Groups. Click on New entries and maintain the field group as 601 shown below.


Step 8: Next, Navigate to Business Partner->Control->Screen Layout->Sections. Click on New Entries button and create a new section named ZLFA1. Also, set a description and title.


Now double click on Section -> Views. Select the section 'ZLFA1' created above and Set item number and view name (as created above). Save the changes.


Step 9: Next, navigate to Business Partner->Control->Screen Layout->Screens. Click on New Entries button & create a new screen named ZLFA1. Also, set a description and screen title and Save the changes.


Now double click on Screen -> Sections. Select the screen created above and Set first item section as BUP009 and second number will be section ‘ZLFA1’ we created. Save the changes as shown below.


...Previous (Part I)                                                                                                       ..Next (Part III.)