2、---*"*"Local interface:*" TABLES*" ZMKPF TYPE ZMKPF_TYP*" EXCEPTIONS*" NO_IDOC*" NO_MODEL*"----------------------------------------------------------------------*variables of general interest DATA:*control record for the IDoc id
3、oc_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
4、 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 ZMKPF_line,
5、* data to be put to the control record c_message_type LIKE edidc-mestyp VALUE 'ZMKPF_IDOC', c_base_idoc_type LIKE edidc-idoctp VALUE 'ZMKPF_IDOC',* segment types to be put to the data record table c_header_segtyp LIKE edi
6、dd-segnam VALUE 'ZMKPF'.* 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_SYSTE
7、M = ' '* 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 me
8、ssage flow maintained in the model, nothing to do EXIT. ENDIF.* put the application header record to the IDoc LOOP AT zmkpf. MOVE-CORRESPONDING zmkpf TO e1xmkal.* append record to IDoc data table t_idoc_data-segnam =