Function Module to create Outbound IDoc

I have created a segment (ZSEGPRO), basic type (ZIDOCPRO) and message type (ZMSGPRO) to create a custom IDoc. Now I have to write a Function Module to create Outbound IDoc.
I want to know what will be in Import, Export, Changing, Tables, Exceptions and Source code of that function module. The fields used in the segment ZSEGPRO is given below:
Fld NameSource Data Elmn     Description
PRODUCT MARA MATNR     Material number
TEXT     MAKT     MAKTX     Material description
PRN     MARA     YYBCEZNDR     Print Field
Additional information: Export parameter will be BAPIRETURN for holding error message(if any).
These Function Module need not require to be RFC enabled.

Hi ,
Refer these:
There are two main reasons
1) Make sure you call COMMIT WORK after the MASTER_IDOC_DISTRIBUTE
http://help.sap.com/saphelp_nw04/helpdata/en/78/21783151ce11d189570000e829fbbd/content.htm
2) The rest of the setting of the ALE IDoc might not have been done
http://help.sap.com/saphelp_46c/helpdata/en/78/2177c951ce11d189570000e829fbbd/frameset.htm
You can use the Area Menu WEDI and do the rest of the settings.
ALE Quick Start guide and ALE Programming Guides for your reference
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFAALEQS/CABFAALEQS.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEPRO/BCMIDALEPRO.pdf
Recent discussion which could be helpful,
About WE21, BD64, sm59
Regards
Shiva Kumar

