EDI Outbound Purchase Order Please check

Hi,
My requirment is i  have one outbound  IDOC, i have to change some data inthe segment E1EDKA1 form some coustam tables
The Basic type is Orders05, i should do some changes in the segment E1EDKA1 based on E1EDKA1-PARVW  in the exit EXIT_SAPLEINM_011,
i have written the code in the exit EXIT_SAPLEINM_011, Can any body pls check my code
TYPES:BEGIN OF ty_ztsd_ilnpurorg,
       bbbnr TYPE ztsd_ilnpurorg-bbbnr,
       bbsnr TYPE ztsd_ilnpurorg-bbsnr,
       bubkz TYPE ztsd_ilnpurorg-bubkz,
      END OF ty_ztsd_ilnpurorg,
      BEGIN OF ty_ztsd_ilnplant,
       bbbnr TYPE ztsd_ilnplant-bbbnr,
       bbsnr TYPE ztsd_ilnplant-bbsnr,
       bubkz TYPE ztsd_ilnplant-bubkz,
      END OF ty_ztsd_ilnplant,
      BEGIN OF ty_kna1,
       bbbnr TYPE kna1-bbbnr,
       bbsnr TYPE kna1-bbsnr,
       bubkz TYPE kna1-bubkz,
      END OF ty_kna1.
*&                    WORK AREA
DATA: lw_ztsd_ilnpurorg TYPE ty_ztsd_ilnpurorg,
      lw_ztsd_ilnplant  TYPE ty_ztsd_ilnplant,
      lw_kna1           TYPE ty_kna1,
      lw_edidd          TYPE edidd,
      lw_e1edka1        TYPE e1edka1.
*&                    VARIABLES
DATA:l_bbbnr      TYPE ztsd_ilnpurorg-bbbnr,
     l_bbsnr      TYPE ztsd_ilnpurorg-bbsnr,
     l_bubkz      TYPE ztsd_ilnpurorg-bubkz,
     l_ilnnr      TYPE e1edka1-ilnnr,
     l_kna1_bbbnr TYPE kna1-bbbnr,
     l_kna1_bbsnr TYPE kna1-bbsnr,
     l_kna1_bubkz TYPE kna1-bubkz,
     l_kna1_partn TYPE e1edka1-partn,
     l_e1edka1_we TYPE e1edka1-ilnnr.
*&                    CONSTANTS
CONSTANTS:lc_orders05(8) TYPE c VALUE 'ORDERS05',
          lc_eledka1(7)  TYPE c VALUE 'E1EDKA1'.
Clearing the workarea
CLEAR:lw_ztsd_ilnpurorg,
      lw_ztsd_ilnplant,
      lw_kna1,
      lw_edidd,
      lw_edidd_1,
      lw_e1edka1,
      lw_e1edp19.
*Checking for the Idoc type ORGERS05
IF control_record_out-idoctp = lc_orders05.
*Reading the EDIDD table for the segment E1EDKA1
  READ TABLE dint_edidd INTO lw_edidd WITH KEY segnam = lc_eledka1.
  IF sy-subrc = 0.
    MOVE lw_edidd-sdata TO lw_e1edka1.
  ENDIF.
*checking the segment E1EDKA1-PARVW
  CASE lw_e1edka1-parvw.
    WHEN 'AG'.
*Selecting the data required for conversion of E1EDKA1-ILNNR to Campina ILN number
      SELECT SINGLE bbbnr bbsnr bubkz
             INTO lw_ztsd_ilnpurorg
             FROM ztsd_ilnpurorg
             WHERE ekorg = lw_e1edka1-paorg.
      IF sy-subrc = 0.
        l_bbbnr = lw_ztsd_ilnpurorg-bbbnr.
        l_bbsnr = lw_ztsd_ilnpurorg-bbsnr.
        l_bubkz = lw_ztsd_ilnpurorg-bubkz.
      ENDIF.
      CONCATENATE l_bbbnr l_bbsnr l_bubkz INTO l_ilnnr.
*Conversion of E1EDKA1-ILNNR to Campina ILN number
      CLEAR dint_edidd.
      CLEAR lw_e1edka1.
      lw_e1edka1-ilnnr = l_ilnnr.
      MOVE lw_e1edka1 TO lw_edidd-sdata.
      MODIFY dint_edidd FROM lw_edidd TRANSPORTING sdata.
