<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic custom idoc in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-idoc/m-p/2436866#M545183</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry for repeating question. my requirement is to create a program, which when executed, creates a custom idoc ( time sheet idoc type ) , using a custom outbound function module. i did all things except coding in function module and calling it in report program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any one give some code for out bound function module or atleast any sample code who to call segments , ports, for creating a custom idoc of type time sheet in outbound function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its urgent any suggestions are highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance,&lt;/P&gt;&lt;P&gt;Suresh.A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jul 2007 04:46:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-04T04:46:00Z</dc:date>
    <item>
      <title>custom idoc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-idoc/m-p/2436866#M545183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry for repeating question. my requirement is to create a program, which when executed, creates a custom idoc ( time sheet idoc type ) , using a custom outbound function module. i did all things except coding in function module and calling it in report program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any one give some code for out bound function module or atleast any sample code who to call segments , ports, for creating a custom idoc of type time sheet in outbound function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its urgent any suggestions are highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance,&lt;/P&gt;&lt;P&gt;Suresh.A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 04:46:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-idoc/m-p/2436866#M545183</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T04:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: custom idoc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-idoc/m-p/2436867#M545184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Creation of an IDoc generation program
The following code extract contains everything needed to generate an IDoc from data contained in a table.
FORM F_110_SEND_IDOC.
CONSTANTS:
*ur message type ZVISTAPM
  C_MESTYP TYPE EDIDC-MESTYP VALUE 'ZVISTAPM',
*ur idoc type ZVISTAPM01
  C_DOCTYP TYPE EDIDC-IDOCTP VALUE 'ZVISTAPM01',
*ur segment name Z1VISTAPM
  C_SEGNAM TYPE EDIDD-SEGNAM VALUE 'Z1VISTAPM'.
DATA:
  I_ZVISTA_PM TYPE ZVISTA_PM_T OCCURS 6000,
  I_EDIDC TYPE EDIDC OCCURS 0,
  I_EDIDD TYPE EDIDD OCCURS 0,
  WA_ZVISTA_PM TYPE ZVISTA_PM_T,
  WA_EDIDC TYPE EDIDC,
  WA_EDIDD TYPE EDIDD,
  WA_Z1VISTAPM TYPE Z1VISTAPM,
  V_OCCMAX TYPE IDOCSYN-OCCMAX,
  V_NBSEG TYPE I.
CLEAR WA_ZVISTA_PM.
CLEAR WA_EDIDC.
* Save the message type and the basic IDoc type
* in the control segment
MOVE C_MESTYP TO WA_EDIDC-MESTYP.
MOVE C_DOCTYP TO WA_EDIDC-IDOCTP.
* Retrieve the maximum number of segments in the basic IDoc
* type
SELECT MIN( OCCMAX )
  FROM IDOCSYN
  INTO V_OCCMAX
  WHERE IDOCTYP EQ C_DOCTYP AND SEGTYP EQ C_SEGNAM.
* Save the whole ZVISTA_PM_T table content
* in the I_ZVISTA_PM internal table.
SELECT *
FROM ZVISTA_PM_T
INTO CORRESPONDING FIELDS OF TABLE I_ZVISTA_PM.
* Create a data segment for each line of I_ZVISTA_PM
LOOP AT I_ZVISTA_PM INTO WA_ZVISTA_PM.
  MOVE-CORRESPONDING WA_ZVISTA_PM TO WA_Z1VISTAPM.
  CLEAR WA_EDIDD.
  MOVE C_SEGNAM TO WA_EDIDD-SEGNAM.
  MOVE WA_Z1VISTAPM TO WA_EDIDD-SDATA.
  APPEND WA_EDIDD TO I_EDIDD.
  CLEAR WA_ZVISTA_PM.
  CLEAR WA_Z1VISTAPM.
ENDLOOP.
* Count the number of data segments
DESCRIBE TABLE I_EDIDD LINES V_NBSEG.
* If the number of data segments exceeds the maximum
* allowed number, then edit a message in the spool,
* then display an error message (quit the program)
IF V_NBSEG GT V_OCCMAX.
  WRITE:/ TEXT-003, V_OCCMAX.
  MESSAGE E751.
ENDIF.
* Call the IDoc creation function
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
  EXPORTING
    MASTER_IDOC_CONTROL = WA_EDIDC
  TABLES
    COMMUNICATION_IDOC_CONTROL = I_EDIDC
    MASTER_IDOC_DATA = I_EDIDD
  EXCEPTIONS
    ERROR_IN_IDOC_CONTROL = 1
    ERROR_WRITING_IDOC_STATUS = 2
    ERROR_IN_IDOC_DATA = 3
    SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
    OTHERS = 5.
* If there was an error, display a message (quit the
* program)
IF SY-SUBRC NE 0.
  MESSAGE E746.
ENDIF.
ENDFORM.

