CONSTANTS:
gc_activity_create TYPE bu_aktyp VALUE '01',
gc_activity_change TYPE bu_aktyp VALUE '02',
gc_activity_display TYPE bu_aktyp VALUE '03'.
PARAMETERS: p_bp TYPE bu_partner.
PARAMETERS: p_cc TYPE bukrs.
START-OF-SELECTION.
PERFORM open_bp USING p_bp p_cc gc_activity_change.
FORM open_bp
USING
iv_bp TYPE bu_partner
iv_cc TYPE bukrs
iv_activity TYPE bu_aktyp.
DATA:
ls_role TYPE bus_roles.
" need to set it as a parameter
" so that it's read in the Company Code subscreen
SET PARAMETER ID 'BUK' FIELD iv_cc.
" create new request
DATA(lo_request) = NEW cl_bupa_navigation_request( ).
" open request with selected partner number
lo_request->set_partner_number( iv_bp ).
" set the activity you want the user to start the maintenance with
lo_request->set_bupa_activity( iv_activity ). " 01 - Create, 02 - Change, 03 - Display
" change the role of the BP to the desired one
" together with the sub header id
ls_role-role = 'FS0000'.
lo_request->set_bupa_partner_role( ls_role ).
lo_request->set_bupa_sub_header_id( 'FS0001' ).
" display general data by default
lo_request->set_maintenance_id( 'B' ). " B - Partner
" set start-up options
DATA(lo_options) = NEW cl_bupa_dialog_joel_options( ).
" start the transaction with an invisible locator
lo_options->set_locator_visible( space ).
" open New BDT Instance for display of selected partner
CALL METHOD cl_bupa_dialog_joel=>start_with_navigation
EXPORTING
iv_request = lo_request
iv_options = lo_options
iv_in_new_internal_mode = abap_true
EXCEPTIONS
already_started = 1
not_allowed = 2
OTHERS = 3.
ENDFORM.