Clearing the workarea
CLEAR:lw_ztsd_ilnpurorg,
      lw_edidd,
      lw_e1edka1,
      l_bbbnr,
      l_bbsnr,
      l_bubkz,
      l_ilnnr.
    WHEN 'SP'.
*Selecting the data required for conversion of E1EDKA1-ILNNR to Plant ILN number
      SELECT SINGLE bbbnr bbsnr bubkz
             INTO lw_ztsd_ilnplant
             FROM ztsd_ilnplant
             WHERE werks = lw_e1edka1-lifnr.
      IF sy-subrc = 0.
        l_bbbnr = lw_ztsd_ilnplant-bbbnr.
        l_bbsnr = lw_ztsd_ilnplant-bbsnr.
        l_bubkz = lw_ztsd_ilnplant-bubkz.
      ENDIF.
      CONCATENATE l_bbbnr l_bbsnr l_bubkz INTO l_ilnnr.
*Conversion of E1EDKA1-ILNNR to Plant ILN number
      CLEAR dint_edidd.
      CLEAR lw_e1edka1.
      lw_e1edka1-ilnnr = l_ilnnr.
      MOVE lw_e1edka1 TO lw_edidd-sdata.
      MODIFY dint_edidd FROM lw_edidd. "TRANSPORTING sdata.
Clearing the workarea
CLEAR:lw_ztsd_ilnplant,
      lw_edidd,
      lw_e1edka1,
      l_bbbnr,
      l_bbsnr,
      l_bubkz,
      l_ilnnr.
    WHEN 'WE'.
*Selecting the data required for conversion of E1EDKA1-PARTN to ILN number from customer master KNA1
      SELECT SINGLE bbbnr bbsnr bubkz
             INTO lw_kna1
             FROM kna1
             WHERE kunnr = lw_e1edka1-partn.
      IF sy-subrc = 0.
        l_kna1_bbbnr = lw_kna1-bbbnr.
        l_kna1_bbsnr = lw_kna1-bbsnr.
        l_kna1_bubkz = lw_kna1-bubkz.
      ENDIF.
      CONCATENATE l_kna1_bbbnr l_kna1_bbsnr l_kna1_bubkz INTO l_kna1_partn.
      FREE:lw_ztsd_ilnplant.
*Selecting the data required for conversion of E1EDKA1-LIFNR to Plant ILN number
      SELECT SINGLE bbbnr bbsnr bubkz
             INTO lw_ztsd_ilnplant
             FROM ztsd_ilnplant
             WHERE werks = lw_e1edka1-lifnr.
      IF sy-subrc = 0.
        l_bbbnr = lw_ztsd_ilnplant-bbbnr.
        l_bbsnr = lw_ztsd_ilnplant-bbsnr.
        l_bubkz = lw_ztsd_ilnplant-bubkz.
      ENDIF.
      CONCATENATE l_bbbnr l_bbsnr l_bubkz INTO l_ilnnr.
*Checking PARTN and LIFNR for data
      IF l_kna1_partn IS NOT INITIAL.
        MOVE l_kna1_partn TO l_e1edka1_we.
      ELSE.
        MOVE l_ilnnr TO l_e1edka1_we.
      ENDIF.
*Conversion of E1EDKA1-PARTN to ILN number from customer master KNA1
             E1EDKA1-LIFNR to Plant ILN number
*Check and Convert PARTN and LIFNR and copy the field contents to ILNNR
      CLEAR dint_edidd.
      CLEAR lw_e1edka1.
      lw_e1edka1-partn = l_kna1_partn.
      lw_e1edka1-lifnr = l_ilnnr.
      lw_e1edka1-ilnnr = l_e1edka1_we.
      MOVE lw_e1edka1 TO lw_edidd-sdata.
      MODIFY dint_edidd FROM lw_edidd. "TRANSPORTING sdata.
*Free the work area and local variables
      FREE:lw_e1edka1,
           lw_edidd,
           l_bbbnr,
           l_bbsnr,
           l_bubkz,
           l_ilnnr.
  ENDCASE.
