Regarding IDOC Extension

Hi Experts,
I need to Extend IDOC <b>COND_A03</b> with 5 Custom feilds. This Idoc will be populating 10 tables like A932,A933,A34,A35,A36,A37....,.I need to extend in
<b>IDOC_INPUT_COND_A</b> through exit CALL CUSTOMER FUNCTION '002'.
Here the 3 feilds will be present in A932 table and there will be only 4 feilds in A933 table and 3 feilds will be present in A934 table and so on. I..e all the 5 custom  feilds will not be present in all the tables.
How i need to build the logic so that when the data comes to that function module i need to populate only 3 feilds into A932 table and 4 feilds into A933 table and so on..
How do i need to build the logic.., to post the data when the number  of fields differ from one table to the other.

ALE FUNCTION MODULE ENHANCEMENTS
Having extended the IDOC type to contain additional fields for an inbound or outbound application, you now want to enhance ALE function modules for populating the additional segment on the outbound or applying the additional segment data on the inbound application.
The core working code for ALE processes for a given application area is always encapsulated in ABAP/4 function modules. These function modules are associated with such control information as message types and process codes. So the ALE process checks this control information and derives the name of the function module to invoke for that particular IDOC processing from certain database tables. These function modules contain objects known as customer functions, which can be considered SAP Enhanced user exits. A function module is called at a particular point during the processing of the main program or function module, and it can be used to influence data processing at that point by adding code to the customer function. The customer function behaves like a normal function module and has import and export parameters, tables (internal tables) statement, and exception processing. Unlike a conventional user exit, customer functions give you the ability to modify only data available to you by the function moduleâs parameters and internal tables. While most ALE/EDI function modules are supported by customer functions, there are ALE/EDI processes that still use conventional user exits. There are a few ways to determine which function module to enhance for a given message type/process code:
• For master data distribution, from SALE go to Extensions -> Master data distribution -> Setup additional data for message types. Search for message type DEBMAS in this example. You see an entry for DEBMAS associated with function module MASTERIDOC_CREATE_SMD_DEBMAS. This data is stored on table TBDME. The function module names for all master data message types follow this pattern: MASTERIDOC_CREATE_SMD_messagetype. This function module calls another function module of name MASTERIDOC_CREATE_DEBMAS or MASTERIDOC_CREATE_messagetype. Search for the words customer function, and you find several hits that can be used to add code to the function module.
• From WEDI got to Control -> Inbound process codes -> Inbound with ALE service -> Processing by function module (transaction WE42), or from WEDI go to Control -> Outbound process codes -> Outbound with ALE service -> With function module (transaction WE41). There will be function modules associated with the process codes. For inbound, the function modules usually follow this pattern: IDOC_INPUT_messagetype: for example, IDOC_INPUT_CHRMAS for inbound characteristics master.
• Use transaction WE57 or from WEDI go to Development -> Message/Application Object. The entries list the function module, Business Object, message type, and IDOC type that are used for inbound ALE/EDI interfaces.
Customer functions are not specific only to ALE and EDI but also to all programs/modules in SAP R/3. Customer function is a SAP enhancement component; the other two types are menu and screen enhancements.
All customer function exits are maintained in SAP enhancements and are found by using transaction SMOD. After executing transaction SMOD, pull down (F4) on the enhancement name field, and execute again. This provides you with a list of all SAP enhancements available. SAP enhancements are grouped by development class pertaining to an application area. Choose Application development R/3 SD master data distribution for development class VSV to lead to a screen that lists VSV00001 as an enhancement (see Figure 5). Press Component +/- to display its function exit components. There are four possible components listed, all of which are function exits (and are function modules) that are called from the ALE function modules in the form Call Customer Function Î001â. This is a special occurrence of the ABAP statement Call. Go to item Exit_SAPLVV01_ 001, which you need to enhance for the Customer Master outbound example of an IDOC extension. In the ALE-function module MASTERIDOC_CREATE_DEBMAS, the statement CALL Customer Function 001 is translated in the background to call component EXIT_SAPLVV01_001. Although this function exit can be edited using transaction SE37, you will use a simpler approach.
When you use SAP enhancements and their components, you manage them with an SAP object known as a project, which is like an envelope containing the selected enhancements and their components. A project can be used to control the execution of components and to transport them to other clients and instances in SAP. Basically, the process involves creating a project, including enhancements and components that are to be enhanced, editing the components, and then activating the project. The following process creates a project for our example Customer Master IDOC extension:
• Execute transaction CMOD.
• Enter name of project, say CSTMAST1.
• Click on Create.
• Enter a description of the project.
• Save.
• Click on SAP Enhancements.
• Enter VSV00001 for Enhancement.
• Save.
Once youâve created the project, edit the function exit components and activate the project. Remember that the code in the function exit enhancement will execute only if the project is activated. In fact, this is a convenient SAP enhancements feature, whereby the work in progress (developing code in the customer function) will not affect users of that application. When the code is completed, the project can be activated so the enhanced functionality takes effect. It can also be deactivated for maintenance.
As mentioned earlier, customer functions (function exits) are embedded in ALE function modules and can be used to influence the creation and modification of IDOC data on an outbound application or to post additional or modified IDOC data to an inbound R/3 application. Function exits are similar to regular function modules, with import/export parameters, tables (internal tables), and exceptions.
The two important factors to consider while developing the customer function are:
1. The point in the ALE function module where the function exit occurs
2. The data made available by the customer function that can be modified or posted to the R/3 application, based on the direction.
Because some function modules have several customer functions, it is critical to choose the function exit best suited for that particular enhancement. Do not attempt to perform activities that the function exit is not designed for. The importance of this point is illustrated by the following description of enhancing function modules for outbound and inbound ALE interfaces.
Outbound interfaces. In an outbound ALE interface you use function exits (customer functions) to populate additional segments created by an IDOC extension or to modify the existing IDOC data segments as per business requirements. Previously, you identified that enhancement VSV00001 has a component EXIT_SAPLVV01_001 (function exit), which can be used for populating the additional data segment Z1SADRX that you created in the IDOC extension ZDEBMASX (IDOC type ZDEBMASZ, based on Basic IDOC type DEBMAS02). You also learned that the ALE function module that calls this function exit is MASTERIDOC_CREATE_DEBMAS, which has a statement Call Customer Function 001.
Browse the function module MASTERIDOC_CREATE_DEBMAS using transaction SE37. You will find that this customer function is invoked for every segment of IDOC type DEBMAS02. In fact, the function exit is called soon after the creation of an existing segment has been populated with data and appended to the IDOC data table (internal table). Also, the function exit is exporting the message type, IDOC type, and the segment name and is importing the IDOC extension type. It is also passing the IDOC data internal table. This indicates that the ALE function module is allowing you to populate additional segments for every existing segment and modify the existing segmentâs data.
Letâs write ABAP/4 code to accomplish the task of populating IDOC segment Z1SADRX with a contact personâs business address:
• From SE37, display function module MASTERIDOC_CREATE_ DEBMAS.
• Find Customer Function 001.
• Double-click on 001.
• The function EXIT_SAPLVV01_001 will be displayed.
• Double-click on INCLUDE ZXVSVU01.
• You will be asked to create a new include object. Proceed as desired.
• Enter code (as in Listing 1).
• Be sure to perform a main program check (Function Module -> Check -> main program) and extended program check (Function module -> Check -> Extended check).
Now that you have extended the IDOC and enhanced the ALE function module based on the requirements for the contact personâs business address on the Customer Master, letâs test the interface. You should create a logical system and define a port for this interface. You should also configure the Customer Distribution Model to indicate that message type DEBMAS is being distributed to this logical system. The only difference in configuration between a regular outbound ALE interface and an enhanced one is the partner profile definition. While maintaining the outbound parameters of the partner profile, make sure the IDOC type is ZDEBMASZ. The fields for Basic IDOC type and extension type are automatically populated with DEBMAS02 and ZDEBMASX, respectively.
To maintain the contact personâs business address of a customer:
• Use transaction BD12 or from BALE go to Master Data ->Customer -> Send and send that Customer Master record by executing the transaction after filling in the relevant fields such as customer number, message type, and logical system.
• Use transaction WE02 or WE05 to verify the IDOC created. You should see the new segment Z1SADRX populated with the correct data.
With SAP releases below 4.5B, you cannot capture changes to business address through change pointers because a change document object is not available for capturing business address changes, and also earlier releases have not been configured to write change documents for a contact personâs business address. If you would like this functionality, you can either create change document objects, generate function modules to create change documents, and perform ALE configuration to tie it in, or make a cosmetic change to the contact person screen data while changing the contact personâs business address so that it gets captured as a change to the Customer Master. Subsequently, the ALE enhancement that you performed captures the contact personâs business address.
Inbound interfaces. The process for enhancing inbound ALE interfaces is similar for outbound, with a few exceptions; specifically in the coding of customer functions (function exits) for the ALE/EDI function modules.
The first step is to create an IDOC extension for the specific Basic IDOC type by adding new segments at the appropriate hierarchy level: that is, associated to the relevant existing segment. Populate the data fields on the new segments with application data by the translator or external system/program before importing them into the R/3 System. Then, find the ALE function module that is invoked by the inbound processing. By browsing through the code or reading the documentation on the function exit enhancements using the SMOD transaction, identify the function exit in which you should place your code. The technique used in the code to post the additional or modified IDOC data to the application can vary based on the application rules and requirements, the data available at that point in processing, and the application function modules available to update the application tables. It is important to search first for application modules that process the data and see if they can be called within the function exit. If the additional data in the extended segments in specific to a custom table or resides in nonkey fields of a single or small set of tables, you may be able to update it directly by SQL statements in the function exit. This approach should be carefully evaluated and is certainly not highly recommended.
Another option is to use Call Transaction from within the function exit to process the additional data. For example, in the case of message type WMMBXY for inbound goods movements from a warehouse management system, the standard interface creates batches for materials, but does not update its characteristics. In such a case, you can use Call Transaction MSC1 to create the batch and assign characteristic values to it from within the function exit provided.
regards,
srinivas
*reward for useful answers*</b>

