1.安装APIFOX,当然也可以使用在线版,无需下载

官网地址:https://apifox.com/

 

2.新建项目

 3.为项目起一个名称,为相关开发测试人员授权

 

4.在根目录新增子目录

 

5.编辑开发/测试/生产环境的地址信息以及默认全局变量

 

6.将SAP提供的ABAPAPI地址配置进APIFOX,有关ABAP提供的服务地址,请参考文章:

1.ABAP 功能模块的 JSON 适配

 

2.RESTFUL方式 

 

 

7.与前一篇文章有所不同的是,本次在ABAP类中增加了更新模块,如图,请见代码:

 8.在APIFOX新建好服务URL后,可以在根目录设置用户密码,这样后面子节点就可以继承根目录的用户配置

 

9.新建调用接口[本例是SAP函数:BAPI_ACC_DOCUMENT_POST]

9.1在BODY页签,现在json格式,输入测试的报文

{
    "documentheader": {
        "obj_type": "",
        "obj_key": "",
        "obj_sys": "",
        "bus_act": "",
        "username": "CHENHUI",
        "header_txt": "抬头文本",
        "comp_code": "1710",
        "doc_date": "2023-06-02",
        "pstng_date": "2023-06-02",
        "trans_date": "0000-00-00",
        "fisc_year": 2023,
        "fis_period": 6,
        "doc_type": "SA",
        "ref_doc_no": "参照字段",
        "ac_doc_no": "",
        "obj_key_r": "",
        "reason_rev": "",
        "compo_acc": "",
        "ref_doc_no_long": "",
        "acc_principle": "",
        "neg_postng": "",
        "obj_key_inv": "",
        "bill_category": "",
        "vatdate": "0000-00-00",
        "invoice_rec_date": "0000-00-00",
        "ecs_env": "",
        "partial_rev": "",
        "doc_status": ""
    },
    "customercpd": {
        "name": "",
        "name_2": "",
        "name_3": "",
        "name_4": "",
        "postl_code": "",
        "city": "",
        "country": "",
        "country_iso": "",
        "street": "",
        "po_box": "",
        "pobx_pcd": "",
        "pobk_curac": "",
        "bank_acct": "",
        "bank_no": "",
        "bank_ctry": "",
        "bank_ctry_iso": "",
        "tax_no_1": "",
        "tax_no_2": "",
        "tax": "",
        "equal_tax": "",
        "region": "",
        "ctrl_key": "",
        "instr_key": "",
        "dme_ind": "",
        "langu_iso": "",
        "iban": "",
        "swift_code": "",
        "tax_no_3": "",
        "tax_no_4": "",
        "title": "",
        "tax_no_5": ""
    },
    "contractheader": {
        "doc_no": "",
        "doc_type_ca": "",
        "res_key": "",
        "fikey": "",
        "payment_form_ref": ""
    },
    "accountgl": [
        {
            "itemno_acc": 1,
            "gl_account": "0012121000",
            "item_text": "",
            "stat_con": "",
            "log_proc": "",
            "ac_doc_no": "",
            "ref_key_1": "",
            "ref_key_2": "",
            "ref_key_3": "",
            "acct_key": "",
            "acct_type": "",
            "doc_type": "",
            "comp_code": "",
            "bus_area": "",
            "func_area": "",
            "plant": "",
            "fis_period": 0,
            "fisc_year": 0,
            "pstng_date": "0000-00-00",
            "value_date": "2023-06-02",
            "fm_area": "",
            "customer": "",
            "cshdis_ind": "",
            "vendor_no": "",
            "alloc_nmbr": "",
            "tax_code": "",
            "taxjurcode": "",
            "ext_object_id": "",
            "bus_scenario": "",
            "costobject": "",
            "costcenter": "",
            "acttype": "",
            "profit_ctr": "",
            "part_prctr": "",
            "network": "",
            "wbs_element": "",
            "orderid": "",
            "order_itno": 0,
            "routing_no": 0,
            "activity": "",
            "cond_type": "",
            "cond_count": 0,
            "cond_st_no": 0,
            "fund": "",
            "funds_ctr": "",
            "cmmt_item": "",
            "co_busproc": "",
            "asset_no": "",
            "sub_number": "",
            "bill_type": "",
            "sales_ord": "",
            "s_ord_item": 0,
            "distr_chan": "",
            "division": "",
            "salesorg": "",
            "sales_grp": "",
            "sales_off": "",
            "sold_to": "",
            "de_cre_ind": "",
            "p_el_prctr": "",
            "xmfrw": "",
            "quantity": 0,
            "base_uom": "",
            "base_uom_iso": "",
            "inv_qty": 0,
            "inv_qty_su": 0,
            "sales_unit": "",
            "sales_unit_iso": "",
            "po_pr_qnt": 0,
            "po_pr_uom": "",
            "po_pr_uom_iso": "",
            "entry_qnt": 0,
            "entry_uom": "",
            "entry_uom_iso": "",
            "volume": 0,
            "volumeunit": "",
            "volumeunit_iso": "",
            "gross_wt": 0,
            "net_weight": 0,
            "unit_of_wt": "",
            "unit_of_wt_iso": "",
            "item_cat": "",
            "material": "",
            "matl_type": "",
            "mvt_ind": "",
            "reval_ind": "",
            "orig_group": "",
            "orig_mat": "",
            "serial_no": 0,
            "part_acct": "",
            "tr_part_ba": "",
            "trade_id": "",
            "val_area": "",
            "val_type": "",
            "asval_date": "0000-00-00",
            "po_number": "",
            "po_item": 0,
            "itm_number": 0,
            "cond_category": "",
            "func_area_long": "",
            "cmmt_item_long": "",
            "grant_nbr": "",
            "cs_trans_t": "",
            "measure": "",
            "segment": "",
            "partner_segment": "",
            "res_doc": "",
            "res_item": 0,
            "billing_period_start_date": "0000-00-00",
            "billing_period_end_date": "0000-00-00",
            "ppa_ex_ind": "",
            "fastpay": "",
            "partner_grant_nbr": "",
            "budget_period": "",
            "partner_budget_period": "",
            "partner_fund": "",
            "itemno_tax": 0,
            "payment_type": "",
            "expense_type": "",
            "program_profile": "",
            "material_long": "",
            "housebankid": "",
            "housebankacctid": "",
            "person_no": 0,
            "acrobj_type": "",
            "acrobj_id": "",
            "acrsubobj_id": "",
            "acritem_type": "",
            "valobjtype": "",
            "valobj_id": "",
            "valsubobj_id": ""
        },
        {
            "itemno_acc": 2,
            "gl_account": "0012401100",
            "item_text": "",
            "stat_con": "",
            "log_proc": "",
            "ac_doc_no": "",
            "ref_key_1": "",
            "ref_key_2": "",
            "ref_key_3": "",
            "acct_key": "",
            "acct_type": "",
            "doc_type": "",
            "comp_code": "",
            "bus_area": "",
            "func_area": "",
            "plant": "",
            "fis_period": 0,
            "fisc_year": 0,
            "pstng_date": "0000-00-00",
            "value_date": "2023-06-02",
            "fm_area": "",
            "customer": "",
            "cshdis_ind": "",
            "vendor_no": "",
            "alloc_nmbr": "",
            "tax_code": "",
            "taxjurcode": "",
            "ext_object_id": "",
            "bus_scenario": "",
            "costobject": "",
            "costcenter": "",
            "acttype": "",
            "profit_ctr": "",
            "part_prctr": "",
            "network": "",
            "wbs_element": "",
            "orderid": "",
            "order_itno": 0,
            "routing_no": 0,
            "activity": "",
            "cond_type": "",
            "cond_count": 0,
            "cond_st_no": 0,
            "fund": "",
            "funds_ctr": "",
            "cmmt_item": "",
            "co_busproc": "",
            "asset_no": "",
            "sub_number": "",
            "bill_type": "",
            "sales_ord": "",
            "s_ord_item": 0,
            "distr_chan": "",
            "division": "",
            "salesorg": "",
            "sales_grp": "",
            "sales_off": "",
            "sold_to": "",
            "de_cre_ind": "",
            "p_el_prctr": "",
            "xmfrw": "",
            "quantity": 0,
            "base_uom": "",
            "base_uom_iso": "",
            "inv_qty": 0,
            "inv_qty_su": 0,
            "sales_unit": "",
            "sales_unit_iso": "",
            "po_pr_qnt": 0,
            "po_pr_uom": "",
            "po_pr_uom_iso": "",
            "entry_qnt": 0,
            "entry_uom": "",
            "entry_uom_iso": "",
            "volume": 0,
            "volumeunit": "",
            "volumeunit_iso": "",
            "gross_wt": 0,
            "net_weight": 0,
            "unit_of_wt": "",
            "unit_of_wt_iso": "",
            "item_cat": "",
            "material": "",
            "matl_type": "",
            "mvt_ind": "",
            "reval_ind": "",
            "orig_group": "",
            "orig_mat": "",
            "serial_no": 0,
            "part_acct": "",
            "tr_part_ba": "",
            "trade_id": "",
            "val_area": "",
            "val_type": "",
            "asval_date": "0000-00-00",
            "po_number": "",
            "po_item": 0,
            "itm_number": 0,
            "cond_category": "",
            "func_area_long": "",
            "cmmt_item_long": "",
            "grant_nbr": "",
            "cs_trans_t": "",
            "measure": "",
            "segment": "",
            "partner_segment": "",
            "res_doc": "",
            "res_item": 0,
            "billing_period_start_date": "0000-00-00",
            "billing_period_end_date": "0000-00-00",
            "ppa_ex_ind": "",
            "fastpay": "",
            "partner_grant_nbr": "",
            "budget_period": "",
            "partner_budget_period": "",
            "partner_fund": "",
            "itemno_tax": 0,
            "payment_type": "",
            "expense_type": "",
            "program_profile": "",
            "material_long": "",
            "housebankid": "",
            "housebankacctid": "",
            "person_no": 0,
            "acrobj_type": "",
            "acrobj_id": "",
            "acrsubobj_id": "",
            "acritem_type": "",
            "valobjtype": "",
            "valobj_id": "",
            "valsubobj_id": ""
        }
    ],
    "accountreceivable": [],
    "accountpayable": [],
    "accounttax": [],
    "currencyamount": [
        {
            "itemno_acc": 1,
            "curr_type": "00",
            "currency": "CNY",
            "currency_iso": "",
            "amt_doccur": 100.0000,
            "exch_rate": 0,
            "exch_rate_v": 0,
            "amt_base": 0,
            "disc_base": 0,
            "disc_amt": 0,
            "tax_amt": 0,
            "amt_doccur_long": 0,
            "amt_base_long": 0,
            "disc_base_long": 0,
            "disc_amt_long": 0,
            "tax_amt_long": 0
        },
        {
            "itemno_acc": 2,
            "curr_type": "00",
            "currency": "CNY",
            "currency_iso": "",
            "amt_doccur": -100.0000,
            "exch_rate": 0,
            "exch_rate_v": 0,
            "amt_base": 0,
            "disc_base": 0,
            "disc_amt": 0,
            "tax_amt": 0,
            "amt_doccur_long": 0,
            "amt_base_long": 0,
            "disc_base_long": 0,
            "disc_amt_long": 0,
            "tax_amt_long": 0
        }
    ],
    "criteria": [],
    "valuefield": [],
    "extension1": [],
    "return": [],
    "paymentcard": [],
    "contractitem": [],
    "extension2": [
        {
            "structure": "ZSENBSEG",
            "valuepart1": "000000000140      字段一       字段二       字段三       字段四       字段五",
            "valuepart2": "",
            "valuepart3": "",
            "valuepart4": ""
        },
        {
            "structure": "ZSENBSEG",
            "valuepart1": "000000000250      字段一       字段二       字段三       字段四       字段五",
            "valuepart2": "",
            "valuepart3": "",
            "valuepart4": ""
        }
    ],
    "realestate": [],
    "accountwt": []
}
View Code