regards
ravish
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;lt;b&amp;gt;plz dont forget to reward points if helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        ravish goyal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 04:55:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-idoc/m-p/2436867#M545184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T04:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: custom idoc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-idoc/m-p/2436868#M545185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this code will help you..&lt;/P&gt;&lt;P&gt;It calls the sements and populate the data into it.&lt;/P&gt;&lt;P&gt;execute this program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS:   C_DOCTYP TYPE EDIDC-IDOCTP VALUE 'ZUSRDET01', idoc type&lt;/P&gt;&lt;P&gt;             C_SEGNAM TYPE EDIDD-SEGNAM VALUE 'Z1USRDET01', segment type&lt;/P&gt;&lt;P&gt;             C_MESTYP TYPE EDIDC-MESTYP VALUE 'ZUSRDET'.  message type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA:      IT_ZUSR02 TYPE USR02 OCCURS 10,&lt;/P&gt;&lt;P&gt;             IT_EDIDC TYPE EDIDC OCCURS 0,&lt;/P&gt;&lt;P&gt;             IT_EDIDD TYPE EDIDD OCCURS 0,&lt;/P&gt;&lt;P&gt;             WA_ZUSR02 TYPE USR02,&lt;/P&gt;&lt;P&gt;             WA_EDIDC TYPE EDIDC,&lt;/P&gt;&lt;P&gt;             WA_EDIDD TYPE EDIDD,&lt;/P&gt;&lt;P&gt;             WA_Z1USRDET01 TYPE Z1USRDET01,&lt;/P&gt;&lt;P&gt;             V_OCCMAX TYPE IDOCSYN-OCCMAX,&lt;/P&gt;&lt;P&gt;             V_NBSEG TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            CLEAR WA_ZUSR02.&lt;/P&gt;&lt;P&gt;            CLEAR WA_EDIDC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            Save the message type and the basic IDoc type in the control segment.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            MOVE C_MESTYP TO WA_EDIDC-MESTYP.&lt;/P&gt;&lt;P&gt;            MOVE C_DOCTYP TO WA_EDIDC-IDOCTP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            Retrieve the maximum number of segments in the basic IDoc type.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            SELECT MIN( OCCMAX )  FROM IDOCSYN  INTO V_OCCMAX  WHERE IDOCTYP EQ C_DOCTYP AND SEGTYP EQ C_SEGNAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            Save the whole USR02 table content in the IT_ZUSR02 internal table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            SELECT * FROM USR02 INTO CORRESPONDING FIELDS OF TABLE IT_ZUSR02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            Create a data segment for each line of IT_ZUSR02.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            LOOP AT IT_ZUSR02 INTO WA_ZUSR02 .&lt;/P&gt;&lt;P&gt;              MOVE-CORRESPONDING WA_ZUSR02  TO WA_Z1USRDET01.&lt;/P&gt;&lt;P&gt;              CLEAR WA_EDIDD.&lt;/P&gt;&lt;P&gt;              MOVE C_SEGNAM TO WA_EDIDD-SEGNAM.&lt;/P&gt;&lt;P&gt;              MOVE WA_Z1USRDET01 TO WA_EDIDD-SDATA.&lt;/P&gt;&lt;P&gt;              APPEND WA_EDIDD TO IT_EDIDD.&lt;/P&gt;&lt;P&gt;              CLEAR WA_ZUSR02.&lt;/P&gt;&lt;P&gt;             CLEAR WA_Z1USRDET01.&lt;/P&gt;&lt;P&gt;            ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           Count the number of data segments.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              DESCRIBE TABLE IT_EDIDD LINES V_NBSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           If the number of data segments exceeds the maximum allowed number,then display an error message.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              IF V_NBSEG GT V_OCCMAX.&lt;/P&gt;&lt;P&gt;              WRITE:/ 'ERROR'.&lt;/P&gt;&lt;P&gt;              ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'&lt;/P&gt;&lt;P&gt;                EXPORTING&lt;/P&gt;&lt;P&gt;                  master_idoc_control                  = WA_EDIDC&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                OBJ_TYPE                             = ''&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                CHNUM                                = ''&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                tables&lt;/P&gt;&lt;P&gt;                  communication_idoc_control           = IT_EDIDC&lt;/P&gt;&lt;P&gt;                  master_idoc_data                     = IT_EDIDD&lt;/P&gt;&lt;P&gt;               EXCEPTIONS&lt;/P&gt;&lt;P&gt;                 ERROR_IN_IDOC_CONTROL                = 1&lt;/P&gt;&lt;P&gt;                 ERROR_WRITING_IDOC_STATUS            = 2&lt;/P&gt;&lt;P&gt;                 ERROR_IN_IDOC_DATA                   = 3&lt;/P&gt;&lt;P&gt;                 SENDING_LOGICAL_SYSTEM_UNKNOWN       = 4&lt;/P&gt;&lt;P&gt;                 OTHERS                               = 5&lt;/P&gt;&lt;P&gt;                        .&lt;/P&gt;&lt;P&gt;              IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;              ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Please Reward points for useful ans.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aarti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 04:58:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-idoc/m-p/2436868#M545185</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T04:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: custom idoc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-idoc/m-p/2436869#M545186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;answered&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2007 06:09:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-idoc/m-p/2436869#M545186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-09T06:09:18Z</dc:date>
    </item>
  </channel>
</rss>

