Begin date in idoc segment E1BEN07 basic type BENEFIT3 health plan IDOC

I run tcode HRBEN0052, Idoc Data Transfer, for my health plans.  If my new health plan record (IT0167) does not have a change in the General plan data (plan type, benefit plan, health plan option, dependent coverage) the begin date value on segment E1BEN07 is not the begin date for the current IT0167 record but of the previous record where the general plan data is the same.  This causes a problem because the additional provider field (PROVI) value in the idoc is from the previous IT0167 record and not the current IT0167 record. 
Does anyone know why the current IT0167 begin date value is not included in the idoc when there are past IT0167 with the same general plan data?

Per SAP
+The current functionality is to combine multiple continuous records if
there is no difference in the records except the dates. If you want the
functionality to be different, you can try the following.
Inside the function module HR_BEN_IDOC_SEND, there is a call to
subroutine "fill_idoc_for_period"
Kindly change the call inside the subroutine "fill_idoc_for_period"
From
1. Read Plan Data
IF idoc_categ-healt = true.
PERFORM read_infty_health TABLES it0167
error_tab
USING subscriber
begda
endda
true
reaction
CHANGING subrc.
To
1. Read Plan Data
IF idoc_categ-healt = true.
PERFORM read_infty_health TABLES it0167
error_tab
USING subscriber
begda
endda
false
reaction
CHANGING subrc.
Please note however that this is a change in the standard and thus will
be considered consulting if an error occurs, which is not supported
by our services.+

