Skip to Content
author's profile photo Former Member
Former Member

No of idocs created

Hi,

Im creating idocs using this function module. MASTER_IDOC_DISTRIBUTE. Can anyone tel me how to display the no of idocs created in the output?

-Anbu.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2009 at 03:45 AM

    There is table parameter MASTER_IDOC_DATA of FM MASTER_IDOC_DISTRIBUTE. Suppoase you are passing internal table ITAB to this parameter. Use DESCRIBE TABLE ITAB LINES lv-Lines. Lv_lines give number of idocs generated.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2009 at 03:46 AM

    Hi Anbu,

    As the FM MASTER_IDOC_DISTRIBUTE creates a single IDoc, you can count on the number of times it has been executed with SY-SUBRC = 0, so that, you can capture the number of success IDocs that has been gerentated.

    Rgds,

    Sripal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 07, 2009 at 12:46 PM

    Hi,

    you can get the idoc number from the table parameter COMMUNICATION_IDOC_CONTROL because always only one line is returned.

    (...)
              CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
                EXPORTING
                  master_idoc_control            = ls_idoc_header_item
                TABLES
                  communication_idoc_control     = lt_idoc_comm_control
                  master_idoc_data               = lt_idoc_data_items
                EXCEPTIONS
                  error_in_idoc_control          = 01
                  error_writing_idoc_status      = 02
                  error_in_idoc_data             = 03
                  sending_logical_system_unknown = 04.
              IF sy-subrc = 0.
    *           Get IDoc number
                CLEAR ls_idoc_comm_control.
                 "               ls_idoc_comm_control-docnum is the idoc number
                READ TABLE lt_idoc_comm_control INDEX 1 INTO ls_idoc_comm_control.
              endif.
    (...)

    Regards,

    Andrea

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 07, 2009 at 02:30 PM

    Sorry if I misunderstood the question. If you have to count the number of idoc created during the processing, you just increment a variable in your program after every call of Master_idoc_distribute if SY-SUBRC = 0.

    Regards,

    Andrea

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.