Populate Segments in ALE

<b>Hai Friends....</b>
      How to Populate the Segment in <b>ALE</b>...
      Please Help me....
       <u><b>BalajeeKannan</b></u>

Hi,
You do not have to populate IDOC data in ALE. SAP does it for you using standard function module. Let's say you are using ALE to distribute material master record, you use transaction BD10.
Also, before using ALE you need to finish certain configuration. This is done in <b>transaction SALE.</b>
Check this link. This describe the scenario where you use your custom IDOC in ALE.
http://www.erpgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
Check these link for more information regarding ALE.
http://help.sap.com/saphelp_46c/helpdata/en/78/2173cf51ce11d189570000e829fbbd/frameset.htm
http://help.sap.com/saphelp_46c/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
Let me know if you need any other information.
Regards,
Rs

Similar Messages

  • Clarification sought on 'Qualifiers'-segment in ALE

    Hi friends,
    Could anyone plz explain me about the qualifiers which comes under segment in ALE.Thanks in advance.Urgent.

    Ok, so the login process APEX creates when you create a new application handles the post login stuff. Now if this is an automatic feature then perhaps the Post-Authentication Process Help should be changed to reflect this. Now to work on the Logout URL

  • To populate Segment data to Order item level in additional tab B

    Hi Experts,
    I am working on Inbound interface using IDoc (ORDERS05); during Idoc process IDOC_ORDERS_INPUT; i have to take segment value and need to populate at order items level; in custom field  (in additional tab B).
    For that i am using FM (Customer exits) :
      Step 1-  EXIT_SAPLVEDA_001 (Getting segment value and passing to XVBAP-Zfield).
      Step 2- EXIT_SAPLVEDA_002 (Passing Value to respective screen using BDCDATA table).
    Due to unable to find where i have to set flag and how ?;                                                                                To avoid multiple record to append ; BDCDATA Table with same screen.
    As mention in this link for Header level additional tab B : http://www.sapfans.com/forums/viewtopic.php?f=21&t=62945#p1025880.
    They are using my_flag to avoid ,issue as i mention in above step.
    Step 3 - At last they are deleting my_flag in FM : EXIT_SAPLVEDA_003. (find in above link)
    Thanks in Advance
    Regards
    Vinay

    you need to use a flag of type vbap-posnr .
    and your check statement will become
    check my_flag NE XVBAP-POSNR. (or the ZZXVBAP-POSNR).
    and setting the flag
    my_flag = XVBAP-POSNR.
    so for same posnr it wont repeat the append.. hope this can help

  • Segment E1EEDPO4 is missing in outbod message type ORDERS05

    Hi Gurus,
    When I create an Output type for PO using Message type ORDERS05, the segments E1EDP04 is missing in data records. Eventually this segment should carry the tax information. The tax information is very much appeared in Po and it is missing in IDOC.  what should I do to make this segment appear in outbound IDOC data records.
    Please mention the T codes and steps.
    Thanks and regards
    Rohini kumar

    Hi,
    You can use user exits EXIT_SAPLEINM_002 to populate segment E1EDP04 for outbound IDoc ORDERS05.
    This segment is not populated in standard FM IDOC_OUTPUT_ORDERS.
    Regards,
    Ferry Lianto

  • ALE triggering ABAP program instead of iDoc

    Is it possible to have ALE trigger an ABAP program instead of an iDoc?
    We need to send changes in Master Data to a system that can't handle iDoc, but does know what to do with SOAP.

    We're talking about an All-in-One system on NetWeaver 700 and ECC 6.0. My company has developed an Add-On for Business One and now they want to develop a similar Add-On for All-in-One. That Add-On should integrate an Open Source system into an SAP system, or at least make the flow of data seem seamless.
    I should be very careful with my comments, as I'm not really understanding enough about your requirements. I must admit key words changes in master data and ALE triggered my initial comment.
    On second thought it might actually be worthwhile to think about other alternatives. E.g. you could look at the technique SAP uses for BW extractors, which might also be suitable.
    I might just be able to hook into the Change Doc system by defining new Change Doc and Change Pointer Types.
    Well, per my comment above, maybe you don't even need change pointers. However, if you do, you can mostly rely on existing change documents unless you're dealing with some odd or custom object.
    Am I right if I think that IDocs handle those Change Pointers from some kind of scheduled background job?
    Part of the setup for change pointers for a specific message type is to define which function module is used for evaluating the change pointers. All change pointers are then evaluated via transaction BD21, program RBDMIDOC, which can also be scheduled in the background.
    but we only need less than 5% of the information contained in an iDoc
    Well, in theory SAP offers some options: You can filter segments via ALE, use reduced message types or define IDoc views. However, depending on the technique this sometimes requires that the actual application (function module creating the IDocs) has to support it (because it's additional API calls that have to be present).
    Defining new IDoc types isn't that attractive to us.
    Though I do understand such statement in specific cases, it's hard to relate to it on a general level. I.e. in the latter case it's often more driven by strange company policies than by good design choices.
    Anyhow, in the end I'm tempted to think that change pointers with IDocs are one option among many. In your specific case however it sounds as if there's possibly other techniques that might be more suitable. So I'll stop for now before I tell you too much crap pushing you in a wrong direction...

  • ORDERS05 Idoc Type Extension

    Hello,
    I am extending the segment E2EDKA3 in ORDERS05. Please let me know any user exit or any other way to populate the values in the extended segments.
    I am adding these fields: VBPA-KUNNR,VBPA-ADRNR,VBPA-XCPDK & VBPA-ADRNP                         .
    Thanks in advance,
    Suresh

    Hi Suresh,
    Go through this info ucan able to do.
    Enhancement of IDoc Type
    Usually enhancement takes place when the content in IDocs provided by SAP are not sufficient for the business process. IDoc extension can take place whenever dictionary table has a new structure appended required by the business process. 
    In brief IDoc extension takes place when extra fields are required for the business process.
    Let us take a scenario and understand the process of IDoc extension.
    In this scenario say visitor is different from the actual customer who has came to the sales office in behalf of the customer to obtain the quotation or inquiry etc. Or an authorized agent qualified by the actual customer to order for items. So a field by name NAMEVI (Visitor) is added to Customer master data. As there is no provision given by SAP to handle this, we need to extend an IDoc. 
    The standard message type and IDoc type provided by SAP are DEBMAS and DEBMAS05. 
    Consider the data in the table below for extending the IDoc. These details can be understood in different sections in the process of extending it. 
    Basic IDoc type      DEBMAS05
    Version      4.7
    IDoc extension      DEBMASEXT
    Custom segment      Z1KNA1
    Fields in Custom Segment      Visitor
    Parent of Custom Segment      E1KNA11
    Outbound process
    Step1. Customize kna1 table by appending a structure provided by SAP (ZAKNA1) 
    Component                Component Type
    VISITOR                     NAMEVI
    Step2: Write a module pool program to update some existing customers to add data  for Visitor. 
    Step3: Create a custom segment
    Transaction Code: WE31
    Segment type: Z1KNA11   Click  (create). Provide short text 
    Field Name                Data element
    VISITOR                NAMEVI
    Save 
    Step4: Create IDoc extension
    Transaction      WE30
    Object Name      DEBMASEXT
    Choose Extension
    Click   and it leads to next screen.
    Linked basic type: DEBMAS05
    Provide description and enter
    Observe all the segments to be copied into your IDoc extension from linked basic
    type.
    Select E1KNA11 and click  (create segment) to obtain a popup window
    Provide the required values and observe child segment Z1KNA11 to be added to
    parent segment E1KNA11. 
    Step5: Release segment and IDoc extension
    Transaction: WE31
    Segment type: Z1KNA11
    Path: Edit à Set release
    Step6: Assign Basic type to extension / messages
    Transaction: WE82
    Click  , then 
    Select DEBMAS message type against DEBMAS06 basic type
    Click   provide the information
    Message Type      Basic Type      Extension      Version
    DEBMAS      DEBMAS06      DEBMASEXT           4.7
    Delete the earlier one from which it was copied.
    Save. 
    Observe the result as follows
    Step 7: Check and Transport IDoc extension
    Transaction: WE30
    Object name: DEBMASEXT
    Path: Development object à Check
    Ensure that there are no errors or warnings
    Now transport
    Path: Development à Transport 
    Step8: Find suitable user exit for writing code to support IDoc extension
    Transaction: SE84.
    Click Enhancements
    In short text provide customer
    Find suitable enhancement to be VSV00001 
                             Alternative way
    Transaction: SMOD
    Click F4 help for Enhancement
    Path: F4help à SAP Applications à Logistics general à Logistics Basic Data à
    Business partners à Vendor Master.
    Find the enhancement as VSV00002, which is an approximate user exit.
    Now search for different extensions like VSV00001. Then see for its components.
    Identify the appropriate user exit to be ‘EXIT_SAPLVV01_001’ (Create Export of
    Additional Customer Master Segments). This user exit can be used in outbound ALE
    process, meant for filling the data into custom segments. 
    You have to identify here another user exit as ‘EXIT_SAPLVV02_001’, which is
    helpful for inbound ALE process. This user exit can be used to read the segments
    and post it to Application repository. 
    Step9: Develop a project to encapsulate enhancements and components.
    Transaction: CMOD.
    Enhancement: custex and click Create to provide attributes.
    Click Enhancement Assignments.
    Provide VSV00001, short text and save.
    From the initial screen of the transaction, select components and click change.
    Find 4 components to be added.
    Activate them.
    Select user exit EXIT_SAPLVV01_001 for outbound process and double click it. It leads to function builder.
    Double click on provided include program ZXVSVU01 and press enter.
    Now, write supporting code for IDoc extension, i.e., populating custom segments in IDoc.
    Check the code and activate.  
    Code in ZXVSVU01
    *& Include           ZXVSVU01                                         *
    *In this scenario, the E1KNA11 has been extended to accommodate
    *User-defined fields in the customer table kna1. The name of the
    *extended
    *segment is z1kna11. There is one custom field: visitor
    *Data declarations
    DATA: kna1m like e1kna1m,
          kna11 like e1kna11,
          z1kna11 like z1kna11,
          w_kna1 like kna1. 
    make sure you are processing correct message type
    check message_type eq 'DEBMAS'.
    make sure data is added after the correct segment
    check segment_name eq 'E1KNA1M'.
    since customer number is not passed in this user exit, you need to go
    through the data records to find the customer number
    loop at idoc_data.
      case idoc_data-segnam.
         when 'E1KNA1M'.
           move idoc_data-sdata to kna1m.
         when 'E1KNA11'.
           move idoc_data-sdata to kna11.
      endcase.                             " case idoc_data-segname.
    endloop.                               " loop at idoc_data. 
    select data from the user-defined fields in kna11.
    select single *
      from kna1                            " Customer master table
      into w_kna1
    where kunnr = kna1m-kunnr.
    if sy-subrc eq 0.
    set the idoc extension name for control record
      idoc_cimtype = 'DEBMASEX'.
    clear custom fields from kna1 to extended segment
      clear z1kna11.
    copy custom fields from kna1 to extended segment 
    move-corresponding w_kna1 to z1kna11. " field name must be same
    condense all fields of extended segment
      condense: z1kna11-visitor.
    populate segment name in the data record, copy data contents into it 
    and append the data record to existing data records in
      move 'Z1KNA11' TO IDOC_data-segnam.    " administrative section
      move z1kna11 to idoc_data-sdata.       " data section 
      append idoc_data.
    endif.                                 " if sy-subrc eq 0.
    Step 10: 
    Define Logical System
    Assign client to Logical System
    Maintain RFC Destination
    Maintain Customer Distribution Model
    Generate Partner Profiles
    Distribute Customer Distribution Model
    INBOUND PROCESS
    Step 11: Append the custom structure to the table KNA1 similar to the process done
            in outbound process.
    Step 12.
    Define Logical System
    Assign client to Logical System
    Generate Partner Profiles
    Step 13. Execute the transaction to ‘Send Customers’ from Outbound system.
    Step 14. Now in the Inbound system, create the project in the similar way as done at
            outbound side.
    In the user exit EXIT_SAPLVV02_001, find include ‘ZXVSVU02’. Write the code to
    support IDoc extension.
    Code in ZXVSVU02
    *&  Include           ZXVSVU02                                         *
    data: kna1m like e1kna1m,
          kna11 like e1kna11,
          z1kna11 like z1kna11.
    data fs_kna1 type kna1.
    message i000(0) with 'INBOUND PROCESS CALLED'.
    LOOP AT IDOC_data.
      case idoc_data-segnam.
        when 'E1KNA1M'.
          kna1m = idoc_data-sdata.
        when 'E1KNA11'.
          kna11 = idoc_data-sdata.
        when 'Z1KNA11'.
          z1kna11 = idoc_data-sdata.
          select single *
            from kna1
            into fs_kna1
           where kunnr = kna1m-kunnr.
          if sy-subrc eq 0.
            update kna1
               set visitor = z1kna11-visitor
             where kunnr = kna1m-kunnr.
          else.
            idoc_status-docnum = idoc_control-docnum.
            idoc_status-status = '51'.
            idoc_status-msgty = 'E'.
            idoc_status-msgid = 'ZE'.
            idoc_status-msgno = '005'.
            idoc_status-msgv1 = kna1m-kunnr.
         append idoc_status.
          endif.                           " if sy-subrc eq 0.
      endcase.                             " case idoc_data-segnam.
    endloop.                               " LOOP AT IDOC_data.
    Step 15. Assign FM to extension/Message type
    Transaction:      WE57
    Path: Change à New Entries
    Select ‘IDOC_INPUT_DEBITOR’ against DEBMAS06 basic type, to fill extra
    information as shown below.
    Function Module          Basic Type     Message Type          Extension
    IDOC_INPUT_DEBITOR     DEBMAS06     DEBMAS          DEBMASEXT
    Step 16. Execute the transaction to ‘Get Customers’.
    And observe that records with extra data are saved in database.
    Rewards some points.
    Rgds,
    P.Nag

  • Outbound IDoc for Goods Movement

    HI
    We need to generate XML files for goods movement posted in SAP at Goods Receipt (MIGO) and Post Goods Issue (VL02N). Requirement is asynchronous update where the receiving system will poll the xml file at the end of the day.
    I have not been able to find any standard outbound idoc for goods movement.Can someone advise how they tackled any similar requirement? Any other approach also appreciated.
    Thanks
    Sriram

    Answer to the question, which would be useful to all.
    <b>MIGO</b>
    MB_CF001 - Customer Function Exit in the Case of Updating a Mat. Doc.
    This exit is called on update task, populate segments (edidc & edidd) of WMMBID02 (WMMBXY message type) and use MASTER_IDOC_DISTRIBUTE. Also you need to maintain the ALE Distribution model in WE64 for this message type.
    Inside the code you can restrict based on movement type. No need to issue COMMIT.
    <b>VL02N</b>
    You can use BAdi: LE_SHP_DELIVERY_PROC to perform this.
    Create Implementation and use the method SAVE_AND_PUBLISH_DOCUMENT.
    Hope this help to others as well.

  • Problem about extended IDOC(urgent)

    Hi experts,
    i have idoctype,extended idoc,and one include.. i need modify that according to the requirement.. here i will give the idoctype and extended idoc type and include program .. please help me where exactly i need to do the change and what are the steps required for the requirement..
    Exact Requirement: Modify the program which populates the idoctype invoice02 and extension zinvoice02 , if netvalue is zero(vbrp-netwr = 0) then populate the idoc segment E1EDP01.E1EDP26 , BETRG WITH QUALF = # 011' WITH ZERO VALUE. curently segment is not populated.
    Please help me in this and explain the steps required for this.
    idoctype:invoice02
    extended idoc:zinvoice02
    include:ZXEDFU02
                                   Here i am giving the include program
    CASE dobject-kschl.
      WHEN 'ZGRI' OR 'ZGDF' OR 'ZGRN' OR 'ZGAE'.
        t_int_edidd[] = int_edidd[].
        t_xtvbdpr[] = xtvbdpr[].
        ta_xvbdkr = xvbdkr.
        CASE int_edidd-segnam.
          WHEN 'E1EDK01'.
            ta_e1edk01 = int_edidd-sdata.
            PERFORM get_shipment_data.
            PERFORM get_route_data.
            int_edidd[] = t_int_edidd[].
          WHEN 'E1EDP01'.
    Update segment E1EDP01
    1. Update field E1EDP01-PSTYP
    2. Accumulated net weight & quantity of batch split items against
    E1EDP01 segment of the main invoice item.
            ta_e1edp01 = int_edidd-sdata.
            i_tabix = sy-tabix.
            CLEAR: ta_e1edp02.                                  "DIAG01+
            PERFORM update_segment_e1edp01.
            MOVE ta_e1edp01 TO t_int_edidd-sdata.
            MODIFY t_int_edidd INDEX i_tabix TRANSPORTING sdata.
    Populate segment Z1EDP08
    Fields: ZZDESPACTY_A, ZZACTYUOM
            PERFORM validate_segment USING control_record_out-idoctp
                                      control_record_out-cimtyp
                                      'Z1EDP08'
                                CHANGING n_subrc.
            CHECK n_subrc EQ 0.
            PERFORM calc_invoice_item_zzdespacty_a.             "DIAG02+
            int_edidd[] = t_int_edidd[].                        "DIAG02+
          WHEN 'E1EDP02'.                                       "DIAG01+
            IF int_edidd-sdata(3) = '016'.                      "DIAG01+
              ta_e1edp02 = int_edidd-sdata.                     "DIAG01+
            ENDIF.                                              "DIAG01+
          WHEN 'E1EDP19'.
    Populate segment Z1EDL24
    Fields: Material Characteristics or Material Class '001'.
            PERFORM validate_segment USING control_record_out-idoctp
                                     control_record_out-cimtyp
                                     'Z1EDL24'
                                     CHANGING n_subrc.
            IF n_subrc EQ 0.
              ta_e1edp19 = int_edidd-sdata.
              CASE ta_e1edp19-qualf.
                WHEN '002'.
                  PERFORM get_mat_characteristic USING ta_e1edp19-idtnr.
                  PERFORM fill_segment_z1edl24.
                  int_edidd[] = t_int_edidd[].
                WHEN OTHERS.
              ENDCASE.
            ENDIF.
          WHEN 'E1EDP26'.
    Populate segment E1EDP26
    Fields: BETRG
            i_tabix = sy-tabix.
            ta_e1edp26 = int_edidd-sdata.
           IF ta_e1edp26-qualf = '001'. "Gross Price which is always present
              PERFORM fill_segment_e1edp26.
              int_edidd[] = t_int_edidd[].
            ENDIF.
          WHEN 'E1EDP08'.
    Populate Segment Z1EDL37                                             *
    Fields: Bespoke fields from Handling Unit (VEKP)
            PERFORM validate_segment USING control_record_out-idoctp
                                      control_record_out-cimtyp
                                      'Z1EDL37'
                                CHANGING n_subrc.
            CHECK n_subrc EQ 0.
            ta_e1edp08 = int_edidd-sdata.
            PERFORM fill_segment_z1edl37.
    Populate Segment Z1EDP08                                             *
    Fields: Total Despatch Activity                                      *
           PERFORM validate_segment USING control_record_out-idoctp
                                     control_record_out-cimtyp
                                     'Z1EDP08'
                               CHANGING n_subrc.
           CHECK n_subrc EQ 0.
           PERFORM calc_invoice_item_acty_total.
            int_edidd[] = t_int_edidd[].
          WHEN OTHERS.
        ENDCASE.
      WHEN 'ZGDW'.
    Line above added line below removed - Assyst 73789
    WHEN 'ZGIN'.
        t_int_edidd[] = int_edidd[].
        t_xtvbdpr[] = xtvbdpr[].
        ta_xvbdkr = xvbdkr.
        CASE int_edidd-segnam.
    Start SU02
          WHEN 'E1EDK01'.
            ta_e1edk01 = int_edidd-sdata.
            i_tabix = sy-tabix.
    Get the conversion factor
            PERFORM modify_exchange_rate.
            MOVE ta_e1edk01 TO t_int_edidd-sdata.
            MODIFY t_int_edidd INDEX i_tabix TRANSPORTING sdata.
            int_edidd[] = t_int_edidd[].
    End SU02
    *************************************************************SAM01 START
          WHEN 'E1EDP02'.
    Populate segment Z1EDP02
    Fields: Reason code for sales order
            ta_e1edp02 = int_edidd-sdata.
            CASE ta_e1edp02-qualf.
              WHEN '002'.
                PERFORM fill_segment_z1edp02.
                PERFORM append_int_edidd TABLES t_int_edidd
                                         USING  'Z1EDP02'
                                                ta_z1edp02.
                int_edidd[] = t_int_edidd[].
              WHEN OTHERS.
            ENDCASE.
    ***************************************************************SAM01 END
        ENDCASE.
    Start of JvdM01
      WHEN 'ZGII'.                                              "JvdM01
        t_int_edidd[] = int_edidd[].
        t_xtvbdpr[] = xtvbdpr[].
        ta_xvbdkr = xvbdkr.
        CASE int_edidd-segnam.
          WHEN 'E1EDK01'.
    Populate segment Z1EDKSH and Z1REM_STE_CDE
    Fields: Shipment Number for Invoice
            Reason code for sales order
            ta_e1edk01 = int_edidd-sdata.
            PERFORM fill_segment_z1edksh_ds.
            PERFORM append_int_edidd TABLES t_int_edidd
                                     USING 'Z1EDKSH'
                                            ta_z1edksh.
            PERFORM fill_segment_z1rem_ste_cde.
            PERFORM append_int_edidd TABLES t_int_edidd
                                     USING  'Z1REM_STE_CDE'
                                            ta_z1rem_ste_cde.
            int_edidd[] = t_int_edidd[].
          WHEN 'E1EDKA1'.
    Populate segment Z1EDKA1
    Fields: Customer Account Group
            ta_e1edka1 = int_edidd-sdata.
            CASE ta_e1edka1-parvw.
              WHEN 'RE'.   "Bill To Party
                PERFORM fill_segment_z1edka1.
                PERFORM append_int_edidd TABLES t_int_edidd
                                         USING 'Z1EDKA1'
                                                ta_Z1EDKA1.
                int_edidd[] = t_int_edidd[].
            ENDCASE.
          WHEN 'E1EDP01'.
    Read segment E1EDP01 for use later                  "JVDM02
            ta_e1edp01 = int_edidd-sdata.
          WHEN 'E1EDP02'.
    Populate segment Z1EDP02
    Fields: Reason code for sales order
            ta_e1edp02 = int_edidd-sdata.
            CASE ta_e1edp02-qualf.
              WHEN '002'.
                PERFORM fill_segment_z1edp02.
                PERFORM append_int_edidd TABLES t_int_edidd
                                         USING  'Z1EDP02'
                                                ta_z1edp02.
                int_edidd[] = t_int_edidd[].
              WHEN OTHERS.
            ENDCASE.
          WHEN 'E1EDP19'.
    Populate segment Z1EDL24 and Z1EDP01                  "JVDM02
    Fields: Pack Size Activity for Material
            Total Activity for Invoice Item
            ta_e1edp19 = int_edidd-sdata.
            CASE ta_e1edp19-qualf.
              WHEN '002'.
                PERFORM fill_segm_z1edl24_and_z1edp01.
                PERFORM append_int_edidd TABLES t_int_edidd
                                         USING  'Z1EDL24'
                                                ta_z1edl24.
                PERFORM append_int_edidd TABLES t_int_edidd
                                         USING  'Z1EDP01'
                                                ta_z1edp01.
                int_edidd[] = t_int_edidd[].
              WHEN OTHERS.
            ENDCASE.
        ENDCASE.
    End JvdM01
    ENDCASE.
    Start SU02 Code Comment for implementing IR 340
    **mpc01 - start of insert
    start assyst 73789
    *IF dobject-kschl = 'ZGDW'."amersham invoices
    **IF dobject-kschl = 'ZGIN'."amersham invoices
    end assyst 73789
    CASE int_edidd-segnam.
      for the organisation data header
       WHEN 'E1EDK14'.
         MOVE int_edidd-sdata TO ta_e2edk14.
        where is qualifying organisation = 003 (delivering company code).
         IF ta_e2edk14-qualf = '003' AND ta_e2edk14-orgid NE space.
           SELECT SINGLE waers
             INTO t001-waers
             FROM t001
            WHERE bukrs = ta_e2edk14-orgid.
           IF sy-subrc = 0.
             t_int_edidd[] = int_edidd[].
            get the billing date for the invoice
             LOOP AT t_int_edidd WHERE segnam = 'E1EDK02'.
               MOVE t_int_edidd-sdata TO ta_e1edk02.
               IF ta_e1edk02-qualf = '009'."billing date
                 w_fkdat = ta_e1edk02-datum.
                 EXIT.
               ENDIF.
             ENDLOOP.
            if no invoice date use current date
             IF w_fkdat IS INITIAL.
               w_fkdat = sy-datum.
             ENDIF.
            change the general document header
             LOOP AT t_int_edidd WHERE segnam = 'E1EDK01'.
               i_tabix = sy-tabix.
               MOVE t_int_edidd-sdata TO ta_e1edk01.
              set the field to the default currency code for the company
               ta_e1edk01-hwaer = t001-waers.
              if the default value equals the idoc currency then exit
               IF t001-waers = ta_e1edk01-curcy.
                 EXIT.
               ENDIF.
              get the exchange rates
               SELECT *
                 INTO TABLE t_tcurr
                 FROM tcurr
                WHERE kurst = 'NYB1'                 " SU01
                 WHERE KURST = 'GEBU'                 " SU01
                  AND fcurr = ta_e1edk01-curcy
                  AND tcurr = t001-waers.
               IF sy-subrc NE 0."no values found
                error the idoc
                 MESSAGE e400(vf) WITH c_exchange_rate_error
                         RAISING error_message_received.
                 EXIT.
               ENDIF.
               LOOP AT t_tcurr.
                convert to date from inverted date to normal date format.
                 CALL FUNCTION 'CONVERSION_EXIT_INVDT_OUTPUT'
                      EXPORTING
                           input  = t_tcurr-gdatu
                      IMPORTING
                           output = w_datum.
                 CONCATENATE w_datum+6(4)
                             w_datum+3(2)
                             w_datum(2)
                        INTO t_tcurr-datum.
                 MODIFY t_tcurr.
               ENDLOOP.
              sort the exchange rates with the newest first.
               SORT t_tcurr BY datum DESCENDING.
              read the first value in the table ie the newest.
               LOOP AT t_tcurr WHERE datum <= w_fkdat.
                 EXIT.
               ENDLOOP.
               IF sy-subrc NE 0."no values found
                error the idoc
                 MESSAGE e400(vf) WITH c_exchange_rate_error
                         RAISING error_message_received.
                 EXIT.
               ENDIF.
    Start SU01
    Get the Exchange rate from the function module and populate
    E1EDK01 TABLE
               w_fcurr = ta_e1edk01-curcy.
               call function 'CONVERT_TO_LOCAL_CURRENCY'
                    exporting
                         date             = w_fkdat
                         foreign_amount   = '0'
                         foreign_currency = w_fcurr
                         local_currency   = t001-waers
                         type_of_rate     = 'GEBU'
                    importing
                         exchange_rate    = t_tcurr-ukurs
                    exceptions
                         no_rate_found    = 1
                         overflow         = 2
                         no_factors_found = 3
                         no_spread_found  = 4
                         derived_2_times  = 5
                         others           = 6.
    End SU01
               ta_e1edk01-wkurs = t_tcurr-ukurs.
              change the header data in segment
               MOVE ta_e1edk01 TO t_int_edidd-sdata.
              update the current idoc segment
               MODIFY t_int_edidd INDEX i_tabix TRANSPORTING sdata.
               EXIT.
             ENDLOOP.
            update all of the idoc segments
             int_edidd[] = t_int_edidd[].
           ENDIF.
         ENDIF.
    ENDCASE.
    *ENDIF.
    **mpc01 - end of insert
    End SU02 Code Comment for implementing IR 340

    Hi Venu,
      Try with this code.
      If vbrp-netwr = 0.
    <b>  WHEN 'E1EDP26.
      CASE ta_e1edp26-qualf.
    ta_e1edp26 = int_edidd-sdata.
    WHEN '011'.
    PERFORM append_int_edidd TABLES t_int_edidd
    USING 'e1edp26'
    ta_e1edp26.
    int_edidd[] = t_int_edidd[].
    ENDCASE.</b>
    ENDIF.
    Thanks
    Manju.

  • Help needed in Message Control - very urgent

    Hi Experts,
    I have one requirement where in the customer wants to stop creation of IDOC which posts Invoice using message control and message control status should be changed to RED color and also the message should be populated in the processing log saying 'IDOC processing failed, External customer numbers not maintained'.
    Could you please let me know any user exits or customer exits available for this purpose.
    I have searched all the possibilities.
    I have chanked the program RSNAST00 which picks up the data from table NAST and looks into table TNAPR to get the processing porgram for th selected output and also this program checks the partner profile and gets the process code which creates an inoice IDOC. I searched for user exits and customer exits to popolate the required messages and stop IDOC creation.
    I am an ABAPER and i know i need to write code to do validation, but could not find the exact place where to write? I any ABAPERS looking at this post, please reply me.
    Can anyone please advise me how to go about solving this issue?
    Thanks
    Srinath

    Hi,
       I am sending the requirement.
      Please send me the solution.
    Requirements:
    1.     EDI Invoice requires populating bottle UPC number not case UPC in IDOC and also populates customer PO number when invoice billing type is a credit.  These changes need to be reflected on EDI invoice (Idoc INVOIC02).
    Investigation:
    Requirement 1. EDI invoices are populating segment E1EDP19 qualifier 003 based on the unit of measure in the line item.  If shipment unit is CSE then it populates CSE upc, if shipment unit is EA then it populates Bottle UPC. 
    a.     It was found that the UPC populated on the EDI invoice was being read from material master – Additional data tab.  (Field SMEINH-EAN11).  For the EDI invoice, the customers expect the bottle UPC on this column.
    Requirement 2.  Need to always populate Segment E1EDK02 Qualifier 001 (customer PO) on the INVOIC02 idoc.  Standard SAP populates this information only when the billing type is F2 (regular invoice) and if the customer PO was entered in the Sales Order.
                                a) Premier requires this information to be populated in the idoc if the billing type is G2, RE, L2 also.
    Solution:
    Requirement 1.
           IDOC_OUTPUT_INVOIC function module needs to be changed to always populate the UPC number for the bottle UPC in segment E1EDP19 qualifier 003, field IDTNR.  This number is found on the material master – Basic data 1 view.  Field name is MARA-EAN11.   Please see screenshot of where in the material master to find the bottle UPC. 
         a. This change applies to all billing types (F2, G2, L2, RE etc).
           Requirement 2.
                 Change IDOC_OUTPUT_INVOIC function module to always populate customer PO information in Segment E1EDK02 qualifier 001, field BELNR.
    If billing type is equal to G2, L2, RE and VBRK-XBLNR not equal blanks then make BELNR = VBRK-XBLNR.
    Segment:  E1EDK02
                                  Field:  QUAL = 001
                                  Field:  BELNR = VBRK-XBLNR
    Please help me how to move a step ahead.
    Waiting for your immediate response.
    Thanks,
    Chandra.

  • 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

  • Inbound idoc values when updated from user exit not saved

    I'm trying to process some user exits of an inbound idoc from WE19.
    The values get correctly populated to IDOC_DATA internal tables of IDOC_INPUT_ORDRSP function module in debug kode
    but when the new idoc is generated from WE19 , those segment values (populated by exit) are not shown/saved.
    The user exit is EXIT_SAPLEINM_007.
    Is it not possible to populate segment values of inbound idocs from using user exits. If yes , then during testing using WE19 , every time a new idoc is created it should display those values into the concerned segments. Please help.

    Hello,
    yes is possible it ...
    I think the problem is:
    or
    you have something wrong when to append the new line on internal table
    or
    the exit used is not correct: read the documentation on EXIT_SAPLEINM_0**

  • Its urgent.Please send me the solution.

    Please find me a solution for the specifications.
    Its urgent.
    Please send me the details as early as possible.
    Requirements:
    1.     EDI Invoice requires populating bottle UPC number not case UPC in IDOC and also populates customer PO number when invoice billing type is a credit.  These changes need to be reflected on EDI invoice (Idoc INVOIC02).
    Investigation:
    Requirement 1. EDI invoices are populating segment E1EDP19 qualifier 003 based on the unit of measure in the line item.  If shipment unit is CSE then it populates CSE upc, if shipment unit is EA then it populates Bottle UPC. 
    a.     It was found that the UPC populated on the EDI invoice was being read from material master – Additional data tab.  (Field SMEINH-EAN11).  For the EDI invoice, the customers expect the bottle UPC on this column.
    Requirement 2.  Need to always populate Segment E1EDK02 Qualifier 001 (customer PO) on the INVOIC02 idoc.  Standard SAP populates this information only when the billing type is F2 (regular invoice) and if the customer PO was entered in the Sales Order.
                                a) Premier requires this information to be populated in the idoc if the billing type is G2, RE, L2 also.
    Solution:
    Requirement 1.
           IDOC_OUTPUT_INVOIC function module needs to be changed to always populate the UPC number for the bottle UPC in segment E1EDP19 qualifier 003, field IDTNR.  This number is found on the material master – Basic data 1 view.  Field name is MARA-EAN11.   Please see screenshot of where in the material master to find the bottle UPC. 
         a. This change applies to all billing types (F2, G2, L2, RE etc).
           Requirement 2.
                 Change IDOC_OUTPUT_INVOIC function module to always populate customer PO information in Segment E1EDK02 qualifier 001, field BELNR.
    If billing type is equal to G2, L2, RE and VBRK-XBLNR not equal blanks then make BELNR = VBRK-XBLNR.
    Segment:  E1EDK02
                                  Field:  QUAL = 001
                                  Field:  BELNR = VBRK-XBLNR
    Waiting for your immediate reaction.
    Thanks,
    Chandra.

    Please provide me a solution

  • Error while Filling custom extended idoc

    i have extended segment e1edpa1 with ZLOC segment in INVOIC01 idoc .now i'm filling this extended idoc from exit EXIT_SAPLIEDI_101 but it is giving me error like "EDI: Syntax error in IDoc (mandatory segment missing)" can anyone tell me what could be the reason?below is my code.
    WHEN 'E1EDPA1'.
          MOVE idoc_data-sdata TO e1edpa1.
          IF e1edpa1-parvw = 'WE'.
            SELECT SINGLE * FROM kna1 INTO w_kna1 WHERE kunnr = e1edpa1-partn.
            IF sy-subrc = 0.
              MOVE: w_kna1-locco TO zloc-locco,
                    w_kna1-bahne TO zloc-bahne.
              MOVE 'ZLOC' TO idoc_data-segnam.    " administrative section
              MOVE zloc TO idoc_data-sdata.       " data section
              APPEND idoc_data.
    thx

    Why do you need to add a segment via code in an inbound IDOC? we dont populate segments in inbound processing, rather you shoul dbe getting value from the source system in the IDOC, and reading the custom segment to process the values.
    if source is not sending the values , and you need those then you are supposed to read and process the values to move those to corresponding structure for SAP program to process the data. Adding a segment in inbound is not going to get you anything.

  • EDI INVOICE Function module IDOC_OUTPUT_INVOIC

    Hi,
      Please help me with a solution for the Specification.
    Requirements:
    1.     EDI Invoice requires populating bottle UPC number not case UPC in IDOC and also populates customer PO number when invoice billing type is a credit.  These changes need to be reflected on EDI invoice (Idoc INVOIC02).
    Investigation:
    Requirement 1. EDI invoices are populating segment E1EDP19 qualifier 003 based on the unit of measure in the line item.  If shipment unit is CSE then it populates CSE upc, if shipment unit is EA then it populates Bottle UPC. 
    a.     It was found that the UPC populated on the EDI invoice was being read from material master – Additional data tab.  (Field SMEINH-EAN11).  For the EDI invoice, the customers expect the bottle UPC on this column.
    Requirement 2.  Need to always populate Segment E1EDK02 Qualifier 001 (customer PO) on the INVOIC02 idoc.  Standard SAP populates this information only when the billing type is F2 (regular invoice) and if the customer PO was entered in the Sales Order.
                                a) Premier requires this information to be populated in the idoc if the billing type is G2, RE, L2 also.
    Solution:
    Requirement 1.
           IDOC_OUTPUT_INVOIC function module needs to be changed to always populate the UPC number for the bottle UPC in segment E1EDP19 qualifier 003, field IDTNR.  This number is found on the material master – Basic data 1 view.  Field name is MARA-EAN11.   Please see screenshot of where in the material master to find the bottle UPC. 
         a. This change applies to all billing types (F2, G2, L2, RE etc).
           Requirement 2.
                 Change IDOC_OUTPUT_INVOIC function module to always populate customer PO information in Segment E1EDK02 qualifier 001, field BELNR.
    If billing type is equal to G2, L2, RE and VBRK-XBLNR not equal blanks then make BELNR = VBRK-XBLNR.
    Segment:  E1EDK02
                                  Field:  QUAL = 001
                                  Field:  BELNR = VBRK-XBLNR
    Waiting for your reply,
    Please,Its urgent.
    Thanks,
    Chandra

    Hi,
    Neither EXIT_SAPLV56K_001 or EXIT_SAPLV56K_002 will be called when delivery is saved.
    You can use this user exits USEREXIT_SAVE_DOCUMENT in program MV50AFZ1 for saving delivery document.
    Also check this include progams which contains all user exits available for delivery processes.
    MV50AFZZ
    MV50AFZ1
    MV50AFZ2
    MV50AFZ3
    MV50AFZK
    MV50AFZL
    MV50AFZP
    Hope this will help.
    Regards,
    Ferry Lianto
    Please reward points if helpful.

  • Outbound IDOC- Goods movement

    Dear Experts,
    We have requirement to trigger idoc for MB1B, MB1C, MB0A, MB01, MIGO where we have
    to create IDOC on goods movement on all these transaction.
    We have found standard IDOC "WMMBID01" for goods movement. But we are struggling
    assign with output type on transaction basis.
    Is the same IDOC will use for all "MB1B, MB1C, MB0A, MB01, MIGO" transaction?????
    How we can define output type for all these transction?
    Is standard IDOC "WMMBID01" will use for all these transaction or different IDOC will use
    for diffenet transaction?
    Looking forward your valuable guidance...
    Will be thankfull to you all...
    Regards,
    This question is in general several times repeated in your different threads, hence I am locking this one
    Edited by: Jürgen L. on Dec 20, 2011 2:15 PM

    Thanks John. Even if I use an output type to trigger IDOC, do I still need to code to populate segments?
    BTW, I tried creating an output type but did not create any IDOCS. Steps I did are:
    1> Create a new output type Z001 with proc. program as RSNASTED and form as EDI_PROCESSING.
    2> Create an OUTBOUND partner profile for LS type and use WMMBXY message type. I am using an XML port to create a IDOC file and NOT use another SAP system to txfr the IDOC, so it creates IDOC as a flat file on app server.
    3> I then do MB1C with 'print' checked and post a 501 mvt type.
    BUT NO IDOC IS created? What am I missing here?
    I suspect improper creation of output type, I did play with it trying diff. options but nothing seems to work!
    Let me know if I am doing something grossly wrong here!
    Thanks and appreciate ur help!
    Bhaven

