Step by Step for configuration of sending customize IDOC/自定义IDOC发送配置

<div style="width: 600px; max-width: 100%; margin-bottom:5px;"><a href="https://docs.com/gan-gavin/6042/idoc-step-by-step-for-configuration-of-sending" title="自定义IDOC配置/Step by Step for configuration of sending customize IDOC" target="_blank" style="font-family: ‘Segoe UI‘; font-size: 13px; text-decoration: none; margin-left:18px ">自定义IDOC配置/Step by Step for configuration of sending customize IDOC</a><span style="font-family: ‘Segoe UI‘; font-size: 13px ">—</span><a href="https://docs.com/gan-gavin" target="_blank" style="font-family: ‘Segoe UI‘; font-size: 13px; text-decoration: none ">Gan Gavin</a><a style="float: right; margin-bottom:5px; margin-right:18px; font-family: ‘Segoe UI‘; font-size: 13px; text-decoration: none " href="https://docs.com/gan-gavin/6042/idoc-step-by-step-for-configuration-of-sending" target="_blank">Docs.com</a></div><iframe src="https://docs.com/d/embed/D25191387-4972-2481-4090-000002467748%7eMed2b92be-eecb-8771-95eb-bbcc19ea8b58" frameborder="0" scrolling="no" width="600px" height="812px" style="max-width:100%" allowfullscreen="False"></iframe>

Step by Step for configuration of sending customize IDOC

  1. WE31 创建IDOC所包含的字段
  1. WE30 创建IDOC 把Segment分配给IDOC
  1. WE81  创建信息类型
  1. WE82   把IDOC类型与信息类型对应
  1. WE57 Assign Message & Idoc Type to a Function Module for data Process (Optional)
  1. SM59 Define a RFC connection for Idoc transfer
  1. WE21 Define a Port ( Assign a RFC destination which created in SM59 )
  1. WE41/42 Creat Process Code
  1. WE20 Define a Partner Profiles

First create Logical system in SALE

  1. Use program to build and send out IDOC

REPORT  ZTESTFORGG_SENDIDOC.

DATA: head TYPE zgghead,
        item TYPE zggitem,
        char TYPE zggchar.

DATA: control_data LIKE edidc,
        data LIKE edidd OCCURS 0 WITH HEADER LINE,
        communication LIKE edidc OCCURS 0 WITH HEADER LINE.

*  Master idoc control record
  control_data-rcvprt = ‘LS‘.
  control_data-rcvprn = ‘ZGG_OUT_LS‘.
  control_data-rcvpor = ‘ZGG_OUT‘.
  control_data-idoctp = ‘ZGGIDOC‘.
  control_data-mestyp = ‘ZGGMSG‘.
*   master idoc data records

head-f1 = ‘Header‘.
  data-segnam = ‘ZGGHEAD‘.
  data-sdata = head.
  append data.

item-if1 = ‘Item1‘.
  data-segnam = ‘ZGGITEM‘.
  data-sdata = item.
  APPEND data.

char-cf1 = ‘Char1‘.
  data-segnam = ‘ZGGCHAR‘.
  data-sdata = char.
  APPEND data.

item-if1 = ‘Item2‘.
  data-segnam = ‘ZGGITEM‘.
  data-sdata = item.
  APPEND data.

char-cf1 = ‘Char21‘.
  data-segnam = ‘ZGGCHAR‘.
  data-sdata = char.
  APPEND data.

char-cf1 = ‘Char22‘.
  data-segnam = ‘ZGGCHAR‘.
  data-sdata = char.
  APPEND data.

item-if1 = ‘Item3‘.
  data-segnam = ‘ZGGITEM‘.
  data-sdata = item.
  APPEND data.

CALL FUNCTION ‘MASTER_IDOC_DISTRIBUTE‘
    EXPORTING
      master_idoc_control = control_data
    TABLES
      communication_idoc_control = communication
      master_idoc_data = data.
  IF sy-subrc = 0.
    COMMIT WORK.
  ENDIF.

  1. WE02 to Check result
  1. Use program RSEOUT00 (usually set up as job) to
    send to external system

Part II: Configuration for inbound IDOC

  1. BD64 to create distribution model (Optional)
  1. BD51 to maintain the characteristic of Inbound
    processing function module

First create a FM with fix
parameters (creation with referring to FM IDOC_INPUT_MATMAS01)

  1. WE57 to mapping the Inbound processing function
    module with message type
  1. WE42 to Create inbound process code
  1. WE20 to add the inbound message into logical
    system

