Custom Idoc-segments

Hi,
I am working on inbound processing of idocs. The issue is to post production confirmations into SAP using idocs sent by the middleware. I have to create a custom idoc for this purpose. I know the steps for creating a custom idoc type and message type.
The problem is that the number of segments of each idoc sent by the middleware is not fixed. They wanted the idoc to be setup in such a way that each time they send an idoc they want segments repeated based on the entries in the flat file.
Please help me out.Thanks

HI,
For this i have a solution.
you can make two segments one is header and other is item.
in Header segment only setno field ocours. and in item segment all three fields will be there. like this.
HEADER INFORMATION:
1
ITEM INFORMATION:
1 a i
1 b o
i c o
Now you fill your each idoc for each setno. and distribute it. and in receving system you will got a IDOC for each SETNO. Then you can loop in header segment and find all its items from item segment.
Regards,
HRA
<b>Reward points if my post helps you.</b>

Similar Messages

  • Custom idoc segment fields not populated

    Way back in 1999 someone create a custom Idoc type with custom Idoc segments in it.  Unfortunately, they forgot to release one of the segments.
    Recently a change was request to add new fields to this custom segment.  In order to get the fields transported the segment had to be released.
    All worked fine in Dev and the new Idoc segments were populated as expected.  However when the idoc segment was moved to the test system all visually appears to be fine but when the idoc is created (status 50) the new fields are not popultated. 
    In 40B the start of the inbound process was IDOC_INBOUND_DATA.  Does anyone know what the new starting point is in 4.7??
    I beleive the error is actually that SData is not reading all the input values and stopping right where the old fields end in teh custom segment.
    Thanks,
    Anthony

    additionally,
    SAP will not allow us to release the basic idoc type because it was released in 40B.  It also will not allow us to cancel the release since we are now in 620.  So, unless anyone has input for this I think the only solution will be to create a successor IDoc type and change our apps to use the new IDoc type with it's enhancements.

  • Error While Creating Custom IDOC Segment using WE31

    Could anyone please help me resolve this issue.
    I am getting following error when trying to create a custom IDOC segment type using WE31.
    "Name range violation: Name Z1WOHDR not permitted in SAP system"
    Segment type trying to create: Z1WOHDR
    Regards
    Venu

    Try changing the name , But i am not getting any such error with the name you are using.
    Just Try with some onther name

  • Error when trying to extend custom idoc

    Hi ladies and gentlemen,
    I am experiencing problems when I try to extand a custom idoc segment.
    I created a custom idoc (ZBEVINBDEL) with 3 segments, generated it and have tested it successfully.  Now the users have come back and requested additional fields.  When I tried to modify the custom segment (after cancelling the segment and idoc status' from released status, I got the message 'Segment type Zxxxxx.. cannot be changed'  (this is because the idoc segment type has been flagged as generated).
    So I thought I'll create an extension to the corresponding segment.  I've created the extension segment in WE31, but when I try to create the extension (ZBEVINBDELX02), and try to create as new to the linked type ZBEVINBDEL, I get another error message 'Action is not possible for generated idoctypes'.
    Has anybody experienced this problem before, and could you give me an explanation on how to get around these problems, either for changing the segment or extending one.  If the answer lies within BDBG, please explain in detail.
    Cheers,
    Steve

    Reuben,
    In the end, I didn't need to touch the extension.  I was able to achieve my goal by adding the new fields in  my custom structure in SE11, and the new fields came into the idoc automatically.  Then I just had to add code to handle the new fields in my Function module.
    Good Luck,
    Steve

  • Maximum Lenght of IDoc Segment

    Folks,
    I am editing definition of custom IDoc segment and trying to add 5 fields with length of   256 characters each. But SAP gives error message each & every time "Segment length is more than 1000 Character" which dose not allow me to change segment definition.
    It is default that we can not change segment length to more than 1000 character or is there any way to change it?
    Thanks!!

    Nope, IDOC data segment can be maximum 1000 bytes

  • Custom IDOC type Segment-field length change

    Hello,
    We have a custom segment developed for triggering Outbouds. I'm tring to change the Field length of a deta element used for one of the fields in the segment.
    But after chaning the data element and activating it also, the changes are not effecting in WE31/ in the structure of the segment.
    Process I'm following:
    we31 <segment>
    ......cancel release
    Change data element and activate
    ....set release.
    Please suggest if something else can be done
    Thanks,
    Lucky.

    > @Sarvesh: The IDOC segment has been released.  I also re-imported the IDOC into XI - is that what you mean by 'reloaded'?
    No, re-importing in XI is different from reloading the metadata into ABAP stack of XI using IDX2 transaction. So if you have not done this, then this could be the main reason of truncating the length.
    Regards,
    Sarvesh

  • After creating successor to a custom IDOC?

    Hello
    We have a custom IDOC type (for sales orders) in the system. Now business want to pass additional data, as per this requirement am trying to add a new custom segment to this custom IDOC, but am getting the below error,
    ZORDR03 has already been released, only display possible
    Message no. E0639
    Diagnosis
    ZORDR03 has already been released. This means that the basic type or extension is locked
    against changes and can only be displayed.
    Procedure
    You can create a successor based on ZORDR03.
    I guess, i can not do CANCEL RELEASE from Memu-->Edit! because this custom IDOC is created in older versions, like 46C, currently we are on ECC6.0, hence i need to create a successor, but pls. let me now
    1) Do I need to change all the config settings like in WE72, WE82, WE20 O/B Prtaner profiles of EDP13?
    2) In what/where else i need to change or replace old ZORDR03  with newley creating ZORDR04?
    Thank you

    You need to be patient - this is not a Helpdesk where you've raised a high priority ticket...
    I'll just say that when we upgraded to ERP6.0, I did not agree with the fact that we could not cancel release on our custom IDOCs and we did not want to create a new version (it's been too long - I don't remember the technical reason for the issue with the new version).  We reset the release in the definition table and made the required changes.  There were no issues with the change.  If you want o go with the 'standard' appraoch, create a new version...

  • Regarding Creation of Custom IDOC

    Hi,
    This is Abdullah Shaik. I want to create an IDOC from the existing IDOC. Some times I need to add some segments to the existing IDOC. Can anybody plz let me know the process how to create the Customized IDOC from the Standard IDOC?
    Thanks & Regards,
    Abdullah shaik.

    Hi Abdullah,
    There are basically two types of IDOCs:-
    Basic IDOCs and Extended IDOCs
    Basic IDOC type defines the structure and format of the business document that is to be exchanged between two systems.
    Extending the functionality by adding more segments to existing Basic IDOCs.
    Creation of IDOC
    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
    Go thro' this link:-
    http://help.sap.com/saphelp_46c/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    I hope this provides you a solution.
    Regards.
    Praveen

  • Development of custom IDOC's

    Hi All,
    Can we go for approach of developing custom IDOC's? where in our scenarios are getting files from thrid party and updating data in file  into ECC.
    Approach towards Custom IDOC's is for error monitoring and recprocessing.
    Would request your inputs and suggesions in this regard.
    Is that good approach for going to custom idocs? if not why?
    Thanks,
    chandra.

    Hi,
    SAP R/3 systems send out data through IDoc (Intermediate Document), which in internally has segments and fields containing the data. But sometimes, these fields are not sufficient for a specific end-to-end business scenario as far as data transfer is concerned. So in such scenario, either few fields are to be added or subtracted, or completely new structure- IDoc needs to be created.
    At times because of the business scenario we do have to create Custom idocs .
    Regards,
    Bhanu

  • PROBLEM IN CUSTOM IDOC CREATION

    Hi Friends,
                    I'm facing a problem in custom idoc creation plz try to assist me
    1.As per the information i have  i'm creating segment in we31
    for cremas01 idoc.But when i enter the name for segment i'm getting message "Name range Voilation particular name which i had given is not permitted in customer system?
    Plz clarify this,and are there any formalities which i should look for before creating custom idoc?
    Good answers will be rewarded.
                                                                              Regards,
                                                                               Vinod.

    The Problem might be.... with the naming of the segment.
    Standard segments should be created with 'E1' and all the custom segments are created using 'Z1' and the name with 8 characters long only is permitted.
    Reward Points if useful.

  • Custom process code and FM for custom IDoc...

    Hello Experts,
    I created a custom IDoc based from ARTMAS05 IDoc. This is because we only need 3 segments and
    the standard idoc(Artmas05) contains so many segments that we need.
    Now, will I create a custom process code and FM for this? how do I go about this?
    Thank you guys and take care!

    Hello,
                 Here are the Steps that we need to be following while creating a Custom Process Code with Custom Function Module. ( Since the Segments to be handled are very Less, I am recommending that you go for a Custom Function Module).
    1. Go to SE37 Create a Function Module. Please ensure to Create it with the IMPORT / EXPORT /TABLES parameters exactly in the way that they exist in any Standard SAP Inbound FM (Refer to IDOC_INPUT_ORDERS for example).
    2. Once our FM is Ready (Need not be Complete with the Code to go ahead with the Process Code Creation) and Active, the next Step is to Create an Entry in the Transaction Code BD51 where we will register the Function Module.
    3. Next, we'll have to go to T-Code WE57 where we'll have to make an entry for the Function Module with the IDoc Type & Message Type.
    4. Finally, go to WE42 and Create a New Process Code and assign the Function Module and the Message Type.
    NOTE 1 : The Process Code is, as we know, Client Dependent. So, once you create a Process Code, we need to have it migrated to the Testing Environment to Start & Carry Out Testing.
    NOTE 2: If Step 2 & 3 are missing, then we'll not be able to assign the Function Module in WE42 while Creating Process Code.
    Hope it was helpful.
    Thanks and Regards,
    Venkata Phani Prasad K

  • Idoc segment population logic needed

    Hi experts,
    I am creating a custom idoc. The custom idoc has one parent segment(zhead1) and a child segment(zinvoice).
    I am populating the  invoice numbers(BELNR) and their line items in the child segment against a particular check number(PAYR_CHECT).
    The structure is coming something like this: If a check has 2 different invoices each having two diff. line items, then  4child segment(containing invoice no. and it's respective line item in one child segment) is getting created against a parent segment(containing check header details).
    But I require a parent segment to get populated against each check no. as well as invoice number and the invoice line items to be in the child segment of the invoice header segment.
    How to do this.
    My current code is:
    LOOP AT T_ZCHKHDR INTO WA_ZCHKHDR.
        CLEAR T_IDOC_DATA.
    Fill the header segment
        ZCHKHDR-ZBUKR  = WA_ZCHKHDR-ZBUKR.
        ZCHKHDR-CHECT  = WA_ZCHKHDR-CHECT.
        ZCHKHDR-ZALDT  = WA_ZCHKHDR-ZALDT.
        ZCHKHDR-VOIDD  = WA_ZCHKHDR-VOIDD.
        ZCHKHDR-RWBTR  = WA_ZCHKHDR-RWBTR.
        ZCHKHDR-STATUS = WA_ZCHKHDR-STATUS.
        ZCHKHDR-BANKA  = WA_ZCHKHDR-BANKA.
        ZCHKHDR-RZAWE  = WA_ZCHKHDR-RZAWE.
        ZCHKHDR-XBLNR  = WA_ZCHKHDR-XBLNR.
        ZCHKHDR-LIFNR  = WA_ZCHKHDR-LIFNR.
        ZCHKHDR-WMWST1 = WA_ZCHKHDR-WMWST1.
        ZCHKHDR-BKTXT  = WA_ZCHKHDR-BKTXT.
        T_IDOC_DATA-SDATA = ZCHKHDR.
    *-- Reduce fields for the segment
        CALL FUNCTION 'IDOC_REDUCTION_FIELD_REDUCE'
          EXPORTING
            MESSAGE_TYPE = C_MSG_TYPE
            SEGMENT_TYPE = C_SEGNAM_ZCHKHDR
            SEGMENT_DATA = T_IDOC_DATA-SDATA
            EMPTY_SYMBOL = C_SLASH
          IMPORTING
            SEGMENT_DATA = T_IDOC_DATA-SDATA.
        T_IDOC_DATA-SEGNAM = C_SEGNAM_ZCHKHDR.
        T_IDOC_DATA-MANDT = SY-MANDT.
        APPEND T_IDOC_DATA.
    Fill the item segment
        LOOP AT T_ZCHKLN INTO WA_ZCHKLN WHERE CHECT = ZCHKHDR-CHECT.
          ZCHKLN-CHECT = WA_ZCHKLN-CHECT.
          ZCHKLN-EBELN = WA_ZCHKLN-EBELN.
          ZCHKLN-PO_EBELP = WA_ZCHKLN-PO_EBELP.
          ZCHKLN-PO_WERKS = WA_ZCHKLN-PO_WERKS.
          ZCHKLN-PO_KOSTL = WA_ZCHKLN-PO_KOSTL.
          ZCHKLN-PO_WBS = WA_ZCHKLN-PO_WBS.
          ZCHKLN-PO_SAKTO = WA_ZCHKLN-PO_SAKTO.
          ZCHKLN-BELNR = WA_ZCHKLN-BELNR.
          ZCHKLN-IN_BUZEI = WA_ZCHKLN-IN_BUZEI.
          ZCHKLN-IN_MENGE = WA_ZCHKLN-IN_MENGE.
          ZCHKLN-IN_MWSKZ = WA_ZCHKLN-IN_MWSKZ.
          ZCHKLN-IN_WRBTR = WA_ZCHKLN-IN_WRBTR.
          ZCHKLN-IN_BSTME = WA_ZCHKLN-IN_BSTME.
          T_IDOC_DATA-SDATA = ZCHKLN.
    *-- Reduce fields for the segment
          CALL FUNCTION 'IDOC_REDUCTION_FIELD_REDUCE'
            EXPORTING
              MESSAGE_TYPE = C_MSG_TYPE
              SEGMENT_TYPE = C_SEGNAM_ZCHKLN
              SEGMENT_DATA = T_IDOC_DATA-SDATA
              EMPTY_SYMBOL = C_SLASH
            IMPORTING
              SEGMENT_DATA = T_IDOC_DATA-SDATA.
          T_IDOC_DATA-SEGNAM = C_SEGNAM_ZCHKLN.
         T_IDOC_DATA-HLEVEL = 2.
          T_IDOC_DATA-MANDT = SY-MANDT.
          APPEND T_IDOC_DATA.
          ENDIF.
          CLEAR: WA_ZCHKLN.
        ENDLOOP.
        AT LAST.
          PERFORM SUB_MASTER_IDOC_CONTROL.
          T_IDOC_HEADER-MESTYP = C_MSG_TYPE.
          T_IDOC_HEADER-IDOCTP = C_IDOC_TYPE.
          SELECT SINGLE PARNUM FROM EDPP1
                               INTO V_SDNPRN
                               WHERE PARTYP = C_LS.             "#EC
          T_IDOC_HEADER-SNDPRN = V_SDNPRN.
          T_IDOC_HEADER-SNDPRT = C_LS.
          T_IDOC_HEADER-OUTMOD = C_OUTMOD.
          T_IDOC_HEADER-STDMES = C_STDMES.
          T_IDOC_HEADER-RCVPFC = V_RCVPFC.
          T_IDOC_HEADER-RCVPRN = V_RCVPRN.
          T_IDOC_HEADER-RCVPOR = V_RCVPOR.
          T_IDOC_HEADER-RCVPRT = C_LS.
          DESCRIBE TABLE T_IDOC_DATA LINES V_LINES.
          IF V_LINES > 0.
            CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
              EXPORTING
                MASTER_IDOC_CONTROL            = T_IDOC_HEADER
              TABLES
                COMMUNICATION_IDOC_CONTROL     = T_COMM_IDOC_CONTROL
                MASTER_IDOC_DATA               = T_IDOC_DATA
              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.
              READ TABLE T_COMM_IDOC_CONTROL INTO WA_COMM_IDOC_CONTROL INDEX 1.
              IF SY-SUBRC = 0.
                MESSAGE S000(ZFI) WITH WA_COMM_IDOC_CONTROL-DOCNUM.
              ENDIF.
            ELSE.
              MESSAGE W001(ZMM) WITH TEXT-003.
            ENDIF.
          ENDIF.
          CLEAR T_IDOC_DATA.
          REFRESH T_IDOC_DATA.
        ENDAT.
        CLEAR: WA_ZCHKHDR.
      ENDLOOP.
    Regards,
    Sangeeta.

    As many entries you have in t_zchkhdr those many headers will be created for header and as many entries you have in t_zchkln , those many entries will be created in line.
    I hope you have the occurences as 1 to many for lines.
    Also you are distributing the IDoc within the loop at t_zchkhdr so one IDoc will be created per t_zchkhdr line.
    If you want one Idoc containing all the headers, then move the MASTER_IDOC_DISTRIBUTE outside the outer loop.
    regards,
    Advait
    Edited by: Advait Gode on Nov 5, 2008 3:46 PM

  • IDOC-Segment Created a idoc document against Billing document

    Dear All,
    Thanks in  advance.
    Already created a idoc document against Billing document and one of the IDOC segment is not in the IDOC document output segments(WE05) actually it missed the segment.
    so i want to add the segment which it was missed during generation of IDOC document against billing document.
    Example:
    a) IDOC document misses one segment let suppose "Seg1".
    b) In "Seg1" it have only one field let suppose "Field1".
    c) But "Field1" does not have any value while generation of IDOC document so it doesn't create the respective segment in IDOC document.
    d) so here, i want to edit the IDOC document to add the "Seg1" in the IDOC document and reprocessing the IDOC document.
    Please help on this issue.
    Regards,
    Sridhar.

    Hello,
              If your requirement is to have the Segment even with only 1 Field, you'll have to create an Idoc Extension in WE30.
             In order to populate the Custom Segment, Use the Customer Function '002' in the IDOC_OUTPUT_INVOIC which is EXIT_SAPLVEDF_002 where you can actually insert the Segment as a Child Segment of an Appropriate Segment.
            You can go for Custom segment with the IDoc Extension so that you dont have to manually insert the Segment again and again while reprocessing it.
    Thanks and Regards,
    Venkat Phani Prasad Konduri

  • Adding field in standard IDOC Segment E1EDL24

    Hello Friends,
    I have an urgent requirement that I have to extend IDOC segment E1EDL24 with two fields PABNR and LFSNR.
    When I tries to change the segment in WE31, it shows an error message that you can only modify the segments of customer namespace and cannot modify Standard IDOC Segments.
    Can we modify the standard IDOC segments, and if yes, how can we modify the standard IDOC segments. Please clarify.
    Points will be rewarded generously.
    Regards,
    Navin

    Hi Naveen,
    We cannot Modify the Standard segments. But we have to Create a new Segment and Add these fields.
    Then Create an Extended Idoc type
    Implement User Exits in Outbound And Inbound ..
    This is the Complete Steps and Info on this...with an Example...
    Enhancing ALE
    For example, if in an outbound interface you find that the IDOC type does not contain all the data you need to pass to the other system, you can extend the IDOC to accommodate the additional fields and enhance the ALE function modules to populate the fields. Similarly, if in an inbound interface, there is additional data that needs to be posted to the R/3 application, you can extend the IDOC type to have additional fields populated by the external system or translator or the other R/3 system and then enhance the inbound ALE function modules to post the additional data to the R/3 application.
    let us use the SAP Customer Master application as an example. Specifically, letâs focus on the IDOC extension and ALE function module enhancement of IDOC type DEBMAS02 and message type DEBMAS (Customer Master) and the IDOC reduction of message type MATMAS.
    IDOC EXTENSIONS
    Letâs first look at the concept of IDOC extension. SAP delivers Basic IDOC types such as DEBMAS02, MATMAS02, ORDERS02, and WMMBID01. By extending the Basic IDOC type, you are actually creating a new IDOC type. You create a new segment with the additional fields. This new segment has to be associated with one of the existing Basic IDOC segments. Then you create a new extension type, which is associated with the Basic IDOC type. This results in a new IDOC type. In order for ALE function modules to relate to this new IDOC type, the IDOC type is linked to the corresponding message type.
    Note that you should not add fields to existing segments but should create a new segment and associate it with an existing segment. This, in a nutshell, is the process of creating IDOC extensions.
    In our example, the Basic IDOC type DEBMAS02 is used to communicate Customer Master data to the SAP Customer Master application. Even though the application has a screen to enter and store a contact personâs business address (see Figure 1), DEBMAS02 does not have a segment or fields that communicate the contact personâs business address. If your business requires that this business address be communicated to the other system through the ALE interface for Customer Master, then you have to extend the DEBMAS02 IDOC type, and enhance the corresponding ALE function module.
    In DEBMAS02 the contact person fields are present in segment E1KNVKM and the business address of the contact person is stored on the SADR SAP table. You need to create a new segment, Z1SADRX, that is associated with E1KNVKM. This will be done in the process of creating an extension type ZDEBMASX. This extension type will then be associated with a new IDOC type, ZDEBMASZ. IDOC type ZDEBMASZ will be linked to message type DEBMAS for Customer Master. The final step in the IDOC extension process is to check the new objects. This check also verifies the structural integrity of the IDOC type. Letâs look at each of these steps in more detail.
    1. Create an Extension Type and a New Segment.
    Determine the fields on table SADR that you are going to provide for in the new segment Z1SADRX. You need fields for name, street, city, region, and country to give the business address of the contact person. You also need fields for the address number. ADRNR is a field in SAP tables such as SADR that uniquely identifies the address of an entity. This field is cross-referenced from other tables to the SADR table to obtain the full description of the address. Because this is an IDOC type for master data, the first field of the new segment will be MSGFN. The message function field informs the receiving system of the action to be taken for that particular segment. In the code that you write for populating the new segment, the value of the message function is the same as that of the parent segment E1KNVKM. In all, you will have 12 fields in segment Z1SADRX (see Table 1).
    To create an extension type and new segment:
    • Use transaction WE30 or from WEDI go to Development -> IDOC types.
    • Enter ZDEBMASX for Object Name.
    • Choose Extension Type.
    • Click on Create.
    • You will see a pop-up screen. Choose Create New, and enter a description. For version 4.x, enter DEBMAS02 in the Linked Basic Type field. Enter.
    • You will see a screen with ZDEBMASX and its description in the first line. Click on this line, and press Create. For version 4.x, expand the tree of segments, and place the cursor on E1KNVKM.
    • You will see a pop-up screen. Enter E1KNVKM as the reference segment. Enter.
    • For 4.x, press Create after placing the cursor on segment E1KNVKM.
    • You will see a line appear with E1KNVKM hierarchically below ZDEBMASX, with a description "Customer Master contact person (KNVK)."
    • Click on this line and press Create. You will receive a message indicating that the new segment being created will be a child segment of E1KNVKM. Enter. A pop-up box appears for the new segment.
    • Enter Z1SADRX as the segment type, 1 for Minimum, 1 for Maximum. Leave Mandatory segment unchecked. These entries imply that there is only one Z1SADRX segment for every occurrence of the E1KNVKM segment, and also that this segment is not mandatory. Note that if the parent segment is not mandatory, then the child segment should not be mandatory, because this could result in a syntax error during the creation or processing of the IDOC.
    • For 4.x, you must first create the IDOC segment Z1SADRX (Iâll explain why in a moment) from the menu path WEDI -> IDOC -> Development -> IDOC Segment.
    • Click on Segment Editor.
    • On the next screen, click on Create.
    • Enter a development class for the object. Enter.
    • This will take you to the screen for segment definition. Enter a description for the segment. Enter the field name, data element, and the data element documentation name. In most cases, all three fields may have the same values. If you are using a field in the segment that is not present in the ABAP/4 data dictionary, you must first create the domain, data element, field, and appropriate documentation before using it in the new segment.
    • Enter these three columns for all 12 fields. Save.
    • Click on Generate/Activate, F3 to step back.
    • From screen Maintain Segment, go to Segment Type -> Release. A checkbox now appears beside the segment definition Z1SADRX (see Figure 2). Check this box. Save.
    • Save again to store the descriptions of the segment, F3 to step back.
    • Save the extension type.
    It is possible to have several new segments with relevant Basic IDOC type parent segments in a single extension type. However, you can form only one IDOC type based on a single extension type.
    2. Create an IDOC Type.
    The next step is to create an IDOC type by associating the extension type that you created with the Basic IDOC type. This is a simple process:
    • From transaction WE30 or WEDI go to Development -> IDOC Types.
    • Enter ZDEBMASZ for Object Name.
    • Click on IDOC Type.
    • Click on Create.
    • Enter DEBMAS02 for Basic IDOC type.
    • Enter ZDEBMASX for extension type.
    • Enter a description.
    • Enter.
    • You will see a display of the composite IDOC type with all segments, including Z1SADRX (see Figure 3).
    It is possible to associate only one extension type with a Basic IDOC type for a given IDOC type. However, you can have multiple new segments in an extension type.
    3. Link IDOC Type to Message Type.
    The next step is to link the new IDOC type to its corresponding message type. This is important, because this relationship is referenced in the partner profile parameters where you specify the message type and IDOC type to be used for that particular representative system. To link the message type:
    • Use transaction WE82, or from WE30, go to Environment -> IDOC Type / Message Type, or from WEDI go to Development -> IDOC Type -> Environment Î IDOC Type / Message Type.
    • Click on Display <-> Change.
    • Click on New Entries.
    • Enter DEBMAS for message type.
    • Enter DEBMAS02 for Basic IDOC type.
    • Enter ZDEBMASX for extension type.
    • Enter your SAP R/3 release number for Release.
    • Save.
    This data is stored on the EDIMSG table and is accessed by several ALE processes to relate the message type to the IDOC type.
    4. Check the IDOC Type.
    Before checking the IDOC type for consistency, it is important to perform another step that releases the extension type to the IDOC type:
    • From WEDI go to Development -> IDOC Types -> Extras -> Release Type, or from transaction WE30 go to Extras -> Release Type.
    • For the Object Name ZDEBMASX and radio button Extension Type, click Yes.
    • The extension type has now been "released."
    You canât edit the extension type once itâs released. To cancel the release for further editing or deactivation, go to WE30 Î Extras Î Cancel release. The final step in the IDOC extension process is checking the validity of the IDOC type:
    • From transaction WE30 or WEDI go to Development -> IDOC types.
    • Enter ZDEBMASX for Object name.
    • Click on Extension Type.
    • From the Development Object menu select Check.
    • Repeat the operation for IDOC type ZDEBMASZ.
    • A check log will be generated for each run with details of correctness or errors (see Figure 4).
    In some situations it is possible to receive errors during the check process, especially segment length errors. The incorrect IDOC segment can be repaired and corrected by executing program RSEREPSG. This program checks the formal consistency and repairs incorrect segments. In test mode it will generate a log of formal correctness for the specified segment only. For the program to repair segments in normal mode, the underlying IDOC structures (DDIC structures) must be active. This program rectifies the lengths of the DDIC structures and not the fields themselves. RSEREPSG can also be used to change the person responsible for the object and the release flag.
    Menu paths may vary slightly depending on the release/version of SAP R/3, but the procedures and the principles are the same.
    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.
    Error handling is a very important consideration when making enhancements to inbound ALE/EDI objects. In ALE and EDI inbound processing, workflow is used for handling errors at different levels such as technical and application. If workflow has been configured for the interface, the error messages and workflow items flow to the inbox of the named recipient(s).
    It is also critical to enhance the workflow that handles notifications of the inbound ALE/EDI process. In most scenarios this is not a very difficult task because SAP lets you influence the workflow parameters and messages in function exits (customer functions). You typically do this using flags and message codes to trigger certain workflow actions. If you conform to the status codes and flags stipulated for workflow processing, the enhancement could be error-free and seamless. In the case of an inbound IDOC with an extension, you should populate the EDIDC fields IDOCTYP (new IDOC type) and CIMTYP (extension type) accordingly.
    Reward if Helpful

  • Devloping the Custom IDoc - Integration sceanarios with Peoplesoft

    HI All,
    We are on mySAP ERP 2005 with SAP HR on the same instance box,  PI 7.0 on other instance, and need to integrate for getting the employee data from Peoplesoft into SAP HR.
    I suspect that, this requirement can be fullfilled via Custom Idoc. Correct if I am wrong. plz...need ur expertise inputs for the same.
    In SAP HR we are having some Infotypes. While developing the custome Idoc, each Infotype should  be added as a segment.
    We are having the Standard Idoc for SAP HRMS is  HRMD_A.HRMD_A06.
    In this case how to develop the custom Idoc to include all Infotypes?
    Should I write the code to insert the dato from that Idoc to tables.
    Please suggest me the procedure.
    Regards
    Sridhar Goli

    And you said they are sening IDOC_XML to you through http, then how it is having namespace, it should be plain Idoc_xml
    like
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ORDERS05>
    - <IDOC BEGIN="1">
    - <EDI_DC40 SEGMENT="1">
      <TABNAM>EDI_DC40</TABNAM>
    Can you explain or give the format to better understand.