测试的报文是由ABAP测试生成而来:

*&---------------------------------------------------------------------*
*& Report Z3426008A
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT z3426008a.
DATA:ls_header TYPE bapiache09,
     lv_key    TYPE bapiache09-obj_key,
     lv_msg    TYPE string,
     ls_struct TYPE zsenbseg,
     lv_posnr  TYPE i.
DATA:lt_gl TYPE bapiacgl09 OCCURS 0 WITH HEADER LINE,
     lt_cr TYPE bapiaccr09 OCCURS 0 WITH HEADER LINE,
     lt_ex TYPE bapiparex OCCURS 0 WITH HEADER LINE,
     lt_rt TYPE bapiret2 OCCURS 0 WITH HEADER LINE.

*参考会计凭证 100000006 F011 2021
ls_header-header_txt = '抬头文本'.
ls_header-comp_code = '1710'.
ls_header-doc_type = 'SA'.
*ls_header-obj_type = 'BKPF'.
ls_header-username = sy-uname.
ls_header-doc_date = sy-datum.
ls_header-pstng_date = sy-datum.
ls_header-fisc_year = sy-datum+0(4).
ls_header-fis_period = sy-datum+4(2).
ls_header-ref_doc_no = '参照字段'.

lv_posnr = lv_posnr + 1.
lt_gl-itemno_acc = lv_posnr.
lt_gl-gl_account = '0012121000'.
lt_gl-value_date = sy-datum.
APPEND lt_gl.

