Chanding the content in an IDOC segment at runtime

Hi Experts,
I have funny issue with modification of the data in an IDOC segment. Below is the description of the issue:
     I am using the IDoc type FIDCC2.FIDCCP02. I have to populate the value for field 'KTOSL' of the
     segment E1FISEG. I wrote the logic in user exit EXIT_SAPLF050_006. It is getting triggered and the
     logic is updating the values in the IDOC_DATA internal table properly.
     When the IDoc is generated, I observed that the value for this field is not updated in IDoc Segment.
Could you please suggest where I went wrong.
Ramana

Hi Neha,
Thank you for the responce.
We need not to fill all the 21 fields before the field KTOSL. Because I was using the work area to modify the internal table based on the index.
One thing I can conclude is that we cannot change the values in the standard segments of a stanrd Idoc type. By the time you enter in the processing Functinal Module, the Idoc number would have been generated. So the modification we carry out are just updating the internal table which of no effect. The right way is that find the place where the values getting updated to the data base and change values as required. These changed values can be founf in the data base but not in the IDoc generated.
Neha one more query for the clarification,could you ever delt with the down payment requests through IDocs. If so please share the details.
Ramana

Similar Messages

  • Changing the content in an IDOC segment at runtime with EXIT_SAPLF050_006

    I am using IDOC FIDCC2 type. I have to change some values of the segment E1FISEG.
    In EXIT: EXIT_SAPLF050_006, I am making these changes, but after the execution.
    When the IDOC is generated, I noticed that the value of this field is not updated in the IDOC segment.
    I'll have something misconfigured?
    The code is as follows:
    CREATE OBJECT wa_obj.                                         "Creando el Objeto.
    BREAK dchirra.
    IF idoc_contrl-mescod EQ 'MPA'.                            "Chequeando Variante lógica de mensaje valida.
      LOOP AT idoc_data INTO e_idoc_data WHERE segnam = 'E1FISEG'.
        CLEAR: ze1fiseg, ze1finbu.                                  "Limpiando estructuras.
        MOVE e_idoc_data-sdata TO ze1fiseg.                         "Llenando estructura del Segmento.
        CALL METHOD wa_obj->get_data                                "Llamando a estractor del objeto.
          EXPORTING
            reserve    = ze1fiseg-reserve                           "- Campo RESERVE.
            estructura = 'E1FISEG'                                  "- Estructura
          CHANGING
            ze1finbu   = ze1finbu                                   "- Segmento ZE1FINBU.
            ze1fiseg   = ze1fiseg.                                  "- Segmento ZE1FISEG.
    Buscando Segmentos Hijos.-
        LOOP AT idoc_data INTO e_idoc_data2 WHERE segnam = 'E1FINBU' AND psgnum = e_idoc_data-segnum.
          MOVE e_idoc_data2-sdata TO ze1finbu.                      "Llenando estructura del Segmento.
          CALL METHOD wa_obj->get_data                              "Llamando a estractor del objeto.
            EXPORTING
              reserve    = ze1finbu-reserve                         "- Campo RESERVE.
              estructura = 'E1FINBU'                                "- Estructura
            CHANGING
              ze1finbu   = ze1finbu                                 "- Segmento ZE1FINBU.
              ze1fiseg   = ze1fiseg.                                "- Segmento ZE1FISEG.
          e_idoc_data2-sdata = ze1finbu.                            "Data Segmento.
          MODIFY idoc_data FROM e_idoc_data2.                       "Modificando data del IDOC
        ENDLOOP.
        e_idoc_data-sdata = ze1fiseg.                               "Data Segmento.
        MODIFY idoc_data FROM e_idoc_data.                          "Modificando data del IDOC
      ENDLOOP.
    ENDIF.

    IF idoc_contrl-mescod EQ 'MPA'
    is this condition is getting satisfied everytime since you are modifying only on this condition.
    I couldnot understand you comments as its not in English, however i tried understanding your logic,seems correct .
    Please check whether condition mentioned above is getting satisfied or not?
    Regards,
    Mayank

  • How to assign idoc segment at runtime ??

    Hi ,
    I have a ztable which is maintained via sm30.
    The field1 is a key field and other fields are idocsegment name , idoc field , field value .
    Field1 = key field
    idoc segment name (field2)
    idoc field (field3)
    field value(field4)
    How do i update idoc segment and particular field with field4 at runtime .
    segment name , field and value changes with the matching key field.
      loop at it_edidd into wa_edidd
       where segnam = wa_ztable-idoc_segment.
    wa_seg = wa_edidd-sdata.
    how to assign the field at runtime ?????????????????????????
    how to change the value of field ?????????????????????????
       update edid4 set   sdata =  wa_seg
                          where docnum  = wa_edidd-docnum
                          and   segnum  = wa_edidd-segnum
                          and   segnam = wa_edidd-segnam.
       if sy-subrc <> 0 .
         rollback work .
         write: / wa_edidd-docnum .
       else.
         commit work.
       endif.
      endloop.
    Please help me with the above code .
    Regards,
    Rachel

    Hello Rachel
    You could do this the following way:
    DATA: ls_edidd    TYPE edidd,
               ld_idx         TYPE i.
    FIELD-SYMBOLS:
      <ls_segment>         TYPE any,
      <ld_field>                TYPE any.
    LOOP AT it_edidd INTO ls_eddid
                                 WHERE ( segnam = wa_ztable-idoc_segment ).
      ld_idx = syst-tabix.
      ASSIGN ls_edidd-sdata TO <ls_segment> CASTING TYPE (ls_edidd-segnam).  " <<<
      ASSIGN COMPONENT wa_ztable-field3 OF STRUCTURE <ls_segment>
                                      TO <ld_field>.
      <ld_field> = wa_ztable-field4.
      MODIFY it_edidd FROM ls_edidd INDEX ld_idx.
    ENDLOOP.
    However, be aware that your logic might fail in case of repetitive segments.
    Regards
      Uwe

  • Unable to change the length of field in idoc segment

    Dear all,
    My requirement is to change the length of a field(Z field) in a segment (Z Segment). I tried the following but in vain
    1)Tried to  Cancel the release and then change the length of the domain. Unfortunately it is givin an error saying "Error while resetting release of segment ZC9DEMARA01".
    I also tried cancelling hte release of extension and then cancelled the release of segment
    2) Created a new version, but in new version the earlier fields are diabled. So I am unable to edit.
    I have gone through some of the links available in SDN but I could not solve as I am unable to cancel the release in the first step.
    [Idoc segment field length changes]
    Could you please help me.
    Thanks in advance!
    regards,
    Aravind

    Hello Aravind,
    I Have created one Segment type with some fields, changed the field length also its working.
    just try to cancel the release and change the length of the filed and do it set release again.
    Try it .
    Thanks,
    santhosh

  • 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 Cancel release error

    Hi all,
       I have problem in cancelling the release of an Idoc Segment. I have a requirement to add new fields to the segment. When I try to do Edit->Cancel Release it is throwing below error.
    "Error while resetting release of segment Z1PXXXX
    Message no. EA259"
    Could anyone tell me how to overcome this error or the root cause of this error?
    Many Thanks,
    Sri
    Edited by: Arunsri on Nov 10, 2009 8:37 AM

    Hello,
    The reason that you are getting these errors is that you cannot cancel
    the release of an extension made in previous version e.g. 4.6C. Instead you have to
    create a new extension.
    It is not possible to change a segment definition which is released in a
    lower release. This is a basic concept of our release strategy to
    guarantee compatibility between different releases.
    You must create a new segment definition for the new release e.g. 620 with a new segment
    field with the appropriate length. In transaction WE20, outbound parameters, you can specify
    the "segment release in IDoc type" for the communication. Please read the F1 help of this field for further
    information.
    For your own segments you can define a new version of the segment via
    transaction WE31 -> Add Version (Shift+F5).
    Please review your online help for more information on this and related topics.
    Hope this information helps.
    Regards,
    David

  • 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

  • How to pass item payment term through Idoc segment E1EDP18

    We use ORDERS idoc to create sales orders and our customers want to replace the default payment term at item level. I found segment E1EDP18 for this purpose but I don't exactly know how to use it, like where to put the payment term key. Can any one expain with the help of a clear  example how to indicate the payment term there ?
    Below is a exerpt of the incoming idoc file I used for testing. In this test I put the paymentt term 0010 in but the information sent in idoc segment is just ignored.
    E1EDP01                     10         625.00
        E1EDP05                        ZD64
        E1EDP05                        ZD66
        E1EDP19                     00269020000
        E1EDP18                     0020010
    Many thanks

    Hi,
             SAP program IDOC_INPUT_ORDERS is not using the item level payment terms sent in IDOC segment P18 to fill the sales order so you need user exit to do this. The program is moving the item level information to an internal table xe1edp18 when the data is parsed from IDOC so you can use this to populate the screen information in the user exit 'CALL CUSTOMER-FUNCTION '002' (IDOC_INPUT_ORDERS).
    Let me explain the process from EDI to SAP.
    1) EDI 850 will have ITD segment at item level (Example ITD013  *2     *        *10 *        *30 *          *        *) you can ask your EDI team to map them to P18 segment as it has the number of days and also the percentage for cash discount. P18 has 3 qualifiers so you can map 3 different temrs (For example the above sample is 1 Term is 2% in 10 days and Term 2 is net 30 days)
    2) During IDOC parsing the program is already filling internal table xe1edp18.
    3) In the user exit CUSTOMER-FUNCTION '002' you need to search for the SAP payment terms with the number of days and percentage (This is available in the table T052). Once you find the SAP terms key, you need to populate it for each item. You need to do this after the program filled the item billing data.
    Dynpro item business data billin details -
        PERFORM VA01_DYNPRO_POSITION_PDE3 USING XVBAP-POSNR.
    *-Zusätzliche Daten für Dynpros vorsehen (Kundenerweiterungen)----
    *-additional data's for new dynpro fields (customer exit)----
        SY-SUBRC = 0.
        PERFORM CUSTOMER_FUNCTION_DYNPRO.  -- THis is the user exit call
    Hope this is useful.
    Ram

  • Extend character length of an idoc segment

    Hello Gurus,
    Our client requires a longer character length for NAME2 and STRAS. SAP standard is that character length for this is 35. Is there a way to extend the length of these idoc segments? Thanks in advance.

    About which IDOC are you talking?
    And why do you need more characters?
    If you are talking about CREMAS vendor or DEBMAS customer,
    then you should consider the ADRMAS Idoc as well.
    Because addresses are stored in central address managment tables sind 4.6 release.
    CREMAS and DEBMAS do not support central address management.
    Please read OSS note 306275 and 384462 for migration of addresses

  • Retrieve IDoc Segment Format

    I am using the SAP function IDOC_SEGMENT_STRUCTURE_READ to retrieve the structure of an IDoc segment.  This function returns a table SEGMENT_STRUCT of type LEDID_T_SEGMENT_STRUCT.
    When I call this function from my ABAP function, I am using the following definition for the table I am sending to IDOC_SEGMENT_STRUCTURE_READ:
    Data: lt_segstru type table of LEDID_T_SEGMENT_STRUCT.
    I am using the same type in my internal function as is used in the SAP function, but when I try to activate my function, I am receiving the following error:
    The type "LEDID_T_SEGMENT_STRUCT" is unknown.     
    I see that LEDID_T_SEGMENT_STRUCT points to the type group of LEDID.  How do I write my table definition in my calling function to match the format of the table returned in IDOC_SEGMENT_STRUCTURE_READ?

    Hi!
    you can try with this program:
    don't forget to include the "TYPE-POOLS ledid." line at the begining, this is the reason why you are receiving the error message.
    REPORT  ztestdpo2                               .
    TYPE-POOLS ledid.
    PARAMETERS: p_segtyp  LIKE edisegmhd-segtyp.
    DATA t_segment_struct TYPE  ledid_t_segment_struct.
    DATA wa_segment_struct LIKE LINE OF t_segment_struct.
    CALL FUNCTION 'IDOC_SEGMENT_STRUCTURE_READ'
      EXPORTING
      RELEASE                         = SY-SAPRL
        segtyp                          = p_segtyp
      VERSION                         = '3'
      TABLES
        segment_struct                  = t_segment_struct
    EXCEPTIONS
       segment_unknown                 = 1
       segment_structure_unknown       = 2
       segment_not_in_release          = 3
       OTHERS                          = 4
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    LOOP AT t_segment_struct INTO wa_segment_struct.
      WRITE:/ wa_segment_struct.
    ENDLOOP.
    Saludos
    Daniel

  • IDoc segment to capture the freight cost (XML/EDI invoice)

    Folks,
    How to capture the freight cost on an EDI incoming invoice. Any idea which IDoc segment can be useful in this regard.
    Any thoughts/suggestions/comments would be deelply appreciated.

    Hope you have not read the Invoice Idoc type whcih is used for EDI invoice.
    The Invoice idoc type does not support the functionality of Planned delivery costs ( Freight )
    Please go through the link
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/44/f50abcea3b11d194dc0000e83dd751/content.htm

  • Content in IDOC Segment getting truncated

    Hi Experts,
    We have a problem with one of our SAP Interface set up with Mobile Application (Ventyx). From Ventyx we receive data in an IDOC through WebMethods (Middleware). We recently changed the length of one of the fields in a segment from 80 to 500.
    When the data comes in, only 132 characters come in. The other part does not reach SAP. However, all 500 characters are seen in Webmethods Outgoing message.
    Is there any configuration or is it standard SAP that allows just 132 characters to come into a particular field. The sum of all fields in that segment, however, is way less than 1000 characters which a Segment can contain.
    Any help would be highly appreciated. Thanks.
    Subhrangsu

    Hi again,
    I just recalled a similar issue I thought I had not much time ago. But after some investigation I discovered that although full IDoc contents can not be seen in IDoc monitoring tools, the full value was available when I was processing the message. The conclusion is: you do not have to worry about not seeing the whole contents for instance in we02 - the content is really there
    If you need to see the full contents of the field, refer to your integration platform's monitoring tools (for instance, it is visible in XI/PI's monitor) or follow the procedure below in ECC:
    1. Go to se37
    2. Select Function Module -> Test -> Test Sequences from the dropdown menu on top of the window.
    3. Type following function modules to be executed: EDI_DOCUMENT_OPEN_FOR_PROCESS, EDI_SEGMENTS_GET_ALL, EDI_DOCUMENT_CLOSE_READ. All you need to know is the IDoc number.
    4. Execute these function modules as a test sequence, typing the IDoc number each time (do not change any other fields contents). In a table of results of the EDI_SEGMENTS_GET_ALL FM you should be able to see the whole contents of your field.
    Hope this helps,
    Grzegorz

  • 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

  • Any transaction to see the content of IDOC field ??

    HI Gurus,
    We have 1000's of Idocs of a particular type processed correctly in our system.
    However one of them had BAD data, which also got processed  in SAP.
    So I am trying to find out which IDOC it was.
    Going through WE02, its proving very difficult to go one-by-one into each and check the contents.
    I need to look for  IDOC where the value in field KUNNR = 'DUMMY'.
    So is theer a transaction/program which can let me know which IDOC number has the value 'DUMMY' in field KUNNR.
    Regards
    Shirin

    we09
    Regards,
    sukarna.ch

  • How to pass the contents of an internal table to the IDoc FIDCC2?

    Hi,
    I have an internal table. Using its contents, I have to create an Idoc and do GL posting.
    I have to use FIDCC2 Idoc and the function module IDOC_INPUT_FIDCC2.
    Can u please let me know how to pass the contents of the internal table into the idoc FIDCC2 and do the GL posting?
    Regards,
    Balaji. R

    Hi balaji,
    use function IDOC_INBOUND_FROM_FILE. This will do half the process.
    Documentation is missing, but program RSEINB00 explains something,
    also some links
    [http://help.sap.com/saphelp_nw70/helpdata/EN/dc/6b7f1543d711d1893e0000e8323c4f/frameset.htm]
    [RSEINB00 does not work in background]
    [RSEINB00 flat file to idoc uploading in XI]
    [Loading flat idoc via report RSEINB00 into integration server fails]
    Hope it helps.
    Regards,
    Clemens

Maybe you are looking for

  • What does it take

    Hey guys I have iCaht AV 2.1 and a Powerbook g4 etc etc and I am trying to set up a chat with my Dad in Australia on an IBM thinkpad running Windows XP and AIM Trillion or whatever it is. What does it take to ACTUALLY have a 2-way Video chat coz NOTH

  • Open Item Management activation for GL accounts in ECC 6.00

    Hi Experts, There is an issue about Open item Management activation for GL line items of FBLL03 for VAT GL code. Unexpectdly do not check the open item management in VAT GL account Master record while created the GL master record in 2007. Now we acti

  • Can we create new cref.exe

    Hi all, suppose if we modify the source code present in java card framework and then compile them to class files, converting these class files to JCA files , generating mask files from these JCA files, and using these mask files along with C code ava

  • How to update clobDomain column

    Hi We have following requirement.we have stored the xml data in clob field in the data base.we want to read that data into Document type(org.w3c.dom.Document) and add few new elements to the document and update the data back in the database.we have u

  • Configuring Contacts (External Domain/Post Office/User)

    We're starting a migration to another mail system. I'm looking for some help to properly configure our GW8sp2hp2 system to send mail to external recipients, whether the mail is sent from an internal GroupWise user or from an Internet sender somewhere