Maybe you are looking for

  • HP Color LaserJet Pro MFP M177fw How to Scan

    I just bout the HP Color LaserJet Pro MFP M177fw printer today and don't know how to use the scanner. I use Windows 8 operating system. Please advise how to use th scanner function. Thanks.  

  • New purchases at the bottom of the "purchased" play list

    When I buy music on iTunes on my mac, and syncs to my iPod Touch, the newest tracks are listed at the top of the play list. This is what I want. But, when I buy tracks directly on my iPod Touch, they are added at the bottom of the list which is quite

  • Launching InDesign CC 2014 with documents already open

    How can I set up InDesign CC 2014 so that it launches with the documents and library that I was working with when I shut it down, already open? InDesign CS6 used to do this and I assumed it was automatic, with CC 2014 I have to reopen everything.

  • Processing data packet (no data)

    Hi all, My issue is: I am trying to load data utilizing a custom datasource and a custom function module.  When the job loads it runs successfully but no records are pulled over.  However, I get records using the extractor checkor in the source syste

  • Drill Down in Pivot Table with item on page level

    Hi, I've got a pivot table with Chart next to it. The chart is a separate view, I did not use the 'Chart pivoted results' option. My pivot table has one Page Level item being the Month Name. I now have the strange behavior that drilling down on the P