Call BP Transaction by passing Business partner number

Use the Below code to call BP Transaction in the place of obsolete Customer/Vendor related transactions in  SAP. 

 DATA:

    lv_request TYPE REF TO cl_bupa_navigation_request,

    lv_options TYPE REF TO cl_bupa_dialog_joel_options,

    lv_partner TYPE bu_partner,

    lv_partner_role TYPE bus_roles,

    lv_start_tab TYPE BUS_NAVIGATION-BUPA-SUB_HEADER_TAB,

    lv_bup_main TYPE bus_bupr_maintenance.


* set start-up navigation-----------------------------------------------

  lv_partner = <fs_row>-kunnr.

  lv_partner_role-role = 'FLCU01'.  “ Pass the Role

  lv_start_tab = 'CVIC01'.          “ Start tab

  CREATE OBJECT lv_request.


*set partner maintenance

  CALL METHOD lv_request->set_maintenance_id

    EXPORTING

      iv_value = lv_request->gc_maintenance_id_partner.


*set partner number to start with (in case of a guid just use the method

*set_partner_guid)

  CALL METHOD lv_request->set_partner_number( im_partner ). “ pass BP number from input


*set the partner role to start with

  CALL METHOD lv_request->set_bupa_partner_role( lv_partner_role ).


*set the activity you want the user to start the maintenance with

  CALL METHOD lv_request->set_bupa_activity

    EXPORTING

      iv_value = lv_request->gc_activity_display.


  CALL METHOD lv_request->set_bupa_sub_header_tab

    EXPORTING

      iv_value = lv_start_tab.


*set start-up options----

  CREATE OBJECT lv_options.


*start the transaction with an invisible locator

  CALL METHOD lv_options->set_locator_visible( space ).


*don't allow navigations to other partners

  CALL METHOD lv_options->set_navigation_disabled( abap_true ).

  CALL METHOD lv_options->set_bupr_create_not_allowed( abap_true ).


  lv_bup_main-create_allowed = abap_true.

  lv_bup_main-change_allowed = abap_true.

  lv_bupr_main-delete_allowed = abap_true.


  CALL METHOD lv_options->set_bupr_maintenance( lv_bup_main ).


  CALL METHOD lv_options->set_activity_switching_off( space ).


*Call the business partner maintenance---

*with those parameters

  CALL METHOD cl_bupa_dialog_joel=>start_with_navigation

    EXPORTING

      iv_request = lv_request

      lv_options = lv_options

    EXCEPTIONS

      OTHERS     = 1.


Comments

Popular posts from this blog

SAP ABAP-Internal Table Operations and Example Program

HR ABAP Interview Questions and Answers

BDC (Batch Data Communication) - SAP ABAP