Deletion of Idoc Segments

Hello everyone,
I would just like to ask on how to delete a specific segment of an Idoc aside from using transaction WE19. I would like to preserve the Idoc that's why I'm looking for another transaction that can be able to perform the deletion.
Thanks in advance!

in WE19 you cannot modify an existing IDOC.
you can open an existing IDOC, but with any change SAP creates a new IDOC which has the current values, the old IDOC is then still as it was before.
Try it, if you back out after saving your changes,  then you see the new IDOC number in WE19 initial screen

Similar Messages

  • Delete Outbound Idoc Segment based on target system

    Hello Folks,
    Problem:
    I have extended the sub structure of an idoc for IT0002 with custom field,
    E1P0002
         Q1P0002
              Z1P0002
    Where Z1P0002 has custom fields.
    When the destination system is 'ABCD' - system should allow the idoc
    else
    When destination is other than 'ABCD' - Z1P0002 segment should be deleted and idoc should be sent.
    How can this be achieved, any sample code.

    Use user-exits .
    if edidc-RCVPRN eq 'ABCD'
    process data .
    else
    call FM segment_delete ( use ur parameters )
    endif.
    Edited by: anil sasidharan on Feb 18, 2009 12:40 PM
    Edited by: anil sasidharan on Feb 18, 2009 12:46 PM
    Edited by: anil sasidharan on Feb 18, 2009 12:48 PM

  • Delete Outbound Idoc Segment based on taget system

    Hello Folks,
    Problem:
    I have extended the sub structure of an idoc for IT0002 with custom field,
    E1P0002
         Q1P0002
              Z1P0002
    Where Z1P0002 has custom fields.
    When the destination system is 'ABCD' - system should allow the idoc
    else
    When destination is other than 'ABCD' - Z1P0002 segment should be deleted and idoc should be sent.
    How can this be achieved, any sample code.

    Hi,
        Make use of Segment level filtering in distribution medel (BD64).
    Thanks,
    Asit Purbey

  • Delete Outbound Idoc Segment

    Hello Folks,
    Problem:
    I have extended the sub structure of an idoc for IT0002 with custom field,
    E1P0002
         Q1P0002
              Z1P0002
    Where Z1P0002 has custom fields.
    When the destination system is 'ABCD' - system should allow the idoc
    else
    When destination is other than 'ABCD' - Z1P0002 segment should be deleted and idoc should be sent.
    How can this be achieved, any sample code.

    Hi,
        Make use of Segment level filtering in distribution medel (BD64).
    Thanks,
    Asit Purbey

  • To delete the IDOC Segment in the Inbound i.e.Item Data

    Hi All,
    Idoc is received for orders05 as inbound.
    The IDoc Data contains two levels of item data
    i.e. Segment E1EDP01 - In this we Pass only the quantity.
          in the Sub Segment of item E1EDP19 - Customer Material in the segment IDTNR with qualifier 002.
    The same segment is repeated again but the customer material is different.
    Now need to check the material, if it is different, i need to delete the entire second item segment and put the customer material in the Segment E1EDP19 which has empty field.
    His there any Function Module or so to delete the incoming data of the idoc through inbound?.
    Could you please let me know if there any way to do the same.
    Thank you.
    Regards,
    Dinesh.

    yes here you can access only one segment, if you don't control that here, then the information will be populated to xvbap. or else you can even try to implement the error handling exit EXIT_SAPLVEDA_008 /EXIT_SAPLVEDA_011
    already item information will be populated to xvbap  table . so try to delete the item from xvbap also

  • Deleting an idoc segment in memory

    I am using the user-exit EXIT_SAPLEINM_011 to delete a segment for materials that I do not want to send to the interface. The material is in the E1EDP19 segment. I search for all E1EDP19 segment where material is stored and get the PSGNUM for each materials that needs to be deleted and store the PSGNUM in a table (LT_PSGNUM). Then I loop throught the PSGNUM table to read each PSGNUM and delete all entries in the internal table EDIDD where PSGNUM matched PSGNUM and SEGNUM so that I can delete parent and children. The problem is somehow it deletes more than what I intend to delete. I have total 28 segments and if deleted cofrrectly I should get only 23 segments instead I get only 4 segments.
    Any help is appreciated and thanks in advance.
    - Vijay

    loop at t_edidd into ls_edidd.
        IF ls_edidd-SEGNAM = 'E1EDP19' and ls_edidd-sdata+0(3) = '001'.
          lv_tabix   = sy-tabix.
          lv_psgnum = ls_edidd-psgnum.
          lv_e1edp19 = ls_edidd-sdata.
          ls_matnr-matnr = lv_e1edp19-idtnr.
    *--- Select the maximo relevant material from MARA
          SELECT SINGLE matnr zzmaximo_relvnt INTO ls_matnr FROM mara
            WHERE matnr = ls_matnr-matnr
            and   ( zzmaximo_relvnt = c_mxtrk  OR
                     zzmaximo_relvnt = c_mxvw ).
          if sy-subrc ne 0.
            append lv_psgnum to lt_psgnum.
          endif.
        endif.
      endloop.
      loop at lt_psgnum into lv_psgnum.
        loop at t_edidd into ls_edidd where segnum = lv_psgnum or psgnum = lv_psgnum.
          lv_tabix = sy-index.
          delete t_edidd index lv_tabix.
        endloop.
      endloop.

  • Delete idoc segments

    Hi all,
    I need to delete the idoc segments for some condition based on the table KNVV value. It is basic type is DEBMAS05.
    I have used a wrapper FM ZIDOC_INPUT_DEBITOR as i could not find a user exit in IDOC_INPUT_DEBITOR.
    In test run we19, in debuggin i see the incorrect records/segments are getting deleted from IDOC_DATA which is the way i have coded. However when i see the generated idoc number i can see all the segments and the incorrect segments are not getting deleted. Let me know how to delete idoc segments through code.
    Note : I have tried in BD59 to reduce the idoc segment, but the condition for our requirnment cannot be possible in BD59.
      LOOP AT idoc_data.
        CASE idoc_data-segnam.
          WHEN 'E1KNA1M'.
            gwa_deb_hdr = idoc_data-sdata.
          WHEN 'E1KNVVM'.
            gwa_deb_sale = idoc_data-sdata.
          WHEN 'E1KNMB1'.
            gwa_deb_comp = idoc_data-sdata.
           APPEND gwa_aex_item TO gt_aex_item.
        ENDCASE.
       IF gwa_deb_hdr+0(3) = '004'.
          IF sy-tabix > 1.
        SELECT SINGLE kunnr vkorg vtweg INTO (lv_kunnr, lv_vkorg, lv_vtweg)
                FROM knvv
                WHERE kunnr = gwa_deb_hdr+3(10)
                   AND vkorg = gwa_deb_sale+3(4)
                   AND vtweg = gwa_deb_sale+6(2).
            IF sy-subrc NE 0.
              DELETE idoc_data INDEX sy-tabix.
            ENDIF.
          ENDIF.
       ENDIF.
      ENDLOOP
    Thanks,
    Senthil

    Just want to know.
    If the standard idoc segmets cannot be deleted through code or this doesnot work as i ran in test run we19?

  • Problem with creation of IDOC Segment Type

    Hi,
    I tried to create IDOC Segment Type Z1LFA1 but error
    prompted "Structure Z1LFA1 already exist.".
    I tried deleting it at se11  but prompted
    "You cannot edit object R3TR TABL Z1LFA1 with the
    standard editor"                          
    and at sm30-TADIR, but prompted
    with "Cannot delete object directory entry, object exists."
    How will go about this??
    Please help!
    Thanks!

    hi,
    yup, tried doing that on we31 but the segment does not exist yet.
    we're currently upgrading from 4.6 to ecc, I think the structure
    was tranferred to our ecc client but the idoc segment and idoc type were not. I'll just have to transport it then.
    Thanks!

  • Idoc segment field length changes

    Hi friends,,
    I am new to idoc.
    My requirement is in my segment
    i am having 5 fields and also this segment is already realeased one.
    i wnat to change the field length from 10 to 20 . how to do this ?
    actually what i did is
    1. i cancel the release for that segment.
    2. in that field inside the dataelement i changed the field length from 10 to 20.
    3. data elemnt get chaged from 10 to 20 but Export length for that field in Idoc segment still retain the 10 only
    can you plz how to resolve this
    deva

    Hi,
    The way you used is right. ( cancel release or create a new segment )
    After you cancel release, try delete that field, and insert a new one.
    If it isn't valid still,  create a new segment instead.
    Regards
    Sam

  • IDOC Segment mapping change

    Hi,
    How can i change the field attached to a IDOC segment.
    Actually we have this Invoice IDOC,in which the E1EDK03 012(Qualifier) is passing the IDOC creation date instead of Billing date.
    So i need to change this mapping to Billing date.
    Please help.

    Hi Salz,
    I just checked my version of SAP (4.7) and you should get an invoice date.  Check out the subroutine FILL_E1EDK03 in function module IDOC_OUTPUT_INVOIC.  The first section of this code creates an E1EDK03 segment with the invoice date (if there is an invoice date), with qualifyer 026.
    Is there a possibility that in fact you are getting an E1EDK03 segment with the invoice date, but you are also getting other E1EDK03 segments (such as the one you mention with qualifyer 012) and they are obscuring the one you are looking for?
    If there are definitely none being created then can I suggest that you debug the subroutine FILL_E1EDK03 in function module IDOC_OUTPUT_INVOIC to check what is happening.  You may need to change the timing of your output record to 1 and run the program RSNAST00 online to get the breakpoint to be hit correctly. 
    If, in your version, the code doesn't include this date, then you have an exit function module EXIT_SAPLVEDF_002 (called via the subroutine CUSTOMER_FUNCTION in function module IDOC_OUTPUT_INVOIC) where you can actually add your own segment data.  For example you an change the contents of an existing segment (as per your original request), or append your own E1EDK03 segment with your own data.  I would recommend adding your own segment rather than changing whats there.
    It is possible to extend idocs to add your own custom segments (eg Z1EDK03), but I wouldn't recommend it in your case, because in later versions of SAP the date is provided and by not creating a new segment (Z1EDK03) you will have no mapping changes to do when you upgrade.  You can just delete your userexit code.
    Hope that all makes sense and helps you with your problem.
    Cheers,
    Brad

  • IDOC Segment is missing in the IDOC even though I have populated values

    Hi Experts,
       I face a problem in the IDOC processing.
       I have a custom IDoc type with 2 segments in the same Hierarchy.
       In the Z program I populate both the segments and send the internal table to the MASTER_IDOC_DISTRIBUTE Fun.Module.
       When the IDOC is generated, I see the IDOC with only one segment and the 2nd segment is missing.
       When I debugged the program, I see the 2nd Segment also getting populated.
       Can you give some info that can resolve my issues.
    Thanks,
    Micheal

    Check the below points,
    1. Check the internal table IDOC_DATA in MASTER_IDOC_DISTRIBUTE in debug mode whether the segement with values are populated.
    2. Are you populating the parent & hierarchy level in segment, if yes check whether the values are right one.
    3. There may be a possiblity the std SAP code would delete the custom segment if its any syntax error in segment defenition.
    Check this and if you still have the issue come back.

  • Syntax error in IDoc segment

    Hi,
    when I make a syntax check on my Idoc segment '/FIT/E1FISFIINV'  I get the error message:
    Entries for segment '/FIT/E1FISFIINV' missing in the 'Segment structures' table.
    I can't delete the segment type as I get the error message Segment /FIT/E1FISFIINV does not exist yet when I try it.
    But I also can't create the segment type as I get the error message Structure /FIT/E1FISFIINV already exists
    I already looke in the tables EDISDEF and EDISEGMENT to check that the entries for the segement /FIT/E1FISFIINV do exist in these tables.
    Does anybody have an idea how to solve this problem?
    Thank you.
    Martin

    I want to create a new idoc type '/FIT/xxxxx' and therefore I want to create new segment types  '/FIT/xxx' for this.
    I copied the segment types from another system (older release) to that system but there seems to be a data inconsistency. which I am trying to fix.

  • Issue with IDOC segment creation..

    hi,
    i created an idoc  segment thru we31. when i was saving it, and when the transport request was asked, i cancelled it. it so happend that the underlying structure was created (i was able to see that in se11) but in we31, the segment definition did not appear and i got the message "segment does not exist yet".
    so in se11, i deleted the associated structure and tried to recreate the segment, i am not able to !! while saving, i get the error "you do not have authorization for delete for function idoc segment"
    when i performed a segment check (ctrl + F1), i got the message,
    Repository structure missing for segment ZZZ                                                                                |
    Inconsistent overall length in segment version 000
    Segment version 000 not released
    Entries exist in table of Segments for segment ZZZ
    Entries exist in table of Segment definitions for segment ZZZ
    Entries exist in table of Segment structures for segment ZZZ
           |   Segment ZZZ is inconsistent                             
    what shud i do ?
    thks

    resolved. seems some authorization was missing. thks

  • Deletion of unwanted segment - error 26

    Hello
    Can somebody please let me know how to delete unwanted segments?
    I want to delete segment E1MARCM for unwanted plants. I am deleting this from BADI_MATMAS_ALE_CR, but I am unable to deal with its child segments.
    Thanks in advance
    Moderator message - Cross post locked
    Edited by: Rob Burbank on Mar 24, 2010 10:57 AM

    In theory the best way to get rid of unwanted segments without any coding is to introduce a filter in the distribution model (transaction BD64). However, this only works if you're using ALE and you know up-front which values you want or don't.
    In your case though it sounds as if you need dynamic filtering, i.e. it depends from case to case which plant segments are wanted. Thus a simple coding routine that deletes unwanted E1MARCM segments along with its children should do.
    Here's some untested ABAP code that probably has some errors. The idea is simply to recursively delete the given IDoc segment (specified in SEGNUM) along with all it's children (i.e. the ones that reference in PSGNUM the given segment number):
    form DELETE_SEGMENT using    SEGNUM    type EDI_DD40-SEGNUM
                        changing EDIDD_TAB type EDI_DD40_TT.
      data EDIDD type EDI_DD40.
      " Delete the parent segment
      delete EDIDD_TAB where SEGNUM = SEGNUM.
      " Delete children of parent segment and their children
      loop at EDIDD_TAB into EDIDD where PSGNUM = SEGNUM.
        " Delete the immediate child
        delete EDIDD_TAB index sy-tabix.
        " Now recursively delete all it's children
        perform DELETE_SEGMENT using    EDIDD-SEGNUM
                               changing EDIDD_TAB.
      endloop.
    endform.
    As I said, just the rough outline. Coding is untested and I'm not completely sure if the looping and deleting really works. Might be better to mark the unwanted segments first and then delete them. E.g. if your IDoc number is filled, then you could for example clear the IDoc number in the table for all unwanted segments and then delete them en-block once you're done.
    Cheers, harald

  • Deletion of unwanted segments error 26

    Hello
    Can somebody please let me know how to delete unwanted segments?
    I want to delete segment E1MARCM for unwanted plants. I am deleting this from BADI_MATMAS_ALE_CR, but I am unable to deal with its child segments.
    Thanks in advance

    In theory the best way to get rid of unwanted segments without any coding is to introduce a filter in the distribution model (transaction BD64). However, this only works if you're using ALE and you know up-front which values you want or don't.
    In your case though it sounds as if you need dynamic filtering, i.e. it depends from case to case which plant segments are wanted. Thus a simple coding routine that deletes unwanted E1MARCM segments along with its children should do.
    Here's some untested ABAP code that probably has some errors. The idea is simply to recursively delete the given IDoc segment (specified in SEGNUM) along with all it's children (i.e. the ones that reference in PSGNUM the given segment number):
    form DELETE_SEGMENT using    SEGNUM    type EDI_DD40-SEGNUM
                        changing EDIDD_TAB type EDI_DD40_TT.
      data EDIDD type EDI_DD40.
      " Delete the parent segment
      delete EDIDD_TAB where SEGNUM = SEGNUM.
      " Delete children of parent segment and their children
      loop at EDIDD_TAB into EDIDD where PSGNUM = SEGNUM.
        " Delete the immediate child
        delete EDIDD_TAB index sy-tabix.
        " Now recursively delete all it's children
        perform DELETE_SEGMENT using    EDIDD-SEGNUM
                               changing EDIDD_TAB.
      endloop.
    endform.
    As I said, just the rough outline. Coding is untested and I'm not completely sure if the looping and deleting really works. Might be better to mark the unwanted segments first and then delete them. E.g. if your IDoc number is filled, then you could for example clear the IDoc number in the table for all unwanted segments and then delete them en-block once you're done.
    Cheers, harald

Maybe you are looking for