BP 维护业务伙伴
BP事务代码不能像普通的VA03 这样跳转,下面介绍3种方法。
1. 单纯跳转到BP
FORM FRM_SHOW_BP USING LV_BP TYPE BU_PARTNER.
CALL METHOD CL_RMPS_ADDRESS=>SHOW_BP
EXPORTING
IM_BP_NUMBER = LV_BP.
ENDFORM.
2. 带业务伙伴角色跳转到BP,SUBMIT 标准程序 /SCMTMS/UI_NAVIGATION_BP
FORM FRM_BP2 USING LV_BP TYPE BU_PARTNER
LV_ROLE TYPE BU_PARTNERROLE.
SUBMIT /SCMTMS/UI_NAVIGATION_BP "VIA SELECTION-SCREEN
WITH P_PARTID = LV_BP
WITH P_ROLE = LV_ROLE
AND RETURN.
ENDFORM.
3. 调用类 CL_BUPA_DIALOG_JOEL 的 START_WITH_NAVIGATION 方法
FORM FRM_BP USING LV_BP TYPE BU_PARTNER
LV_ROLE TYPE BU_PARTNERROLE.
DATA: LO_REQUEST TYPE REF TO CL_BUPA_NAVIGATION_REQUEST,
LS_REQUEST TYPE BUS_ROLES,
LO_OPTIONS TYPE REF TO CL_BUPA_DIALOG_JOEL_OPTIONS,
LS_BUPR_MAINTENANCE TYPE BUS_BUPR_MAINTENANCE,
LV_START_TAB TYPE BUS_NAVIGATION-BUPA-SUB_HEADER_TAB.
IF LV_ROLE = 'TM0001'. " position to Driver tab for role Driver
LV_START_TAB = 'TM0001'. " Screens (BUS5) in BUPT
ENDIF.
CREATE OBJECT LO_REQUEST.
LO_REQUEST->SET_MAINTENANCE_ID( LO_REQUEST->GC_MAINTENANCE_ID_PARTNER ).
LO_REQUEST->SET_PARTNER_NUMBER( LV_BP ).
IF LV_ROLE IS NOT INITIAL.
LS_REQUEST-ROLE = LV_ROLE.
LO_REQUEST->SET_BUPA_PARTNER_ROLE( LS_REQUEST ).
ENDIF.
IF LV_START_TAB IS NOT INITIAL.
LO_REQUEST->SET_BUPA_SUB_HEADER_TAB( LV_START_TAB ).
ENDIF.
LO_REQUEST->SET_BUPA_ACTIVITY( LO_REQUEST->GC_ACTIVITY_DISPLAY ).
CREATE OBJECT LO_OPTIONS.
LO_OPTIONS->SET_LOCATOR_VISIBLE( ABAP_FALSE ).
LO_OPTIONS->SET_NAVIGATION_DISABLED( ABAP_FALSE ).
LO_OPTIONS->SET_BUPR_CREATE_NOT_ALLOWED( ABAP_TRUE ).
LS_BUPR_MAINTENANCE-CREATE_ALLOWED = ABAP_TRUE.
LS_BUPR_MAINTENANCE-CHANGE_ALLOWED = ABAP_TRUE.
LS_BUPR_MAINTENANCE-DELETE_ALLOWED = ABAP_TRUE.
LO_OPTIONS->SET_BUPR_MAINTENANCE( LS_BUPR_MAINTENANCE ).
LO_OPTIONS->SET_ACTIVITY_SWITCHING_OFF( SPACE ).
CL_BUPA_DIALOG_JOEL=>START_WITH_NAVIGATION(
EXPORTING
IV_REQUEST = LO_REQUEST
IV_OPTIONS = LO_OPTIONS
EXCEPTIONS
OTHERS = 1 ).
ENDFORM.