Segment in Idocs.

Hi,
I am sending a PO through EDI.
I am working in an enhancement wherein when the PO is sent,then the outbound Idoc ORDERS05 will have some more details other than what it already has.
I have written the code to populate the fields of most of the segment,but there is one segment where I am facing problem.
The requirement is such that in segment E1EDKA1,when the PARVW field is WE,I need to modify the segment and add some more data to its fields(telf1,bname,etc.).The problem is I am unable to modify the segment but when I tried to append the segment with the new values,it is working fine.
I can't understand why modify is not working but append is working.
Please help.
Thanks,
Sandeep.

Hi,
    Something like this.
DATA: s_e1axxxx LIKE e1xxxx1.
LOOP AT int_edidd.
  CASE int_edidd-segnam.
    WHEN '...'.
    WHEN 'E1xxx'.
       MOVE int_edidd-sdata TO s_e1adrm1.
       make changes to S_E1xxxx-PARTNER_ID.
       MODIFY int_edidd.
  ENDCASE.
ENDLOOP.
<b>Reward points</b>
Regards

Similar Messages

  • How to generate a new segment in IDoc for multiple occurance of Control Num

    Hi Experts,
    In my scenario, i need to generate a new segment in IDoc(Target Structure) based on  Control Number Field in the Source Structure.
    The segment need to be created for multiple occurance of the Control Number.
    Ex:
    Control Number - 100 appears 5 times in Source Structure.This control Number is mapped to one of the Field in the Segment of  IDoc.
    Now my requirement is to generate the Segment 5 times with respective to this Control Number.
    please help me out to resolve this issue.
    Thanks,
    Kish.

    Hi,
    Here is the XML Structure of my Source:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:GoodsReceipt_MT xmlns:ns0="urn:WOL-com:XI:data:HJ:10">
       <row>
          <CONTROL_NUMBER>111</CONTROL_NUMBER>
          <LINE_NUMBER>1111</LINE_NUMBER>
          <CONTROL_NUMBER_2/>
          <OUTSIDE_ID/>
          <WH_ID>111111</WH_ID>
          <LOCATION_ID/>
          <HU_ID>11111</HU_ID>
          <NUM_ITEMS/>
          <ITEM_NUMBER>111111</ITEM_NUMBER>
          <CONTROL_NUMBER_3>LR</CONTROL_NUMBER_3>
          <LOT_NUMBER>11111</LOT_NUMBER>
          <UOM>11111</UOM>
       </row>
       <row>
          <CONTROL_NUMBER>111</CONTROL_NUMBER>
          <LINE_NUMBER>12222</LINE_NUMBER>
          <CONTROL_NUMBER_2/>
          <OUTSIDE_ID/>
          <WH_ID>12222</WH_ID>
          <LOCATION_ID/>
          <HU_ID>1222</HU_ID>
          <NUM_ITEMS/>
          <ITEM_NUMBER>112222</ITEM_NUMBER>
          <TRAN_QTY>112222</TRAN_QTY>
          <CONTROL_NUMBER_3>LR</CONTROL_NUMBER_3>
          <LOT_NUMBER>12222</LOT_NUMBER>
          <UOM>1122222</UOM>
       </row>
       <row>
          <CONTROL_NUMBER>222</CONTROL_NUMBER>
          <LINE_NUMBER>2222</LINE_NUMBER>
          <CONTROL_NUMBER_2/>
          <OUTSIDE_ID/>
          <WH_ID>22222</WH_ID>
          <LOCATION_ID/>
          <HU_ID>222222</HU_ID>
          <NUM_ITEMS/>
          <ITEM_NUMBER>2222222</ITEM_NUMBER>
          <TRAN_QTY>22222222</TRAN_QTY>
          <LOCATION_ID_2>33333333</LOCATION_ID_2>
          <CONTROL_NUMBER_3>LR</CONTROL_NUMBER_3>
          <LOT_NUMBER>22222</LOT_NUMBER>
          <UOM>22222</UOM>
       </row>
       <row>
          <CONTROL_NUMBER>333</CONTROL_NUMBER>
          <LINE_NUMBER>3333</LINE_NUMBER>
          <CONTROL_NUMBER_2/>
          <OUTSIDE_ID/>
          <WH_ID>33333</WH_ID>
          <LOCATION_ID/>
          <HU_ID>33333</HU_ID>
          <NUM_ITEMS/>
          <ITEM_NUMBER>333333</ITEM_NUMBER>
          <TRAN_QTY>33333333</TRAN_QTY>
          <CONTROL_NUMBER_3>LR</CONTROL_NUMBER_3>
          <LOT_NUMBER>33333</LOT_NUMBER>
          <UOM>333333</UOM>
       </row>
    </ns0:GoodsReceipt_MT>
    Now Control_Number 111 occurs 2 times, 222 & 333 occurs 1 time.
    Now one IDoc for 111,222 & 333 should be generated.
    But Control_number 111 appears 2 times.
    Now the data in the 2 rows should be passed to Single IDoc by repeating the segments inside the IDoc.
    As u said i changed the Occurance of IDoc to 0...unbound and imported as External Definition. I have done upto Generating IDoc for each unique Control_Number.
    I stuck up at repeating the Segments in the IDoc.
    So please help me out.
    Thanks,
    Kish.

  • How to isolate error with a record/segment in IDOC with multiple records

    I have an IDOC with multiple records/segments (typically 1000 records/segments). Sometime XI can not process the IDOC because of some control characters in data.
    1. How can I pre-processed the IDOC to remove those control characters?
    Can I use XPATH expression/Java class to do it? How can I configure the XPATH expression/Java class in XI to pre-process the file?
    2. Until I have answer to 1st question. I would like to find out the error is exactly for which record? What configuration can I do in XI to isolate the error is with which record/segment in IDOC?
    Thanks in advance.

    Split the IDoc.
    with in the UDF, after the validations if every thing fine, pass as successful records to success_MT and pass it to target system using Branching in BPM.
    if errors found in the record, then store the error records in Hash table with in UDF, get the IDoc number, frame as a string and raise alert.
    U have to do this in the context of IDoc.
    If U wanna get the IDoc Number, Segment Name and field name for every failure, U can pass the expected error field name as constant to UDF, frame the sentence in the UDF like -> <b>IDoc 1234321 segment – SEG001 – field – FLD03 has a special character ‘*’</b>.
    If U wanna pass this string to source/target, U can do in error messages branch in BPM.
    U must use BPM for splitting the IDoc, since it is multi-mapping.
    reg.,
    Yallabandi.

  • How  can create SEGMENTS and IDOC TYPE in BADI in ECC 6.0 version

    Hi All,
                Can any one help, how  to create SEGMENTS and IDOC TYPE in BADI in ECC 6.0 version.This is my task.
    Given BADI name was----VENDOR_ADD_DATA_BI .
    Thanks

    Anil,
    look at this thread ..may be this helps you.
    Re: 824 IDOC and BADI/User Exit
    sateesh.

  • In exit EXIT_SAPLKD01_001 populate custom segment of idoc ext. cremas05

    Hi,
       I am using EXIT_SAPLKD01_001 where I need to populate 2 custom segments for idoc extension cremas05.
    I have created a function module separately where I have populated the 2 structures that is of same type as the segment structure.
    In the exit I have called the function module where the structures are populated.
    Now my question is how to populate the custom segments from the function module structures directly in the exit.
    Thanks and Regards
    P

    Hi
    Now I'm able to do this.... closing the thread.

  • E1EDKT1 segment in Idoc INVOIC02

    Hi,
    Im getting the following error when sending an INVOIC02 Idoc to ECC:
    "Error: Segment 'E1EDKT1', segmentnumber '000010' not correct in structure INVOIC02"
    I already refreshed the IDoc metadata and I see the segment in the repository and IDX2. The connection to the backend works fine: when I remove this segment the Idoc is processed succesful. What could be causing this problem?

    Hi Iddo Rijsdijk,
    It solved my issue as well. Thanks.
    - Netrey

  • Optional Segments in IDocs

    How do Optional segments in Idocs gets triggered ? Iam generating Idocs on R/3 Side and optional segments seems to be not getting created when I see on WE05 Tcode.
    My Question is does these segments will be created automatically if there is a data ?
    Please clarify

    Hi Ram,
    There needs to a specific coding for filling the segments be it optional or anyother. I believe the filling of the segment is being done in SAP R/3 and there might not be a code to fill these optional segments.
    Just simply write a code where you are filling other segmemts for the IDoc in case it's not there and it should work.
    Hope this helps.
    Nishant
    Message was edited by: Nishant Rustagi

  • Idoc segment to idocs

    Hello all,
    I am working on idoc to idoc scenario, i have to map a segment to idoc, exact requirement is
    " If there are 10  "E1P12" segments in the inbound IDOC then we need to create 10 outbound Delins IDOCs, each with 1 E1EDP10 segment.
    Can anyone provide me the steps to follow in this scenario.
    Thanks for all your help.

    one more
    For every Idoc generated on the target side the header data is populated frm source Idoc.(i.e) the same header repeated 4r all idocs right???
    In order to do tat u need to write a simple udf
    public void Test(String[] a,String[] b,ResultList result,Container container)
       //write your code here
    for (int i=0; i<a.length;i++)
         result.addValue(b[0]);
    use this udf under all header element(eg.element1 under header tgt side)
    then mapping ll be
    E1EP12----->
                          Test-------->Split By Value---->element1
    src element---->

  • Segment to idoc..

    Hello all,
    I am working on the scenario where i need to mapp a segment to idoc.
    means if i am having 10 segments then 10 idocs should get created.
    If there are 10 EDP10 segments in the inbound IDOC then we need to create 10 outbound Delins IDOCs, each with 1 EDP10 segment.
    I have to display the header part from other segment with each idoc created.
    Please explain in detail.
    Thanks for all your help.

    Hi siddhesh,
       Try the below logics...
       It will working fine for me in Orders IDOC.
        If you have a Multiple E1EDPO1 for each E1EDPO1 need to create a
        Each IDOC.
        and also Each IDOC have Only one E1EDPO1.
        But Header segments Like EIEDKO1 comes only one time.
        This also should be enable each IDOC in the Receiver.
      First for Multiple IDOC:
        E1EDPO1Remove ContextSplitByValue(Each)Collapse ContextIDOC
      Second for enable each E1EDPO1 for each IDOC:
        E1EDPO1SplitByValue(Each)E1EDPO1
         other elements need to simple map.
         Like..
         Posex--Posex
         Action--Action
      Third For header need to use Each IDOC:
        EIEDKO1(Context IDOC)                     ---
        E1EDPO1(Change the context to IDOC)---UseOneAsMany-E1EDKO1
        E1EDPO1                                          ---
        Other elements also need to map like above.
        Consider the field ACTION
         ACTION(Context IDOC)                       ---
        E1EDPO1(Change the context to IDOC)---UseOneAsMany-ACTION
        E1EDPO1                                           ---
       In useoneasmany we need to keep first and second node context should be same.
    Regards,
    Prakasu

  • How can i check the segment in idoc.

    hi gurus,
       how can i check the segment in idoc.please help me as

    Hi Rohit,
    In WE02/05 U can view the IDocs.
    Since u r having the IDoc with u, Double click the Idoc no. and it will take you to screen where it will show you all the segments of IDoc. Here you can check which segment is giving error.
    Go to  WE60/63 which shows the detailed documentation in the MySAP environments if u have been using the old 4.6c systems. In 6.10 since the documentation is not available ,modify your personal settings to show the documentation by default; In 6.10 in transactions WE60 and WE63, documentation is no longer generated by default for the segment fields when the documentation is generated. To activate the generation of the documentation from the corresponding data elements, proceed as follows: WE60/WE63. > Goto > User settings. Here you must set the indicator for 'Display of the documentation' under 'Display attributes for IDOC types' and then save the change. Now the documentation is also displayed for the segment fields when WE60/WE63 is executed.
    **Reward points if u find this useful.
    Thanks & Regards,
    gyanaraj

  • Limit the no of segments per IDOC to less than the current default value

    Hi friends,
    please help me in the following issue.
    The possibility to limit the number
    of segments per IDOC to less than the current default value.
    Purpose is to limit the traffic of IDOCs between systems.
    How to solve this issue to avoid traffic
    Thanks in advance.
    Regards
    Sandeep

    Hi Kiran,
    Actually we are using standard ones at that time we are getting prolems. When using custom developed ALE's
    we are putting segment size is less.To decrease segment size is there any filtering at the sender side? To change segment size may be nedd to take help form SAP.
    But if have filtering at any level from sender side need to confirm before consult SAP.
    Regards
    Sandeep

  • Filling up segments of Idoc of Invoice List

    Hi!
    Invoices and Invoice List are beeing created... everything would be fine, but some fields are missing in the Invoice List while existing in Invoices.
    I guess I need to find the code where these fields are filled up for Invoices and to add this code to appropriate place for Invoice List. How to do this?
    I think that needed segments are existing for Invoice List, just not filled up...
    By the way, how to find out Idoc number of Invoice List? If I have it, I could compare segments with Idocs of Invoices.
    Any ideas?
    Will reward,
    Mindaugas.

    I saw the Function module -
    Please look at code at :
    Include program : LVEDFF0R
    FORM REDUCTION_TABLE_CREATE.
      PERFORM IDOC_SEGMENTS_READ.
      PERFORM IDOC_ACTIVE_SEGMENTS_SET.
    ENDFORM.                    " REDUCTION_TABLE_CREATE
    Keep the break point at form routine and debug the the function module
    If you do not know how to do debugging then use following way :
    keep the break point in form routine above as i said
    Create invoice or invoice list
    when you maintain output type in invoice or invoice list -
    Now click on Further data ->select peridoc scheduling-> back and save it.
    Run RSNAST00 Program
    Output application : V3
    Object key : Invoice or invoice list number
    Output type : RD00 or LR00
    Medium = 6(EDI) ,A (ALE)
    when you execute the program and it will goto debugging.
    Thanks
    Seshu

  • Populating  the segments of idocs

    Hi,
        How do segments of the idoc get populated with data from SAP tables ?  (for SAP standard idoc or newly created idoc and outbound process)
    Can anyone say in details?
    Good answer will be rewarded
    Thanks ,
    Manas Behera

    For any IDOC there is a specific standard function module assigned that is called to fill the IDOC segments.
    For orders it is e.g. IDOC_OUTPUT_ORDERS.
    This function takes care of the filling of the IDOC segments. You also usually have user exits available in those function modules that you can use to manipulate the IDOC data or fill/add custom segments/fields.
    The function modules usually start with IDOC_OUTPUT_* for outgoing IDOCS and IDOC_INPUT_* for incoming IDOCS.
    Hope that helps,
    Michael

  • Creation of multiple Records in the file as per multiple segments in IDOC

    Hi SapAll.
    i have got a requirement to create a multiple records in a file based on multiple segments at sending Idoc in a File To Idoc Interface.
    the Scenario  is the reciever message type is mapped with fields of 3 segments in sending IDOC.
    SEG01   1.....1(PARENT SEGMENT)
      SEG02  0...999999(CHILD SEGMENT)
      SEG03 0...9999999(CHILD SEGMENT)
    in an instance where if the SEG01 exists for one time and SEG02 exists for 2 times and Seg03 Exists for 2 times PI is creating the file with 2 records in it but
    when if the SEG01 exists for one time and SEG02 exists for 2 times and Seg03 Exists for 1 time it is raising the error in message mapping where it is supposed to create 2 records in a file with empty values in the fields (mapping with seg03) segment.
    can anybody help me in this.
    regards.
    Varma

    you can create a UDF after you validate if the count match. if match you create the message if not, call de UDF.
    this UDF should receive two parameters -->Queue SEG2 and queue of SEG3.
    then you should loop by the count of SEG2. if you find a Supress Value in the queue of SEG3 add a "" to result. for example.
    for(i=0;i<=SEG2.count;i++){
    If SEG3<i>.equals(ResultList.SUPPRESS) {
           result.addValue(" ");
    }else{result.addValue(SEG3<i>);
    the result of UDF is a queue which should map to target field directly coz it has context changes
    I think that is what you are needing. if no let me know.
    RP
    Edited by: Rodrigo Alejandro Pertierra on Jun 17, 2010 11:56 AM

  • Missing Fiels and Segment in IDOC ORDER05

    We have a requirement to include the storage location as part of the ship-to parameters our in procuremet interface based on ALE.
    We user Idoc ORDERS.ORDERS03
    Our System is ERP ECC 6.0
    We want to see:
    1.Field: E1EDKA1-KNREF
    2.Segment: E1EDPA1
    I found a SAP note where it describes exactly the same issue, but it is applicate only until release 4.6C
    [SAP NOTE: 112151|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=112151]
    The suggested solution is to use Idoc ORDERS04 of higher.
    However when I change the system to use the new version of the message, the message strucure and the included fields do not change. The message type did change to ORDERS05.
    Before I adventure into finding the user exits and coding the segments and fiels we require; does anyone know if there is a standard way to enable this segments and field?
    Thanks,
    Juan.

    Hi Juan Francisco Zurita Duque 
    KNREF : Customer description of partner (plant, storage location)
    internal data type : CHAR
    Internal length : 000030 characters
    Position in segment : 040, Offset : 0906. external length : 000030
    Use
    Sold-to party number sent in by the customer in delivery schedules.
    Use
    The system uses this number to automatically determine the ship-to party.
    Every thing good for ORDRE05 IN ECC6.0
    Check your config settign related to Message type and idoc type.....once again.....
    RR

  • Missing segment in Idoc

    Hi
    Mine is an Idoc to File scenario. The mapping is fine and the interface is also working fine. However, there is one defect attached to it. The Idoc used is ARTMAS. When I trigger the Idoc for a range of articles from BD10, a particular segment is missing in the Idoc. I checked in WE02 and found out that a segment is missing in the Idocs generated. E1BPE1MEANRT is the segment that is missing. Because of this, the file created  at target side has the couple of fields with values missing. The source fields of these missing fields lie in E1BPE1MEANRT.
    How do I fic this issue ?
    Regards
    Harish Babu

    Hello,
    Couple of suggestions:
    If you want to populate the segment and fields in PI mapping, you can use mapwithDefault function and populate NULL values in PI.
    OR
    1. Check the fields in the segment E1BPE1MEANRT, and respective field data of Article is maintained or not. If not maintained, please update the same with the help of functional.
    2. Check with the Abap team to debug the Bapi / program which populates the Idoc. The issue is inclined towards functional  / ABAP team.
    -Rahul

Maybe you are looking for