Adding several standard segments in Outbound IDoc

Hi All,
I have a requirement in Orders05 Idoc type (Extension created). I want to pass Segment E1EDP19 three times based on the value of qualifier (3 qualifiers) in  the customer exit.
As per my understanding, Loop at idoc_data is used when updating a Segment field with some value. But in this case I have to pass/add the same segment to internal table.
Please suggest the approach for this.
Thanks in advance!
Regards
Tanu

Hi Tanu,
There are several ways to do this, below mentioned are a couple of them,
1) In the mentioned user exit, you will have all the Segments filled in. Your requirement if i understand correctly is to add E1EDP19 segments under E1EDP01 segments. So all that you have to do is build the logic to insert(not append as append would put E1EDP19 at the very which is not correct as per the structure/syntax of ORDERS05) E1EDP19 under E1EDP01 segments accordingly.
2) The other way to accomplish(this should be relatively easy i guess) this would be to append the E1EDP19 segments into INT_EDIDD with corresponding Segment Num, Parent Segnam and parent Segnum accordingly and the use the FM SPCM_SORT_IDOC_STRUCTURE to re-structure the IDOC as per the structure of ORDERS05.
Refer the below thread where i have provided my inputs for a similar requirment.
Sorting Idoc Segments
Regards,
Chen
Edited by: Chen K V on Jun 23, 2011 11:40 AM

