IDoc - Get Segment Definition or Version in Code

I'm working on the ABAP-PI Port, created a FM based on FM OWN_FUNCTION now.
In my FM, there is a call to a function
CALL FUNCTION 'EDI_SEGMENTS_GET_ALL'
that retrieves all the segment data for a particular IDoc number.
However, it returns only the segment name EDIDD-SEGNAM and not the segment definition.
Example:
Value returned: "E1EDKA1" ( EDIDD-SEGNAM , 27 char long field)
I'm actually looking for the Segment Definition that goes up to 30 characters long.
Value I need to be returned: "E2EDKA1001" - has the extra 3 digits at the end that represents the Version.
If you go to WEDI, Development > IDoc Segments, You can see that the Segment definitions belong to a data type EDISEGDEF (30 characters long).
Does anyone know how I can get this programmatically?
The IDoc file downloaded by the FILE port stores the 30 char Segment Definition in the file
Using the ABAP-PI it only returns the segment name (27 char)

Hi all,
Thanks for your replies.
EDISDEF might be useful, but I'm not sure how to use it at the moment.
I am supplied in the code a structure of type EDIDC, which has the following values (not all are listed)
MANDT     C     3      308
DOCNUM     N     16      0000000000002050
DOCREL     C     4      640
STATUS     C     2      03
DOCTYP     C     8
DIRECT     C     1      1
RCVPOR     C     10      SUBSYSABAP
RCVPRT     C     2      B
The above represnets a particular IDoc being processed (see DOCNUM and DOCREL)
The default code then uses a FM to get the segment data based on the DOCNUM.
CALL FUNCTION 'EDI_SEGMENTS_GET_ALL'
      EXPORTING
           DOCUMENT_NUMBER         = I_EDIDC-DOCNUM
      TABLES
           IDOC_CONTAINERS         = I_EDIDD
      EXCEPTIONS
           DOCUMENT_NUMBER_INVALID = 1
           END_OF_DOCUMENT         = 2
           OTHERS                  = 3.
Does anyone know of any FM that returns a EDID4 (has 30 char segment version) structure instead of a EDIDD structure (27 char seg def)?
And the value EDIDC-DOCREL (SAP Release for IDoc)  e.g.
<b>640</b>
does not match up with values available in EDISDEF-RELEASED (IDoc development: Release of segment definition), e.g.
<b>30F
40A
45A
</b>
How can I find if the segment definitions are
E2EDKA1 or
E2EDKA1001 or
E2EDKA1002 or
E2EDKA1003

