废话不多说 直接上代码
DATA : IO_FACADE TYPE REF TO CL_UKM_FACADE, IO_CALCULATOR TYPE REF TO IF_UKM_CALCULATOR, IO_PARTNER TYPE REF TO CL_UKM_BUSINESS_PARTNER, IO_BUPA_FACTORY TYPE REF TO CL_UKM_BUPA_FACTORY, IO_ACCOUNT TYPE REF TO CL_UKM_ACCOUNT, LW_BP_CREDIT_SGM TYPE UKM_S_BP_CMS_SGM, LT_RETURN TYPE UKM_T_MONITOR_RETURN. DATA:I_PARTNER TYPE KUNNR VALUE '500363'. DATA:I_CREDITSEGMENT TYPE UKM_CREDIT_SGMNT VALUE 'C001'. I_PARTNER = |{ I_PARTNER ALPHA = IN }|. IO_FACADE = CL_UKM_FACADE=>CREATE( I_ACTIVITY = CL_UKM_CNST_EVENTING=>BP_MAINTENANCE ). IO_CALCULATOR = IO_FACADE->GET_CALCULATOR( ). IO_BUPA_FACTORY = IO_FACADE->GET_BUPA_FACTORY( ). ******read businee partner*************** IO_PARTNER = IO_BUPA_FACTORY->GET_BUSINESS_PARTNER( I_PARTNER ). CALL METHOD IO_BUPA_FACTORY->GET_CREDIT_ACCOUNT EXPORTING I_PARTNER = I_PARTNER I_CREDIT_SGMNT = I_CREDITSEGMENT RECEIVING RO_CREDIT_ACCOUNT = IO_ACCOUNT. IO_ACCOUNT->GET_BP_CMS_SGM( IMPORTING ES_BP_CMS_SGM = LW_BP_CREDIT_SGM ). LW_BP_CREDIT_SGM-CREDIT_LIMIT = '10.00'. LW_BP_CREDIT_SGM-XCRITICAL = 'X'. LW_BP_CREDIT_SGM-LIMIT_CHG_DATE = SY-DATUM. IO_ACCOUNT->SET_BP_CMS_SGM( EXPORTING IS_BP_CMS_SGM = LW_BP_CREDIT_SGM ). IO_BUPA_FACTORY->SAVE_ALL( ). "下面这一句很关键 CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING WAIT = 'X'.