Similar Messages

  • I need to create RFC function module which creates the IDOC

    Hi-
    Any idea how to create RFC function module which creates the outbound IDOC. If you have any sample code please forward to me.
    Thanks,
    Sony

    My Problem is
    Whenever they create Invoice using T-code's like FV65(Parked Document), automatically should create IDOC's...
    I have used message type FIDCC1 but this message type is usefull only for Posting documents.
    1. Whenever they create parked document, entries will be stored in BKPF(Parked Document-Filed-BKPF-BSTAT = 'V') and Bseg....
    2. I have to read entries from those tables and should create IDOC...
    3. I checked FM's(FI_IDOC_CREATE_FIDCC1, FI_IDOC_PREPARE) but are not useful...
    4. Now I need to write one RFC function module and that FM should create the IDOC's....
    Can anyone please help me out?
    Thanks,
    Sony

  • Function Module to Generate Outbound IDOC for Sales Documents

    Hello Experts,
    Can someone please help me, I need to know which function module to use in order to generate the outbound IDOC for sales documents.  Some of the fm's I have come across are the following:
    IDOC_OUTPUT_ORDERS, but actually for Purchase Orders
    IDOC_OUTPUT_ORDRSP, but did not generate any IDocs for my sample Sales Order.
    Points will be given for any help provided.
    Thanks in advance.

    Hi Nagaraj,
    I tried using the IDOC_OUTPUT_ORDERS but I keep getting an error that the Purchase Order <xxx> does not exist, even though the document I tried is a sales order.  For everyone's reference here is the code:
    form process_data.
      DATA v_idoc       TYPE edidc-docnum.
      DATA i_edidd      TYPE TABLE OF edidd.
      DATA wa_idoc_ctrl TYPE edidc.
      LOOP AT i_nast INTO wa_nast.
        CLEAR i_msgs[].
        CALL FUNCTION 'WFMC_PROTOCOL_GET'
          EXPORTING
            cps_nast        = wa_nast
          tables
            messages        = i_msgs
         EXCEPTIONS
           NOT_FOUND       = 1
           OTHERS          = 2.
        LOOP AT i_msgs INTO wa_msgs WHERE arbgb EQ 'E0'.
    *--- Check first if there is an IDOC
          IF wa_msgs-msgv1 IS INITIAL.
            CONTINUE.
          ENDIF.
          v_idoc = wa_msgs-msgv1.
          CLEAR i_edidd[].
          CLEAR wa_idoc_ctrl.
          CALL FUNCTION 'IDOC_READ_COMPLETELY'
            EXPORTING
              document_number                = v_idoc
            IMPORTING
              IDOC_CONTROL                   = wa_idoc_ctrl
    *         NUMBER_OF_DATA_RECORDS         =
    *         NUMBER_OF_STATUS_RECORDS       =
            TABLES
    *         INT_EDIDS                      =
              INT_EDIDD                      = i_edidd
            EXCEPTIONS
    *         DOCUMENT_NOT_EXIST             = 1
    *         DOCUMENT_NUMBER_INVALID        = 2
              OTHERS                         = 3.
          CALL FUNCTION 'IDOC_OUTPUT_ORDERS'
            EXPORTING
              object                              = wa_nast
              control_record_in                   = wa_idoc_ctrl
    *       IMPORTING
    *         OBJECT_TYPE                         =
    *         CONTROL_RECORD_OUT                  =
            tables
              int_edidd                           = i_edidd
    *       EXCEPTIONS
    *         ERROR_MESSAGE_RECEIVED              = 1
    *         DATA_NOT_RELEVANT_FOR_SENDING       = 2
    *         OTHERS                              = 3
          IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          COMMIT WORK.
        ENDLOOP.
      ENDLOOP.

  • BAPI or function module for creating outbound delivery agains STO

    Hi,
    Is there any function module or BAPI to create an outboud delivery against STO?  Appreciated if anybody tells what are all the mandatory fields to pass.
    Thanks and Regards,
    Suresh

    Hi,
    Pls check the BAPIs,
    BAPI_OUTB_DELIVERY_CONFIRM_DEC BAPI for Outbound Delivery Confirmation from a Decentralized System
    BAPI_OUTB_DELIVERY_SPLIT_DEC   BAPI for Subsequent Outbound-Delivery Split from a Decentralized Syste
    Regards,
    Renjith Michael.

  • Function module for create outbound delivery

    Hi,
          Can any one pls tell me the BAPI function module name for create outbound delivery with order reference.
    Regards,
    Mahi

    Hi
    This is the BAPI for creating Delivery with Sales Order Reference.
    You can use the BAPI <b>BAPI_DELIVERYPROCESSING_EXEC</b>
    Check this sample code..
    PARAMETERS: p_vbeln LIKE vbak-vbeln.
    DATA: BEGIN OF t_vbap OCCURS 0,
            vbeln LIKE vbap-vbeln,
            posnr LIKE vbap-posnr,
            kwmeng LIKE vbap-kwmeng,
            matnr  LIKE vbap-matnr,
            werks  LIKE vbap-werks,
          END OF t_vbap.
    DATA: t_request TYPE STANDARD TABLE OF bapideliciousrequest
          WITH HEADER LINE.
    DATA: t_created TYPE STANDARD TABLE OF bapideliciouscreateditems
          WITH HEADER LINE.
    DATA: t_return TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
    SELECT vbeln posnr kwmeng matnr werks
           INTO TABLE t_vbap
           FROM vbap
           WHERE vbeln = p_vbeln.
    LOOP AT t_vbap.
      t_request-document_numb = t_vbap-vbeln.
      t_request-document_item = t_vbap-posnr.
      t_request-quantity_sales_uom = t_vbap-kwmeng.
      t_request-id = 1.
      t_request-document_type = 'A'.
      t_request-delivery_date      = sy-datum.
      t_request-material = t_vbap-matnr.
      t_request-plant = t_vbap-werks.
      t_request-date = sy-datum.
      t_request-goods_issue_date = sy-datum.
      t_request-goods_issue_time = sy-uzeit.
      APPEND t_request.
    ENDLOOP.
    CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
      TABLES
        request               = t_request
        createditems          = t_created
        return                = t_return
    READ TABLE t_return WITH KEY type = 'E'.
    IF sy-subrc = 0.
      MESSAGE e208(00) WITH 'Delivery creation error'.
    ENDIF.
    COMMIT WORK.
    READ TABLE t_created INDEX 1.
    Write: /  t_created-document_numb.
    REWARD IF HELPFUL.

  • Function Module for Creating Outbound Delivery

    Hi All,
    Please provide me the FM Name which will create the outbound delivery same as VL01N transaction and I needs to update Serial Numbers also. Please help me to find the FM which will create outbound delivery and behave same as VL01N transaction.
    Thanks in advance.

    hi
    check FM 1:
        CLEAR: ls_request.
        ls_request-document_type      = 'A'.
        ls_request-document_numb      = tvbap-vbeln.
        ls_request-document_item      = tvbap-posnr.
        ls_request-quantity_sales_uom = tvbap-KWMENG.
        ls_request-PLANT              = tvbap-werks.
        ls_request-STGE_LOC           = tvbap-lgort.
        ls_request-MATERIAL           = tvbap-matnr.
        ls_request-batch              = tvbap-charg.
        ls_request-date_usage         = p_datvw.
        ls_request-date               = p_date.
        ls_request-time               = p_time.
        APPEND ls_request TO lt_request.
      CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
    * EXPORTING
    *   DELIVERY_EXTEND         =
    *   TECHN_CONTROL           =
      TABLES
        REQUEST                 = lt_request
    *   PARTNER                 =
    *   PARTNER_ADDR            =
    *   TEXT_HEADER             =
    *   TEXT_LINES              =
        CREATEDITEMS            = CREATEDITEMS
        RETURN                  = RETURN
    *   EXTENSION1              =
    *   EXTENSION2              =
    *   CO_CHAR_VALUES          =
    *   BATCH_ATTRIBUTES        =
    *   BATCH_VALUES_CHAR       =
    *   BATCH_VALUES_CURR       =
    *   BATCH_VALUES_NUM        =
    *   TOKENREFERENCE          =
    or FM2:
      CALL FUNCTION 'W_FRM_DELIVERY_CREATE_GENERAL'
        EXPORTING
          I_INTERNAL_COMMIT   = 'X'
          I_NO_LOCK_DOCS      = 'X'
          I_INIT_UNIT_CONV    = 'X'
        TABLES
          T_DOCUMENTS         = ITAB_DOCUMENTS
          T_MESSAGELOG        = ITAB_MESSAGELOG
          T_VBLS              = T_VBLS
        EXCEPTIONS
          NOTHING_TO_DO           = 1
          MESSAGE_ACCORDING_LOGS  = 2
          OTHERS                  = 3.
    regards,darek

  • Creating outbound IDOC for EDI

    HI All,
    I have to create an IDOC for EDI. Can anyone tell be the function module to create an IDOC for EDI. I know MASTER_IDOC_DESTRIBUTE, but it is only used for ALE.
    Can anyone help me in this.
    Thanks.
    Shweta

    Dudes:
    It sounds to me like all of you guys need some training and some understanding of the basics.
    MASTER_IDOC_DESTRIBUTE is called by the standard IDoc interface after an IDoc has been built and is ready to be kicked out the door. It provides all the services needed to write the idoc to the database and send it out through the partner profile and file or tRFC port. It's used both for ALE and EDI IDocs.
    I cover the processing flow extensively in my new book from SAP Press "Architecting EDI with SAP IDocs". The book is available from:
    http://www.sappress.com/product.cfm?account=&product=H3003
    I also cover these topics in my IT Toolbox blog at:
    http://it.toolbox.com/blogs/ehadzipetros
    And my SDN blog at:
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417600)ID1280983950DB11991735787968519403End?blog=/pub/u/252038725
    Good luck. ejh,

  • Idoc/ Function module to create a Licence in GTS

    Dear experts,
      I have a situation where in I need to create Licence in GTS system based on the information from a 3rd party system. So, Is there any inbound idoc in GTS system to automatically create the licence (I'm using middle ware to convert the XML from 3rd party to an IDOC).
    Or is there any function module, to create a licence in GTS system.
    Thanks for the Info.
    Sorry for the duplication of same question that i posted in GTS forum. I couldn't get a single reply from 3 days, so I reposted the same.
    Thanks
    -Amit.

    Hi Amit
    I'm facing the same problem you had.
    May I ask you how you created the function module?
    Thanks in Advance
    Ashwaan

  • Function Module to create AFS Outbound delivery for sales order

    Guys,
    I am looking for a function module to create deliveries for a sales order IN IS-AFS.
    I cannot make BAPI_DELIVERYPROCESSING_EXEC work. Also, if I use the IDOC type /AFS/DELVRY03 via message type WHSCON and function module IDOC_INPUT_DELVRY it doesn' work either.
    Does anyone know which function module I could use? I need to select specific AFS schedule lines though, but at this point I am not able to make any work.
    Thanks
    Leonardo

    This will not help .
    Edited by: Amit Khare on Aug 7, 2008 3:49 AM

  • How to do configuration to create outbound idoc using message control

    The objective is to create outbound idoc based on some selection criteria using message control approach.The interface will be triggered when there is goods receipt via MIGO transaction.............Now based on the material document number from NAST table i am going to fetch data and do further processing inside the function module i am going to create.later idocs will be created via program RSNASTED.How we do the configuration to set up this whole operation?

    Please go thru:
    1) message control
    2) http://help.sap.com/saphelp_di46c2/helpdata/EN/c8/19878343b111d1896f0000e8322d00/content.htm
    Regards
    Shital

  • Variables passed to Function module for posting the Idoc

    Hi,
    For Posting the Inbound Idoc a Function module is created what should be the values passed to
    1) return_variable and
    2) workflow_result.
    I saw in many of the program like this if there is an error in posting.
    I gave return_variable-wf_param = ' Error Idoc'.
    and workflow_result = '99999'.
    Why are these values passed, where are they used.

    Josephine,
    In your parntner profile for your customer/vendor ( depending on your idoc type and business scenario) , you would have assigned the post processing permitted agent.
    In case the function module errors out, these values are carried out to the WF container and appropriate post processing notifications are sent to the agents. That is the purpose of having these variables in here.
    It could be a success/failure, agents are notified in either case.
    Ganesh

  • Need a function module to create production order with reference

    Hi
    I need a function module to create a production order with reference to an existing order. There is no BAPI available for SAP 4.7 release. I found that the function module CO_ZF_PRODUCTIONORDER_CREATE does not create with reference to an existing order.
    Any help will be rewarded.
    Pavan

    Dear Pavan,
    Unfortunately there is no FM for this..
    Cheers
    Nitesh

  • How to find out the inbound function module in the extended idoc

    Hi,
    how to find out the inbound function module in the extended idocs
    Thanks .

    through we41/we42 you can find the inbound function module.......
    or
    thorough we19(idoc test tool) ....
    give the input as message type or basic idoc..
    press exec...
    then you can find th button on application tool bar as inbound funtion module....
    from here also you can find..........
    <REMOVED BY MODERATOR>
    Khasimsa
    Edited by: Alvaro Tejada Galindo on Apr 14, 2008 1:34 PM

  • Function modules to create a movement type 105 and 104

    Hi folks,
             I have created a custom screen and attached to MIGO Transaction. If my user enter data and click 'PASS' on my screen, a movement type 105 to be triggered in back ground. And if he click 'FAIL', movement type 104 need to be triggered. is there any BAPI or Function Module to create goods movement type. I have searched some function modules in SE37 and found some stuff. But i am confused which one to use...Could you pls guide me regarding this...
    for ur information, i am thinking to use these FM's
    MB_READ_GOODS_MOVEMENT
    MB_CREATE_GOODS_MOVEMENT
    MB_CANCEL_GOODS_MOVEMENT
    Will it be useful for me.
    Thanks in advance,
    Shyam.
    Edited by: shyam prasad on Jan 7, 2009 10:24 AM

    Hi
    Yes you can use this function modules.
    Thanks & Regards
    Kishore

  • Function module to create Inbound delivery with reference to Purchase Order

    Hi experts,
    I want to create Inbound delivery with refernce to Purchase Order. But I want to create item wise. For example If one purchase order is there with 10 line items. 10, 20, 30, 40, 50......100.
    If I am showing report for Purchase Order with select option and if I select first 5 line items 10, 20, 30, 40, 50 then my program should be create one Inbound delivery for selected line items only. I have tried BDC for Tcode VL31N, but its not worked. Is there any Function module to create Inbound delivery with reference to Purchase Order for selected line items????????

    Hi,
    Try FM RV_DELIVERY_CREATE or GN_DELIVERY_CREATE.
    For creating a delivery wrt PO u 1st need to have a sales order i guess.
    Regards,
    Amit