lt_cr-itemno_acc = lv_posnr.             " 会计凭证行项目编号
lt_cr-curr_type  = '00'.          " 货币和评估视图
lt_cr-currency   = 'CNY'.         " 货币码
lt_cr-amt_doccur = '100'.
APPEND lt_cr.

ls_struct-posnr = lv_posnr.
ls_struct-bschl = '40'.
ls_struct-rstgr = ''.
ls_struct-zzfield1 = '字段一'.
ls_struct-zzfield2 = '字段二'.
ls_struct-zzfield3 = '字段三'.
ls_struct-zzfield4 = '字段四'.
ls_struct-zzfield5 = '字段五'.
lt_ex-structure = 'ZSENBSEG'.
lt_ex-valuepart1 = ls_struct.
APPEND lt_ex.

lv_posnr = lv_posnr + 1.
lt_gl-itemno_acc = lv_posnr.
lt_gl-gl_account = '0012401100'.
lt_gl-value_date = sy-datum.
APPEND lt_gl.

lt_cr-itemno_acc = lv_posnr.      " 会计凭证行项目编号
lt_cr-curr_type  = '00'.          " 货币和评估视图
lt_cr-currency   = 'CNY'.         " 货币码
lt_cr-amt_doccur = '-100'.
APPEND lt_cr.

ls_struct-posnr = lv_posnr.
ls_struct-bschl = '50'.
ls_struct-rstgr = ''.
ls_struct-zzfield1 = '字段一'.
ls_struct-zzfield2 = '字段二'.
ls_struct-zzfield3 = '字段三'.
ls_struct-zzfield4 = '字段四'.
ls_struct-zzfield5 = '字段五'.
lt_ex-structure = 'ZSENBSEG'.
lt_ex-valuepart1 = ls_struct.
APPEND lt_ex.

