cancel
Showing results for 
Search instead for 
Did you mean: 

How to build a control record

Former Member
0 Kudos

can anyone tel me how to create a control record and what are the sap tables needed to retrieve the port and partner information from?

&----


*& Form BUILD_CONTROLRECORD

&----


*

  • The IDOC control record contains message type, port and

  • partnerinformation

*----


  • build the EDIDC record

IDOC_CONTROL-MESTYP = C_ZCUSCRT_MES_TYPE.

IDOC_CONTROL-IDOCTP = C_ZCUSCRT_IDOC_TYPE.

IDOC_CONTROL-RCVPRN = TARGET_SYS.

  • confirm partner type

SELECT PARTYP INTO IDOC_CONTROL-RCVPRT FROM EDPP1

WHERE PARNUM = 'ZBIZTALK'.

IF IDOC_CONTROL-RCVPRT = 'LS'.

    • subrc

EXIT.

ENDIF.

ENDSELECT.

ENDFORM. " F_BUILD_CONTROLRECORD

how do i get the port number should i also include sender details

please help urgent

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You do not have to put the Port number if you are sending an IDOC to R/3. That takes care by itself from the Sender Service which inturn uses the logical system name and the port.

SAP tables for IDOC info: EDIDC,edi* in se16 and you should see all the relevant tables.

Thanks

Ashish

Answers (1)

Answers (1)

Former Member
0 Kudos

Partners information can be read from NAST for the given applicaiton, message/output type, object. (KAPPL, KSCHL, OBJKY).

EDIDC will be generated automatically as soon as the Message type is triggered from the document transaction. Example when PO is triggered with output medium "6 EDI" or any other medium, it creates two records depending on the medium fired. In case of medium 6 (which you want to use for pulling IDOCs into XI) it creates an entry in NAST and EDIDC.

Here is something looks like

1.Declare a header table

DATA: IT_CTRL LIKE EDI_DC OCCURS 10 WITH HEADER LINE.

2. Build this table.

*Concatenate SID to form proper header elements

  • Like 'SAPD10' - it_ctrl-rcvpor

CONCATENATE C_SAP SY-SYSID INTO V_RCVPOR.

  • Like 'SAPD10110' - IT_CTRL-rcvprn

CONCATENATE C_SAP SY-SYSID SY-MANDT INTO V_RCVPRN.

  • Build IDOC header. This section will create an EDI_DC *structure needed to build an IDOC.

IT_CTRL-DOCREL = SPACE.

IT_CTRL-DIRECT = V_INBOUND_ID. "direction; 2 = inbound

IT_CTRL-RCVPOR = V_RCVPOR. "receiver port

IT_CTRL-RCVPRT = V_LOGICAL_SYSID. "LS=logical system

IT_CTRL-RCVPRN = V_RCVPRN. "receiving logical system

IT_CTRL-SNDPOR = V_SEND_PORT."mandatory but not validated

IT_CTRL-SNDPRT = V_LOGICAL_SYSID. "LS=logical system

IT_CTRL-SNDPRN = V_LOGICAL_SYS. "sending logical system

IT_CTRL-MESTYP = V_DELVRY_MESTYP."message type

IT_CTRL-IDOCTYP = V_DELVRY_IDOCTYP."idoc type

APPEND IT_CTRL.

This builds the control structure.

Normally R/3 smacks the control record during the data transmission.

XI you can do this by unchecking the "APPLY CONTROL RECORD for IDOC..." for the IDOC comm channel (RECEIVER settings in Integration directory, not sure of terminology) also make sure you disable the EDIDC40 control record in the message map.

Further you have User Exits to use for your purpose.

Ex:

Look for the function module IDOC_OUTPUT_ORDERS, and see for

  • docu: customer exit - control record (001)

CALL CUSTOMER-FUNCTION '001'

EXPORTING

CONTROL_RECORD_OUT = CONTROL_RECORD_OUT

DEKKO = EKKO

DOBJECT = OBJECT

IMPORTING

CONTROL_RECORD_OUT = CONTROL_RECORD_OUT.

This gives you the option to pass the info you want. here in this case, you are adhering to standards and SAP does the Control record built and you are going to change certain fields for your needs.

Hope this is of use.

Let us know if you any questions.

Good Luck,

Srini.