Maybe you are looking for

  • Can not display long derived measure - ORA-33674

    I would need calculated measures for compiling some special URL, but there seems to be now way to have results longer than 60 characters. I tried creating the measure using AWM and using OLAP API. Both will result in: ORA-33674: Data block exceeds th

  • Index does not exist in database system ORACLE??????

    Hi Experts, I created a Secondary Index in DEV, its fine and the message is, <b><i>Index KNA1~Z01 exists in database system ORACLE</i></b> I moved it to TEST and there I got the message is like, <i><b>Index does not exist in database system ORACLE</b

  • BAPI for Purchase order change

    Hi experts,   I just want to change PO quantity by BAPI function module: BAPI_PO_CHANGE, I fill in PO number, Item number, material number and PO quantity to parameters, but result is not well. it shows a message below and the purchase order is not c

  • Recon. Changed

    HI, We are using 5.0 Version. We have facing one problem in payable and receivable accounts,i.e., We have changed the Recon accounts in Master data. That effect showing in reports.The problem is when I was see the Payable reports(S_ALR_87012082 - Ven

  • Column in Query

    Hello Gurus...      I have an existing query where I see NET SALES of current year (Fiscal Year Period). When I give 05.2005 (its Nov 2005) Fiscal period (July-June). I get Net sales of 12 months in 12 Columns (05.2005 - 05 2004) and a Summary Column