Similar Messages

  • Regarding IDOC Extensions

    hi guys,
    i have extended DEBMAS05, that is added a child segment <b>zknvkm</b> under <b>E1knvkm</b> segment and also found a function module exit which populates each segment in DEBMAS05.
    so any one please help me what should be the logic to populate the child segment <b>zknvkm</b>.
    waiting for your reply
    thanks
    pavan

    Hi Pavan,
    Please try this.
    data: wa_edidd  like edidd,
          wa_zknvkm like zknvkm.
    loop at idoc_data.
       if idoc_data-segnam = 'E1KNVKM'.
         clear wa_edidd.    
         idoc_data-segnam = 'ZKNVKM'.
         wa_zknvkm = ...
         move wa_zknvkm to wa_edidd-sdata.
         append wa_edidd-sdata to idoc_data.
       endif.
    endloop.
    idoc_cimtype = 'ZKNVKM'.
    Hope this will help.
    Regards,
    Ferry Lianto

  • IDOC: Problem with data filter for IDOC extension field

    Hallo!
    I've created an idoc extension for the basic type DEBMAS06 that works fine. Now I want to use a data filter for one field ( company code ) of my segment. Every segment with a company code different from 100 should be filtered and not send to the other client. But what happend is that for all customers that have at least one company code different from 100, all segments including the one with cc 100 were deleted and a error "Segment ... does not exist for message type DEBMAS" appeared on the screen.
    Does anyone have any ideas about this problem?

    Not sure about changes to be made at the filtering options.
    An alternative would be sending the data to XI as it is and perform the mapping to remove the unnecessary segments.
    Disadvantage: Unnecessary processing of segment would be done at XI.
    Advantage: The integration logic would be completely handled by XI.
    Regards,
    Prateek

  • IDOC extension not considerated

    Hello.
    I am having a problem with an extension. I have added in an IDOC structure of ORDERS05 an extension with a segment ZE1EDK01 that is a child of E1EDK01. I went throught all the steps we normally read on every website... the WE31 thing, the "set release" etc...  In the final, when you look at the structure in WE30, the extension is found as a child of E1EDK01.
    That new segment contains a KOSTL that I manually fill in the user exit EXIT_SAPLEINM_011.
    Though, in this user-exit, we receive the "final structure" of the IDOC where, since it is not filled yet, the added segment ZE1EDK01 is not in the final structure so I don't understand how to insert the KOSTL in my new segment that is absent of the final IDOC structure
    I thought adding the segment through an append to the table containing the IDOC structure but I fell it would kinda mess up the segment structure and/or the whole IDOC structure (The new segment not being under the E1EDK01, for example).
    So I have a few ideas but no real solution...
    Is that possible i'm not in the right User-Exit to add the KOSTL value in the IDOC?
    Am I missing something in the configuration of that extension?
    Do I have to add the new segment structure myself with an append (Or an insert) inside the final IDOC?
    I'm a bit in a dead end here. Only a few hypothesis but no real answers on where to head with that.
    Thank you for your help.
    <removed by moderator>                                                                               
    Regards!
    Edited by: Thomas Zloch on Nov 22, 2011 5:33 PM

    You are right. Since ZE1EDK01 is your own segment, you need to insert it right below E1EDK01 to which it is a child.
    IDOC_OUTPUT_ORDERS won't append and fill the ZE1EDK01 segment for you, you need to do it yourself like below. And no it won't mess up anything provided, you defined ZE1EDK01 to be a child segment of E1EDK01, following right below it in your IDoc extension definition
    In user exit, EXIT_SAPLEINM_011, the code below will insert ZE1EDK01 segment right below E1EDK01, its parent.
      DATA: lv_tabix TYPE sy-tabix.
      DATA: ls_ze1edk01 TYPE ze1edk01.
      CLEAR dint_edidd.
      READ TABLE dint_edidd WITH KEY segnam = 'E1EDK01'.
      IF sy-subrc = 0.
        lv_tabix = sy-tabix + 1.
        CLEAR dint_edidd.
        dint_edidd-segnam = 'ZE1EDK01'.
        ls_ze1edk01-field = 'value'.   "Assign your Z segment field values here
        MOVE ls_ze1edk01 TO dint_edidd-sdata.
        INSERT dint_edidd INDEX lv_tabix.
      ENDIF.

  • IDOC extensions during Upgrade from Ver 4.6 to ECC 6.0

    We are working on an Upgrade project wherein we are going from Ver. 4.6 to ECC 6.0. Can you guide us what all we need to do with the IDOC extensions alerady implimented in ver 4.6 in order to confirm them good with ECC 6. Also to be noted, we are making the new system and all the customer developments Unicode compatible.
    Thank you!!

    Hi Satish,
    Now i am sending some URL for Functional upgrade
    May be those are all useful toyou
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/erp6/transactionsChangedinECC6.0
    http://solutionbrowser.erp.sap.fmpmedia.com/Default.aspx
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/erp6/
    Regards
    Surya

  • Help Everyone: IDOC Extension Problem

    Hi All,
    Ive created an idoc extension for idoc type ORDERS01. I appended an extension ZE1EDK01 below header segment E1EDK01. Im trying to populate this through an exit but I cant seem to find the right values for these specifically the segnum and hlevel:
      wa_edidd-MANDT  = SY-MANDT.
      wa_edidd-SEGNUM = '000002'.
      wa_edidd-SEGNAM = 'ZE1EDK01'.
      wa_edidd-PSGNUM = '000000'.
      wa_edidd-HLEVEL = '02'.
      wa_edidd-DTINT2 = '1000'.
    How do I determine the values above?
    Also, I created an extension for item data segment E1EDP01. Im directly modifying the internal table of the IDOC and I want to populate the extension per line item in the idoc. How do I do this? Do I just append entries to EDIDD? How do I ensure that each entry appended corresponds to the correct line item?
    Please help. I really need to finish this in 2 hours.
    Thank you so much.
    Best Regards,
    Kenny

    Hi,
    I get what is the issue here. <b>It is not because of using CASE statement or IF condition in LOOP</b>.
    You are using user-exit EXIT_SAPLEINM_002. This user-exit triggers for each segment added to IDOC. So this is what is happening.
    - Segment E1EDK01 is added then user-exit triggers and it adds ZE1EDK01 segment.
    - Now the next segment is E1EDK14. After this segment also the exit trigges. When you loop at int_edidd the very first segment is E1EDK01 and it again adds ZE1EDK01 segment.
    So, for each segment in IDOC this exit triggers and add segment ZE1EDK01 under E1EDK01.
    <b>The solution is to use user-exit EXIT_SAPLEINM_011 instead.</b>
    This is very last user-exit which trigges in FM IDOC_OUTPUT_ORDERS and it has all the segment in it. So there is nothing wrong with your code but you are using wrong user-exit.
    Let me know if you have any question.
    Regards,
    RS
    Actually Srinivas is also right. If you use the user-exit EXIT_SAPLEINM_002 without using loop command and only using CASE statement it will work. <b>OR</b> you use user-exit EXIT_SAPLEINM_011. Its upto you.
    Message was edited by:
            RS

  • Idoc Extension...Access Key

    Hi Guru
    Require your suggestion.
    I have to extend the standard idoc DEBMAS05 but when i am doing it asking for Access Key.
    Now i don't want to use access key. So what is other option for it,
    Can i copy the all DEBMAS05 idoc as ZDEBMAS05 and then do the extension....
    If yes then in  that case do i need to to make ZDEBMAS  Message Type or i can use the same DEBMAS Message for ZDEBMAS05.
    Please give me Steps how to procees for Copy the Besic type.
    Rgz
    SA

    Hi
    here is my scenario
    Can you help me on following.
    I am working on DEBMAS05 Idoc.
    Sender system sending  DEBMAS05 Idoc which is an Idoc Extension with two Z segment.
    Now here is my problem.
    In Receving system if i am extending the DEBMAS05 its asking for Access key.Which i don't want. Is any other alternative of doing this?
    I have two below option but not much clear about it.
    1. If i copy the DEBMAS05 to ZDEBMAS05 and then do idoc extension.In this case do i need to also make ZDEBMAS.
    or i can using DEBMAS as Message type for ZDEBMAS05?
    2. I found one function-exit 'EXIT_SAPLVV02_001' in (user-exit VSV00001) which has description 'Read and Post Additional Export Customer Master Segments'.
    can i use above function-exit  in DEBMAS05 without extending the Idoc for Z fields in reciver side.
    i am just evaluating above option so that i do not use Access Key.If above option is not valid then i may use Access Key,
    Please suggest.
    Regards
    RJ

  • Find Idoc extension type for Basic Idoc type

    Hi all,
    Is there any way to find existing extesions for Idoc given by SAP? For example, for basic idoc DEBMAS05 for version 4.7 , Idoc extension is DEBMASEXT.
    In similar way I want to know what is Idoc extension for Idoc basic type PREQCR02 [Create Purchase Requisition].
    Thanks in advance.
    Madhura

    The reason is preqcr02 is a generated idoc type  and matmas05 and debmas05 are not generated idoc types .
    You can search in table EDBAS for this .  If you go for dynamic debuggin , message comes from form
    create_ext_structure  in include MSED5F02 
    data: l_edbas type edbas.
      select single * from edbas into l_edbas
         where idoctyp eq edi_iapi01-idoctyp.
    if l_edbas-generated eq 'X'.
       message e099(b1) with
          'Action is not possible for generated idoctypes'.
    endif.
    Edited by: anil sasidharan on Feb 25, 2009 12:51 PM
    Edited by: anil sasidharan on Feb 25, 2009 12:59 PM

  • Idoc Extension name not getting populated

    Hi all
    I have extended the idoc INVOIC02 and inside the exit- EXIT_SAPLVEDF_002, i m writing code for custom segments. Now the problem is, i am not able to see my idoc extension name in the importing parameter(CONTROL_RECORD_OUT-CIMTYP ) of the exit FM .
    I have maintained the partner profile (with same extension), distribution model and WE82 config. Please let me know, any config. is required, so the extension name will get populated.
    Vinoth

    Hi
    Check in the WE57 where Link is maintianed for Message type Idoc type and Idoc extension is attached to FUnction Module
    and check the Process code.
    Prabhudas

  • Idoc extension not displayed - outbound / INVOIC02

    Hi All,
    I have created a Extension Idoc ZINV2 , Basic type INVOIC02.
    I have added the segment YE1EDK01 ( with 2 custom fields ) under the segment E1EDK01. the message type is INOIC.
    The Partner Type is KU and the partner number used is 7000001.
    In the Outbound parameters : i have assigned
    Partner function as PY
    Message type is INVOIC.
    Message function is US.
    and I am assigning the Basic type and Extesnion type here properly.
    The segment and the idoc extension are released.
    In VF02 , in OUTPUT i am giving the Output type as YU10 for outout MEDIUM EDI.
    The idoc is getting created without any problem. But the Extesnion type is not displayed in the idoc in WE02. the added segment YE1EDK01 is not displayed.
    What could be the Problem , i am not able to sort out.
    Kindly help me in solving this .
    Should we need to do anything in WE57.
    Kindly help in solving this problem.
    Waiting for your replies.
    Suki.R

    Hi,
    When you need to add an Idoc extension, it must be appended in INT_EDIDD itab, after the actual segment. hen only it will be picked in the Idoc.
    Steps to add extension(Example)::
    1. WE31 - Create A segment(ZETEST) with additional fields, that needs to be added.
    2. WE20 - Create the Extension(ZORDERS) for the given Basic type.
            2.1    Now add the custom segment(ZETEST) as the child segment to the segment which you want to extend(e.g. E1EDK01)
            2.2    Define the minimum and maximum occurrence
    3. Release the custom segment (ZETEST) and the Extension (ZORDERS).
    4. WE82 - Assign Basic type to extension / messages
    5. WE30 - Check and Transport IDoc extension
                     5.1  Give the Extension Name(ZORDERS)
                     5.2 In the menu Path :  Development Object -- >Check (Ensure that there are no errors or warnings)
                     5.3 Now Transport: Path: Development -> Transport
    6. WE20 - Now go to the Partner Profile and add the Extension(ZORDERS) in the Message control data and Save it.
    7. Go to the Function module for processing the Idoc, and add the code for custom fields.
    Eg Code:
    clear: lt_dxvbep, lt_dxvbep[],
           ls_dxvbap,
           ls_ysd_tvpr,
           ls_aufk,
           ls_ze1edket,
           ls_edi_partner,
           ls_int_edidd.
    if int_edidd-segnam = 'E1EDK01'.
      do 1 times.
        check control_record_out-cimtyp = 'ZORDERS'.
        data: ls_pmt_vbak like vbak,
              ls_pmt_vbuk like vbuk,
              ls_e1edk01  like e1edk01,
              ls_ze1edk01 like ze1edk01,
              ls_nastflags like ysd_tvoutflags.
    */ Clear workarea
        clear: ls_pmt_int_edidd.
    */ Get data
        select single * into ls_pmt_vbak from vbak
        where vbeln = dxvbak-vbeln.
        select single * into ls_pmt_vbuk from vbuk
        where vbeln = dxvbak-vbeln.
    */ Get customizing
        select * up to 1 rows
        from ysd_tvoutflags into ls_nastflags
        where flagn = 'STA_PMT_DELETE_IDOC'
          and kappl = 'V1'.
        endselect.
    */ Set extended name
        ls_pmt_int_edidd-segnam = 'ZE1EDK01'.
    */ Set data for ZE1EDK01
        ls_ze1edk01-cmgst = ls_pmt_vbuk-cmgst.
    */ Move to EDIdata and append
        move ls_ze1edk01 to ls_pmt_int_edidd-sdata.
        append ls_pmt_int_edidd to int_edidd.
    */ Modify E1EDK01 with extra field
        loop at int_edidd where segnam = 'E1EDK01'.
          move int_edidd-sdata to ls_e1edk01.
          ls_e1edk01-lifsk = ls_pmt_vbak-lifsk.
          move ls_e1edk01 to int_edidd-sdata.
          modify int_edidd.
        endloop.
      enddo.
    Hope this helps........

  • Regarding IDOCS.....

    Hii All,
    kindly suggest me some links regarding IDOCs, as I need to create one regarding PO.
    Points for sure......:)
    Regards,
    Ashish

    Hi
    If u want any material giev me ur mail id i'll forward u some documents
    <u><b>Data Creation in Idoc</b></u>
    IDocs are text encoded documents with a rigid structure that are used to exchange data between R/3 and a foreign system. Instead of calling a program in the destination system directly, the data is first packed into an IDoc and then sent to the receiving system, where it is analyzed and properly processed. Therefore an IDoc data exchange is always an
    asynchronous process. The significant difference between simple RFC-calls and IDoc data exchange is the fact, that every action performed on IDocs are protocolled by R/3 and IDocs can be reprocessed if an error occurred in one of the message steps.
    While IDocs have to be understood as a data exchange protocol, EDI and ALE are typical use cases for IDocs. R/3 uses IDocs for both EDI and ALE to deliver data to the receiving system. ALE is basically the scheduling mechanism that defines when and between which partners and what kind of data will be exchanged on a regular or event triggered basis. Such a set-up is called an ALE-scenario.
    IDoc is a intermediate document to exchange data between two SAP Systems.
    *IDocs are structured ASCII files (or a virtual equivalent).
    *Electronic Interchange Document
    *They are the file format used by SAP R/3 to exchange data with foreign systems.
    *Data Is transmitted in ASCII format, i.e. human readable form
    *IDocs exchange messages
    *IDocs are used like classical interface files
    IDOC types are templates for specific message types depending on what is the business document, you want to exchange.
    WE30 - you can create a IDOC type.
    An IDOC with data, will have to be triggered by the application that is trying to send out the data.
    FOr testing you can use WE19.
    How to create idoc?
    *WE30 - you can create a IDOC type
    For more information in details on the same along with the examples can be viewed on:
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm#_Toc8400404
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a6620507d11d18ee90000e8366fc2/frameset.htm
    http://www.sappoint.com/presentation.html
    http://www.allsaplinks.com/idoc_search.html
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://www.erpgenie.com/sapedi/idoc_abap.htm
    To Create Idoc we need to follow these steps:
    Create Segment ( WE31)
    Create Idoc Type ( WE30 )
    Create Message Type ( WE81 )
    Assign Idoc Type to Message Type ( WE82 )
    Creating a Segment
    Go to transaction code WE31
    Enter the name for your segment type and click on the Create icon
    Type the short text
    Enter the variable names and data elements
    Save it and go back
    Go to Edit -> Set Release
    Follow steps to create more number of segments
    Create IDOC Type
    Go to transaction code WE30
    Enter the Object Name, select Basic type and click Create icon
    Select the create new option and enter a description for your basic IDOC type and press enter
    Select the IDOC Name and click Create icon
    The system prompts us to enter a segment type and its attributes
    Choose the appropriate values and press Enter
    The system transfers the name of the segment type to the IDOC editor.
    Follow these steps to add more number of segments to Parent or as Parent-child relation
    Save it and go back
    Go to Edit -> Set release
    Create Message Type
    Go to transaction code WE81
    Change the details from Display mode to Change mode
    After selection, the system will give this message “The table is cross-client (see Help for further info)”. Press Enter
    Click New Entries to create new Message Type
    Fill details
    Save it and go back
    Assign Message Type to IDoc Type
    Go to transaction code WE82
    Change the details from Display mode to Change mode
    After selection, the system will give this message “The table is cross-client (see Help for further info)”. Press Enter.
    Click New Entries to create new Message Type.
    Fill details
    Save it and go back
    Check these out..
    Re: How to create IDOC
    Check below link. It will give the step by step procedure for IDOC creation.
    http://www.supinfo-projects.com/cn/2005/idocs_en/2/
    ALE/ IDOC
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.docs
    go trough these links.
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    An IDoc is simply a data container that is used to exchange information between any two processes that can understand the syntax and semantics of the data...
    1.IDOCs are stored in the database. In the SAP system, IDOCs are stored in database tables.
    2.IDOCs are independent of the sending and receiving systems.
    3.IDOCs are independent of the direction of data exchange.
    The two available process for IDOCs are
    Outbound Process
    Inbound Process
    AND There are basically two types of IDOCs.
    Basic IDOCs
    Basic IDOC type defines the structure and format of the business document that is to be exchanged between two systems.
    Extended IDOCs
    Extending the functionality by adding more segments to existing Basic IDOCs.
    To Create Idoc we need to follow these steps:
    Create Segment ( WE31)
    Create Idoc Type ( WE30)
    Create Message Type ( WE81)
    Assign Idoc Type to Message Type ( WE82)
    imp links
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    www.sappoint.com
    --here u can find the ppts and basic seetings for ALE
    http://sappoint.com/presentation.html
    www.sapgenie.com
    http://www.sapgenie.com/ale/index.htm
    WE30 - you can create a IDOC type.
    An IDOC with data, will have to be triggered by the application that is trying to send out the data.
    Try this..Hope this will help.
    >>>> SAP ALE & IDOC<<<<
    Steps to configuration(Basis) >>
    1. Create Logical System (LS) for each applicable ALE-enabled client
    2. Link client to Logical System on the respective servers
    3. Create background user, to be used by ALE(with authorizaton for ALE postings)
    4. Create RFC Destinations(SM59)
    5. Ports in Idoc processing(WE21)
    6. Generate partner profiles for sending system
    The functional configuration(Tcode: SALE)
    • Create a Customer Distribution Model (CDM);
    • Add appropriate message types and filters to the CDM;
    • Generate outbound partner profiles;
    • Distribute the CDM to the receiving systems; and
    • Generate inbound partner profiles on each of the clients.
    Steps to customize a new IDoc >>>
    1. Define IDoc Segment (WE31)
    2. Convert Segments into an IDoc type (WE30)
    3. Create a Message Type (WE81)
    4. Create valid Combination of Message & IDoc type(WE82)
    5. Define Processing Code(WE41 for OUT / WE42 for IN)
    6. Define Partner Profile(WE20)
    Important Transaction Codes:
    SALE - IMG ALE Configuration root
    WE20 - Manually maintain partner profiles
    BD64 - Maintain customer distribution model
    BD71 - Distribute customer distribution model
    SM59 - Create RFC Destinations
    BDM5 - Consistency check (Transaction scenarios)
    BD82 - Generate Partner Profiles
    BD61 - Activate Change Pointers - Globally
    BD50 - Activate Change Pointer for Msg Type
    BD52 - Activate change pointer per change.doc object
    BD59 - Allocation object type -> IDOC type
    BD56 - Maintain IDOC Segment Filters
    BD53 - Reduction of Message Types
    BD21 - Select Change Pointer
    BD87 - Status Monitor for ALE Messages
    BDM5 - Consistency check (Transaction scenarios)
    BD62 - Define rules
    BD79 - Maintain rules
    BD55 - Defining settings for IDoc conversion
    WEDI - ALE IDoc Administration
    WE21 - Ports in Idoc processing
    WE60 - IDoc documentation
    SARA - IDoc archiving (Object type IDOC)
    WE47 - IDoc status maintenance
    WE07 - IDoc statistics
    BALE - ALE Distribution Administration
    WE05 - IDoc overview
    BD87 - Inbound IDoc reprocessing
    BD88 - Outbound IDoc reprocessing
    BDM2 - IDoc Trace
    BDM7 - IDoc Audit Analysis
    BD21 - Create IDocs from change pointers
    SM58 - Schedule RFC Failures
    Basic config for Distributed data:
    BD64: Maintain a Distributed Model
    BD82: Generate Partner Profile
    BD64: Distribute the distribution Model
    Programs
    RBDMIDOC – Creating IDoc Type from Change Pointers
    RSEOUT00 – Process all selected IDocs (EDI)
    RBDAPP01 - Inbound Processing of IDocs Ready for Transfer
    RSARFCEX - Execute Calls Not Yet Executed
    RBDMOIND - Status Conversion with Successful tRFC Execution
    RBDMANIN - Start error handling for non-posted IDocs
    RBDSTATE - Send Audit Confirmations
    FOr testing you can use WE19.
    Check these links.
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.docs
    Please check this PDF documents for ALE and IDoc.
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEIO/BCMIDALEIO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEPRO/BCMIDALEPRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFAALEQS/CABFAALEQS.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDISC/CAEDISCAP_STC.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDI/CAEDI.pdf
    Check below link. It will give the step by step procedure for IDOC creation.
    http://www.supinfo-projects.com/cn/2005/idocs_en/2/
    <b>Reward points for useful Answers</b>
    Regards
    Pavan

  • Standar IDOC Extension

    Hello Group:
            I Need to Extend the Standard Idoc BUPA_INBOUND_MAIN_SAVE_M03.
            I created the New Segment with their fields in the WE31.
            Now, I want to Create the Extension in the WE30.
            But the Error is appearing:
            "Cannot create extension for generated IDoc types"
            Please, Anybody could tell me how correct it?
                                        Sincerely, Thank you, Herná

    Usually enhancement takes place when the content in IDocs provided by SAP are not sufficient for the business process. IDoc extension can take place whenever dictionary table has a new structure appended required by the business process.
    In brief IDoc extension takes place when extra fields are required for the business process.
    If you are creating a new IDOC.....
    1) Create segment (WE31)
    Of course it will have naming convention for different company. Here are some tips:
    2) Create IDOC Types (WE30)
    3) Create message type (WE81)
    4) Link message type with basic type (WE82)
    5) Create FM
    In the FM all the attributes should be the same for Inbound or Outbound. Basically you can get an example from the std FM
    6) Create Process Code (Inbound - WE41/ Outbound - WE42)
    7) Link FM with Basic Type

  • Inbound IDOC extension

    Hi,
    iam working on an inbound IDOC TPSSHT01, i need to add an extrta field and segment , so i create an data element and  Z segment and add the field in the segment
    i have to copy the TPSSHT01 to a ZTPSSHT01 and do the IDoc extension ,
    i have to copy the function module IDOC_INPUT_SHIPPL to Z_IDOC_INPUT_SHIPPL
    Can any body let me know what are the steps that i have to follow to process the inbound idoc with the above requirment
    Cheers,
    Sai

    Hi ,
          Follow this procedure .
    In bound Idoc…
    Step 1: Create segment
    a.     T.code WE31
    b.     Enter a new segment type and press create button
    c.     Give a short text
    d.     Enter the field names say FIELD NAME : MATNR ;; DATA ELEMENT: CHAR(18)
    e.     Save the segment   (zkrishseg)
    Step 2: Create IDOC type
    a.     T.code WE30
    b.     Enter a new IDOC type name
    c.     Choose the basic type and press the create button.
    d.     Choose the create new option button and enter a description and press enter
    e.     Place the cursor on the type name and then press create button.
    f.     Enter the segment name created in step 1 and check the mandatory segment check box
    g.     Enter minimum number and maximum number as 1 and press enter.
    h.     Then save the IDOC type.   (zkrishtyp)
    Step 3: Create message type
    a.     T.code WE81
    b.     Press change button.
    c.     Press new entries button.
    d.     Enter a message type and short text and press save button. (zkrishmsg)
    Step 4: Assign message type to IDOC type.
    a.     T.code WE82
    b.     Press change button
    c.     Press new entries button.
    d.     Enter the created message type, IDOC type and version release (46B or 46C)
    Step 5:  Create a function module for inbound. (Z_IDOC_KRISH_INBOUND)
    Step 5A: Create characteristics of inbound FM.
    a.     T.code BD51
    b.     Click ‘New entries’
    c.     Enter the IDOC function module name and 1(individual type) in ‘input t.’.
    d.     Save it.
    Step 6: Assignment of FM to log, message and type.
    a.     T.code WE57
    b.     Go for change mode and click ‘new entries’.
    c.     In processing by…enter FM name and enter ‘F’ as type.
    d.     Enter basic type (idoc type-zkrishtyp) and message type (zkrishmsg) in the respective text boxes.
    e.     Choose the direction as 2 – Inbound.
    f.     Save the data.
    Step 7. : Creation of inbound process code.
    a.     T.code WE42
    b.     Go to change mode and click ‘create entries’.
    c.     Enter a new process code and description (zidockrish)
    d.     Enter the FM name in the identification text box
    e.     Choose processing with ALE service
    f.     Choose processing by FM and click Save button
    g.     In the next screen, select the FM name and click save button
    Step 7a : Creation of inbound process code.
    h.     T.code SM59
    i.     Select ‘R/3 connection’  and click ‘create’.
    j.     Enter all system related things(for Eg. Connection type as ‘3’, Target host as ‘SAP04’,
    Description , and Logon  details and save.
    Step 8:  Define a port
    a.     T.code WE21
    b.     Click on Transactional RFC and press the ‘Create’ button
    c.     Enter a port name and description. (ztestkrish)
    d.     Choose the release type.
    e.     Choose the RFC destination.
    f.     To create RFC destination…go to SPRO and search RFC destination…and create.
    g.     Save the data.
    Step 9. Define logical system
    a.     T.code SALE
    b.     Click down the sending and receiving systems
    c.     Click down the logical systems
    d.     Choose Define logical system.
    e.     Go for new entries.
    f.     Enter a new name and description and save it. (zkrishlog)
    Step 10. Create partner profile
    a.     T.code  WE20
    b.     Choose partner type LS and click create.
    c.     Enter the logical system name in partner number
    d.     Then Save …. Here Type is ‘US’.
    e.     click + icon(create inbound parameter) in the bottom. Note: Two table control subscreens will appear.  One for inbound and the other for outbound.  Click + icon in inbound area.
    f.     Enter the message type, process code and save the data.
    Step 11. Checking the Idoc
    a.     T.code WE19,
    b.     Choose radio Basic type , enter the type name(zkrishtyp) and press execute button.
    c.     Click on EDIDC Number.
    d.     Enter partner Number, Partner type, Port Number for sender and recipient ( data remains same here for sender and recipient)
    e.     Enter Message type and press ENTER.
    f.     Click on empty space corresponding to SEGMENT name and enter Paarameters like MATNR, WERKS and CHARG etc….
    g.     Click standard inbound properties here…  and press enter… see the result….
    h.     T.code WE02
    i.     Enter IDOC number press ENTER see the status.
    Function Module in Inbound
         Import Parameters
         INPUT_METHOD           LIKE BDWFAP_PAR-INPU              Inbound method for the IDoc inb 
    MASS_PROCESSING     LIKE BDWFAP_PAR-MASS            Flag: Mass processing 
    Export Parameters        
    WORKFLOW_RESULT     LIKE      BDWF_PARAM-RESULT          Final value of method          
    APPLICATION_VARIABLELIKE      BDWF_PARAM-APPL_VAR  Variable to be used by 
    IN_UPDATE_TASK      LIKE      BDWFAP_PAR-UPDATETASK       Flag: Application has 
    CALL_TRANSACTION_DONLIKE      BDWFAP_PAR-CALLTRANS        Flag: Application 
    tables
         IDOC_CONTRL         LIKE      EDIDC                       Control record (IDoc)       
    IDOC_DATA              LIKE      EDIDD                       Data record (IDoc)          
    IDOC_STATUS          LIKE      BDIDOCSTAT           ALE IDoc status (subset of al
    RETURN_VARIABLES    LIKE      BDWFRETVAR    Assignment of IDoc or documen
    SERIALIZATION_INFO  LIKE      BDI_SER                Serialization objects for one
         Source code
    FUNCTION ZASHOKMODULE.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
    *"     VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
    *"  EXPORTING
    *"     VALUE(WORKFLOW_RESULT) LIKE  BDWF_PARAM-RESULT
    *"     VALUE(APPLICATION_VARIABLE) LIKE  BDWF_PARAM-APPL_VAR
    *"     VALUE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK
    *"     VALUE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS
    *"  TABLES
    *"      IDOC_CONTRL STRUCTURE  EDIDC
    *"      IDOC_DATA STRUCTURE  EDIDD
    *"      IDOC_STATUS STRUCTURE  BDIDOCSTAT
    *"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR
    *"      SERIALIZATION_INFO STRUCTURE  BDI_SER
    data: begin of w_data occurs 0.
           include structure edidd.
    data: end of w_data.
    data: wa_data like ZASH1.
    data : i_data like standard table of wa_data initial size 0.
    *tables : zhemal1.
    data : begin of wa_zhemal1.
            include structure zhemal1.
    data : end of wa_zhemal1.
    data : i_ZHEMal1 like standard table of wa_ZHEMal1 initial size  0.
    read table idoc_data with key SEGNAM = 'ZASH1'.
    loop at  IDOC_DATA into  W_DATA where segnam = 'ZASH1'.
      WA_DATA = W_DATA-SDATA.
      wa_data  = w_data-sdata.
      append wa_data to i_data.
    endloop.
    MOVE IDOC_DATA-DOCNUM TO IDOC_STATUS-DOCNUM.
        IDOC_STATUS-MSGID = 'ZABC'.
        IDOC_STATUS-STATUS = 53.
        IDOC_STATUS-MSGTY = 'S'.
        IDOC_STATUS-MSGNO = '001'.
        APPEND IDOC_STATUS.
    LOOP AT i_data into wa_data.
    wa_ZHEMal1-VBELN = wa_data-VBELN.
    wa_ZHEMal1-POSNR = wa_data-POSNR.
    wa_ZHEMal1-MATNR = wa_data-MATNR.
    wa_ZHEMal1-MATWA = wa_data-MATWA.
    wa_ZHEMal1-MATKL = wa_data-MATKL.
    append wa_ZHEMal1 to i_ZHEMal1.
    insert ZHEMal1 from table  i_ZHEMal1 accepting duplicate keys .
    ENDLOOP.
    ENDFUNCTION.
    For Out bond  Steps are
    1.     Create segment
    2.     Create Type
    3.     Create Message Type
    4.     Assign message Type to Idoc Type.
    5.     Create Port
    6.     Define Logical systems.
    7.     Define Partner profile.
    8.     Create a Report program.
    Report program Out bond
    REPORT ZASH1 .
                  Outbound standalone idoc creation                      *
    Program Name : Y_VENMAST_OUTBOUND_STANDALONE                         *
    Description  : Outbound standalone idoc creation for training        *
                   to Unilever offshore team members                     *
    Created by   : Satyam Computer Services Ltd.                         *
    Created on   : 04.01.2002                                            *
                           Modification Log                              *
    Developer           Date            Transport #   Details            *
    Subramony         04.01.2002                                         *
    Tables Declaration                                                   *
    TABLES : zhemal1.
    Internal table declaration                                           *
    data : i_zhem1 Like standard table of zhem1 with header line.
    data : control_record_out like edidc.
    *data: p type p decimals 2,
         c(10) type c.
    start-of-selection.
        p = '3.14'.
        c = p.
        overlay c with '0000000000000'.
      write c.
    DATA : BEGIN OF I_EDIDD OCCURS 0.
            INCLUDE STRUCTURE EDIDD.
    DATA : END OF I_EDIDD.
    DATA : BEGIN OF I_EDIDC OCCURS 0.
            INCLUDE STRUCTURE EDIDC.
    DATA : END OF I_EDIDC.
    DATA : BEGIN OF I_zhemal1 OCCURS 0,
                VBELN LIKE zhemal1-VBELN,
                POSNR LIKE zhemal1-POSNR,
                MATNR LIKE zhemal1-MATNR,
                MATWA LIKE zhemal1-MATWA,
                MATKL LIKE zhemal1-MATKL,
           END OF I_zhemal1.
    SELECT-OPTIONS : S_vbeln FOR zhemal1-vbeln .
    START-OF-SELECTION.
      PERFORM F_GET_zhemal1.
    END-OF-SELECTION.
    Building Control record
    CONTROL_RECORD_OUT-MESTYP = 'ZASH1'.
    CONTROL_RECORD_OUT-IDOCTP = 'ZASH1'.
    CONTROL_RECORD_OUT-RCVPRT = 'LS'.
    CONTROL_RECORD_OUT-RCVPRN = 'ZASH1'.
    CONTROL_RECORD_OUT-sndPRT = 'LS'.
    CONTROL_RECORD_OUT-sndPRN = 'ZASH1'.
    PERFORM F_PROCESS_OUTPUT.
    *PERFORM F_FILL_EDIDD.
    PERFORM F_CREATE_IDOC.
    Form  F_GET_Y1COTU110                                                *
    FORM F_GET_zhemal1.
      SELECT VBELN  POSNR MATNR MATWA MATKL
             FROM ZHEMAL1
             INTO TABLE I_ZHEMAL1
             WHERE VBELN IN S_VBELN.
    ENDFORM.                    " F_GET_zhemal1
    Form f_process_output                                                *
    FORM F_PROCESS_OUTPUT.
      LOOP AT I_zhemal1.
      I_zhem1-VBELN = I_zhemal1-VBELN.
      I_zhem1-POSNR = I_zhemal1-POSNR.
      I_zhem1-MATNR = I_zhemal1-MATNR.
      I_zhem1-MATWA = I_zhemal1-MATWA.
      I_zhem1-MATKL = I_zhemal1-MATKL.
      i_edidd-segnam = 'ZASH1'.
        i_edidd-sdata  = I_zhem1.
        append i_edidd.
        clear i_edidd.
      ENDLOOP.
    ENDFORM.                    " f_process_output
    Form  f_create_edidc                                                 *
    FORM F_CREATE_IDOC.
      CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
           EXPORTING
                MASTER_IDOC_CONTROL            = CONTROL_RECORD_OUT
           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 SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        LOOP AT I_EDIDC.
          WRITE :/ 'IDoc Generated  :' , I_EDIDC-DOCNUM.
        ENDLOOP.
        COMMIT WORK.
      ENDIF.
    ENDFORM.                               " f_create_idoc
    Please reward if useful.

  • User Exit-Idoc extension customising

    Hello all,
    Can anyone tell me how I can establish a Link between a Basic idoc type and Idoc Extension?
    I wrote a INCLUDE programme in the USER EXIT SAPLVV01.
    I really appreciate your help.
    Note: Points for sure.
    Thank you

    Joslyn-
    The link between Basic IDOC type and IDOC extension is done in the partner profile first (WE20). After you have created an extension for your IDOC, you need to provide the same under Extension IDOC type in the outbound parameters of partner profile.
    I am not sure about your requirement but from the user exit you are using, I guess you have more than one extension for customer master IDOC and you want to choose one based on certain parameters. The import and tables parameters of this exit should provide you enough information to do the same.
    Let us know with specific questions if you need more info.
    KK

  • IDOC extension with SAP Upgrade

    Hi,
    I'm using IDOC extension in my scenario. I just concern that if one day my company decides to update SAP into a newer version. Would that has any impact on my IDOC? Becasue in T-Code: WE82 that I use to assign IDOC extension, there is a field for SAP Release version. If Release version is changed, Do I have to come to this T-Code and add my extension to the new release?
    Thanks,
    Pavin

    Hi,
    From Release 4.0 the IDoc type is identified via the basic type  and extension  fields and no longer via the DOCTYP field. Therefore, the different identification fields must be assigned to each other so that new extensions can be used for communication with older releases.
    IDOCTYP and CIMTYP must be converted to DOCTYP in the following cases:
            You are communicating with an R/3 System with Release 3.0/3.1.
            You or your business partner are using an EDI subsystem with an older release status.
            You are communicating with an R/3 System with Release 2.1/2.2 or an R/2 System which has defined and therefore u201Crecognizesu201D your extended IDoc type (as a former intermediate structure). This case is extremely rare.
    You can convert the fields in the IDoc type editor (transaction WE30) with which you have defined your 4.X extension (Environment ® Conversion ® IDoc type).
    Hope this link helps u...
    http://help.sap.com/saphelp_nw04/helpdata/en/dc/6b7f2f43d711d1893e0000e8323c4f/frameset.htm
    Edited by: anil sasidharan on Mar 3, 2009 11:04 AM

Maybe you are looking for