手工处理inbound IDOC:BD87, 程序:RBDAPP01(BD20,可用于schedule一个job)RBDMANI2

Test inbound processing

Create a table to store the inbound IDOC data

BD87 to process inbound IDOC

Recipient中的Port要维护成WE20里面Message对应的LS

Check the data in table

Inbound processing function module:

FUNCTION zggmsg_in_proc.
*"----------------------------------------------------------------------
*"*"Global Interface:
*"  IMPORTING
*"     VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
*"     VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
*"     VALUE(NO_APPLICATION_LOG) LIKE  SY-DATAR OPTIONAL
*"     VALUE(MASSSAVEINFOS) LIKE  MASSSAVINF STRUCTURE  MASSSAVINF
*"       OPTIONAL
*"  EXPORTING
*"     VALUE(WORKFLOW_RESULT) LIKE  BDWF_PARAM-RESULT
*"     VALUE(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_INFO STRUCTURE  BDI_SER
*"  EXCEPTIONS
*"      WRONG_FUNCTION_CALLED
*"----------------------------------------------------------------------
  DATA: wa_idoc_control   TYPE          edidc,
        wa_idoc_data      TYPE          edidd,
        gv_time           TYPE          sy-uzeit,
        gv_index          TYPE          i,
        gv_appt_ser       TYPE          string.
  DATA: lt_zggmsg         TYPE STANDARD TABLE OF zggmsg,
        lw_zggmsg         TYPE zggmsg,
        lv_key1           TYPE timestampl,
        lv_key            TYPE timestamp.
  IF idoc_contrl-mestyp = ‘ZGGMSG‘.
    "check if it is the right message type
****for inbound IDoc receive, you can‘t delete this block of code, otherwise the inbound IDoc will be error
    READ TABLE idoc_contrl INDEX 1.
    "/h
    IF sy-subrc = 0.
      idoc_status-docnum = idoc_contrl-docnum.
      idoc_status-status = ‘53‘.
      idoc_status-msgty = ‘S‘.
      idoc_status-msgid = ‘00‘.
      idoc_status-msgno = ‘001‘.
      idoc_status-msgv1 = ‘This is ‘.
      idoc_status-msgv2 = ‘a message ‘.
      idoc_status-msgv3 = ‘from ‘.
      idoc_status-msgv4 = ‘Gavin‘.
    ELSE.
      idoc_status-docnum = idoc_contrl-docnum."/h
      idoc_status-status = ‘51‘.
    ENDIF.
    APPEND idoc_status.
****for inbound IDoc receive, you can‘t delete this block of code, otherwise the inbound IDoc will be error
    CLEAR gv_index.
    LOOP AT idoc_data WHERE segnam = ‘ZGGCHAR‘.
      gv_index = gv_index + 1.
      GET TIME STAMP FIELD lv_key.
      GET TIME STAMP FIELD lv_key1.
      lw_zggmsg-cdate = lv_key.
      lw_zggmsg-seqnum = gv_index.
      lw_zggmsg-cf1 = idoc_data-sdata.
      READ TABLE idoc_data WITH KEY segnum = idoc_data-psgnum.
      IF sy-subrc = 0.
        lw_zggmsg-if1 = idoc_data-sdata.
        READ TABLE idoc_data WITH KEY segnum = idoc_data-psgnum.
        IF sy-subrc = 0.
          lw_zggmsg-f1 = idoc_data-sdata.
        ENDIF.
      ENDIF.

APPEND lw_zggmsg TO lt_zggmsg.
      CLEAR lw_zggmsg.

ENDLOOP.

ENDIF.

IF lt_zggmsg IS NOT INITIAL.
    MODIFY zggmsg FROM TABLE lt_zggmsg.
    COMMIT WORK AND WAIT.
  ENDIF.

ENDFUNCTION.

Some related link:

http://docs.oracle.com/cd/B14099_19/integrate.1012/b14061/processing.htm

http://blog.csdn.net/hackai886/article/details/7930052

Some more testing:

If change the RFC connection to another client

Send IDOC out from 781, and firstly in 782 it will get
error:

Add parameters in WE20 (first need to maintain WE42)

BD87 reprocess the IDOC

Check in table

时间: 2024-08-13 07:54:49

Step by Step for configuration of sending customize IDOC/自定义IDOC发送配置的相关文章

Linux Booting Process: A step by step tutorial for understanding Linux boot sequence

