SAP 物料主数据 PRD覆盖QAS实现-BP同步

2024-06-05 17:12

本文主要是介绍SAP 物料主数据 PRD覆盖QAS实现-BP同步,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

BP分客商 

客户分基本数据KNA1

角色数据 BUT100

地址数据 adrc  ,BUT021_FS 

公司数据KNB1

销售视图数据  KNVV

合作伙伴 KNVP

税 KNVI 

标识数据  dfkkbptaxnum 

采购数据  LFM1

采购公司数据 lfb1 

FORM FRM_SYNBP.DATA:LTOKEN TYPE STRING.DATA: LL_LINES(10),"行数LL_TABIX(10),"循环标号LL_PECNT     TYPE P LENGTH 6 DECIMALS 2, "百分比LL_PECET(6),"百分数LL_TEXT(40)."消息CLEAR: LL_LINES,LL_TABIX,LL_PECNT,LL_PECET,LL_TEXT.DATA: LEN            TYPE        I, "发送报文长度LEN_STRING     TYPE        STRING,URL            TYPE        STRING, "接口地址SQLSTR         TYPE STRING,LV_SERVER_NAME TYPE ZE_SERVER_NAME,POST_STRING    TYPE        STRING,RESULT         TYPE        STRING,LTIMEEND       TYPE STRING, "时间戳结束LTIMEST        TYPE STRING. "时间戳开始DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_TEST_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORNO_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_TEST_ROW1_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_TEST_FUNC_ID_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: LTARS TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: LBUTPARTNER LIKE BUT000-PARTNER.DATA: LT_DATA    TYPE CVIS_EI_EXTERN_T,LT_DATAU   TYPE CVIS_EI_EXTERN_T,LS_DATA    TYPE CVIS_EI_EXTERN,LT_CMDSALE TYPE CMDS_EI_SALES_T,LS_CMDSALE TYPE CMDS_EI_SALES,LS_PAADR   TYPE BUS_EI_BUPA_ADDRESS,LS_BANK    TYPE BUS_EI_BUPA_BANKDETAIL,LS_SALES   TYPE CMDS_EI_SALES,LT_SALES   TYPE CMDS_EI_SALES_T,LS_TAX     TYPE CMDS_EI_TAX_IND,LT_TAX     TYPE CMDS_EI_TAX_IND_T.DATA: LV_GUID   TYPE GUID_16,LV_BPGUID TYPE BU_PARTNER_GUID.DATA:LT_ROLES        TYPE BUS_EI_BUPA_ROLES_T,LS_ROLES        TYPE BUS_EI_BUPA_ROLES,
*    LS_BANK_ADDRESS TYPE BAPI1011_ADDRESS,
*    LS_BANK_RETURN  TYPE BAPIRET2,LT_BANK         TYPE TABLE OF BUS_EI_BUPA_BANKDETAIL,LS_FUNCTIONS_S  TYPE CMDS_EI_FUNCTIONS,LS_FUNCTIONS_T  TYPE CMDS_EI_FUNCTIONS_T,LT_RETURN_MAP   TYPE MDG_BS_BP_MSGMAP_T,LS_PURCHASING   TYPE VMDS_EI_PURCHASING,LT_PURCHASING   TYPE TABLE OF VMDS_EI_PURCHASING,LS_FUNCTIONS    TYPE VMDS_EI_FUNCTIONS,LT_FUNCTIONS    TYPE VMDS_EI_FUNCTIONS_T,LT_RETURN_KONZS TYPE BAPIRETM,LT_RETURN       TYPE BAPIRETM,LT_RETURN_TAX   TYPE TABLE OF BAPIRET2 WITH HEADER LINE,LS_ADDRESSUSAGE TYPE BUS_EI_BUPA_ADDRESSUSAGE,LT_ADDRESSUSAGE TYPE BUS_EI_BUPA_ADDRESSUSAGE_T,LT_PAADR        TYPE TABLE OF BUS_EI_BUPA_ADDRESS.DATA:LT_INDU      TYPE TABLE OF BUS_EI_BUPA_INDUSTRYSECTOR.   "行业DATA:LT_COMPANY TYPE TABLE OF CMDS_EI_COMPANY.DATA:LT_COMPANYV TYPE TABLE OF VMDS_EI_COMPANY.DATA:BEGIN OF LT_BUT021  OCCURS 0 ,PARTNER      LIKE BUT020-PARTNER,ADDRNUMBER   LIKE BUT020-ADDRNUMBER,ADDRESS_GUID LIKE BUT020-ADDRESS_GUID,ADR_KIND     LIKE BUT021_FS-ADR_KIND,END OF LT_BUT021.IF S_PARTNR IS INITIAL.SQLSTR = 'SELECT PARTNER FROM BUT000 WHERE CLIENT = 800'.ELSE.IF S_PARTNR-HIGH  IS INITIAL.S_PARTNR-HIGH = S_PARTNR-LOW.ENDIF.SQLSTR = 'SELECT PARTNER FROM BUT000 WHERE CLIENT = 800 AND PARTNER BETWEEN ''' && S_PARTNR-LOW && ''' AND ''' && S_PARTNR-HIGH && ''''.ENDIF.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING LV_URL_STR SQLSTR CHANGING L_JSON_ROOT_OBJECT.DATA: L_STRING TYPE STRING.DATA:CNT TYPE I.DATA:PINDX TYPE I.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().DESCRIBE TABLE LTAR LINES CNT.LOOP AT LTAR INTO DATA(LSAR).PINDX = SY-TABIX.L_SAP_TEST_OBJECT = LSAR-NODE.L_SAP_TEST_FUNC_ID_OBJECT  =  L_SAP_TEST_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'PARTNER' ).LBUTPARTNER = L_SAP_TEST_FUNC_ID_OBJECT->VALUE.
*    WRITE:/ '开始同步第' && PINDX && '/' && CNT && '物料' && LS_MARA-MATERIAL.SELECT * FROM BUT000 INTO TABLE @DATA(LBUT) WHERE PARTNER = @LBUTPARTNER.IF LBUT[] IS INITIAL AND SY-SUBRC = 0.CONTINUE.
*        已有编号不做处理ENDIF.TRY.CALL METHOD CL_SYSTEM_UUID=>IF_SYSTEM_UUID_STATIC~CREATE_UUID_X16RECEIVINGUUID = LV_GUID.CATCH CX_UUID_ERROR .ENDTRY.SQLSTR = 'SELECT PARTNER,TYPE,BU_GROUP,TITLE,BU_SORT1,BU_SORT2,NAME_ORG1,NAME_ORG2,NAME_ORG3,NAME_ORG4,TITLE_LET  FROM BUT000 WHERE CLIENT = 800 AND PARTNER = ''' &&  LBUTPARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING LV_URL_STR SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTARS  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().LOOP AT LTARS INTO LSAR.CLEAR LT_DATA[].L_SAP_TEST_OBJECT = LSAR-NODE.LS_DATA-PARTNER-HEADER-OBJECT_TASK = 'I'.LS_DATA-PARTNER-HEADER-OBJECT_INSTANCE-BPARTNER  = LBUTPARTNER.            "业务伙伴编号LS_DATA-PARTNER-HEADER-OBJECT_INSTANCE-BPARTNERGUID = LV_GUID.                          "BAPI 的 CHAR 32 格式业务伙伴地址的全局唯一标识符*--- Partner / Central data / common ------------------------------*L_SAP_TEST_FUNC_ID_OBJECT  =  L_SAP_TEST_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'TYPE' ).LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATA-BP_CONTROL-CATEGORY = L_SAP_TEST_FUNC_ID_OBJECT->VALUE.     "业务伙伴类别L_SAP_TEST_FUNC_ID_OBJECT  =  L_SAP_TEST_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'BU_GROUP' ).LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATA-BP_CONTROL-GROUPING = L_SAP_TEST_FUNC_ID_OBJECT->VALUE. "业务伙伴分组
*    * 业务伙伴角色 [若传入的BU_GROUP=Z005和Z006,默认角色FLCU00和FLCU01,其他的默认角色ZFLCU0、ZFLCU1和ZUKM00]PERFORM GETINILROLES USING LV_URL_STR LBUTPARTNER CHANGING LT_ROLES.LS_DATA-PARTNER-HEADER-OBJECT_INSTANCE-BPARTNER = LBUTPARTNER.LS_DATA-PARTNER-CENTRAL_DATA-ROLE-ROLES = LT_ROLES.       "外部接口:角色数据L_SAP_TEST_FUNC_ID_OBJECT  =  L_SAP_TEST_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'TITLE' ).LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATA-BP_CENTRALDATA-TITLE_KEY   = L_SAP_TEST_FUNC_ID_OBJECT->VALUE.       "称谓代码L_SAP_TEST_FUNC_ID_OBJECT  =  L_SAP_TEST_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'BU_SORT1' ).LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATA-BP_CENTRALDATA-SEARCHTERM1 = L_SAP_TEST_FUNC_ID_OBJECT->VALUE.     "客商简称L_SAP_TEST_FUNC_ID_OBJECT  =  L_SAP_TEST_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'BU_SORT2' ).LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATA-BP_CENTRALDATA-SEARCHTERM2 = L_SAP_TEST_FUNC_ID_OBJECT->VALUE.    "原系统编号LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATAX-BP_CENTRALDATA-TITLE_KEY   = ABAP_TRUE.LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATAX-BP_CENTRALDATA-SEARCHTERM1 = ABAP_TRUE.LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATAX-BP_CENTRALDATA-SEARCHTERM2 = ABAP_TRUE.* 若客商名称1字段值的长度超40位字符,超40位的部分写入客商名称2字段L_SAP_TEST_FUNC_ID_OBJECT  =  L_SAP_TEST_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'NAME_ORG1' ).LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATA-BP_ORGANIZATION-NAME1  = L_SAP_TEST_FUNC_ID_OBJECT->VALUE. "客商名称1L_SAP_TEST_FUNC_ID_OBJECT  =  L_SAP_TEST_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'NAME_ORG2' ).LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATA-BP_ORGANIZATION-NAME2  = L_SAP_TEST_FUNC_ID_OBJECT->VALUE. "客商名称2L_SAP_TEST_FUNC_ID_OBJECT  =  L_SAP_TEST_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'NAME_ORG3' ).LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATA-BP_ORGANIZATION-NAME3  = L_SAP_TEST_FUNC_ID_OBJECT->VALUE. "客商名称3L_SAP_TEST_FUNC_ID_OBJECT  =  L_SAP_TEST_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'NAME_ORG4' ).LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATA-BP_ORGANIZATION-NAME4  = L_SAP_TEST_FUNC_ID_OBJECT->VALUE. "客商名称4LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATAX-BP_ORGANIZATION-NAME1 = ABAP_TRUE.LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATAX-BP_ORGANIZATION-NAME2 = ABAP_TRUE.LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATAX-BP_ORGANIZATION-NAME3 = ABAP_TRUE.LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATAX-BP_ORGANIZATION-NAME4 = ABAP_TRUE.L_SAP_TEST_FUNC_ID_OBJECT  =  L_SAP_TEST_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'TITLE_LET' ).LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATA-BP_CENTRALDATA-TITLELETTER = L_SAP_TEST_FUNC_ID_OBJECT->VALUE.LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATAX-BP_CENTRALDATA-TITLELETTER = ABAP_TRUE.PERFORM GETADDRESSINFO USING LV_URL_STR LBUTPARTNER CHANGING LT_PAADR[].LS_DATA-PARTNER-CENTRAL_DATA-ADDRESS-ADDRESSES = LT_PAADR[].PERFORM GETINDUSINFO USING LV_URL_STR LBUTPARTNER CHANGING LT_INDU[].IF LS_DATA-PARTNER-CENTRAL_DATA-COMMON-DATA-BP_CONTROL-GROUPING <> 'Z004'.LS_DATA-PARTNER-CENTRAL_DATA-INDUSTRY-INDUSTRIES = LT_INDU[].LS_DATA-PARTNER-CENTRAL_DATA-INDUSTRY-CURRENT_STATE = 'X'.ENDIF.*    CLEAR LT_BANK[].
*    PERFORM GETBANKINFO USING LV_URL_STR LBUTPARTNER CHANGING LT_BANK[].PERFORM GETCOMPINFO4KUNNR USING LV_URL_STR LBUTPARTNER CHANGING LT_COMPANY[].LS_DATA-CUSTOMER-COMPANY_DATA-COMPANY = LT_COMPANY[].LS_DATA-CUSTOMER-HEADER-OBJECT_INSTANCE-KUNNR = LBUTPARTNER.CLEAR LT_COMPANYV[].PERFORM GETCOMPINFO4LIFNR USING LV_URL_STR LBUTPARTNER CHANGING LT_COMPANYV[].LS_DATA-VENDOR-COMPANY_DATA-COMPANY = LT_COMPANYV[].LS_DATA-VENDOR-HEADER-OBJECT_INSTANCE-LIFNR = LBUTPARTNER.PERFORM GETKNVVINFO USING LV_URL_STR LBUTPARTNER CHANGING LT_SALES[].LS_DATA-CUSTOMER-SALES_DATA-SALES = LT_SALES[].PERFORM GETKNVIINFO USING LV_URL_STR LBUTPARTNER CHANGING LT_TAX[].LS_DATA-CUSTOMER-CENTRAL_DATA-TAX_IND-TAX_IND = LT_TAX[].CLEAR LT_PURCHASING[].PERFORM GETLFMIINFO USING LV_URL_STR LBUTPARTNER CHANGING LT_PURCHASING[].LS_DATA-VENDOR-PURCHASING_DATA-PURCHASING = LT_PURCHASING[].APPEND LS_DATA TO LT_DATA.CALL METHOD CL_MD_BP_MAINTAIN=>VALIDATE_SINGLEEXPORTINGI_DATA        = LS_DATA "lt_dataIMPORTINGET_RETURN_MAP = LT_RETURN_MAP. "lt_return.IF LT_RETURN_MAP IS INITIAL.CALL METHOD CL_MD_BP_MAINTAIN=>MAINTAINEXPORTINGI_DATA   = LT_DATAIMPORTINGE_RETURN = LT_RETURN.*------------------COMMIT BAPI ----------------------------*LOOP AT LT_RETURN INTO DATA(LS_RETURN).LOOP AT LS_RETURN-OBJECT_MSG INTO DATA(LS_RETMSG) WHERE TYPE CA 'EXA'.CLEAR: LL_TEXT.CALL FUNCTION 'MESSAGE_TEXT_BUILD'EXPORTINGMSGID               = LS_RETMSG-IDMSGNR               = LS_RETMSG-NUMBERMSGV1               = LS_RETMSG-MESSAGE_V1MSGV2               = LS_RETMSG-MESSAGE_V2MSGV3               = LS_RETMSG-MESSAGE_V3MSGV4               = LS_RETMSG-MESSAGE_V4IMPORTINGMESSAGE_TEXT_OUTPUT = LL_TEXT.
*          CONCATENATE OUTPUT-ITEM-EV_MSG LL_TEXT INTO OUTPUT-ITEM-EV_MSG.ENDLOOP.ENDLOOP.IF LL_TEXT IS INITIAL.CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'EXPORTINGWAIT = 'X'.DO 10 TIMES.SELECT SINGLE PARTNER INTO @DATA(LSPTMP)FROM BUT000 WHERE PARTNER_GUID = @LV_GUID.IF SY-SUBRC = 0.EXIT.ELSE.WAIT UP TO 1 SECONDS.ENDIF.ENDDO.ENDIF.ENDIF.PERFORM MAINTAXNUM USING LV_URL_STR LBUTPARTNER.ENDLOOP.ENDLOOP.
ENDFORM.FORM MAINTAXNUM USING  PURL TYPE STRING PARTNER TYPE BUT000-PARTNER.DATA:SQLSTR TYPE STRING.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAXTYPE  TYPE DFKKBPTAXNUM-TAXTYPE,LTAXNUMXL TYPE DFKKBPTAXNUM-TAXNUMXL,LBPARTNER TYPE DFKKBPTAXNUM-PARTNER.LBPARTNER = PARTNER.SQLSTR = 'SELECT * FROM DFKKBPTAXNUM  WHERE CLIENT = 800 AND PARTNER = ''' && PARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().LOOP AT LTAR INTO DATA(LSAR).L_SAP_ROW_OBJECT = LSAR-NODE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'TAXTYPE' ).LTAXTYPE = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'TAXNUMXL' ).LTAXNUMXL = L_SAP_COL_OBJECT->VALUE.CALL FUNCTION 'BAPI_BUPA_TAX_ADD'EXPORTINGBUSINESSPARTNER = LBPARTNERTAXTYPE         = LTAXTYPETAXNUMBER       = LTAXNUMXL.ENDLOOP.
ENDFORM.FORM GETLFMIINFO USING PURL TYPE STRING PARTNER TYPE BUT000-PARTNER CHANGING LT_PURCHASING TYPE STANDARD TABLE.DATA:LS_PURCHASING TYPE VMDS_EI_PURCHASING.DATA:SQLSTR TYPE STRING.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA:LS_FUNCTIONS TYPE VMDS_EI_FUNCTIONS,LT_FUNCTIONS TYPE VMDS_EI_FUNCTIONS_T.SQLSTR = 'SELECT *  FROM LFM1 WHERE mandt = 800 and LIFNR  = ''' && PARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().LOOP AT LTAR INTO DATA(LSAR).CLEAR: LS_PURCHASING.LS_PURCHASING-TASK = 'I'.L_SAP_ROW_OBJECT = LSAR-NODE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'EKORG' ).LS_PURCHASING-DATA_KEY-EKORG = L_SAP_COL_OBJECT->VALUE."采购组织L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'WAERS' ).LS_PURCHASING-DATA-WAERS   = L_SAP_COL_OBJECT->VALUE.             "采购订单货币L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'WEBRE' ).LS_PURCHASING-DATA-WEBRE   = L_SAP_COL_OBJECT->VALUE.             "标识:基于收货的发票验证L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ZTERM' ).LS_PURCHASING-DATA-ZTERM   = L_SAP_COL_OBJECT->VALUE.             "付款条件代码L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'LEBRE' ).LS_PURCHASING-DATA-LEBRE   = L_SAP_COL_OBJECT->VALUE.             "基于服务的发票校验标识L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'KZAUT' ).LS_PURCHASING-DATA-KZAUT   = L_SAP_COL_OBJECT->VALUE.             "自动产生允许的采购订单L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'XERSY' ).LS_PURCHASING-DATA-XERSY   = L_SAP_COL_OBJECT->VALUE.             "评估收货结算 (ERS)L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'XERSR' ).LS_PURCHASING-DATA-XERSR   = L_SAP_COL_OBJECT->VALUE.   "自动计算退回项目的接收安排L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'EKGRP' ).LS_PURCHASING-DATA-EKGRP   = L_SAP_COL_OBJECT->VALUE.   "采购组L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'PLIFZ' ).LS_PURCHASING-DATA-PLIFZ   = L_SAP_COL_OBJECT->VALUE.   "计划交货时间(天)L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'KALSK' ).LS_PURCHASING-DATA-KALSK   = L_SAP_COL_OBJECT->VALUE.   "计算方案组(供应商)L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'SPERM' ).LS_PURCHASING-DATA-SPERM   = L_SAP_COL_OBJECT->VALUE.   "采购冻结在采购组织层L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'LFABC' ).LS_PURCHASING-DATA-LFABC   = L_SAP_COL_OBJECT->VALUE.   "ABC标识L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'VERKF' ).LS_PURCHASING-DATA-VERKF   = L_SAP_COL_OBJECT->VALUE.   "销售人员L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'INCO1' ).LS_PURCHASING-DATA-INCO1   = L_SAP_COL_OBJECT->VALUE.   "国际贸易条款L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'INCO2' ).LS_PURCHASING-DATA-INCO2_L   = L_SAP_COL_OBJECT->VALUE.   "国际贸易条款位置 1L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ZOLLA' ).LS_PURCHASING-DATA-ZOLLA   = L_SAP_COL_OBJECT->VALUE. "海关LS_PURCHASING-DATAX-WAERS   = ABAP_TRUE.LS_PURCHASING-DATAX-WEBRE   = ABAP_TRUE.LS_PURCHASING-DATAX-ZTERM   = ABAP_TRUE.LS_PURCHASING-DATAX-LEBRE   = ABAP_TRUE.             "基于服务的发票校验标识LS_PURCHASING-DATAX-KZAUT   = ABAP_TRUE.             "自动产生允许的采购订单LS_PURCHASING-DATAX-XERSY   = ABAP_TRUE.             "评估收货结算 (ERS)LS_PURCHASING-DATAX-XERSR   = ABAP_TRUE.             "自动计算退回项目的接收安排LS_PURCHASING-DATAX-EKGRP   = ABAP_TRUE.             "采购组LS_PURCHASING-DATAX-PLIFZ   = ABAP_TRUE.             "计划交货时间(天)LS_PURCHASING-DATAX-KALSK   = ABAP_TRUE.             "计算方案组(供应商)LS_PURCHASING-DATAX-SPERM   = ABAP_TRUE.             "采购冻结在采购组织层LS_PURCHASING-DATAX-LFABC   = ABAP_TRUE.             "ABC标识LS_PURCHASING-DATAX-VERKF   = ABAP_TRUE.             "销售人员LS_PURCHASING-DATAX-INCO1   = ABAP_TRUE.             "国际贸易条款LS_PURCHASING-DATAX-INCO2_L = ABAP_TRUE.             "国际贸易条款位置 1LS_PURCHASING-DATAX-ZOLLA   = ABAP_TRUE.             "海关CLEAR: LS_FUNCTIONS,LT_FUNCTIONS.LS_FUNCTIONS-TASK = 'I'.LS_FUNCTIONS-DATA_KEY-PARVW = 'RS'.   "付款方LS_FUNCTIONS-DATA-DEFPA = 'X'.LS_FUNCTIONS-DATAX-DEFPA = ABAP_TRUE.LS_FUNCTIONS-DATA-PARTNER = PARTNER.LS_FUNCTIONS-DATAX-PARTNER = ABAP_TRUE.APPEND LS_FUNCTIONS TO LT_FUNCTIONS.LS_PURCHASING-FUNCTIONS-FUNCTIONS = LT_FUNCTIONS.LS_PURCHASING-FUNCTIONS-CURRENT_STATE = 'X'.APPEND LS_PURCHASING TO LT_PURCHASING[].ENDLOOP.
ENDFORM.FORM GETKNVIINFO USING PURL TYPE STRING PARTNER TYPE BUT000-PARTNER CHANGING LT_TAX TYPE STANDARD TABLE.DATA:LS_TAX     TYPE CMDS_EI_TAX_IND.DATA:SQLSTR TYPE STRING.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LVKORG TYPE KNVV-VKORG,LVTWEG TYPE KNVV-VTWEG,LSPART TYPE KNVV-SPART.SQLSTR = 'SELECT *  FROM KNVI WHERE mandt = 800 and KUNNR  = ''' && PARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().LOOP AT LTAR INTO DATA(LSAR).CLEAR: LS_TAX.LS_TAX-TASK = 'I'.L_SAP_ROW_OBJECT = LSAR-NODE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ALAND' ).LS_TAX-DATA_KEY-ALAND = L_SAP_COL_OBJECT->VALUE."启运国家L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'TATYP' ).LS_TAX-DATA_KEY-TATYP = L_SAP_COL_OBJECT->VALUE."'MWST'. "税类别(营业税,联邦营业税,...)L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'TAXKD' ).LS_TAX-DATA-TAXKD     = L_SAP_COL_OBJECT->VALUE.LS_TAX-DATAX-TAXKD = 'X'.APPEND LS_TAX TO LT_TAX.ENDLOOP.
ENDFORM.FORM GETKNVVINFO USING PURL TYPE STRING PARTNER TYPE BUT000-PARTNER CHANGING LT_SALES TYPE STANDARD TABLE.DATA: LS_CMDSALE   TYPE CMDS_EI_SALES.DATA:LS_FUNCTIONS_T  TYPE CMDS_EI_FUNCTIONS_T.DATA:SQLSTR TYPE STRING.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LVKORG TYPE KNVV-VKORG,LVTWEG TYPE KNVV-VTWEG,LSPART TYPE KNVV-SPART.SQLSTR = 'SELECT *  FROM KNVV WHERE mandt = 800 and KUNNR  = ''' && PARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().LOOP AT LTAR INTO DATA(LSAR).CLEAR: LS_CMDSALE,LS_FUNCTIONS_T[].LS_CMDSALE-TASK = 'I'.L_SAP_ROW_OBJECT = LSAR-NODE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'VKORG' ).LVKORG = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'VTWEG' ).LVTWEG = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'SPART' ).LSPART = L_SAP_COL_OBJECT->VALUE.PERFORM GETFUNCTIONINFO USING PURL PARTNER LVKORG LVTWEG LSPART CHANGING LS_FUNCTIONS_T[].IF LS_FUNCTIONS_T[] IS NOT INITIAL.LS_CMDSALE-FUNCTIONS-FUNCTIONS =  LS_FUNCTIONS_T.LS_CMDSALE-FUNCTIONS-CURRENT_STATE = 'X'.ENDIF.LS_CMDSALE-DATA_KEY-VKORG = LVKORG.LS_CMDSALE-DATA_KEY-SPART = LSPART.LS_CMDSALE-DATA_KEY-VTWEG = LVTWEG.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'KVGR1' ).LS_CMDSALE-DATA-KVGR1 = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'KVGR2' ).LS_CMDSALE-DATA-KVGR2 = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'KVGR3' ).LS_CMDSALE-DATA-KVGR3 = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'BZIRK' ).LS_CMDSALE-DATA-BZIRK = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'VKGRP' ).LS_CMDSALE-DATA-VKGRP = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'KALKS' ).LS_CMDSALE-DATA-KALKS = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'KONDA' ).LS_CMDSALE-DATA-KONDA = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'KTGRD' ).LS_CMDSALE-DATA-KTGRD = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'PLTYP' ).LS_CMDSALE-DATA-PLTYP = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'VKBUR' ).LS_CMDSALE-DATA-VKBUR = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'VSBED' ).LS_CMDSALE-DATA-VSBED = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'WAERS' ).LS_CMDSALE-DATA-WAERS = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ZTERM' ).LS_CMDSALE-DATA-ZTERM = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'BEGRU' ).LS_CMDSALE-DATA-BEGRU = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'LOEVM' ).LS_CMDSALE-DATA-LOEVM = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'VERSG' ).LS_CMDSALE-DATA-VERSG = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'AUFSD' ).LS_CMDSALE-DATA-AUFSD = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'KDGRP' ).LS_CMDSALE-DATA-KDGRP = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'VKGRP' ).LS_CMDSALE-DATA-VKGRP = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'AWAHR' ).LS_CMDSALE-DATA-AWAHR = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'INCO1' ).LS_CMDSALE-DATA-INCO1 = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'INCO2' ).LS_CMDSALE-DATA-INCO2 = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'LIFSD' ).LS_CMDSALE-DATA-LIFSD = L_SAP_COL_OBJECT->VALUE.LS_CMDSALE-DATAX-KVGR1  = ABAP_TRUE.LS_CMDSALE-DATAX-KVGR2  = ABAP_TRUE.LS_CMDSALE-DATAX-KVGR3  = ABAP_TRUE.LS_CMDSALE-DATAX-BZIRK = ABAP_TRUE.LS_CMDSALE-DATAX-VKGRP = ABAP_TRUE.LS_CMDSALE-DATAX-KALKS = ABAP_TRUE.LS_CMDSALE-DATAX-KONDA = ABAP_TRUE.LS_CMDSALE-DATAX-KTGRD = ABAP_TRUE.LS_CMDSALE-DATAX-PLTYP = ABAP_TRUE.LS_CMDSALE-DATAX-VKBUR = ABAP_TRUE.LS_CMDSALE-DATAX-VSBED = ABAP_TRUE.LS_CMDSALE-DATAX-WAERS = ABAP_TRUE.LS_CMDSALE-DATAX-ZTERM = ABAP_TRUE.LS_CMDSALE-DATAX-LOEVM = ABAP_TRUE.LS_CMDSALE-DATAX-VERSG = ABAP_TRUE.LS_CMDSALE-DATAX-AUFSD = ABAP_TRUE.LS_CMDSALE-DATAX-KDGRP = ABAP_TRUE.LS_CMDSALE-DATAX-VKGRP = ABAP_TRUE.LS_CMDSALE-DATAX-WAERS = ABAP_TRUE.LS_CMDSALE-DATAX-AWAHR = ABAP_TRUE.LS_CMDSALE-DATAX-INCO1 = ABAP_TRUE.LS_CMDSALE-DATAX-INCO2 = ABAP_TRUE.LS_CMDSALE-DATAX-LIFSD = ABAP_TRUE.APPEND LS_CMDSALE TO LT_SALES.ENDLOOP.
ENDFORM.
FORM  GETFUNCTIONINFO USING PURL TYPE STRING PARTNER TYPE BUT000-PARTNER PVKORG TYPE KNVV-VKORG PVTWEG TYPE KNVV-VTWEG PSPART TYPE KNVV-SPART CHANGING LT_FUNCTION TYPE STANDARD TABLE.DATA:LS_FUNCTIONS  TYPE LINE OF CMDS_EI_FUNCTIONS_T.DATA:SQLSTR TYPE STRING.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LPARVW TYPE KNVP-PARVW.SQLSTR = 'SELECT *  FROM KNVP WHERE mandt = 800 and KUNNR = ''' && PARTNER && '''' && ' AND VKORG = ''' && PVKORG && '''' && ' AND VTWEG = ''' && PVTWEG && '''' && ' AND SPART = ''' && PSPART && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().LOOP AT LTAR INTO DATA(LSAR).CLEAR LS_FUNCTIONS.LS_FUNCTIONS-TASK = 'I'.L_SAP_ROW_OBJECT = LSAR-NODE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'PARVW' ).LPARVW = L_SAP_COL_OBJECT->VALUE.LS_FUNCTIONS-DATA_KEY-PARVW = LPARVW.
*    LS_FUNCTIONS-DATA-PARTNER = PARTNER.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'DEFPA' ).LS_FUNCTIONS-DATA-DEFPA = L_SAP_COL_OBJECT->VALUE.LS_FUNCTIONS-DATAX-DEFPA = ABAP_TRUE.
*    LS_FUNCTIONS-DATAX-PARTNER = ABAP_TRUE.IF LPARVW <> 'ZE'.APPEND LS_FUNCTIONS TO LT_FUNCTION.ENDIF.ENDLOOP.
ENDFORM.FORM GETCOMPINFO4KUNNR USING PURL TYPE STRING PARTNER TYPE BUT000-PARTNER CHANGING LT_COMP TYPE STANDARD TABLE.DATA:LSCOMP TYPE CMDS_EI_COMPANY.DATA:SQLSTR TYPE STRING.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.SQLSTR = 'SELECT *  FROM KNB1 WHERE mandt = 800 and KUNNR  = ''' && PARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().LOOP AT LTAR INTO DATA(LSAR).CLEAR LSCOMP.LSCOMP-TASK = 'I'.L_SAP_ROW_OBJECT = LSAR-NODE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'BUKRS' ).LSCOMP-DATA_KEY-BUKRS = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ZTERM' ).LSCOMP-DATA-ZTERM       = L_SAP_COL_OBJECT->VALUE.       " terms of paymentL_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ZWELS' ).LSCOMP-DATA-ZWELS = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ALTKN' ).LSCOMP-DATA-ALTKN = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'AKONT' ).LSCOMP-DATA-AKONT = L_SAP_COL_OBJECT->VALUE.LSCOMP-DATAX-ZTERM = 'X'.LSCOMP-DATAX-AKONT = 'X'.LSCOMP-DATAX-ZWELS = 'X'.LSCOMP-DATAX-ALTKN = 'X'.APPEND LSCOMP TO LT_COMP.ENDLOOP.
ENDFORM.FORM GETCOMPINFO4LIFNR USING PURL TYPE STRING PARTNER TYPE BUT000-PARTNER CHANGING LT_COMP TYPE STANDARD TABLE.DATA:LSCOMP TYPE VMDS_EI_COMPANY.DATA:SQLSTR TYPE STRING.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.SQLSTR = 'SELECT *  FROM LFB1 WHERE mandt = 800 and LIFNR  = ''' && PARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().LOOP AT LTAR INTO DATA(LSAR).CLEAR LSCOMP.LSCOMP-TASK = 'I'.L_SAP_ROW_OBJECT = LSAR-NODE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'BUKRS' ).LSCOMP-DATA_KEY-BUKRS = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ZTERM' ).LSCOMP-DATA-ZTERM       = L_SAP_COL_OBJECT->VALUE.       " terms of paymentL_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ZWELS' ).LSCOMP-DATA-ZWELS = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ALTKN' ).LSCOMP-DATA-ALTKN = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'AKONT' ).LSCOMP-DATA-AKONT = L_SAP_COL_OBJECT->VALUE.LSCOMP-DATAX-ZTERM = 'X'.LSCOMP-DATAX-AKONT = 'X'.LSCOMP-DATAX-ZWELS = 'X'.LSCOMP-DATAX-ALTKN = 'X'.APPEND LSCOMP TO LT_COMP.ENDLOOP.
ENDFORM.FORM GETBANKINFO USING PURL TYPE STRING PARTNER TYPE BUT000-PARTNER CHANGING LT_BANK TYPE STANDARD TABLE.DATA:LS_BANK       TYPE BUS_EI_BUPA_BANKDETAIL.DATA:SQLSTR TYPE STRING.DATA:STRTMP(30) TYPE C.DATA:CNT TYPE I.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.SQLSTR = 'SELECT * FROM KNBK WHERE mandt = 800 and  KUNNR  = ''' && PARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().LOOP AT LTAR INTO DATA(LSAR).CLEAR LS_BANK.L_SAP_ROW_OBJECT = LSAR-NODE.LS_BANK-TASK = 'I'.   "创建L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'BKVID' ).LS_BANK-DATA_KEY = L_SAP_COL_OBJECT->VALUE.                "银行标识L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'BANKS' ).LS_BANK-DATA-BANK_CTRY       = L_SAP_COL_OBJECT->VALUE.                "银行国家L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'BANKL' ).LS_BANK-DATA-BANK_KEY        = L_SAP_COL_OBJECT->VALUE.                "银行代码L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ACCOUNT' ).STRTMP  = L_SAP_COL_OBJECT->VALUE.CNT = STRLEN( STRTMP ).IF STRTMP IS NOT INITIAL AND CNT >= 20.LS_BANK-DATA-BANK_ACCT       = L_SAP_COL_OBJECT->VALUE+0(18).        "银行账号LS_BANK-DATA-BANK_REF        = L_SAP_COL_OBJECT->VALUE+18(20).       "银行细目的参考明细ELSEIF CNT <= 18.LS_BANK-DATA-BANK_ACCT       = L_SAP_COL_OBJECT->VALUE+0(18).        "银行账号ENDIF.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'KOINH' ).LS_BANK-DATA-ACCOUNTHOLDER   = L_SAP_COL_OBJECT->VALUE.                "账户持有人L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'ACCNAME' ).LS_BANK-DATA-BANKACCOUNTNAME = L_SAP_COL_OBJECT->VALUE.              "账户名称LS_BANK-DATAX-BANK_CTRY       = ABAP_TRUE.LS_BANK-DATAX-BANK_KEY        = ABAP_TRUE.LS_BANK-DATAX-BANK_ACCT       = ABAP_TRUE.LS_BANK-DATAX-BANK_REF        = ABAP_TRUE.LS_BANK-DATAX-ACCOUNTHOLDER   = ABAP_TRUE.LS_BANK-DATAX-BANKACCOUNTNAME = ABAP_TRUE.APPEND LS_BANK TO LT_BANK.ENDLOOP.
ENDFORM.FORM CHKBANKINFO USING PURL TYPE STRING PBANKS TYPE BU_BANKS PBANKL TYPE BU_BANKK.DATA:SQLSTR TYPE STRING.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.SQLSTR = 'SELECT * FROM BNKA WHERE mandt = 800 and BANKS  = ''' && PBANKS && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().ENDFORM.
FORM GETINDUSINFO USING PURL TYPE STRING PARTNER TYPE BUT000-PARTNER CHANGING LT_INDU TYPE STANDARD TABLE.DATA:LS_INDU      TYPE BUS_EI_BUPA_INDUSTRYSECTOR.   "行业DATA:SQLSTR TYPE STRING.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.SQLSTR = 'SELECT BRSCH FROM KNA1 WHERE mandt = 800 and  KUNNR  = ''' && PARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().IF LTAR[] IS INITIAL.SQLSTR = 'SELECT BRSCH FROM LFA1 WHERE mandt = 800 and  LIFNR  = ''' && PARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().ENDIF.LOOP AT LTAR INTO DATA(LSAR).L_SAP_ROW_OBJECT = LSAR-NODE.LS_INDU-TASK = 'I'.   "创建L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'BRSCH' ).LS_INDU-DATA_KEY-IND_SECTOR = L_SAP_COL_OBJECT->VALUE.
*    ls_indu-data_key-ind_sector = INPUT-it_but000-isec.  "行业领域LS_INDU-DATA_KEY-KEYSYSTEM = 'ZJK1'."'Z012'.  "行业系统LS_INDU-DATA-IND_DEFAULT  = 'X'.     "行业系统中业务伙伴的行业是标准的LS_INDU-DATAX-IND_DEFAULT = 'X'.     "行业系统中业务伙伴的行业是标准的APPEND LS_INDU TO LT_INDU.ENDLOOP.ENDFORM.FORM  GETADDRESSINFO USING PURL TYPE STRING PARTNER TYPE BUT000-PARTNER CHANGING LT_PAADR TYPE STANDARD TABLE.DATA:LS_PAADR  TYPE BUS_EI_BUPA_ADDRESS.DATA:SQLSTR TYPE STRING.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LPPSTAT TYPE MARA-PSTAT.DATA:LS_MAIL   TYPE BUS_EI_BUPA_SMTP,LT_MAIL   TYPE BUS_EI_BUPA_SMTP_T,LS_FAX    TYPE BUS_EI_BUPA_FAX,LT_FAX    TYPE BUS_EI_BUPA_FAX_T,LS_PHONE  TYPE BUS_EI_BUPA_TELEPHONE,LT_PHONE  TYPE BUS_EI_BUPA_TELEPHONE_T,LS_PHONE1 TYPE CVIS_EI_PHONE_STR,LT_PHONE1 TYPE CVIS_EI_PHONE_T.SQLSTR = 'SELECT ADRC.*,BUT021_FS.ADR_KIND,BUT021_FS.VALID_TO,BUT021_FS.VALID_FROM,BUT021_FS.XDFADU '&&' FROM BUT021_FS JOIN ADRC ON ADRC.ADDRNUMBER = BUT021_FS.ADDRNUMBER AND ADRC.CLIENT = BUT021_FS.client ' &&
' WHERE  BUT021_FS.client = 800 AND BUT021_FS.PARTNER = ''' && PARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().LOOP AT LTAR INTO DATA(LSAR).CLEAR LS_PAADR.L_SAP_ROW_OBJECT = LSAR-NODE.LS_PAADR-TASK = 'I'.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'LANGU' ).LS_PAADR-DATA-POSTAL-DATA-LANGU = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'COUNTRY' ).LS_PAADR-DATA-POSTAL-DATA-COUNTRY = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'REGION' ).LS_PAADR-DATA-POSTAL-DATA-REGION = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'CITY1' ).LS_PAADR-DATA-POSTAL-DATA-CITY = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'STREET' ).LS_PAADR-DATA-POSTAL-DATA-STREET = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'STR_SUPPL1' ).LS_PAADR-DATA-POSTAL-DATA-STR_SUPPL1 = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'STR_SUPPL2' ).LS_PAADR-DATA-POSTAL-DATA-STR_SUPPL2 = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'STR_SUPPL3' ).LS_PAADR-DATA-POSTAL-DATA-STR_SUPPL3 = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'LOCATION' ).LS_PAADR-DATA-POSTAL-DATA-LOCATION = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'SORT1' ).LS_PAADR-DATA-POSTAL-DATA-C_O_NAME = L_SAP_COL_OBJECT->VALUE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'POST_CODE1' ).LS_PAADR-DATA-POSTAL-DATA-POSTL_COD1 = L_SAP_COL_OBJECT->VALUE.LS_PAADR-DATA-POSTAL-DATAX-LANGU       = ABAP_TRUE.LS_PAADR-DATA-POSTAL-DATAX-COUNTRY     = ABAP_TRUE.LS_PAADR-DATA-POSTAL-DATAX-REGION      = ABAP_TRUE.LS_PAADR-DATA-POSTAL-DATAX-CITY        = ABAP_TRUE.LS_PAADR-DATA-POSTAL-DATAX-STREET      = ABAP_TRUE.LS_PAADR-DATA-POSTAL-DATAX-STR_SUPPL1  = ABAP_TRUE.LS_PAADR-DATA-POSTAL-DATAX-STR_SUPPL2  = ABAP_TRUE.   "客商地址LS_PAADR-DATA-POSTAL-DATAX-STR_SUPPL3  = ABAP_TRUE.   "客商地址LS_PAADR-DATA-POSTAL-DATAX-LOCATION  = ABAP_TRUE.   "客商地址LS_PAADR-DATA-POSTAL-DATAX-C_O_NAME    = ABAP_TRUE.LS_PAADR-DATA-POSTAL-DATAX-POSTL_COD1  = ABAP_TRUE.*    ls_mail-contact-task = 'I'.
*    LS_MAIL-CONTACT-DATA-E_MAIL = INPUT-IT_BUT000-SMTP_ADDR.
*    LS_MAIL-CONTACT-DATAX-E_MAIL = 'X'.
*    APPEND LS_MAIL TO LT_MAIL.
*    LS_PAADR-DATA-COMMUNICATION-SMTP-SMTP = LT_MAIL.*    LS_FAX-CONTACT-TASK = 'I'.
*    LS_FAX-CONTACT-DATA-COUNTRY = INPUT-IT_BUT000-COUNTRY.
*    LS_FAX-CONTACT-DATA-FAX = INPUT-IT_BUT000-FAX_NUMBER.
*    LS_FAX-CONTACT-DATAX-COUNTRY = 'X'.
*    LS_FAX-CONTACT-DATAX-FAX = 'X'.
*    APPEND LS_FAX TO LT_FAX.
*    LS_PAADR-DATA-COMMUNICATION-FAX-FAX = LT_FAX.*   ls_phone-contact-task = 'I'.
*    ls_phone-contact-DATA-COUNTRY = INPUT-it_but000-COUNTRY.
*    ls_phone-contact-DATA-telephone = INPUT-it_but000-telf1.
*    ls_phone-contact-datax-COUNTRY = 'X'.
*    ls_phone-contact-datax-telephone = 'X'.
*    APPEND ls_phone TO lt_phone.
*    CLEAR: ls_phone.
*    ls_paadr-DATA-COMMUNICATION-phone-phone = lt_phone.
*
*    ls_phone-contact-task = 'I'.
*    ls_phone-contact-DATA-COUNTRY = INPUT-it_but000-COUNTRY.
*    ls_phone-contact-DATA-r_3_user  = '2'.                  "标识符:电话是移动电话
*    ls_phone-contact-DATA-telephone = INPUT-it_but000-telf2.
*    ls_phone-contact-datax-COUNTRY = 'X'.
*    ls_phone-contact-datax-r_3_user = 'X'.
*    ls_phone-contact-datax-telephone = 'X'.
*    APPEND ls_phone TO lt_phone.
*    CLEAR: ls_phone.
*    ls_paadr-DATA-COMMUNICATION-phone-phone = lt_phone.
*    ls_paadr-DATA-COMMUNICATION-phone-current_state = 'X'.APPEND LS_PAADR TO LT_PAADR.ENDLOOP.
ENDFORM.FORM GETINILROLES USING PURL TYPE STRING PARTNER TYPE BUT000-PARTNER CHANGING LT_ROLES TYPE STANDARD TABLE.DATA:LS_ROLES        TYPE BUS_EI_BUPA_ROLES.DATA:SQLSTR TYPE STRING.DATA: L_JSON_ROOT_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_ERRORTYPE_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LTAR TYPE TABLE OF ZCL_MDP_JSON_NODE=>TYP_ARRAY_CHILDREN.DATA: L_SAP_ROW_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: L_SAP_COL_OBJECT TYPE REF TO ZCL_MDP_JSON_NODE.DATA: LPPSTAT TYPE MARA-PSTAT.SQLSTR = 'SELECT * FROM BUT100 WHERE MANDT = 800 AND PARTNER = ''' && PARTNER && ''''.PERFORM FRM_SYNOBJ(ZABAP_COMMON_PROGRAM) USING PURL SQLSTR CHANGING L_JSON_ROOT_OBJECT.L_ERRORTYPE_OBJECT = L_JSON_ROOT_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RESULT').LTAR  = L_ERRORTYPE_OBJECT->ARRAY_CHILDREN().LOOP AT LTAR INTO DATA(LSAR).CLEAR LS_ROLES.LS_ROLES-TASK = 'I'.L_SAP_ROW_OBJECT = LSAR-NODE.L_SAP_COL_OBJECT =  L_SAP_ROW_OBJECT->OBJECT_GET_CHILD_NODE( KEY = 'RLTYP' ).LS_ROLES-DATA_KEY = L_SAP_COL_OBJECT->VALUE.
*    LS_ROLES-DATA_KEY = 'ZFLCU0'."'ZFLCU0'.   "角色IF LS_ROLES-DATA_KEY = 'ZFLCU0'.LS_ROLES-DATA-ROLECATEGORY = 'FLCU00'.ELSE.LS_ROLES-DATA-ROLECATEGORY = L_SAP_COL_OBJECT->VALUE."'FLCU00'.ENDIF.LS_ROLES-DATA-VALID_FROM = SY-DATUM.LS_ROLES-DATA-VALID_TO = '99991231'.LS_ROLES-CURRENTLY_VALID = ABAP_TRUE.LS_ROLES-DATAX-VALID_FROM = ABAP_TRUE.LS_ROLES-DATAX-VALID_TO = ABAP_TRUE.APPEND LS_ROLES TO LT_ROLES.ENDLOOP.ENDFORM.

这篇关于SAP 物料主数据 PRD覆盖QAS实现-BP同步的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1033666

相关文章

Python获取中国节假日数据记录入JSON文件

《Python获取中国节假日数据记录入JSON文件》项目系统内置的日历应用为了提升用户体验,特别设置了在调休日期显示“休”的UI图标功能,那么问题是这些调休数据从哪里来呢?我尝试一种更为智能的方法:P... 目录节假日数据获取存入jsON文件节假日数据读取封装完整代码项目系统内置的日历应用为了提升用户体验,

SpringBoot3实现Gzip压缩优化的技术指南

《SpringBoot3实现Gzip压缩优化的技术指南》随着Web应用的用户量和数据量增加,网络带宽和页面加载速度逐渐成为瓶颈,为了减少数据传输量,提高用户体验,我们可以使用Gzip压缩HTTP响应,... 目录1、简述2、配置2.1 添加依赖2.2 配置 Gzip 压缩3、服务端应用4、前端应用4.1 N

SpringBoot实现数据库读写分离的3种方法小结

《SpringBoot实现数据库读写分离的3种方法小结》为了提高系统的读写性能和可用性,读写分离是一种经典的数据库架构模式,在SpringBoot应用中,有多种方式可以实现数据库读写分离,本文将介绍三... 目录一、数据库读写分离概述二、方案一:基于AbstractRoutingDataSource实现动态

Python FastAPI+Celery+RabbitMQ实现分布式图片水印处理系统

《PythonFastAPI+Celery+RabbitMQ实现分布式图片水印处理系统》这篇文章主要为大家详细介绍了PythonFastAPI如何结合Celery以及RabbitMQ实现简单的分布式... 实现思路FastAPI 服务器Celery 任务队列RabbitMQ 作为消息代理定时任务处理完整

Java枚举类实现Key-Value映射的多种实现方式

《Java枚举类实现Key-Value映射的多种实现方式》在Java开发中,枚举(Enum)是一种特殊的类,本文将详细介绍Java枚举类实现key-value映射的多种方式,有需要的小伙伴可以根据需要... 目录前言一、基础实现方式1.1 为枚举添加属性和构造方法二、http://www.cppcns.co

使用Python实现快速搭建本地HTTP服务器

《使用Python实现快速搭建本地HTTP服务器》:本文主要介绍如何使用Python快速搭建本地HTTP服务器,轻松实现一键HTTP文件共享,同时结合二维码技术,让访问更简单,感兴趣的小伙伴可以了... 目录1. 概述2. 快速搭建 HTTP 文件共享服务2.1 核心思路2.2 代码实现2.3 代码解读3.

MySQL双主搭建+keepalived高可用的实现

《MySQL双主搭建+keepalived高可用的实现》本文主要介绍了MySQL双主搭建+keepalived高可用的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,... 目录一、测试环境准备二、主从搭建1.创建复制用户2.创建复制关系3.开启复制,确认复制是否成功4.同

Java实现文件图片的预览和下载功能

《Java实现文件图片的预览和下载功能》这篇文章主要为大家详细介绍了如何使用Java实现文件图片的预览和下载功能,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... Java实现文件(图片)的预览和下载 @ApiOperation("访问文件") @GetMapping("

使用Sentinel自定义返回和实现区分来源方式

《使用Sentinel自定义返回和实现区分来源方式》:本文主要介绍使用Sentinel自定义返回和实现区分来源方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Sentinel自定义返回和实现区分来源1. 自定义错误返回2. 实现区分来源总结Sentinel自定

Java实现时间与字符串互相转换详解

《Java实现时间与字符串互相转换详解》这篇文章主要为大家详细介绍了Java中实现时间与字符串互相转换的相关方法,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录一、日期格式化为字符串(一)使用预定义格式(二)自定义格式二、字符串解析为日期(一)解析ISO格式字符串(二)解析自定义