1、 Idoc Type to a Function Module for Process第六步:SM59 Define a RFC connection for Idoc transfer 第七步:WE21 Define a Port ( Assign a RFC destination which created in SM59 ) 第八步:WE41/42 Creat Process Code第九步:WE20 Define a Partner Profiles( Also creat a Outbound parameters with Port, or Inbound parameters
2、with Process code )管理IDOC:WE02显示IDOC,可以根据时间,IDOC类型查找IDOC,查看成功,出错信息。WE46IDOC管理(出入)WE60IDOC类型文档(可以查看IDOC结构,和每个字段的描述. WE19 根据IDOC号进行IDOC处理,可以修改IDOC值进行补发动作,处理分为内向和外向。消息配置:WE20 配置伙伴消息进和出IDOC类型WE21 配置伙伴。以下操作在发送方:1.创建IDOC类型的段(WE31)IDOC类型的字段,意思说咱们都要传递那些数据。咱们那个地址只传递3个字段的数据。2.创建IDOC类型,并把段分派给IDOC类型(WE30)新建IDOC
3、类型,点击,将适才创建的段分派给IDOC类型,3.创建消息类型(WE81)消息类型是传递消息的大体单元,所有的消息传递都是通过消息类型来操作的。那个地址咱们只概念消息类型的名称。4.将IDOC类型分派给消息类型(WE82)5.概念RFC连接(SM59)源系统:目标系统:6.概念端口(WE21)那个地址概念目标系统的端口,概念事物性RFC7.保护伙伴参数(WE20)咱们为源系统保护出站参数。第一创建逻辑系统,在SALE中,作为合作伙伴编号以下内容为接收方系统完成:8.依照前面的步骤,在接收方,创建相同的消息类型9.设置入站处置代码(WE42)咱们利用FUNCTION MUDULE来处置数据。需要
4、概念入站处置代码,再分派给进站参数第一创建FM,咱们从标准的IDOC FM “BAPI_IDOC_INPUT1”复制一个咱们自己的,逻辑咱们自己写,只取其参数,代码如下。(具体创建FM的方式略)function zflowtest.*-Local interface: IMPORTING VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC EXPORTING VALUE(WORKFLOW_RESULT) LIKE BDWF_PARAM-RESULT VAL
5、UE(APPLICATION_VARIABLE) LIKE BDWF_PARAM-APPL_VAR VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS TABLES IDOC_CONTRL STRUCTURE EDIDC IDOC_DATA STRUCTURE EDIDD IDOC_STATUS STRUCTURE BDIDOCSTAT RETURN_VARIABLES STRUCTURE BDWFRETVAR SERIALIZATION_
6、INFO STRUCTURE BDI_SER EXCEPTIONS WRONG_FUNCTION_CALLEDdata: gt_zflowdb type zflowdb occurs 0 with header line, gt_zflow type zflow occurs 0 with header line.* SET RETURN_VARIABLES VALUE read table idoc_contrl index 1. return_variables-doc_number = idoc_contrl-docnum. return_variables-wf_param = Pro
7、cessed_IDOCs. append return_variables.* SET IDOC_STATUS VALUE. clear idoc_status. idoc_status-status = 53 idoc_status-docnum = idoc_contrl-docnum. idoc_status-repid = sy-repid. append idoc_status.* READ EDIDD loop at idoc_data. case idoc_data-segnam. when ZFLOW move idoc_data-sdata to gt_zflow. endc
8、ase. append gt_zflow. endloop.* PROCESSING DATA loop at gt_zflow. gt_zflowdb-bukrs = gt_zflow-bukrs. gt_zflowdb-gjahr = gt_zflow-gjahr. gt_zflowdb-wrbtr = gt_zflow-wrbtr. append gt_zflowdb. insert zflowdb from table gt_zflowdb.endfunction.创建同意数据的数据表ZFLOWDB:将刚创建的FM添加到进站函数模块列表中(BD51)下面咱们开始创建进站处置代码:(WE
9、42) 概念逻辑信息:10.分派FM到消息和IDOC类型(WE57)11.保护伙伴参数文件(WE20)12.在发送端效劳器新建一下程序,执行:report ztestidoc . g_idoc_ctl like edidc, g_zflow like zflow. gi_ret_ctl like edidc occurs 0, gi_idoc_data like edidd occurs 0 with header line.* BUILD IDOC_CTL RECORD perform build_idoc_ctl.* BUILD ICOC_SEGMENT DATA perform buil
10、d_idoc_seg.* CALL FUNCTION AND CREATE IDOC perform create_idoc.*&-* Form CREATE_IDOC* text*-* - p1 text* - p2 textform create_idoc. call function MASTER_IDOC_DISTRIBUTE exporting master_idoc_control = g_idoc_ctl* OBJ_TYPE = * CHNUM = tables communication_idoc_control = gi_ret_ctl master_idoc_data =
11、gi_idoc_data* EXCEPTIONS* ERROR_IN_IDOC_CONTROL = 1* ERROR_WRITING_IDOC_STATUS = 2* ERROR_IN_IDOC_DATA = 3* SENDING_LOGICAL_SYSTEM_UNKNOWN = 4* OTHERS = 5 . if sy-subrc 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. else. commit work. endif.endform. CR
12、EATE_IDOC Form BUILD_IDOC_CTL-*form build_idoc_ctl.* TYPE g_idoc_ctl-idoctp = ZFLOWMON. IDOC TYPE g_idoc_ctl-mestyp = ZFLOWMSGMESSAGE TYPE* RECEIVER g_idoc_ctl-rcvprt = LSPARTNER TYPE g_idoc_ctl-rcvprn = B3TCLNT800PARTNER NO* SENDER g_idoc_ctl-sndprt = g_idoc_ctl-sndprn = PIITST100 BUILD_IDOC_CTL Fo
13、rm BUILD_IDOC_SEGform build_idoc_seg.* HEAD DATA gi_idoc_data-segnam = SEGMENT NAME gi_idoc_data-segnum = 1. SEGMENT NO g_zflow-bukrs = 1003 g_zflow-gjahr = 2010 g_zflow-wrbtr = 1000 move g_zflow to gi_idoc_data-sdata. append gi_idoc_data. gi_idoc_data-segnum = 2. 10041001 BUILD_IDOC_SEG通过WE02检查执行结果:发送方:双击各个项目能够看到明细同意方:查询表结果:此刻咱们看到,咱们将数据从一个系统传输到了另一个系统,继而,咱们基于这些数据成立应用。
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1