One of the most remarkable achievement in the history of mankind is computers. Another amazing fact about this remarkable achievement called computers is that its a collection of different electronic components, and they work together in coordination

Step by step Install a Local Report Server and Remote Report Server Database

原创地址:http://www.cnblogs.com/jfzhu/p/4012097.html 转载请注明出处 前面的文章<Step by step SQL Server 2012的安装 >中,介绍过如何安装SQL Server 2012,其中的Database Engine Services和Reporting Services - Native安装在了同一台服务器上,但是为了提高性能,我们可以将Database Engine与Reporting Service分别安装在不同的服务器上.

Step by Step Guide: How to Configure SSL/TLS on ORACLE RAC (with SCAN) (Doc ID 1448841.1)

In this Document   Goal   Solution   References Applies to: Advanced Networking Option - Version 11.2.0.2 to 12.2.0.1 [Release 11.2 to 12.2]Oracle Net Services - Version 12.2.1.2.0 to 12.2.1.2.0 [Release 12.2]Information in this document applies to a

数论之高次同余方程(Baby Step Giant Step + 拓展BSGS)

什么叫高次同余方程?说白了就是解决这样一个问题: A^x=B(mod C),求最小的x值. baby step giant step算法 题目条件:C是素数(事实上,A与C互质就可以.为什么?在BSGS算法中是要求a^m在%c条件下的逆元的,如果a.c不互质根本就没有逆元.) 如果x有解,那么0<=x<C,为什么? 我们可以回忆一下欧拉定理: 对于c是素数的情况,φ(c)=c-1 那么既然我们知道a^0=1,a^φ(c)=1(在%c的条件下).那么0~φ(c)必定是一个循环节(不一定是最小的)

Git Step by Step – (8) Git的merge和rebase

前面一篇文章中提到了"git pull"等价于"git fetch"加上"git merge",然后还提到了pull命令支持rebase模式,这篇文章就介绍一下merge和rebase之间有什么差别. 由于我们主要是想看看merge跟rebase之间的区别,这里就是用本地仓库的分支进行演示了. merge 其实在介绍分支的那篇文章中已经介绍过了一些分支merge的内容,这里就进行一些补充和总结. 下面我们基于本地一个仓库开始介绍,当前仓库的分支情

C# 2012 step by step 学习笔记8 CHAPTER 9 Creating Value types with enumerations and Structures

C# 2012 step by step 学习笔记8 CHAPTER 9 Creating Value types with enumerations and Structures things about 1. Declare an enumeration type. 2. Create and use an enumeration type. 3. Declare a structure type. 4. Create and use a structure type. 5. Explain

C++开发WPF,Step by Step

示例代码 使用C++来开发WPF,主要是如何在MFC(Win32)的窗口中Host WPF的Page.下面我就做个详细的介绍. 一.创建工程, 由于MFC的Wizard会生成很多用不到的代码,所以我准备从一个空的工程开始创建一个MFC的工程. a)         打开VS2005,菜单File->New->Projects-, 左面选择Visual C++->Win32,右面选择Win32 Console Application,给工程起个名字CPlusPlus_WPF, Ok进入下一

数据库设计 Step by Step (1)——扬帆启航

引言:一直在从事数据库开发和设计工作,也看了一些书籍,算是略有心得.很久之前就想针 对关系数据库设计进行整理.总结,但因为种种原因迟迟没有动手,主要还是惰性使然.今天也算是痛下决心开始这项卓绝又令我兴奋的工作.这将是一个系列的文 章,我将以讲座式的口吻展开讨论(个人偷懒,这里的总结直接拿去公司培训新人用). 系列的第一讲我们先来回答下面几个问题 数据库是大楼的根基 大多数程序员都很急切,在了解基本需求之后希望很快的进入到编码阶段(可能只有产出代码才能反映工作量),对于数据库设计思考得比较少. 这

数据库设计 Step by Step (2)——数据库生命周期

引言:数据库设计 Step by Step (1)得到这么多朋友的关注着实出乎了我的意外.这也坚定了我把这一系列的博文写好的决心.近来工作上的事务比较繁重,加之我期望这个系列的文章能尽可能的系统.完整,需要花很多时间整理.思考数据库设计的各种资料,所以文章的更新速度可能会慢一些,也希望大家能够谅解. 系列的第二讲我们将站在高处俯瞰一下数据库的生命周期,了解数据库设计的整体流程 数据库生命周期 大家对软件生命周期较为熟悉,数据库也有其生命周期,如下图所示. 图(1)数据库生命周期 数据库的生命周期