It would be very help full if any body can quickely check the code and reply back,
Thanks in advance,
sai.

Dear
Please check setting in IMG SAP Supl.Rel.Management>SRM Server>Technical Basic Setting>Define Back end system for Product category.
Thanks & Regards
Rajendran

Similar Messages

  • I am trying to order a book, I keep getting the same error message," A network error occurred while processing your order, please check your network connection and try again"

    I am trying to order a book with iphoto, I keep getting the same error message.
    " A network error occurred while processing your order, please check your network connection and try again"
    I get the billing part up, it has even uploaded my jpegs but at the final process, I get the same message.
    I have ordered two books a few months ago without any problems.
    Now I keep getting the same message either half way into
    the order or at the final hurdle after the images have been uploaded.
    Any ideas?
    My shared Network has been fine and that does'nt seem an issue.
    Help.

    Try again in a couple of hours - sometimes it is a temp condition
    LN

  • I want to see open purchase orders please suggest me how to see it?

    i want to see open purchase orders please suggest me how to see it?

    A-ERLEDIGT     Closed RFQs
    A-OFFEN     Open RFQs
    AVIS     Open notification quantities
    GUTSCHRIFT     Invoices exist
    M-OFFEN     Open target quantity
    R-ERLEDIGT     No open invoices
    RECHNUNG     Open invoices
    W-OFFEN     Open target value
    WA351     Open issue quantity
    WA352     Issue quantity reversible
    WE101     Open goods receipt
    WE102     Goods receipt exists
    WE103     Open goods receipt
    WE104     GR blocked stock exists
    WE105     GR blocked stock exists
    WE106     Goods receipt exists with IV
    WE107     Goods receipt pending IV
    which one to be select?

  • Idoc using EDI for purchase order

    hi all,
    could someone explain me all  the steps required in generating purchase order idoc  using EDI butnot using ALE.
    i want all the steps to be in detail.
    thanks in advance
    suma sailaja pvn

    EDI is described as the interchange of structured data according to agreed message standards between computer systems, by electronic means. Structured data equates to a simple and direct method of presenting the data content of a document. The method of ensuring the correct interpretation of the information by the computer system is defined by the EDI standard."
    EDI is a technique used to communicate business transactions between computer systems of different companies and organizations. Note that sometimes the EDI mechanism deployed at a company is often used to interface to other systems within the same organization."
    The difference between ALE and EDI process flows occurs at the communication level. The EDI process transmits IDocs to an EDI subsystem using flat file format. The ALE process transmits IDocs to an SAP system via memory, using asynchronous communication.
    Check the following links
    How Can I transfer invoice details to customer through IDOC in EDI
    Re: IDOC Types and their equivalent messages in EDIFACT and ANSI X12
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://www.henrikfrank.dk/abapexamples/IDOC/IDOC.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/0b/2a6095507d11d18ee90000e8366fc2/frameset.htm
    Reward Points if useful.

  • Edi for purchase order

    hi,
    can any one say me the step to send a Purchase order through an EDI

    EDI is described as the interchange of structured data according to agreed message standards between computer systems, by electronic means. Structured data equates to a simple and direct method of presenting the data content of a document. The method of ensuring the correct interpretation of the information by the computer system is defined by the EDI standard."
    EDI is a technique used to communicate business transactions between computer systems of different companies and organizations. Note that sometimes the EDI mechanism deployed at a company is often used to interface to other systems within the same organization."
    The difference between ALE and EDI process flows occurs at the communication level. The EDI process transmits IDocs to an EDI subsystem using flat file format. The ALE process transmits IDocs to an SAP system via memory, using asynchronous communication.
    Check the following links
    How Can I transfer invoice details to customer through IDOC in EDI
    Re: IDOC Types and their equivalent messages in EDIFACT and ANSI X12
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://www.henrikfrank.dk/abapexamples/IDOC/IDOC.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/0b/2a6095507d11d18ee90000e8366fc2/frameset.htm
    Reward Points if useful.

  • EDI 860 - Purchase Order Change Request in SRM

    Hello All,
    I'm working on a problem involving the generation of the EDI 860 when a Purchase Order in changed in SRM.  If anyone is familiar with this functionality please contact me and I will have specific questions.
    Thank you,
    JR

    Hi,
    I wonder why would you want to do that. Any change to the PO is internal to your organisation till such a PO is ordered(approved). Once ordered you can anyways send the output to you vendor which would inform him of the changes.
    Regards
    Azad

  • Sp Transaction Procedure For Purchase Order Item Checking

    Hello All,
    I need to create a sp_Transaction notification for Purchase Order where system will check that the document to be added
    with Vendor 'A' and ItemCode 'ERT' should not be be previously added for the same vendor 'A.
    Example:-
    Doc No.  Vendor   Item Code
    1                A            ERT
    Is added
    Next if the Purchase Order is added with same vendor and same Item then system should block the entry and throw a message
    'Purchase Order Already Entered for Vendor 'A' with Item Code 'ERT'"
    This checking will be done for each line item of currently entered Purchase Order Document.
    Thanks ,
    Amit

    Hello Amit,
    You don't need post identical thread twice. This SP related discussion is usually posted on main forum.
    Please close this one.
    Thanks,
    Gordon

  • EDI from Purchase Order to Sales Order

    Hi all,
    I've customized the EDI system: at purchase order creation the system automatically creates a sales order(inside the same system). Now i'm facing the following situation : since PO data is very different from SO data (eg. terms of payment), i'm getting errors when i integrate the sales order idoc. Is there a way that i can "map" the "transalation" of the PO to SO data. How can i do this? Best regards,
    PCastro

    Pedro, when you create the SO , what are the steps before creating the Idoc, is it automated, if not  you can maybe write some ABAP code and change the data before the Idoc is created.
    I cannot get the full picture of what you are doing but if the Idoc creation in not automatic you can always change the values in some ABAP code.
    If it is automatic, see if there are any user exits.
    Regards

  • Outbound Purchase order user exit EXIT_SAPLEINM_002 help

    Hi,
    Can somebody tell me how to stop the IDOC processing if the conditions are not met? My detail question is
    I am modifying the data in the outbound IDOC (IDOC_OUTPUT_ORDERS) for purchase order. I am using the user exit EXIT_SAPLEINM_002 to modify the segment data.
    But I would like to know how to stop for creating the IDOC if one of the condition will not met (for example if there is no data in Ztable while fetching then IDOC should not be created )?
    If the condition will fail I don't want to create the IDOC but Purchase order has to create in R/3.
    Any suggestions on my above query is highly appreciable.
    Regards,
    Noorul

    Hi
    The purchase order should always be created because it's created before creating the IDOC, I suppose it will be created by a particular message.
    Have you tried to raise the exception DATA_NOT_RELEVANT_FOR_SENDING?
    Max

  • Sp_Transaction Notification For Purchase Order Item Checking

    Hello All,
    I need to create a sp_Transaction notification for Purchase Order where system will check that the document to be added
    with Vendor 'A' and ItemCode 'ERT' should not be be previously added for the same vendor 'A.
    Example:-
    Doc No.  Vendor   Item Code
    1                A            ERT
    Is added
    Next if the Purchase Order is added with same vendor and same Item then system should block the entry and throw a message
    'Purchase Order Already Entered for Vendor 'A' with Item Code 'ERT'"
    This checking will be done for each line item of currently entered Purchase Order Document.
    Thanks ,
    Amit

    Hi Amit,
    i found this on forum. Try this,
    if @object_type = N'22' and @transaction_type in (N'A', N'U')
    begin
    declare @line1 int
    declare @lin1 int
    declare @out1 int
    Set @out1 = 0
    SET @lin1 = 0
    Declare @Vend as varchar(200)
    Declare @ItemCode as varchar(200)
    Select @Vend = CardCode From OPOR Where DocEntry = @list_of_cols_val_tab_del
    Select @line1 = Max (LineNum)FROM POR1 WHERE POR1.DocEntry = @list_of_cols_val_tab_del
    While @lin1 < @line1
    Begin
         Select @ItemCode=ItemCode From POR1 Where DocEntry=@list_of_cols_val_tab_del and LineNum = @lin1
          if (SELECT COUNT(T0.DocEntry) FROM POR1 T0 inner join OPOR T1 on T0.DocEntry = T1.DocEntry
          WHERE T0.ItemCode = @ItemCode and T1.CardCode = @Vend)> 1
          Begin
               Set @Out1 = 1
               Break;
          END
               Else
               Begin
               Set @lin1 = @lin1+1
               Continue
          END
    END
    Set @lin1 = @lin1 + 1
    if @out1 = 1
    begin
          Set @error = 1
          Set @error_message = 'Item Code in line ' + CONVERT(nvarchar(4), @lin1) + N'already Exists For This Vendor!'
    End
    END
    Check this too Stored procedure in purchase order for duplicate item for a vendor
    Thanks,
    Joseph
    Edited by: Joseph Antony on Jan 11, 2011 1:37 PM

  • EDI Outbound sales order change

    Hello,
        I am triggering an EDI outbond sales order change.
    I am useing ORDCHG and ORDERS05.
    While setting up the Outband Partner profile,In the Message conterol tab
    what is the Application,message function and process code.
    Thanks in advance...

    I am triggering an EDI outbond sales order change.
    I am useing ORDCHG and ORDERS05.
    While setting up the Outband Partner profile,In the Message conterol tab
    what is the Application,message function and process code.
    -The application is V1.
    -You should enter in the Messagetype the Outputtype as used in NACE and the Sales Order Output creation. That can be BA00.
    Make sure you make 2 entries in the partner profile: one where in the messagecontrol tab the change message Tab is ticked (in case the order changes) and one where it is not ticked (initial change).
    -Message functionion can be used optionally, to differentiate to make it unique.
    -The Processcode can be SD10 (or ME02 for PO change). You can use the dropdownbox if there is something configred yet.

  • Itunes has taken money out of my bank and I haven't purchased anything. please check and advise ASAP

    My account has been debited for a total of £49.45p over the course of 2 days, namely 21st and 22nd of January 2013.
    I / we have not downloaded any music over these 2 days. I expect you to reimburse this money forthwith.
    Regards
    Karen jones

    Please be aware that you are not communicating with Apple when you post in these forums. The only people who will reply to your posts are your fellow users, and we cannot check nor refund anything.
    The most immediate thing you need to do is to call your bank and report the unauthorized charges. Your bank can contact Apple if they need additional information.
    Next, log into your iTunes Store account and see if the purchases are reflected in the Purchase History. If they are, immediately change the password to your iTunes Store account, making sure it's not something easily guessed or looked up. Then go here:
    http://www.apple.com/support/itunes/contact/
    and follow the instructions to report the issue to the iTunes Store. 
    If the charges are not reflected in the Purchase History, then it's most likely a fraudulent charge to your bank account directly rather than an unauthorized purchase through your iTunes Store account in which case it will be up to your bank to handle.
    Regards.

  • Wrong Purchase order please help

    Frdns
    i posted PO with wrong vendor,
    so is there any way i can change the vendor on the same PO or i can cancel the PO ?
    Please help
    Thanks

    If you haven't done a goods receipt then you probably should delete the PO. You may want to post this message in the "Materials Management" forum as well.

  • FM BAPI purchase order to check if is invoiced

    Hi,
    I've got to migrate PO to a new comp code, is there any bapi or FM thats show's if the po as been invoiced.
    Thzs in advanced to all
    Jaime Cordeiro

    Hi,
    Thzs for the anserw, the solution pass by the reading of that table and a combination of the quantitys.
    Regards
    Jaime Cordeiro
    Award point given

  • How to import 300 purchase order into SAP using excel upload

    Hi Everyone,
    I am trying to close all the existing purchase orders in the system (about 300) and create similarly 300 new ones under new accounts.
    My questions is can I do that using an excel upload, or it will have to be done manually? If I can, any help in that regard would be highly appreciated.
    Regards,
    Abubakr Asif

    Hi
    Welcome to SDN World!
    You can use LSMW to create 300 Purchase Orders.
    please check this link for guidance
    http://www.ficoexpertonline.com/downloads/0703.doc
    To close existig POs, you can use Mass update (Tr code MEMASSPO).
    hope it helps.
    regards
    Srinivas
    Reward if it helps

Maybe you are looking for