DATA:BEGIN OF ls_request,
       documentheader    LIKE bapiache09,
       customercpd       LIKE bapiacpa09,
       contractheader    LIKE bapiaccahd,
       accountgl         LIKE TABLE OF bapiacgl09,
       accountreceivable LIKE TABLE OF bapiacar09,
       accountpayable    LIKE TABLE OF bapiacap09,
       accounttax        LIKE TABLE OF bapiactx09,
       currencyamount    LIKE TABLE OF bapiaccr09,
       criteria          LIKE TABLE OF bapiackec9,
       valuefield        LIKE TABLE OF bapiackev9,
       extension1        LIKE TABLE OF bapiacextc,
       return            LIKE TABLE OF bapiret2,
       paymentcard       LIKE TABLE OF bapiacpc09,
       contractitem      LIKE TABLE OF bapiaccait,
       extension2        LIKE TABLE OF bapiparex,
       realestate        LIKE TABLE OF bapiacre09,
       accountwt         LIKE TABLE OF bapiacwt09,
     END OF ls_request.

DATA:BEGIN OF ls_response,
       obj_type          LIKE  bapiache09-obj_type,
       obj_key           LIKE  bapiache09-obj_key,
       obj_sys           LIKE  bapiache09-obj_sys,
       accountgl         LIKE TABLE OF bapiacgl09,
       accountreceivable LIKE TABLE OF bapiacar09,
       accountpayable    LIKE TABLE OF bapiacap09,
       accounttax        LIKE TABLE OF bapiactx09,
       currencyamount    LIKE TABLE OF bapiaccr09,
       criteria          LIKE TABLE OF bapiackec9,
       valuefield        LIKE TABLE OF bapiackev9,
       extension1        LIKE TABLE OF bapiacextc,
       return            LIKE TABLE OF bapiret2,
       paymentcard       LIKE TABLE OF bapiacpc09,
       contractitem      LIKE TABLE OF bapiaccait,
       extension2        LIKE TABLE OF bapiparex,
       realestate        LIKE TABLE OF bapiacre09,
       accountwt         LIKE TABLE OF bapiacwt09,
     END OF ls_response.

ls_request-documentheader   = ls_header.
ls_request-accountgl[]      = lt_gl[].
ls_request-currencyamount[] = lt_cr[].
ls_request-extension2[]     = lt_ex[].

DATA:lv_fname    TYPE string,
     lv_request  TYPE string,
     lv_response TYPE string.

lv_fname = `BAPI_ACC_DOCUMENT_POST`.
lv_request  = /ui2/cl_json=>serialize( data = ls_request compress = abap_false pretty_name = 'L' ).
PERFORM frm_call_function USING lv_fname lv_request CHANGING lv_response.
/ui2/cl_json=>deserialize( EXPORTING json = lv_response pretty_name = 'X' CHANGING data = ls_response ).

FORM frm_call_function USING iv_fname TYPE string
                             iv_request TYPE string
                    CHANGING ov_response TYPE string.
  DATA:lv_url      TYPE string,
       lv_hostname TYPE string,
       lv_port     TYPE string.

  CALL FUNCTION 'TH_GET_VIRT_HOST_DATA'
    EXPORTING
      protocol = 0
      virt_idx = 0
    IMPORTING
      hostname = lv_hostname
      port     = lv_port.

  lv_url = 'http://' && lv_hostname && ':' && lv_port && '/abapapi/' && iv_fname.
  CALL METHOD cl_http_client=>create_by_url
    EXPORTING
      url                = lv_url
    IMPORTING
      client             = DATA(lo_http_client)
    EXCEPTIONS
      argument_not_found = 1
      plugin_not_active  = 2
      internal_error     = 3
      OTHERS             = 4.

  lo_http_client->propertytype_logon_popup = lo_http_client->co_disabled.
  lo_http_client->authenticate( EXPORTING username = CONV string( 'HTTP_USER' ) password = CONV string( '123qazQAZ' ) ).
  "lo_http_client->request->set_content_type( content_type = 'application/json; charset=utf-8' ).
  lo_http_client->request->set_method( if_http_request=>co_request_method_post ).
  lo_http_client->request->set_header_field( name = if_http_header_fields=>content_type value = 'application/json; charset=utf-8' ).
  lo_http_client->request->set_cdata( data   = iv_request offset = 0 length = strlen( iv_request ) ).
  lo_http_client->send(  EXCEPTIONS http_communication_failure = 1 http_invalid_state = 2 ).
  lo_http_client->receive( EXCEPTIONS http_communication_failure = 1 http_invalid_state  = 2 http_processing_failed = 3 ).
  lo_http_client->get_last_error( IMPORTING message = DATA(lv_message) code = DATA(lv_code) ).
  ov_response = lo_http_client->response->get_cdata( ).
  lo_http_client->close( ).
ENDFORM.
View Code