Similar Messages

  • EXTEND BASIC TYPE HRMD_A FOR TRANSFER IDOC DATA (HR MODULE)

    Hi,
    I'm trying to various infotype 2001,2002,2006 ecc to another SAP system via ALE and since they are not part of message type "HRMD_A" I have created the extension ZHRMD_A06. I've already created the new segments(we31) and put these segments (with names Z1P2001, Z1P2002 ecc ecc) into the extension(we30). And I've assigned the extension to the message and basic type (we82).
    The new segment are processed correctly in the idoc creation via transaction PFAL, but via transaction BD21 i meet the abend message : B1 070 - Internal Error : program....command... for argument Z1P2001 (for example)
    In other words, BD21 do not process the custom segment but the PFAL yes...how it is possible?
    I've activate the change pointer in every customizing table intersting.
    Many thanks in advance for any reply
    Achille

    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.

  • Populating the custom segments for the Basic type attached to HRMD_A (IDOC)

    Hi,
    I've enhanced a few infotypes and want the new fields to be available in an IDOC created through the program RHALEINI.
    Here are the steps I followed.
    Step 1 :(we31)
    We created new segment Z1IT023 , containing all the fields from infotype 0023 along with the custom fields added.
    Step 2 :(we30)
    We created an extension of IDOC type HRMD_A07 by name HRMD_EX to include this segement.
    Step 3 :
    We added an entry in table EDIMSG against message type HRMD_A , with base type : HRMD_A07 , extension : HRMD_EX , version : 700
    Step4 :(we20)
    Now , we made changes to partner profile by adding entry for message type HRMD_A with base IDOC type as HRMD_A07 and extension as HRMD_EX
    Step5:
    We changed the entry in table T777D and specified the IDOC segment as Z1IT023.
    Step6.
    We then tried to execute the report RHALEINI to generate the IDOC. The IDOC got created, but it didn't have the data for the segment Z1IT023.
    In fact, there is a different solution to this... by adding the custom segment(containing nly the new infotype fields) as a child of the original segment E1P0023 and then writting code in the user-exit to populate the segment, but our intension is to have a single segment with all the infotype 0023 data. Besides, I believe in HR, making an entry in T777D should free us from writing any code for populating the IDOC segments.
    Can anybody please suggest me, where am I going wrong. How can the new segments be populated automatically.
    Thanks in advance.
    Sujit.
    Responses will be suitably rewarded.

    Hi,
    Did u get any exit to populate the custom segment?
    Thanks,
    San

  • Idoc processing - determine Basic Type in Program

    Hi Forums,
    I would like to determine the Basic type that is being processed by at the time of my Idoc creation.
    the function module I am using is being called by shipping document as well as delivery documents.
    I would like my code only to be executed when it is a basic type of DELVRY05

    Hi,
    1) Goto Tcode - we57:
    Assign function module to IDoc type
    Module: Function module
    Basic type: 
    Message type:
    Direction: 2 (inbound)
    This will differentiate between Shipping and Delivery.
    2) Creating Inbound process code - we42
        For Outbound Process Code -- WE41.
    For further plz refer following link.
    https://wiki.sdn.sap.com/wiki/display/ABAP/ALE%2CIDOC
    Thanks and Regards,
    ShreeMohan

  • How to get optional segments of Basic type ORDERS05

    Hi All,
    I am using ORDERS05 Basic type for one implementation where I need to use segment E1CUCFG of this basic type but it is not coming as this is optional segment. Please let me know how to get it.
    Thanks !!

    Hi,
    In WE30, I can see the segment E1CUCFG for ORDERS05, If you want to use that, you will have to populate the same.
    Regards,
    Amitava

  • Idoc segments and Partner types

    Hi Experts,
    Will we be able to find the partner details from the IDoc segments.
    Thanks in Advance.
    Regards,
    Sridevi

    Hi,
    I want  to get a list of partners to whom a particular IDoc segment is sent.
    Thanks,
    Sridevi

  • IDOC Exit for Basic Type  PORDCR101

    I had extended the idoc type PORDCR101( Create Purchase Order ) and added the new segment under E1BPMEPOITEM .
    Now i want to find the exit which will help me in populating the added segment fields when the IDOC is posted .
    Any sort of help is appreciated .
    Regards,
    Praveen.

    Hello,
    The message PORDCR will use FM IDOC_INPUT_PORDCR and further processing is done using a BAPI: BAPI_PO_CREATE.
    Enhancement SAPLMEWP deals with the Exits related to the BAPI.
    Hope the above point helps you.
    Best Regards, Murugesh AS

  • Duplicate IDOC created for basic type PEXR2002

    Hi,
    We are using PEXR2002 idoc for some document postings in FI. For a segment EIEDP02, when trying to write a BELNR field value which exceeds its size of CHAR 35. Its creating a duplicate segment with same key value. Because of this, the idoc not getting created and ends up in error.
    Could you please anyone help me in this regard?
    Thanks and Regards,
    Vimala P

    Hi,
    In our process, the EIEDP02-BELNR value is actually filled with document text field value which is of length more than 35. What is happening right now is, if the length of document text having more than 35 characters and then with first 35 character of BELNR value one segment is created. And it again create one more segment EIEDP02 with BELNR value having the rest of the fields value(>35 characters). Thus creates duplicate segments which results in IDOC creation failure
    Thanks and Regards,
    Vimala P

  • Fill IDOC segment, E1IDBW1. For PEXR2002 Basic Type

    Hello Team.
    We send the IDOC for the Basic Type PEXR2002, Message Type PAYEXT.
    This IDOC doesn't fill the Segment E1IDBW1 (IDoc header - special instructions (INP) )
    I'm review some notes(1164524) and said to fill this segment it's neccesarie config the IHC.
    But doesn't have this functionality.
    It's possible fill the segment E1IDBW1 in a user exit or any other enhacement at creation idoc moment?
    My idea is used the FM
      CALL FUNCTION 'GET_SEGMENT_POS_FOR_INSERT'
        EXPORTING
          I_BASIS_TYPE            = ch_edidc-idoctp
          I_EXT_TYPE              = ch_edidc-cimtyp
          I_SEGMENT_TYPE          = 'E1IDBW1'
        IMPORTING
          E_INDEX                 = li_tabix
        TABLES
          IT_EDIDD                = t_edidd
        EXCEPTIONS
          BASIS_TYPE_NOT_FOUND    = 1
          EXTENSION_NOT_FOUND     = 2
          EXTENSION_ERROR         = 3
          INVALID_IDOC_DEFINITION = 4
          IDOC_ERROR              = 5
          INVALID_SEGMENT_TYPE    = 6
          INVALID_START_INDEX     = 7
          NO_MORE_POSITION        = 8
          TOO_MANY_SEGMENTS       = 9
          OTHERS                  = 10.
    To Fill 2 constants in this segment.
    Do you have any other idea?
    Thanks
    Edited by: David Lezama Gonzalez on Sep 1, 2011 2:51 PM

    Hi,
    Basically the segment E1IDBW1 will always be filled via user exit.
    If you work with the IHC (In-House-Cash) application you have to fill
    the E1IDBW1 segment as described in note 626577.
    If you don't work in an IHC environment the following conditions must
    be fulfilled:
    1. The payment program has to fill certain fields (e. g. REGUH-DTAWS,
    REGUH-DTWS1 - REGUH-DTWS4).
    2. If this is fulfilled the payment data (REGUH, REGUP tables) will
    be filled. The instruction keys will be moved to IDOC segment
    E1IDKU3.
    3. In user exit EXIT_SAPLIEDP_002 you can take over the instruction
    keys from segment E1IDKU3 into E1IDBW1.
    You may also read note 496663, this note explains about user exit
    EXIT_SAPLIEDP_002 to populate this field in the idoc.
    Also, you can check the note:
    580321 - RFFOEDI1: BTE process 00002441 (Change IDoc)
    REgards,
    Cristiano

  • Data Services IDOC Errors when working with a newl Basic Type

    Hello,
    Just wondering if anyone else has encountered an issue similar to the one I am dealing with. We are trying to create business partners in SAP CRM from Data Services via IDOC. We are not using the standard IDOC, but instead we are using a new IDOC type.
    This IDOC type is generated by SAP CRM automatically through a transaction BDFG. This transaction creates a new basic type for an standard IDOC with the additional fields that we have added through the easy enhancement workbench (EEWB).
    The issue that we are having is that when we import the IDOC type into data services and we look at the schema many fields and sub-structures of the IDOC are duplicated. This means that we receive hundreds of errors when we try to validate our data flow. I can delete the duplicated sub structures in my query transformation but then the query transformation and the output schema and the idoc input schema are no longer identical.
    I have searched all over oss and different web forums for a solution but no one else it seems has even encountered this error. If anyone else has had a similar issue and can offer help it would be greatly appreciated.
    Bill

    Issue is resolved.
    After importing the meta data for the IDOC into data services I then proceeded to edit out all of the duplicate structures and fields from the IDOC.
    After making the IDOC structure in data services identical to the structure of the IDOC  in SAP I then proceeded to test this IDOC and it executed successfully.

  • Error in idoc of basic type artmas05 - status 51 with Message no. MG537

    Hi all,
         I tried to upload the material master table through idoc creation of basic type artmas05. But when i'm trying to do that i'm getting status 51 with Message no. MG537. then I analysed the application log which displays the following
    *The field MARA-MEINS/BAPIE1MARART-BASE_UOM(_ISO) is defined as a required
    field; it does not contain an entry
    *The field MARA-TAKLV/BAPIE1MARART-TAX_CLASS is defined as a required field; it does not contain an entry        
    *The field MARA-TRAGR/BAPIE1MARART-TRANS_GRP is defined as a required field; it does not contain an entry
    *You have not fully maintained the tax classifications
    *The field MAW1-WLADG/BAPIE1MAW1RT-LOADINGGRP is defined as a required field; it does not contain an entry
    But i hv given values for all the above fields in their respective segments.So can any1 suggest me how to proceed further.
    It would be helpful if someone could tel me the required fields in idoc to upload material master table through idoc.
    Thanks in advance,
    Revathi.

    Hi,
    Anybody please tell me the reason for the following error, despite giving all the field values mentioned there. The same error occurs even if I run the BAPI (which the ARTMAS iDoc uses) directly by passing values.
    The field MARA-MEINS/BAPIE1MARART-BASE_UOM(_ISO) is defined as a required field; it does not contain an entry
    The field MARA-TAKLV/BAPIE1MARART-TAX_CLASS is defined as a required field; it does not contain an entry
    The field MARA-TRAGR/BAPIE1MARART-TRANS_GRP is defined as a required field; it does not contain an entry
    The field MAW1-WLADG/BAPIE1MAW1RT-LOADINGGRP is defined as a required field; it does not contain an entry
    Regards,
    Gowri.S

  • Release? while assigning Z Message Type to a Standard  SAP IDOC Basic type

    Hi Experts,
    Am trying to assign a custom Message Type to a Standard SAP IDOC Basic type in WE82 transaction, but am not sure How to find the Release(last column of WE82 Tx)? Pls. let me know.
    Thank you

    Hello,
    In case of IDOC, Go to Transaction WE30, type your IDOC name & select basic type & extension.
    After that select Go to -> Header data (Shift+F7), you will Idoc header info. In the same pop-up you will find IDOC release for which version.
    Regards,
    Sameer

  • Idoc basic type and extension copied to new extension now how to trigger

    HI EXPERTS,
    I have copied a basic type and extension of idoc and now my new idoc has extension name say ext1.
    my old extension name is ext .
    now i want to trigger an idoc with ext1 extension ,i do not want to change idoc settings in we20.
    how can i do this ,please some one reply .
    Thanks,
    Pradeep.

    hi nikhil,
    reason is we want two different transport paths ,one team is amking changes to existing things ,i am working on another pahse of project .
    I have almost reached near to the solution .i have set the message variant in we20 ,now when i trigger its generating 2 idocs
    i am trying to write code in exit but in exit there there is no field idoc_mescod or idoc_cimtype
    Kindly suggest!!!1
    Thanks,
    pradeep.

  • 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

  • IDOC Status 26: EDI: Syntax error in IDoc (segment cannot be identified).

    Hi All,
    I have created IDOC extension for IDOC Basic type "PROACT01" and have followed all required necessary steps but getting IDOC
    Status 26. EDI: Syntax error in IDoc (segment cannot be identified). The exact error is:
    Please check Error Details and the details of the steps I followed for Setting up IDOC Extension:
    Error Detail :
    EDI: Syntax error in IDoc (segment cannot be identified)
    Message no. E0078
    Diagnosis
    The segment ZPROSEG does not occur at the current level of the basic type PROACT01 (extension PROACTEX).
    This error can have several reasons:
    The segment ZPROSEG is assigned to a group whose header segment does not occur.
    The segment ZPROSEG does not exist in the syntax description of the basic type PROACT01 (extension PROACTEX).
    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.
    Procedure
    Please check the IDoc or the syntax description of the basic type PROACT01 (extension PROACTEX).
    Can you please look at this problem and suggest what is wrong with IDOC Extension/Custome Segment?
    Below is the Details of the Steps which I have followed:
    1. Tcode WE31 - Created new custom Segment ZPROSEG with 4 fields. Released segment.
    2. TCode WE30 - Created IDOC Extension PROACTEX for Basic Type PROACT01. Released IDOC extension.
         Here when I run syntax check warning appears "No predecessors exist".  I am not sure if its okay!!
    3. TCode WE82 - Added Extension PROACTEX in the Message Type PROACT with BASIC Type PROACT01.
    4. TCode WE20 - Added IDOC Extension PROACTEX in the predefined partner profile in WE20 transaction.
    5. Added the following code in the Customer Exit EXIT_SAPLWVMI_001 include ZXWVMIU01 .
    DATA segnam(27).
    READ TABLE dedidd WITH KEY segnam = 'ZPROSEG'.
    IF sy-subrc NE 0.
    LOOP AT dedidd WHERE segnam = 'E1EDP31'.
    CLEAR dedidd.
    dedidd-segnam = 'ZPROSEG'.
    zproseg-matnr = 'Mat1'.
    zproseg-lgort = '001'.
    zproseg-gernr = 'SNo1'.
    zproseg-labst = 2.
    dedidd-sdata = zproseg.
    APPEND dedidd.
    ENDLOOP.
    ENDIF.
    Finally ran  transaction WVM2 (Transfer of Stock & Sales Data) to generate IDOC, its creating IDOC but when checked IDOC in WE05 its getting Status Error "26".
    Looking forward for your reply.
    Many thanks in advance.

    Hello,
    Actually you are appending the Z segment instead of inserting into the correct position. So the segment is added at the last, so hierarchy of segments is collapsed.
    So get the index of the previous segment E1EDP31 and increase the index by 1 and INSERT the Z segment with that new index as below.
    LOOP AT dedidd WHERE segnam = 'E1EDP31'.
    lv_index = sy-tabix. " <<--
    ADD 1 TO lv_index. " <<--
    CLEAR dedidd.
    dedidd-segnam = 'ZPROSEG'.
    zproseg-matnr = 'Mat1'.
    zproseg-lgort = '001'.
    zproseg-gernr = 'SNo1'.
    zproseg-labst = 2.
    dedidd-sdata = zproseg.
    *APPEND dedidd.
    INSERT dedidd INDEX lv_index. " <<---
    ENDLOOP.
    Here actually we are insering the record inside the LOOP and it regenerates the index again. It is not actually a good practice.
    So the best practice is get the index and generate the segment inside the loop, store them into another internal table, come out the loop and insert the Z segments into DEDIDD by looping the new internal table.

Maybe you are looking for