Similar Messages

  • XI IDOC missing segment definition in type E1LFM1M

    Hi experts,
    we have recently upgraded our ERP system to NW 702 EH5. As aresult a new segment definition was added to our segment type E1LFM1M ( segment def. E2LFM1M007). The problem we are havign is that our XI system is still running on NW700 and it doesnt have this segment defintion. Since the upgrade we are getting an error in transaction RFC complaining about the new segment definition E2LFM1M007 everytime we try to send a vendor from ERP to SUS using BD14. Is there a way we can deactivate the new segment definition E2LFM1M007 in segment type E1LFM1M?
    Thanks,
    Abdul.

    Hi Abdul,
    Actually it does not matter what are your systems' versions, PI can always handle an IDoc properly. All you need to do is perform the following steps in your PI system:
    1. Log on to ABAP stack, go to t-code idx2, find your ECC system and that particular IDoc (I believe this will be CREMAS) and delete its metadata.
    2. Log on to Enterprise Services Repository, find your SWCV where the IDoc definition was loaded, and load it again from your ECC system, then activate the change.
    3. If necessary, also adjust the message mapping to use/not use the new segment. Activate your changes.
    Once you have these steps completed, you are ready to retest your scenario and say goodbye to the error.
    Hope this helps,
    Grzegorz

  • IDOCS: Segment Definition and Segment Type

    Hi Gurus,
    We are working on IDOCs and trying to send a Location Master IDOCs to Third party system.
    1. In the IDOC print preview we are in a position to see the IDOC segment type Ex: E1TPLOC but customer is asking for Segment definition E2TPLOC.
    When we go through the documentation:
    u2022     Segment Type consists of Segment definition with Version and Release.
    u2022     Segment Definition will contain the Field names
    u2022     E1TPLOC, E1TPDLH, E1KNVAM, E1TPTRM & E1TPSHH Segment types with concerned Segment definitions are
                         E2TPLOC,E2TPDLH, E2KNVAM
    How to see the Segment definition types?

    Hi,
    You can see the documentation in the transaction WE60 by giving the IDOC Basic type and extension if you have any.
    E1 and E2 are the same, when you see the definition of the segment the naming convention will be E2 and when populating the data it will be E1.
    I believe he is asking the segment definition alone, you go to WE60 transaction and give the inputs and click the parser button and that will give you the definition of the idoc and which you can share it with your partner.
    Thanks,
    Mahesh.

  • Segment definition version

    Hi,
    We have generated IDOC for basic type MATMAS03
    and following are some of the segments, their versions and release.
    Segment type  Version Release
    E1MARAM         005    620
    E1MARMM         002    620
    For segment type E1MARAM and E1MARMM we want to use following version and release
    keeping rest of the things same.
    Segment type  Version Release
    E1MARAM         004    46C
    E1MARMM         001    46A
    Is it possible to create idoc with these versions for segment E1MARAM and E1MARMM.
    I am using FM MASTER_IDOC_DISTRIBUTE.
    Rgds,
    Fattesingh

    Hi all,
    Thanks for your replies.
    EDISDEF might be useful, but I'm not sure how to use it at the moment.
    I am supplied in the code a structure of type EDIDC, which has the following values (not all are listed)
    MANDT     C     3      308
    DOCNUM     N     16      0000000000002050
    DOCREL     C     4      640
    STATUS     C     2      03
    DOCTYP     C     8
    DIRECT     C     1      1
    RCVPOR     C     10      SUBSYSABAP
    RCVPRT     C     2      B
    The above represnets a particular IDoc being processed (see DOCNUM and DOCREL)
    The default code then uses a FM to get the segment data based on the DOCNUM.
    CALL FUNCTION 'EDI_SEGMENTS_GET_ALL'
          EXPORTING
               DOCUMENT_NUMBER         = I_EDIDC-DOCNUM
          TABLES
               IDOC_CONTAINERS         = I_EDIDD
          EXCEPTIONS
               DOCUMENT_NUMBER_INVALID = 1
               END_OF_DOCUMENT         = 2
               OTHERS                  = 3.
    Does anyone know of any FM that returns a EDID4 (has 30 char segment version) structure instead of a EDIDD structure (27 char seg def)?
    And the value EDIDC-DOCREL (SAP Release for IDoc)  e.g.
    <b>640</b>
    does not match up with values available in EDISDEF-RELEASED (IDoc development: Release of segment definition), e.g.
    <b>30F
    40A
    45A
    </b>
    How can I find if the segment definitions are
    E2EDKA1 or
    E2EDKA1001 or
    E2EDKA1002 or
    E2EDKA1003

  • IDOC - add new field in in existing segment definition

    Hi,
    For segement type say Z1MARA1 if we need to add a new field in segement definition say Z2MARA1 SAP is not allowing to add new field if we tried to cancelled the realsed 30E it not allowing since the SAP realease which we are working is 640 so only we can create new segement defination with version Z2MARA1001 with new field added but issues is that the partner Profile for outbound parameters the Segment release in IDOc Type is 31I so if we change this segment release in IDOC type to new version ie., 640 then it will pick all the new segement associated with it due to which the the format in which we pass the segements to third party will change so is there any way to use the existing segment definition which is release 30E & add addition field to it. Only one way I found is that when i try to cancel the released message is trigger so in the debug if I make it success it allows to add new field in existing segment definition but which is wrong way of doing is there any way we can used same segment definition & add new field without adding new version & new released.
    Thanks in advance.
    Rajeev

    Varma,
    I know that we can add new segement with new version my question is existing segement definition can we add a new filed because in partner profile we specified release 31i so even we create new segement type then version will be 640 so it will not pick the latest version.
    Thanks
    Rajeev

  • How to cancel the release of the current segment definition-WE31-IDOC?

    Hi Experts,
    Am trying to add a new field to a existing custom segment type/defination. This segment type is already using in the system.
    So, went to WE31 and pressed the PENCIL button for changing/adding my new field, but am geting the below message,
    (1)pls let me know that does it mean CANCEL the release (Menu>Edit>Cancel Release)? if so, Can I go ahead and use this CANCEL the release? do I need to take any pre-requisites as this segment is already relased?
    (2)But, you know there is another option saying 'ADD VERSION-Shift+F5', if I choose this option, its also taking me to a screen where in I can add new fields so which is correct option for me is it either (1) or (2)?
    Current segment definition Z_segment_defination can no longer be changed
    Message no. EA666
    Diagnosis
    The current segment definition Z_segment_defination of segment type Zsegment_type is already released.
    System Response
    The segment definition cannot be changed.
    Procedure
    You can either add a new segment definition or cancel the release of the current segment definition.
    Thank you

    so i tried to CANCEL the release by goiong menu pathEdit-->Cancel the release, but am getting the below error, How to fix it to add my new field?
    Error while resetting release of segment
    Thank you

  • IDOC Segment Definition received instead of Segment type

    Hello Folks,
    When i send a Z Idoc Segment from A to B System, It is successfull from A System, but in B System sometimes its erroringout because in the inbound idoc Segment Definition is coming instead of Segment type.
    For Example
    From A System I have sent Z1P0002 segment
            B System I have received Z2P0002000(Which is the segment definition for Segment type Z1P0002)
    Any inputs to above problem?

    Hi,
    The problem may be due to system B using a older release version of the IDoc. In those scenarios, even though your IDoc type is recognized, it may not be possible for the reciever to determine the right segment version of the reciever.
    There are options in the WE20 partner profile configuration, Field Segment release in IDoc type and Segment Appl. rel. which enable the partner system preventing from erroring out.
    BR/Yogesh
    Edited by: Yogesh Surender on Jun 1, 2009 12:34 PM

  • Segment Definition Name in IDOC

    Hi Gurus,
       I am new to IDOCs.
       I need to create a new segment type in WE31.Its name should be say Z1TEST and I want to have the segment definition name to say Z2TEST.Currently the segment definition name is blank and disabled and when I save the segment type, the segment definition name, by default , comes as Z1TEST000(as per my example).
       Can u please suggest any ways of putting my own naming in the segment definition.
    Thanx in advance.

    hi,
    Defining Segments
    Use
    This is where you define segments so that you can assign them.
    Procedure
    From the Commission System screen, choose Master Data -> Segment Assignment -> Segments -> Maintain.
    Choose a segment type and an effective validity date.
    Choose Save.
    Result
    You have created a representation of the commission calculation of relevant data from the external policy management system. You can now assign the segments.
    A data segment contains a collection of fields from SAP tables. A data segment may hold master data or data from an application document. A segment is a collection of all the records of one type. A segment may contain data from a single SAP database table, or it may combine related data from multiple tables.
    A checksum is basically a one-way hash of whatever data arguments you supply.
    Regards,

  • Segment definition in an IDOC type

    Hi,
    What does Maximum number and Minimum number stand for in an segment definition within an IDOC type? I think there are two options.
    1. the occurence number of the segment type in an IDOC type defintion
    2. the occurence number of the segment data of a special IDOC
    1 or 2. Please suggest ... It will better if there is any example for me to understand it. Thanks.
    Regards

    Option 2 is correct from my observation.

  • Duplicate Outbound IDocs getting Triggered at the same time.

    Hi Folks,
    I have created custom outbound idoc and done all the configurations required like WE20, WE30, WE31, WE81, WE82, WE 41, WE57 etc.
    Also I have written my code to populate segments and then call MASTER_IDOC_DISTRIBUTE in the custom function module which is assigned to the process code and also done the configurations like we57 etc. for the same.
    Now when I trigger my output type from VL74 transaction, I noticed two entries in we02 resulting in two IDocs generated for 1 HU.
    The difference in two IDocs is the first IDoc getting generated in error with status 29. While the second one as success with status 03.
    The data records containing segments have same values for both the IDocs number.
    Whether the configuration is a issue here or problem in code of custom fm?
    Please help.

    Hi Anil,
    Appreciate your quick response.
    In my custom FM I have populated an internal table it_master_idoc_data with two records of two segments, containing segment name in SEGNAM filed and segment data in SDATA field. 
    Please let me know whether the data in this internal table of structure EDIDD sufficient for passing to MASTER_IDOC_DISTRIBUTE FM? Or do I need to populate any other field of EDIDD.
    Also I am exporting a structure master_idoc_control containing values in this 5 fields.
    MESTYP = Z message type, Z IDOCTP, partner and details in  RCVPOR, RCVPRN, RCVPRT fields.
    I am not populating the internal table communication_idoc_control while calling FM MASTER_IDOC_DISTRIBUTE from my custom function module.
    After executing MASTER_IDOC_DISTRIBUTE FM, when the control comes back to my custom FM there is one record in communication_idoc_control  internal table with IDoc number in DOCNUM field with status 29(error). Now when we check in WE02 there are two IDocs generated after this transaction's execution.
    The first one in error which FM MASTER_IDOC_DISTRIBUTE returns and second one in success with status 03.
    Please help....
    Thanks,
    Pravesh

  • Flat File IDOC - ECC, segment defn x in IDoc type y CIM type do not exist

    Hi,
    I'm working on idoc flat file > sap scenario.  Everything seems to be working up until the point where I get an error message:
    EDISDEF: Port EDIPORT segment defn E2FINBU000 in IDoc type FIDCCP01 CIM type  do not exist
    I've loaded the meta data, and the file structure is fine.  I believe the issue is related to PI not having the idoc I'm interested in listed in WE30.  How do I reference the standard IDOC type FIDCCP01?  Ideas I've had are around SWCV or transport from another system, the first I'm not sure which SWCV, the later seems a bit of a bodge and I dont like the idea.
    Thanks
    James.

    Hmm.. some light for the situation.  Seems that the segments imported are:
    E1FINBU     E2FINBU     31I
    E1FINBU     E2FINBU001     40A
    E1FINBU     E2FINBU002     40B
    E1FINBU     E2FINBU003     45A
    E1FINBU     E2FINBU004     45B
    E1FINBU     E2FINBU005     46A
    E1FINBU     E2FINBU006     46C
    Which indeed does not have E2FINBU000, which the IDOC is most definitely trying to pass.  I can only guess that the middleware producting this IDOC is flawed, and that standard SAP ALE will accept this as E2FINBU (It works into another SAP system without XI).
    Guess I've answered my own question, but feel free to offer light for points
    Thanks,
    James.

  • Add IT0006 custom fields for segment definition E1P0006 basic type HRMD_A06

    Hello!  I am am trying to determine how to bring in our custom fields from IT0006 into our IDOC's for message type HRMD_A basic type HRMD_A06 without performing a custom SAP modification.  I was able to create a new segement definition called Z1P0006 and replace the SAP standard E1P0006 IDOC segment defintion in table T777D for infotyp 0006 to Z1P0006.  However, I receive a message that I must not maintain this IDOC segment manually and instead you must maintain infotypes and their individual elements by using the transactions for processing infotypes: PPCI or PM01 (Infotype copy transaction for personnel administration). 
    Does anyone know of a way to bring in the new custom infotype fields from i.e. reimport the table structure for IT0006 into the segment definition without a custom SAP modificaiton?  I would really appreciate any help on this topic!
    Thanks!
    Holly

    unfortunately, the standard do not provide the infotypes for the HR-TM (Time Management), that
    are between the structures i must send in the other system sap.
    Ok, I have never delt with Time data in HRMD_A. Probably this is the case then
    Ok,now i've checked the filter in BD64 and the tables BDCP2, CDHDR and CDPOS but it seems
    all correct!!
    By checking Filters I mean that confirm if you have added Time Infotypes there (just
    making sure). If data is appearing in BDCP2 that means there is no problem in Change
    pointer creation, Just ruling out possibility.
    Try with an user exit it's a good idea, but why in the PFAL the idoc (with the custom segments)
    is created without problems and in the BD21 no??? This is very strange
    1) Well BD21 uses the Function module (TBDME for HRMD_A) which read change pointers and
    create IDOCs. So now if you have extended Segment you have to add your population code
    here somewhere.
    2) PFAL is Push program, my assimption here is you have wriiten some piece of code to
    populate Additinal segments data here? Otherwise IDOC will not be populated
    automatically.
    Let me know what you think.

  • IDOC field segments

    Hi all,
    I am doing a EDI 850 to ORDERS03 IDOC mapping. I imported the structure of ORDERS03 IDOC from SAP into our third party mapping translator. Its has the fields
    E2EDK01005  instead of E1EDK01
    E2EDK14 instead of E1EDK14
    E2EDK03 instaed of E1EDK03. I exceuted the mapping and i see the IDOC getting created in SAP with E1EDK01 and so on....
    I went through the forums and came to know that 1 means outbound, 2 means inbound and the E2EDK01...are the definitions are as per the 45B release...
    But i am still not clear why there happens to be a difference in the IDOC segment name that has been imported into the translatorVS the IDOC that is getting created in SAP. Should i assume that E2EDK01005 is the equivalent of E1EDK01 etc....
    can some one help me undertsnad this segment name mismatch??
    C Nathan

    Hi,
    When creating IDocs in the R/3 system using transaction WE30, three structures are created and numbered automatically for each IDoc segment. For example: Delivery header has E1TPDLH, E2TPDLH and E3TPDLH. E1 TPDLH is release-independent, E2TPDLH is release-dependent and E3 TPDLH is used for documentation. When segment names are transferred, you must specify the E2 segment names in order to be working independently of SAP release. That's the reason you see it differently.
    Reference link http://help.sap.com/saphelp_40b/helpdata/en/1a/0e381b539911d1898b0000e8322d00/content.htm
    Cheers,
    Prasanna

  • IDoc Editing Segment

    Hi all,
      I have a requirement where the field length in one of the fields in the segment (Z1PXXXX) has to be changed. Since the segment definition is in different SAP release, i created a new version and tried to edit it. But all the fields from the older version is grayed out.
    Could you please tell me how to change the field length?
    Thanks,
    Sri

    It is always better to use IDOC either by loading the structure as an IDOC or by External Definition.
    Loading it as imported message will lead into consistencies for future.
    If you are not able to change the field length, try to take care of it during Mapping.
    Regards
    Krish

  • IDOC WBBDLD Segment 16 not showing up

    In BD52 what object should I use so that WBBDLD05 will show segment 16 for taxes?

    I guess I was wrong in stating the question.  I found that BD52 does not make a segment in an idoc appear.  The issue is that I cannot get segment 16 to show up with the tax code.  We have tax codes set up in our system but the segment must have been turned off when our consultants set the system up.  We were using another POS software package that was not integrated with SAP ECC.  Now we want to use the integrated system and we don't know how to get the segment to show up.  Any thoughts?

Maybe you are looking for