也可以使用APIFOX调用参数结构来生成测试报文的字段样例:

 自动生成的报文结构

  1 {
  2     "DOCUMENTHEADER": {
  3         "OBJ_TYPE": "",
  4         "OBJ_KEY": "",
  5         "OBJ_SYS": "",
  6         "BUS_ACT": "",
  7         "USERNAME": "",
  8         "HEADER_TXT": "",
  9         "COMP_CODE": "",
 10         "DOC_DATE": "",
 11         "PSTNG_DATE": "",
 12         "TRANS_DATE": "",
 13         "FISC_YEAR": "",
 14         "FIS_PERIOD": "",
 15         "DOC_TYPE": "",
 16         "REF_DOC_NO": "",
 17         "AC_DOC_NO": "",
 18         "OBJ_KEY_R": "",
 19         "REASON_REV": "",
 20         "COMPO_ACC": "",
 21         "REF_DOC_NO_LONG": "",
 22         "ACC_PRINCIPLE": "",
 23         "NEG_POSTNG": "",
 24         "OBJ_KEY_INV": "",
 25         "BILL_CATEGORY": "",
 26         "VATDATE": "",
 27         "INVOICE_REC_DATE": "",
 28         "ECS_ENV": "",
 29         "PARTIAL_REV": "",
 30         "DOC_STATUS": ""
 31     },
 32     "CUSTOMERCPD": {
 33         "NAME": "",
 34         "NAME_2": "",
 35         "NAME_3": "",
 36         "NAME_4": "",
 37         "POSTL_CODE": "",
 38         "CITY": "",
 39         "COUNTRY": "",
 40         "COUNTRY_ISO": "",
 41         "STREET": "",
 42         "PO_BOX": "",
 43         "POBX_PCD": "",
 44         "POBK_CURAC": "",
 45         "BANK_ACCT": "",
 46         "BANK_NO": "",
 47         "BANK_CTRY": "",
 48         "BANK_CTRY_ISO": "",
 49         "TAX_NO_1": "",
 50         "TAX_NO_2": "",
 51         "TAX": "",
 52         "EQUAL_TAX": "",
 53         "REGION": "",
 54         "CTRL_KEY": "",
 55         "INSTR_KEY": "",
 56         "DME_IND": "",
 57         "LANGU_ISO": "",
 58         "IBAN": "",
 59         "SWIFT_CODE": "",
 60         "TAX_NO_3": "",
 61         "TAX_NO_4": "",
 62         "TITLE": "",
 63         "TAX_NO_5": ""
 64     },
 65     "CONTRACTHEADER": {
 66         "DOC_NO": "",
 67         "DOC_TYPE_CA": "",
 68         "RES_KEY": "",
 69         "FIKEY": "",
 70         "PAYMENT_FORM_REF": ""
 71     },
 72     "ACCOUNTGL": [
 73         {
 74             "ITEMNO_ACC": "",
 75             "GL_ACCOUNT": "",
 76             "ITEM_TEXT": "",
 77             "STAT_CON": "",
 78             "LOG_PROC": "",
 79             "AC_DOC_NO": "",
 80             "REF_KEY_1": "",
 81             "REF_KEY_2": "",
 82             "REF_KEY_3": "",
 83             "ACCT_KEY": "",
 84             "ACCT_TYPE": "",
 85             "DOC_TYPE": "",
 86             "COMP_CODE": "",
 87             "BUS_AREA": "",
 88             "FUNC_AREA": "",
 89             "PLANT": "",
 90             "FIS_PERIOD": "",
 91             "FISC_YEAR": "",
 92             "PSTNG_DATE": "",
 93             "VALUE_DATE": "",
 94             "FM_AREA": "",
 95             "CUSTOMER": "",
 96             "CSHDIS_IND": "",
 97             "VENDOR_NO": "",
 98             "ALLOC_NMBR": "",
 99             "TAX_CODE": "",
100             "TAXJURCODE": "",
101             "EXT_OBJECT_ID": "",
102             "BUS_SCENARIO": "",
103             "COSTOBJECT": "",
104             "COSTCENTER": "",
105             "ACTTYPE": "",
106             "PROFIT_CTR": "",
107             "PART_PRCTR": "",
108             "NETWORK": "",
109             "WBS_ELEMENT": "",
110             "ORDERID": "",
111             "ORDER_ITNO": "",
112             "ROUTING_NO": "",
113             "ACTIVITY": "",
114             "COND_TYPE": "",
115             "COND_COUNT": "",
116             "COND_ST_NO": "",
117             "FUND": "",
118             "FUNDS_CTR": "",
119             "CMMT_ITEM": "",
120             "CO_BUSPROC": "",
121             "ASSET_NO": "",
122             "SUB_NUMBER": "",
123             "BILL_TYPE": "",
124             "SALES_ORD": "",
125             "S_ORD_ITEM": "",
126             "DISTR_CHAN": "",
127             "DIVISION": "",
128             "SALESORG": "",
129             "SALES_GRP": "",
130             "SALES_OFF": "",
131             "SOLD_TO": "",
132             "DE_CRE_IND": "",
133             "P_EL_PRCTR": "",
134             "XMFRW": "",
135             "QUANTITY": "",
136             "BASE_UOM": "",
137             "BASE_UOM_ISO": "",
138             "INV_QTY": "",
139             "INV_QTY_SU": "",
140             "SALES_UNIT": "",
141             "SALES_UNIT_ISO": "",
142             "PO_PR_QNT": "",
143             "PO_PR_UOM": "",
144             "PO_PR_UOM_ISO": "",
145             "ENTRY_QNT": "",
146             "ENTRY_UOM": "",
147             "ENTRY_UOM_ISO": "",
148             "VOLUME": "",
149             "VOLUMEUNIT": "",
150             "VOLUMEUNIT_ISO": "",
151             "GROSS_WT": "",
152             "NET_WEIGHT": "",
153             "UNIT_OF_WT": "",
154             "UNIT_OF_WT_ISO": "",
155             "ITEM_CAT": "",
156             "MATERIAL": "",
157             "MATL_TYPE": "",
158             "MVT_IND": "",
159             "REVAL_IND": "",
160             "ORIG_GROUP": "",
161             "ORIG_MAT": "",
162             "SERIAL_NO": "",
163             "PART_ACCT": "",
164             "TR_PART_BA": "",
165             "TRADE_ID": "",
166             "VAL_AREA": "",
167             "VAL_TYPE": "",
168             "ASVAL_DATE": "",
169             "PO_NUMBER": "",
170             "PO_ITEM": "",
171             "ITM_NUMBER": "",
172             "COND_CATEGORY": "",
173             "FUNC_AREA_LONG": "",
174             "CMMT_ITEM_LONG": "",
175             "GRANT_NBR": "",
176             "CS_TRANS_T": "",
177             "MEASURE": "",
178             "SEGMENT": "",
179             "PARTNER_SEGMENT": "",
180             "RES_DOC": "",
181             "RES_ITEM": "",
182             "BILLING_PERIOD_START_DATE": "",
183             "BILLING_PERIOD_END_DATE": "",
184             "PPA_EX_IND": "",
185             "FASTPAY": "",
186             "PARTNER_GRANT_NBR": "",
187             "BUDGET_PERIOD": "",
188             "PARTNER_BUDGET_PERIOD": "",
189             "PARTNER_FUND": "",
190             "ITEMNO_TAX": "",
191             "PAYMENT_TYPE": "",
192             "EXPENSE_TYPE": "",
193             "PROGRAM_PROFILE": "",
194             "MATERIAL_LONG": "",
195             "HOUSEBANKID": "",
196             "HOUSEBANKACCTID": "",
197             "PERSON_NO": "",
198             "ACROBJ_TYPE": "",
199             "ACROBJ_ID": "",
200             "ACRSUBOBJ_ID": "",
201             "ACRITEM_TYPE": "",
202             "VALOBJTYPE": "",
203             "VALOBJ_ID": "",
204             "VALSUBOBJ_ID": ""
205         }
206     ],
207     "ACCOUNTRECEIVABLE": [
208         {
209             "ITEMNO_ACC": "",
210             "CUSTOMER": "",
211             "GL_ACCOUNT": "",
212             "REF_KEY_1": "",
213             "REF_KEY_2": "",
214             "REF_KEY_3": "",
215             "COMP_CODE": "",
216             "BUS_AREA": "",
217             "PMNTTRMS": "",
218             "BLINE_DATE": "",
219             "DSCT_DAYS1": "",
220             "DSCT_DAYS2": "",
221             "NETTERMS": "",
222             "DSCT_PCT1": "",
223             "DSCT_PCT2": "",
224             "PYMT_METH": "",
225             "PMTMTHSUPL": "",
226             "PAYMT_REF": "",
227             "DUNN_KEY": "",
228             "DUNN_BLOCK": "",
229             "PMNT_BLOCK": "",
230             "VAT_REG_NO": "",
231             "ALLOC_NMBR": "",
232             "ITEM_TEXT": "",
233             "PARTNER_BK": "",
234             "SCBANK_IND": "",
235             "BUSINESSPLACE": "",
236             "SECTIONCODE": "",
237             "BRANCH": "",
238             "PYMT_CUR": "",
239             "PYMT_CUR_ISO": "",
240             "PYMT_AMT": "",
241             "C_CTR_AREA": "",
242             "BANK_ID": "",
243             "SUPCOUNTRY": "",
244             "SUPCOUNTRY_ISO": "",
245             "TAX_CODE": "",
246             "TAXJURCODE": "",
247             "TAX_DATE": "",
248             "SP_GL_IND": "",
249             "PARTNER_GUID": "",
250             "ALT_PAYEE": "",
251             "ALT_PAYEE_BANK": "",
252             "DUNN_AREA": "",
253             "CASE_GUID": "",
254             "PROFIT_CTR": "",
255             "FUND": "",
256             "GRANT_NBR": "",
257             "MEASURE": "",
258             "HOUSEBANKACCTID": "",
259             "RES_DOC": "",
260             "RES_ITEM": "",
261             "FUND_LONG": "",
262             "DISPUTE_IF_TYPE": "",
263             "BUDGET_PERIOD": "",
264             "PAYS_PROV": "",
265             "PAYS_TRAN": "",
266             "SEPA_MANDATE_ID": "",
267             "PART_BUSINESSPLACE": "",
268             "REP_COUNTRY_EU": "",
269             "PYMT_AMT_LONG": ""
270         }
271     ],
272     "ACCOUNTPAYABLE": [
273         {
274             "ITEMNO_ACC": "",
275             "VENDOR_NO": "",
276             "GL_ACCOUNT": "",
277             "REF_KEY_1": "",
278             "REF_KEY_2": "",
279             "REF_KEY_3": "",
280             "COMP_CODE": "",
281             "BUS_AREA": "",
282             "PMNTTRMS": "",
283             "BLINE_DATE": "",
284             "DSCT_DAYS1": "",
285             "DSCT_DAYS2": "",
286             "NETTERMS": "",
287             "DSCT_PCT1": "",
288             "DSCT_PCT2": "",
289             "PYMT_METH": "",
290             "PMTMTHSUPL": "",
291             "PMNT_BLOCK": "",
292             "SCBANK_IND": "",
293             "SUPCOUNTRY": "",
294             "SUPCOUNTRY_ISO": "",
295             "BLLSRV_IND": "",
296             "ALLOC_NMBR": "",
297             "ITEM_TEXT": "",
298             "PO_SUB_NO": "",
299             "PO_CHECKDG": "",
300             "PO_REF_NO": "",
301             "W_TAX_CODE": "",
302             "BUSINESSPLACE": "",
303             "SECTIONCODE": "",
304             "INSTR1": "",
305             "INSTR2": "",
306             "INSTR3": "",
307             "INSTR4": "",
308             "BRANCH": "",
309             "PYMT_CUR": "",
310             "PYMT_AMT": "",
311             "PYMT_CUR_ISO": "",
312             "SP_GL_IND": "",
313             "TAX_CODE": "",
314             "TAX_DATE": "",
315             "TAXJURCODE": "",
316             "ALT_PAYEE": "",
317             "ALT_PAYEE_BANK": "",
318             "PARTNER_BK": "",
319             "BANK_ID": "",
320             "PARTNER_GUID": "",
321             "PROFIT_CTR": "",
322             "FUND": "",
323             "GRANT_NBR": "",
324             "MEASURE": "",
325             "HOUSEBANKACCTID": "",
326             "BUDGET_PERIOD": "",
327             "PPA_EX_IND": "",
328             "PART_BUSINESSPLACE": "",
329             "PAYMT_REF": "",
330             "PYMT_AMT_LONG": ""
331         }
332     ],
333     "ACCOUNTTAX": [
334         {
335             "ITEMNO_ACC": "",
336             "GL_ACCOUNT": "",
337             "COND_KEY": "",
338             "ACCT_KEY": "",
339             "TAX_CODE": "",
340             "TAX_RATE": "",
341             "TAX_DATE": "",
342             "TAXJURCODE": "",
343             "TAXJURCODE_DEEP": "",
344             "TAXJURCODE_LEVEL": "",
345             "ITEMNO_TAX": "",
346             "DIRECT_TAX": ""
347         }
348     ],
349     "CURRENCYAMOUNT": [
350         {
351             "ITEMNO_ACC": "",
352             "CURR_TYPE": "",
353             "CURRENCY": "",
354             "CURRENCY_ISO": "",
355             "AMT_DOCCUR": "",
356             "EXCH_RATE": "",
357             "EXCH_RATE_V": "",
358             "AMT_BASE": "",
359             "DISC_BASE": "",
360             "DISC_AMT": "",
361             "TAX_AMT": "",
362             "AMT_DOCCUR_LONG": "",
363             "AMT_BASE_LONG": "",
364             "DISC_BASE_LONG": "",
365             "DISC_AMT_LONG": "",
366             "TAX_AMT_LONG": ""
367         }
368     ],
369     "CRITERIA": [
370         {
371             "ITEMNO_ACC": "",
372             "FIELDNAME": "",
373             "CHARACTER": "",
374             "PROD_NO_LONG": ""
375         }
376     ],
377     "VALUEFIELD": [
378         {
379             "ITEMNO_ACC": "",
380             "FIELDNAME": "",
381             "CURR_TYPE": "",
382             "CURRENCY": "",
383             "CURRENCY_ISO": "",
384             "AMT_VALCOM": "",
385             "BASE_UOM": "",
386             "BASE_UOM_ISO": "",
387             "QUA_VALCOM": "",
388             "AMT_VALCOM_LONG": ""
389         }
390     ],
391     "EXTENSION1": [
392         {
393             "FIELD1": "",
394             "FIELD2": "",
395             "FIELD3": "",
396             "FIELD4": ""
397         }
398     ],
399     "RETURN": [
400         {
401             "TYPE": "",
402             "ID": "",
403             "NUMBER": "",
404             "MESSAGE": "",
405             "LOG_NO": "",
406             "LOG_MSG_NO": "",
407             "MESSAGE_V1": "",
408             "MESSAGE_V2": "",
409             "MESSAGE_V3": "",
410             "MESSAGE_V4": "",
411             "PARAMETER": "",
412             "ROW": "",
413             "FIELD": "",
414             "SYSTEM": ""
415         }
416     ],
417     "PAYMENTCARD": [
418         {
419             "ITEMNO_ACC": "",
420             "CC_GLACCOUNT": "",
421             "CC_TYPE": "",
422             "CC_NUMBER": "",
423             "CC_SEQ_NO": "",
424             "CC_VALID_F": "",
425             "CC_VALID_T": "",
426             "CC_NAME": "",
427             "DATAORIGIN": "",
428             "AUTHAMOUNT": "",
429             "CURRENCY": "",
430             "CURRENCY_ISO": "",
431             "CC_AUTTH_NO": "",
432             "AUTH_REFNO": "",
433             "AUTH_DATE": "",
434             "AUTH_TIME": "",
435             "MERCHIDCL": "",
436             "POINT_OF_RECEIPT": "",
437             "TERMINAL": "",
438             "CCTYP": "",
439             "AUTHAMOUNT_LONG": ""
440         }
441     ],
442     "CONTRACTITEM": [
443         {
444             "ITEMNO_ACC": "",
445             "CONT_ACCT": "",
446             "MAIN_TRANS": "",
447             "SUB_TRANS": "",
448             "FUNC_AREA": "",
449             "FM_AREA": "",
450             "CMMT_ITEM": "",
451             "FUNDS_CTR": "",
452             "FUND": "",
453             "AGREEMENT_GUID": "",
454             "FUNC_AREA_LONG": "",
455             "CMMT_ITEM_LONG": "",
456             "GRANT_NBR": "",
457             "VTREF": "",
458             "VTREF_GUID": "",
459             "EXT_OBJECT_ID": "",
460             "BUS_SCENARIO": "",
461             "REFERENCE_NO": "",
462             "BUDGET_PERIOD": ""
463         }
464     ],
465     "EXTENSION2": [
466         {
467             "STRUCTURE": "",
468             "VALUEPART1": "",
469             "VALUEPART2": "",
470             "VALUEPART3": "",
471             "VALUEPART4": ""
472         }
473     ],
474     "REALESTATE": [
475         {
476             "ITEMNO_ACC": "",
477             "BUSINESS_ENTITY": "",
478             "BUILDING": "",
479             "PROPERTY": "",
480             "RENTAL_OBJECT": "",
481             "SERV_CHARGE_KEY": "",
482             "SETTLEMENT_UNIT": "",
483             "CONTRACT_NO": "",
484             "FLOW_TYPE": "",
485             "CORR_ITEM": "",
486             "REF_DATE": "",
487             "OPTION_RATE": ""
488         }
489     ],
490     "ACCOUNTWT": [
491         {
492             "ITEMNO_ACC": "",
493             "WT_TYPE": "",
494             "WT_CODE": "",
495             "BAS_AMT_LC": "",
496             "BAS_AMT_TC": "",
497             "BAS_AMT_L2": "",
498             "BAS_AMT_L3": "",
499             "MAN_AMT_LC": "",
500             "MAN_AMT_TC": "",
501             "MAN_AMT_L2": "",
502             "MAN_AMT_L3": "",
503             "AWH_AMT_LC": "",
504             "AWH_AMT_TC": "",
505             "AWH_AMT_L2": "",
506             "AWH_AMT_L3": "",
507             "BAS_AMT_IND": "",
508             "MAN_AMT_IND": "",
509             "BAS_AMT_LC_LONG": "",
510             "BAS_AMT_TC_LONG": "",
511             "BAS_AMT_L2_LONG": "",
512             "BAS_AMT_L3_LONG": "",
513             "MAN_AMT_LC_LONG": "",
514             "MAN_AMT_TC_LONG": "",
515             "MAN_AMT_L2_LONG": "",
516             "MAN_AMT_L3_LONG": "",
517             "AWH_AMT_LC_LONG": "",
518             "AWH_AMT_TC_LONG": "",
519             "AWH_AMT_L2_LONG": "",
520             "AWH_AMT_L3_LONG": ""
521         }
522     ]
523 }
View Code

9.2在header页签输入参数:Commit,值为X,目的是提交数据

 

9.3,在左上角切换环境进行发送测试,如有COOKie干扰测试,可以删除COOKie,点击发送并保存

 

10已经成功生成会计凭证

 11.进到SAP系统,使用事务码FB03查看该会计凭证

 

12.同理也可以调用其他SAP提供的函数或者自开发的函数

13.点击左下角的“文档模式”,切换编辑模式,将测试的报文进行修改,按项目要求生成对方能够理解的接口定义书

 14.点击修改文档页签,点击“JSON/XML智能识别、快捷导入”按钮,将测试报文粘贴后,会自动转成测试的结构对象,按转义将项目要求的字段和字段描述加上,用不上的字段可以保留或者剔除

 

15.如果网络涉及到代理和证书,点击右上角设置按钮,可以配置代理和证书