Maybe you are looking for

  • User status to prohibit automatic creation of PR

    Hi Gurus, I have scenario when project needs to be released in the beginning of the project for incoming order analysis of the project. Now if I release the entire project, the PR is generated automatically, on release. I want to restrict this. For t

  • How do I save attachement from my e-mail to my I pad

    Pleas I need to save some file or an attachement on my e-mail address inbox to my ipad3 but  I found it difficult . And which application do I need to do this. Am seriously concussed and I can't go further. This is seriously hinder my work in the off

  • F4 hep for selection screen field

    Hello , Im trying to create custom f4 help for Parameter ekbe-belnr by using below code. It displaying  F4 values for EKBE-belnr. But when i select any value in F4 hlep , its not displaying in Selection Field. How can i reflect selected value in to s

  • Issue Installing SP2 for Windows Server 2008 SP1

    Hello, I have a very annoying issue, and I hope someone can help a bro out. Server: Windows Server 2008 SP1 64-bit Issue: SP2 wont install on Windows Server 2008 SP1 This is what I am seeing when I check the event viewer: 1. (Information) Windows Ser

  • Flex is taking time

    Hi guys, I am facing a problem while working on flex builder 3.0 Problem description : My application consist around 4000 line of code where i am binding 2000 XML with different ids. now whenever i want to edit any line of code or if i want to delete