Similar Messages

  • Can Std. FM fill Z-segments in Outbound IDocs?

    Hello All,
    In the outbound DESADV from our system, there is a Z segment and the FM used to create this DESADV is the std one. How is the std FM populating the segment which is part of the extension? Should not every extended IDoc be using a modified or custom FM for its processing??
    Thanks,
    Charles.

    Most function modules that populate Outbound IDOCs should have user exits available in the standard FM to populate Z Segments.
    Best Regards,
    Chris H.

  • Add segment to outbound Idoc for Sales order

    HI experts,
    I need to add segment E1EDP02 under Existing segment E1EDP01 for outbound IDOC for Sales order. FM" IDOC_OUTPUT_ORDRSP".
    I have used the Exit : "EXIT_SAPLVEDC_003" for the FM "IDOC_OUTPUT_ORDRSP"  in the include of the Exit   i wrote my code also for adding segment and activate it.
    But when i am trying to debug the code it's not working
    So please guide me how to debug it
    I have followed below steps to Debug.
    1. In VA02 i have repeat the output.
    2. Put the breakpoint in the Exit include program .
    3. put the Breakpoint in ALE processing Routine in RSNASTED program also
    4. Trigger the program RSNAST00 by giving the  Parameter value of SALES ORDER number and execute.
    But not working
    And i need to know whether i have used the Correct EXIT or not.In that case how to identify the correct exit's
    Thanks In advance

    Hi,
    I hope you have to add your segments through WE30 first for your IDOC type.
    Cheers,
    Raja.D

  • How to fill data in to extended idoc segments  for outbound program

    Hi all,
    I am new to this Community In the extension of  Standard idoc INVOIC02  with some custom segments like zemail, zfax,,,,how to fill the data into both standard segments and custom segments for outbound idoc using exit EXIT_SAPLVEDF_002 of standard function module IDOC_OUTPUT_INVOIC...
    i need some sample code
    THANKS
    PAVAN K

    Hi all,
    I am new to this Community In the extension of  Standard idoc INVOIC02  with some custom segments like zemail, zfax,,,,how to fill the data into both standard segments and custom segments for outbound idoc using exit EXIT_SAPLVEDF_002 of standard function module IDOC_OUTPUT_INVOIC...
    i need some sample code
    THANKS
    PAVAN K

  • About Orders05 outbound Idoc.

    Hi,
    I am using an outbound idoc of basic type Orders05 with an extension of the idoc header segment.This outbound idoc will get triggered once a PO is saved and sent through EDI.
    I have to do an enhancement wherein I have to populate the mode of transport field(EXPVZ) and place of loading(LADEL) in the fields of the extended segment selecting them from EIKP depending upon the BELNR value in the header of the idoc(E1EDK01-BELNR).
    I am unable to understand how do I populate the fields.
    Could you please help me.
    Thanks,
    Sandeep.

    HI,
    see the below steps you will completely understand the processing outbound..
    2.1 Outbound Interface
    PROCESS DIAGRAM
    Outbound Interface
    1. Analyse Hierarchy Levels
    2. Create New segment
    3. Create New IDoc Type
    4. Create New Message Type
    5. Link Message with IDoc Type
    6.  Create an entry in EDP13 via transactions WE20 and BD64
    7. Populate the Custom IDoc via ABAP Program
    7b Error Handling
    7c. Send Status Email
    8. Test the Population of the Custom IDoc
    <b>Step 1 – Analyse Hierarchy Levels:</b>
    Analyse the data relationships being processed in the interface.  Define the appropriate hierarchical Parent-to-Child relationships. 
    Navigate to transaction code WEDI
    Transaction WEDI displays the IDOC main menu.  This allows navigation around the various development and control areas to create a customised IDOC.
    <b>Step 2 – Create a new segment:</b>
    via wedi : Development - IDOC Segments or Transaction code WE31.
    •     Enter segment name and click on Create.
    &#61662;     The name of the segment type must start with Z1 , and have a maximum of eight characters.
    •     Enter description and enter the relevant field names and data elements.
    &#61662;     The segment should represent a structure in the program so for each field in the segment a field name and a data element must be defined.
    •     Save the segment and enter Person Responsible and Processing Person .
    •     Go to Edit and Set Release.
    •     Repeat this procedure for each new Segment in the IDOC.
    <b>Step 3 – Create a new IDOC Type</b>
    via wedi Development - IDOC Types or Transaction WE30.
    •     Enter segment name (starting with Z), click on Basic Type and then Create. 
    •     Create as new, enter Person Responsible and Processing Person  and enter description.
    •     On ‘Create Basic Type’ screen decide where segments should be inserted and go to Edit/Create Segment.
    •     Complete relevant fields in the Maintain Attributes screen:
    •     From the relevant segments created in Step 2 enter the Segment type and if mandatory segment.
    •     The Minimum and Maximum number of segments to be allowed in the sequence. (One minimum and one maximum if segment is mandatory).
    •     The Parent Segment and Hierarchy Level will be automatically created depending on where in the IDOC tree you decided to create that particular segment.
    •     Repeat this process for each segment needed in the IDOC type, deciding whether to add the next segments at the same level or as a ‘Child’.
    •     When IDOC created return to initial screen.  Go to Edit and Set Release.
    •     Go to Transaction WE60 to view the IDoc Type you have created.
    <b>Step 4 – Create new Message Type</b>
    via wedi Development - Message Types or Transaction WE81.
    •     Display/Change and click on New Entries
    •     Create a new Message Type and Save.
    Step <b>5 – Link Message Type to IDOC Type</b>
    via wedi Development - IDOC Type/Message or Transaction WE82.
    •     Display/Change and then click on New Entries.
    •     Enter Message Type, Basic Type (IDOC Type) and Release (46C) and Save.
    <b>Step 6 – Create an entry in EDP13 via transactions WE20 and BD64.</b>
    The partner profile for the Idoc must be set up and generated in the transaction BD64 and transaction WE20.
    •     WE20 – Add Message Type to appropriate Partner Type, Enter Message Type, Receiver Port and Idoc Type and Save.
    •     BD64 – Create a Model View, Enter Sender and Receiver Ports, Attach Message Type.  Go to ‘Environment’ on Menu and click on Generate Partner Profiles and generate (not save) profile.
    <b>Step 7 – Populate the custom IDOC via ABAP Program</b>
    See Test Program ZOUTBD_IDOC_TEMPLATE, Appendix IV.
    •     Create an Internal Table for each segment type, this should be exactly the same structure as the segment type.
    •     The control record is filled into a structure like EDIDC.  The message type and the Idoc type for the Idoc must be populated into the eddic structure.
    - PERFORM populate_Control_structure USING  c_mestyp
                                                c_SEGMENT_type1.
    •     The data segments are filled into a structure like edidd-sdata; sdata and the segment name are populated into the edidd structure.
    - PERFORM transfer_Parent_data_to_seg.
    •     The standard SAP function module MASTER_IDOC_DISTRIBUTE is called to pass the populated IDOC to the ALE Layer.
    - PERFORM master_idoc_distribute.
    •     NOTE:  This function module is only called for stand alone programs and Shared Master Data programs (SMD).   It is not called when using extensions or output determination.
    •     The ALE Layer handles the sending of the IDOC to the receiving system.
    •     Error Handling (see  Step 7b).
    •     Commit work.
    Project Specific
    <b>Step 7b – Error Handling</b>•     Analyse which fields in the interface are mandatory for the receiving system and who needs to receive error notification.
    •     Declare a structure of type ‘MCMAILOBJ’ for sending instructions.
    •     Enter values for the internal table based on structure ‘MCMAILOBJ’
    •     For selection processes, on SY-SUBRC checks and where fields are mandatory for the receiving system; insert Function Module  ‘MC_SEND_MAIL’.
    •     Enter values in the following parameters: -
    MS_MAIL_SENDMODE         =  ‘B’ (Batch Mode)
    MS_MAIL_TITLE                    =  'Mail Title'
    MS_MAIL_DESCRIPTION     =  ‘Error description’ (e.g. MATNR not given)
    MS_MAIL_RECEIVER           =  ‘Name of Receiver’ (To be determined)
    MS_MAIL_EXPRESS             =  ‘E’ (Express Delivery)
    MS_MAIL_DLINAME            = Leave Blank
    MS_MAIL_LANGU                =  'E'  (Language)
    MS_MAIL_FUNKOBJ_NAME  = Leave Blank
    TABLES
               MS_MAIL_CONT           =  I_MCMAILOBJ
    Note:
    It has to be determined separately for each interface how these errors and mail notifications are to be grouped – dependant upon the number of errors that are potentially likely. One possible approach is to send an email for each reason for rejection and include all the records that failed for that reason in the mail notification. Another possible approach is to send an email for every failure.
    When error checking for mandatory fields it is common SAP practice to reject a record on its first failure (irrespective of subsequent errors in that record)
    <b>Step 7c – Send status mail</b>
    •     Append to table I_MCMAILOBJ details of the time the interface was processed, how many Idocs were created and how many of these produced a status of 03.
    •     Select the user to receive the mail from ZINT_RECEIVER, using the name of the program as a key (SY-CPROG).
    •     Use function Module ‘MC_SEND_MAIL’ to send a mail to the user containing the contents of I_MCMAILOBJ at the end of the interface processing.
    <b>Step 8 – Test the population of the custom IDOC</b>
    via wedi IDoc - Display IDoc or Transaction WE02.
    •     Enter your message type and execute.
    •     Status should be green, double click on one of the Idocs you have created to view its contents.
    •     If a problem has occurred click on Status which will give you a description of the error.
    •     Drop down Data Records arrow and this should list the data in the IDoc in the correct hierarchical structure.
    •     Click on each individual segment and view the content to check that the correct data has been read.
    •     If you have UNIX access by using AL11 you can view the file that you have created.
    Note:
    For some interfaces it may be valid to send an empty file to SAP.  This empty file is converted to the custom IDOC format expected by SAP.  This custom IDOC will contain dummy information.  In the inbound processing code, if the dummy information is identified then the processing of the IDOC is considered to be complete and the IDOC should then be assigned a successfully processed status of 53, even though it has not been processed at all.
    rewards if useful
    regards,
    nazeer

  • Error when Adding a segment to an IDOC

    Hi I have added one segment to an IDOC through one user exit and it is giving the error with status 26.
    Here I am pasting the error details,
    The segment E1IDT02 does not occur at the current level of the basic type PEXR2001 (extension ).
    This error can have several reasons:
    The segment E1IDT02 is assigned to a group whose header segment does not occur.
    The segment E1IDT02 does not exist in the syntax description of the basic type PEXR2001 (extension ).
    The sequence of segments in the group in which the segment appears is incorrect.
    Previous errors ('mandatory' segment or group missing) may be due to this error.
    Can any body help me, and let me know what can I do to avoid this.
    Thanks,
    Deepak.

    Actually in the basic type of IDOC, there is no segment with this name. But I am adding this directly in an user exit. Can you tell me what is the actual procedure to add a new segment to the basic type of IDOC
    Thanks
    ravi

  • EDI Outbound IDOC Remove unused fields from segment

    Hi All,
    I am configuring a outbound idoc scenario for Message type ORDERS. The basic type for this message type is ORDERS05.
    The segment E1EDKA1 has 44 fields, I need only the first field and the last field of this segment.
    How do I remove the unused fields in this segment ?  I Tried BD56 and BD32 But they are for removing the complete segment and so does not serve my purpose.
    Any pointers to this issue is appreciable .
    Regards,

    Hi,
    Segmetns of standard message types can be deleted from BD53. But I don't think deleting fields would be possible from segments of standard idoc type. What you can do is you can create your own custom idoc type with the fields you want and allign it with the standard message type ORDERS. This should solve your purpose.
    BR,
    Atanu Mukherjee

  • Standard program for creating outbound IDoc holding wbs+cost plan

    Hello,
    a)
    Before we start developing our own ABAP, I would like to ask the forum if somebody knows if there is already a standard ABAP program for generating outbound IDocs including wbs-element data (CJ20N; wbs ID, description) plus annual data from the cost planning (CJ41; such as fiscal year and costing items from unit costing; quantity, unit, price per unit, total price, description of item) ?
    b) we are planning to use the logical message /ISDFPS/PS, basic type /ISDFPS/PS01 and enhance this IDoc with segments for the costing items from the cost planning.
    Question: Do you know if there is a standard IDoc which has segments for both wbs-element data and costing items?
    Kind regards
    Viveka Schwartz

    Hi Frank,
    Did u check this Link on the PP confirmaitos[LINK|http://help.sap.com/saphelp_47x200/helpdata/en/12/3bbc1c504811d182c20000e829fbfe/frameset.htm]
    Reg
    Dsk
    Edited by: DSk on Sep 14, 2010 3:44 PM

  • Standard program for creating outbound IDoc including wbs + cost planning

    Hello,
    a)
    Before we start developing our own ABAP, I would like to ask the forum if somebody knows if there is already a standard ABAP program for generating outbound IDocs including wbs-element data (CJ20N; wbs ID, description) plus annual data from the cost planning (CJ41; such as fiscal year and costing items from unit costing; quantity, unit, price per unit, total price, description of item) ?
    b) we are planning to use the logical message /ISDFPS/PS, basic type /ISDFPS/PS01 and enhance this IDoc with segments for the costing items from the cost planning.
    Question: Do you know if there is a standard IDoc which has segments for both wbs-element data and costing items?
    Kind regards
    Viveka Schwartz

    Hi Frank,
    Did u check this Link on the PP confirmaitos[LINK|http://help.sap.com/saphelp_47x200/helpdata/en/12/3bbc1c504811d182c20000e829fbfe/frameset.htm]
    Reg
    Dsk
    Edited by: DSk on Sep 14, 2010 3:44 PM

  • Outbound IDOC process - Using standard  or Custom Program

    Hi all,
    i'm having some doubts regarding IDOC's outbound processing.
    I'm trying to understand 2 scenarios:
    1- Trigger Standard Outbound IDOC without writting any Z program ou IDOC FM.
    It's possible to trigger a outbound idoc for exemple, whenever a sales order is created. To do this is, i suposed i don't need to write any code at all, correct?
    What i need to do is create a logical system (SALE), define Transmission protocol (WE20, in here i associate the partner, and the outbound message type? After this point is the idoc automatic triggered?
    If not, what is the correct procedure?
    2 Trigger Ountbound IDOC using Z program.
    Whats is diferent from the point 1 to this situation?
    Best regards,
    Pedro

    Kali,
    1. You can search in SE37 using IDOC_OUTPUT* for finding out corresponding function modules. It is based on message types.
    2. You can search user exit in above mentioned function module. So first get the correct populating FM & then you can search for Call Customer Function inside the code for user exit.
    3.Again ans is same as in point 1.

  • How outbound IDoc with Z segment is creating without using a program/FM?

    Hi,
    I am having an outbound IDoc with Z message type and segments.
    I need to find how this IDoc/ IDoc segment is getting created. I tried to find
    it using the segment’s where used list (in SE11- IDoc segment structure). But it
    is showing that the structure and fields are not used anywhere.
    How it is possible to create a Z segment in IDoc without
    using the corresponding structure in some program or function module?
    I have searched in google/scn for a solution, but didn’t find
    anything.
    Any one please helps me to find how this IDoc segment is
    populating?
    Regards,
    Dipin

    Hi Arthur,
    This IDoc is catering as part of a flow (Tcode IW21). I have
    set a break point in the function module ALE_IDOCS_CREATE and processed the transaction
    IW21, but the program didn’t stop in the break point, but the IDoc got created.
    Regards,
    Dipin

  • Adding Alternative Unit of Measure to Outbound idoc

    Hi gurus,
    I need to add alternative unit of measure information to an outbound ORDERS idoc for each line item segment. How do I know what segments and qualifiers to use?
    Thanks!
    Will

    Hi  Will
    Unit of measure at item level is in
    Segment --> E1EDP01 : IDoc: Document Item General Data
    Field -->  MENEE : Unit of measure
    Do you want to convert the Unit of measure in outbound idoc?
    Use conversion rules for this...
    or
    do  you want send  Unit of measure  and secondary unit of measure ??
    extend the idoc type and write user exit to populate date in extended segment...
    i hope above info helps you
    Thanks
    RAMESH

  • How to include a new segment in FIDCCP02 idoc (OUTBOUND)

    Hi,
    I would like to know in which EXIT or BADI I should append my new segment to the idoc data.  I have created the new segment to add new Z fields that I added before on the BSEG, and I have created the enhancement of the idoc and put the new segment in the correct place.
    Best Regards

    Adrian,
    Isn't the BADI IDOC_DATA_INSERT the correct answer?
    Regards,
    Ashvin

  • Outbound IDoc taking wrong segments

    Hi All,
    Outbound Custom IDoc is taking wrong segments when it is created. Message type, IDoc Type, process code and Function Module all are properly set.
    This IDoc sometimes takes correct segments and sometimes wrong. because of this it is going into status 26 with syntax error.
    Since the IDoc does not contain correct segments.
    Can anyone help me please.
    Thanks in Advance
    Pragna

    HI,
    Make your outbound IDOC restricted with for particular PLANT or Storage location in the using filter option in BD60.
    Hope this might be helpful to you

  • ME59 Purchase order outbound idoc header text missing in segment

    Hi All,
    When Purchase Order created via ME59 for third party vendor Outbound Idoc is created but Header Text of PO not copied into IDOC Segment.This Problem occurs when PO has sales order assignment.
    Please Advice..
    Thanks,
    Vinod.

    Hi Ankur,
    I am not an expert in this area but I'm looking on an ORDERS05 iDoc where I have the following data for E1EDK14:
    <u>E1EDK14 014:</u>
    QUALF: 014
    ORGID: [Purchasing organization ID]
    <u>E1EDK14 009:</u>
    QUALF: 009
    ORGID: [Purchasing Group ID]
    <u>E1EDK14 013:</u>
    QUALF: 013
    ORGID: [Purchase Order type, e.g. EC]
    <u>E1EDK14 011:</u>
    QUALF: 011
    ORGID: [Company Code]
    Hope this helps!
    Regards,
    Kristoffer

Maybe you are looking for