IDOC配备手册
作为目前ERP市场上最为领先旳应用系统之一,始终以来,SAP R/3在提供API应用编程接口和接口工具方面也同样领先于其他ERP厂商。ALE/IDocs是SAP公司为SAP R/3 ,目定义消息类型MKAL_IDOC。
把基本类型ZMKAL_IDOC分派给消息类型MKAL_IDOC。
。
表构造,ZMKAL_TYP,相应行类型构造为ZMKAL_LINE
:ZMKAL_IDOC_SEND,
源代码如下,参数、异常定义见函数开头阐明
FUNCTION zmkal_idoc_send .
*"----------------------------------------------------------------------
*"*"Local interface:
*" TABLES
*" ZMKAL TYPE ZMKAL_TYP
*" EXCEPTIONS
*" NO_IDOC
*" NO_MODEL
*"----------------------------------------------------------------------
*variables of general interest
DATA:
*control record for the IDoc
idoc_control LIKE edidc,
*data records for the IDoc
t_idoc_data LIKE edidd OCCURS 0 WITH HEADER LINE,
*table for the IDocs created by MASTER_IDOC_CONTROL
t_comm_control LIKE edidc OCCURS 0 WITH HEADER LINE,
*partner type for logical system
c_partner_type_logical_system LIKE edidc-rcvprt,
*help variable for the check if an IDoc has to be created
h_create_idoc.
* variables specific for this example
DATA:
* field strings with IDoc segment structure
e1xmkal TYPE zmkal_line,
* data to be put to the control record
c_message_type LIKE edidc-mestyp VALUE 'ZMKAL_IDOC',
c_base_idoc_type LIKE edidc-idoctp VALUE 'ZMKAL_IDOC',
* segment types to be put to the data record table
c_header_segtyp LIKE edidd-segnam VALUE 'ZMKAL'.
* check if an IDoc has to be created, read the distribution model
CALL FUNCTION 'ALE_MODEL_DETERMINE_IF_TO_SEND'
EXPORTING
message_type = c_message_type
* SENDING_SYSTEM = ' '
* RECEIVING_SYSTEM = ' '
* VALIDDATE = SY-DATUM
IMPORTING
idoc_must_be_sent = h_create_idoc.
* exceptions
* own_system_not_defined = 1
* others = 2.
IF h_create_idoc IS INITIAL.
raise no_model.
* no message flow maintain
IDOC配置手册 来自淘豆网m.daumloan.com转载请标明出处.