BADI for Purchase  Order

Hi,Friends
I Want to Implement BADI , Which is already available in SAP.
The Path for BADI is given below.
SPRO->SAP Reference IMG->Materials Management->Purchasing->Business Add-Ins for Purchasing
Name of BADI
1 Control of Pricing Type: Additional Fields : ME_DEFINE_CALCTYPE
2.Run Through Items Again in the Event of Changes in EKKO : ME_CHECK_ALL_ITEMS
This enhancement is about Transaction Code ME23N for creating Purchase Order.
I am not getting what exactly this BADI does?
while creating purchase order and Price determination process ,When i define Incoterms at Header level i want to change condition type for Item Level according to our requirement.
my problem is that , i don't have parameters to pass condition types.
can anybody tell me the solution?

Hi archana,
actually i want to use the same BAdi and method (PROCESS_ITEM).
Question: did you use parameter GET_HEADER of method PROCESS_ITEM ?
my problem: i want to read BSART from MEPOHEADER-data and according to result i want check MEPOITEM-data (here: WEPOS)
ls_mepoitem = im_item->get_data( )
works, but i did not find out how to use
...->get_header( )
If you used it, can you paste© your source code ???
Thanx a lot !
Jörg
P.S. it's my first BAdI
-- no more help needed ! Problem solved by adding own post!!! ---
Message was edited by: Jörg Sauterleute

Similar Messages

  • Use of SAVE_TEXT in customer exits / BADI for purchase order

    Hi All,
    I am trying to save some long text by using SAVE_TEXT function module in a badi implementation for purchase order header text. The same is working fine if i try to update the PO header text via a report. But if i try using badi (the code is written in a PAI event for the BADI), then though the text transfer and save is successful during the code excution, but for the first time when i add any text its not visible in ME22N tcode. Since its an online event. But when i double click on that editor and the sap script editor gets opened. then i press back button, the text is appearing on the same small screen edtor . after this any number of time i edit or delete text, the save_text function module works fine.
    My issue is why for the first time always i have to double click on the editor to open the sap script editor. I have also included commit_text in this case after save_text FM.
    the requirement here goes like this. in one tab for PO header the user will enter some number (This is a customizing screen implemented through badi.) and the corresponsing discription should appear when user clicks on text tab in po header screen (me21n / me22n).
    Kindly help.
    Thanks
    Mamata

    Hi  mamata rath
    I have solve the problem which similar to yours.  the code which is as the following
    DATA: textline TYPE tdline,
            name TYPE c LENGTH 70,
            glines TYPE TABLE OF tline,
            gline  LIKE LINE OF glines,
            ls_header TYPE thead.
         CONCATENATE ch_eban-banfn ch_eban-bnfpo INTO name.
             ls_header-tdobject = 'EBAN'.
             ls_header-tdname = name.
             ls_header-tdid = 'B01'.
             ls_header-tdspras = sy-langu.
             CALL FUNCTION 'SAVE_TEXT'
               EXPORTING
    *           CLIENT                = SY-MANDT
                 header                = ls_header
    *           INSERT                = ' '
    *           SAVEMODE_DIRECT       = ' '
    *           OWNER_SPECIFIED       = ' '
    *           LOCAL_CAT             = ' '
    *         IMPORTING
    *           FUNCTION              =
    *           NEWHEADER             =
               tables
                 lines                 = glines
               EXCEPTIONS
                 ID                    = 1
                 LANGUAGE              = 2
                 NAME                  = 3
                 OBJECT                = 4
                 OTHERS                = 5
              IF sy-subrc = 0.
                  CALL FUNCTION 'COMMIT_TEXT'
                    EXPORTING
                      OBJECT                = 'EBAN'
                      NAME                  = name
    *                ID                    = '*'
    *                LANGUAGE              = '*'
    *                SAVEMODE_DIRECT       = ' '
    *                KEEP                  = ' '
    *                LOCAL_CAT             = ' '
    *              IMPORTING
    *                COMMIT_COUNT          =
    *              TABLES
    *                T_OBJECT              =
    *                T_NAME                =
    *                T_ID                  =
    *                T_LANGUAGE            =
              ENDIF.

  • User exit or BADI for purchase order

    Hi,
    I want send outbound IDOC for purchase order to 3rd party integration system.
    It is too hard to map between standard purchase order IDOC and business object of 3rd party system because the structure of standard purchase order IDOC is so complicated.
    So I want bring purchase order data into CBO table when purchase order is created or released. And this data will be inserted CBO IDOC for more simple structure than standard one.
    I'm trying to find some of user exit or BADI to insert from standard purchase order to CBO table in the time of purchase order is created or released.
    And I'm trying to find another way using message type.
    As far as I know it is possible to set sending IDOC in the purchase order message type setting in IMG.
    Is anyone who has related situation or know the way to do this?

    Hi,
    I have similar requirement, however the BADI name you mentioned does not exist.
    Pls let me know the right one.
    Thanks,
    Dipak

  • User Exit/BADI for Purchase Order and Purchase Requisitions

    HI,
    I have a requireent where i have to check the the user does not enter both Subitems and Over a Limit for a Service Purchase Requisition.
    Is there a User Exit or Badi that i can use where this information is availaible.
    also i have to check that release strategy is assigned to every purchase order where the version has been completed.
    Is there a User Exit or Badi where Information of EREV table is availaible.
    Regards,
    Tarun Bahal

    For Purchachase requisition , the BADIs and USER EXITS are
    ME_COMMITMNT_PARKING BAdI for Redefining Commitment Interface When Parking
    ME_MEREQ_PARKING BAdI Purchase Requisition: "Hold"
    ME_REQ_HEADER_TEXT Copy Header Text: Enjoy Purchase Requisition
    try with the above BADI's
    MEREQ001 Customers' Own Data in Purchase Requisition
    for Purchase order , the BADIs and USER EXITS are
    ARC_MM_EKKO_CHECK BAdI: Enhancement of Archivability Check (MM_EKKO)
    ARC_MM_EKKO_WRITE BAdI: Enhancement of Scope of Archiving (MM_EKKO)
    EXTENSION_US_TAXES Extended Tax Calculation with Additional Data
    MEGUI_LAYOUT BAdI for Enjoy Purchasing GUI
    ME_ACTV_CANCEL_PO BAdI for Activating the Cancel Function at Header Level
    ME_BADI_DISPLAY_DOC BAdI for Internal Control of Transaction to be Invoked
    ME_BAPI_PO_CREATE_01
    ME_BAPI_PO_CREATE_02
    ME_BAPI_PR_CREATE_01
    ME_BAPI_PR_CREATE_02
    ME_BSART_DET Change document type for automatically generated POs
    ME_CCP_ACTIVE_CHECK BAdI to check whether CCP process is active
    ME_CCP_BESWK_AUTH_CH BAdI for authorization checks for procuring plant
    ME_CCP_DEL_DURATION Calc. of Delivery Duration in CCP Process (Not in Standard)
    ME_CHANGE_CHARACTER Customer-Specific Characteristics for Product Allocation
    ME_CHANGE_OUTTAB Enrich ALV Output Table in Purchasing
    ME_CHECK_ALL_ITEMS Run Through Items Again in the Event of Changes in EKKO
    ME_CHECK_OA Check BAdI for Contracts
    ME_CHECK_SOURCES Additional Checks in Source Determination/Checking
    ME_CIN_LEINRF2R BADI for CIN India - Delivery charges
    ME_CIN_LEINRF2V BADI for LEINRF03 excise_invoice_details
    ME_CIN_MM06EFKO Copy PO data for use by Country version India
    ME_CIP_ALLOW_CHANGE Configuration in Purchasing: Changeability Control
    ME_CIP_REF_CHAR Enables Reference Characteristics in Purchasing
    ME_COMMITMENT_RETURN Commitment for return item
    ME_COMMITMENT_STO_CH BadI for checking if commitments for STOs are active
    ME_COMMTMNT_PO_RELEV Check for Commitment-Relevance of Purchase Orders
    ME_COMMTMNT_PO_REL_C Check for Commitment-Relevance of Purchase Orders
    ME_COMMTMNT_REQ_RELE Check of Commitment Relevance of Purchase Requisitions
    ME_COMMTMNT_REQ_RE_C Check of Commitment Relevance of Purchase Requisitions
    ME_DEFINE_CALCTYPE Control of Pricing Type: Additional Fields
    ME_DP_CLEARING Clearing (Offsetting) of Down Payments and Payment Requests
    ME_FIELDSTATUS_STOCK FM Account Assignment Behavior for Stock PR/PO
    ME_GUI_PO_CUST Customer's Own Screens in Enjoy Purchase Order
    ME_HOLD_PO Hold Enjoy Purchase Orders: Activation/Deactivation
    ME_INFOREC_SEND Capture/Send Purchase Info Record Changes - Internal Use
    ME_PO_PRICING Enhancements to Price Determination: Internal
    ME_PO_PRICING_CUST Enhancements to Price Determination: Customer
    ME_PO_SC_SRV BAdI: Service Tab Page for Subcontracting
    ME_PROCESS_COMP Processing of Component Default Data at Time of GR: Customer
    ME_PROCESS_PO Enhancements for Processing Enjoy Purchase Order: Intern.
    ME_PROCESS_PO_CUST Enhancements for Processing Enjoy Purchase Order: Customer
    ME_PROCESS_REQ Enhancements for Processing Enjoy PReqs: Internal
    ME_PROCESS_REQ_CUST Enhancements for Processing Enjoy PReqs: Customer
    ME_PURCHDOC_POSTED Purchasing Document Posted
    ME_RELEASE_CREATE BAdI: Release Creation for Sched.Agrmts with Release Docu.
    ME_REQ_OI_EXT Commitment Update in the Case of External Requisitions
    ME_REQ_POSTED Purchase Requisition Posted
    ME_TAX_FROM_ADDRESS Tax jurisdiction code taken from address
    ME_TRF_RULE_CUST_OFF BADI for Deactivation of Field T161V-REVFE
    ME_TRIGGER_ATP Triggers New ATP for Changes in EKKO, EKPO, EKPV
    ME_WRF_STD_DNG PO Controlling Reminder: Extension to Standard Reminder
    MM_DELIVERY_ADDR_SAP Determination of Delivery Address
    MM_EDI_DESADV_IN Supplementation of Delivery Interface from Purchase Order
    SMOD_MRFLB001 Control Items for Contract Release Order
    AMPL0001  User subscreen for additional data on AMPL             
    LMEDR001  Enhancements to print program                          
    LMELA002  Adopt batch no. from shipping notification when posting
    LMELA010  Inbound shipping notification: Transfer item data from 
    LMEQR001  User exit for source determination                     
    LMEXF001  Conditions in Purchasing Documents Without Invoice Rece
    LWSUS001  Customer-Specific Source Determination in Retail       
    M06B0001  Role determination for purchase requisition release    
    M06B0002  Changes to comm. structure for purchase requisition rel
    M06B0003  Number range and document number                       
    M06B0004  Number range and document number                       
    M06B0005  Changes to comm. structure for overall release of requi
    M06E0004  Changes to communication structure for release purch. d
    M06E0005  Role determination for release of purchasing documents 
    ME590001  Grouping of requsitions for PO split in ME59           
    MEETA001  Define schedule line type (backlog, immed. req., previe
    MEFLD004  Determine earliest delivery date f. check w. GR (only P
    MELAB001  Gen. forecast delivery schedules: Transfer schedule imp
    MEQUERY1  Enhancement to Document Overview ME21N/ME51N           
    MEVME001  WE default quantity calc. and over/ underdelivery toler
    MM06E001  User exits for EDI inbound and outbound purchasing docu
    MM06E003  Number range and document number                       
    MM06E004  Control import data screens in purchase order          
    MM06E005  Customer fields in purchasing document                 
    MM06E007  Change document for requisitions upon conversion into P
    MM06E008  Monitoring of contr. target value in case of release or
    MM06E009  Relevant texts for "Texts exist" indicator             
    MM06E010  Field selection for vendor address                     
    MMAL0001  ALE source list distribution: Outbound processing      
    MMAL0002  ALE source list distribution: Inbound processing       
    MMAL0003  ALE purcasing info record distribution: Outbound proces
    MMAL0004  ALE purchasing info record distribution: Inbound proces
    MMDA0001  Default delivery addresses                             
    MMFAB001  User exit for generation of release order              
    MRFLB001
    Regards,
    Anirban

  • BADI for purchase order item confirmation?

    Hi all,
    In Purchase Order change mode (ME22N), we want to calculate the delivery date based on the confirmation date that was entered in the PO item detail, confirmation tab (instead of based on the PO creation date).
    Please help by specifing Which BADI should we use for that purpose? And which method will be helpful? 
    Thanks,
    Vamshi.

    Hi
    You can use BADI ME_PROCESS_PO_CUST
    Ranga

  • Required BADI  for  purchase order

    Hi experts,
    Can any one please suggest me which BADI or userexit suitable in purchase order to restrict accountassignement category depend upon Doc type with the suitable method.

    Hi Ram,
              Actually my requirement is like this .
    In the me21n tcode, if doctype of purchase order is 'ZCAP' then it has to allow the accasscategory 'A' only.
    If any other accasscategory assigned then it has to display error message.
    For that i have gone for me_process_po_cust BADI. But it does not had any changing parameters to satisfy my requirements.
    Is there any alternative?
    pleae Reply me asap .
    Its very urgent...

  • BADI for Purchase Order - WBS link

    Hello Experts,
    I am making a report where the user will be able to select on project and wbs, and depending on this selection the belonging purchase orders are to be listed. Is there any function modules that return this data? Or which tables do I have to look through to see the linking between PO's and project/wbs...
    best Regards Baljinder

    Hi,
    Its PRPS for the WBS elements will be stored,
         proj is the table which stores all the projects for the header data,
         ekbe for the purchase order history will be stored,
         fmifiit is the table which stores all the object numbers related to the posted data against purchase     order.
    Regards,
    Naresh
    Edited by: naresh kumar on Mar 25, 2009 10:51 AM

  • BADI for Purchase order Print

    Dear All,
    Is there a Standard BADI to Trigger PO Print Function for Message type NEU.
    Regards
    Amey

    Hi Amey,
    Moving this thread to ERP MM forum.
    Thanks,
    Mahesh

  • BADI requirement for Purchase Order

    Hello,
    I have to find a BADI for Purchase order which will satisfy requirement stated below.
    When processing on PO will be done for Goods received and/or Final delivery and/or Final invoice , I need to trigger an Idoc from BADI which will inform another client that flags stated above are set against that PO.
    Which BADI can be used to find information of these flag are set on PO as soon as it is processed and which in trun help me to trigger this idoc?
    Regards,
    Madhura

    try with MB_DOCUMENT_BADI
    this BADi will get trig for all goods movement transaction.
    better u go for user exits, insteed of BADi

  • BADI / User exit for Purchase order(ME21N) after saving the document

    Hi expert,
    I need the BADI / User exit for Purchase order(ME21N) after saving the document
    This is for email sending after create the purchase order so PO document number will be the import parameter
    pls help me
    point will be reward
    Regards,
    Ganesh

    Hi Ganesh,
    Could you please share your solution?
    Thanks.
    Hoops
    Edited by: Hoops on Jun 13, 2011 10:51 PM

  • User Exit for Purchase Order Release Strategy

    Hi,
    I am a little new to this, how do I search for a user exit for purchase order release strategy (TCode ME29N).
    Thanks in advance.
    Mick

    Hi
    Check the following Exits and BADI for Pur Requisition
    Enhancement
    MEVME001 WE default quantity calc. and over/ underdelivery tolerance
    MM06E001 User exits for EDI inbound and outbound purchasing documents
    MM06E003 Number range and document number
    MM06E004 Control import data screens in purchase order
    MM06E005 Customer fields in purchasing document
    MM06E007 Change document for requisitions upon conversion into PO
    MM06E008 Monitoring of contr. target value in case of release orders
    MM06E009 Relevant texts for "Texts exist" indicator
    MM06E010 Field selection for vendor address
    MM06E011 Activate PReq Block
    MMAL0001 ALE source list distribution: Outbound processing
    MMAL0002 ALE source list distribution: Inbound processing
    MMAL0003 ALE purcasing info record distribution: Outbound processing
    MMAL0004 ALE purchasing info record distribution: Inbound processing
    MMDA0001 Default delivery addresses
    MMFAB001 User exit for generation of release order
    MRFLB001 Control Items for Contract Release Order
    AMPL0001 User subscreen for additional data on AMPL
    LMEDR001 Enhancements to print program
    LMELA002 Adopt batch no. from shipping notification when posting a GR
    LMELA010 Inbound shipping notification: Transfer item data from IDOC
    LMEQR001 User exit for source determination
    LMEXF001 Conditions in Purchasing Documents Without Invoice Receipt
    LWSUS001 Customer-Specific Source Determination in Retail
    M06B0001 Role determination for purchase requisition release
    M06B0002 Changes to comm. structure for purchase requisition release
    M06B0003 Number range and document number
    MEQUERY1 Enhancement to Document Overview ME21N/ME51N
    MELAB001 Gen. forecast delivery schedules: Transfer schedule implem.
    MEFLD004 Determine earliest delivery date f. check w. GR (only PO)
    MEETA001 Define schedule line type (backlog, immed. req., preview)
    ME590001 Grouping of requsitions for PO split in ME59
    M06E0005 Role determination for release of purchasing documents
    M06E0004 Changes to communication structure for release purch. doc.
    M06B0005 Changes to comm. structure for overall release of requisn.
    M06B0004 Number range and document number
    Business Add-in
    ME_PROCESS_REQ_CUST Enhancements for Processing Enjoy PReqs: Customer
    ME_PROCESS_REQ Enhancements for Processing Enjoy PReqs: Internal
    ME_PROCESS_PO_CUST Enhancements for Processing Enjoy Purchase Order: Customer
    ME_PROCESS_PO Enhancements for Processing Enjoy Purchase Order: Intern.
    ME_PROCESS_COMP Processing of Component Default Data at Time of GR: Custome
    ME_PO_SC_SRV BAdI: Service Tab Page for Subcontracting
    ME_PO_PRICING_CUST Enhancements to Price Determination: Customer
    ME_PO_PRICING Enhancements to Price Determination: Internal
    ME_INFOREC_SEND Capture/Send Purchase Info Record Changes - Internal Use
    ME_HOLD_PO Hold Enjoy Purchase Orders: Activation/Deactivation
    ME_GUI_PO_CUST Customer's Own Screens in Enjoy Purchase Order
    ME_FIELDSTATUS_STOCK FM Account Assignment Behavior for Stock PR/PO
    ME_DP_CLEARING Clearing (Offsetting) of Down Payments and Payment Requests
    ME_PURCHDOC_POSTED Purchasing Document Posted
    SMOD_MRFLB001 Control Items for Contract Release Order
    EXTENSION_US_TAXES Extended Tax Calculation with Additional Data
    ARC_MM_EKKO_WRITE BAdI: Enhancement of Scope of Archiving (MM_EKKO)
    ARC_MM_EKKO_CHECK BAdI: Enhancement of Archivability Check (MM_EKKO)
    MM_EDI_DESADV_IN Supplementation of Delivery Interface from Purchase Order
    MM_DELIVERY_ADDR_SAP Determination of Delivery Address
    ME_WRF_STD_DNG PO Controlling Reminder: Extension to Standard Reminder
    ME_TRIGGER_ATP Triggers New ATP for Changes in EKKO, EKPO, EKPV
    ME_TRF_RULE_CUST_OFF BADI for Deactivation of Field T161V-REVFE
    ME_TAX_FROM_ADDRESS Tax jurisdiction code taken from address
    ME_REQ_POSTED Purchase Requisition Posted
    ME_REQ_OI_EXT Commitment Update in the Case of External Requisitions
    ME_RELEASE_CREATE BAdI: Release Creation for Sched.Agrmts with Release Docu.
    ME_DEFINE_CALCTYPE Control of Pricing Type: Additional Fields
    ME_CHANGE_OUTTAB Enrich ALV Output Table in Purchasing
    ME_CHANGE_CHARACTER Customer-Specific Characteristics for Product Allocation
    ME_CCP_DEL_DURATION Calc. of Delivery Duration in CCP Process (Not in Standard)
    ME_CCP_BESWK_AUTH_CH BAdI for authorization checks for procuring plant
    ME_CCP_ACTIVE_CHECK BAdI to check whether CCP process is active
    ME_BSART_DET Change document type for automatically generated POs
    ME_BAPI_PR_CREATE_02
    ME_BAPI_PR_CREATE_01
    ME_BAPI_PO_CREATE_02
    ME_BAPI_PO_CREATE_01
    ME_BADI_DISPLAY_DOC BAdI for Internal Control of Transaction to be Invoked
    ME_ACTV_CANCEL_PO BAdI for Activating the Cancel Function at Header Level
    MEGUI_LAYOUT BAdI for Enjoy Purchasing GUI
    ME_CHECK_ALL_ITEMS Run Through Items Again in the Event of Changes in EKKO
    ME_COMMTMNT_REQ_RE_C Check of Commitment Relevance of Purchase Requisitions
    ME_COMMTMNT_REQ_RELE Check of Commitment Relevance of Purchase Requisitions
    ME_COMMTMNT_PO_REL_C Check for Commitment-Relevance of Purchase Orders
    ME_COMMTMNT_PO_RELEV Check for Commitment-Relevance of Purchase Orders
    ME_COMMITMENT_STO_CH BadI for checking if commitments for STOs are active
    ME_COMMITMENT_RETURN Commitment for return item
    ME_CIP_REF_CHAR Enables Reference Characteristics in Purchasing
    ME_CIP_ALLOW_CHANGE Configuration in Purchasing: Changeability Control
    ME_CIN_MM06EFKO Copy PO data for use by Country version India
    ME_CIN_LEINRF2V BADI for LEINRF03 excise_invoice_details
    ME_CIN_LEINRF2R BADI for CIN India - Delivery charges
    ME_CHECK_SOURCES Additional Checks in Source Determination/Checking
    ME_CHECK_OA Check BAdI for Contracts
    Reward points if useful
    Rgds,
    Naren

  • User Exit for Purchase Order Line Items.

    I have been trying to search for a User Exit for Purchase Order Line Items and have been unable to do find anything.  I need to overwrite the Net Price and Pricing Condition on a certain type of material based upon the Pricing Condition for that Line Item which is on the Sales Document.  Any direction you can point me into would be greatly appreciated.  Thanks.

    Thanks for pointing me in the right direction.  I was able to create my first BADI using the PROCESS_ITEM method.  The following link was also very helpful: Re: BADI ME_PROCESS_PO_CUST Method:PROCESS_ITEM

  • Updating Batch classification data from MIGO for Purchase order

    Hi,
    I need to update batch classification data (in MSC3n) from MIGO for purchase order. The logic needed for this is as below,
    1) Pass material and batch to MCH1 table to get CUOBJ_BM.
    2) Pass CUOBJ_BM to INOB table to get INOB-OBJEK.
    3) Pass INOB-OBJEK to CLAF_CLASSIFICATION_OF_OBJECTS to get class name & characteristic name.
    4) Pass INOB-OBJEK, CLASS name and characteristic name to BAPI_OBJCL_CHANGE to update batch classification data.
    I created implicit enhancement at the bottom of FM "CLVF_VB_INSERT_CLASSIFICATION". But the problem is, the return parameter of BAPI_OBJCL_CHANGE is giving the following error.
    Class type 023, object type MCH1, object RAW-6             0000001151
    Object is currently locked by user
    The assignment was not changed
    Please let me know how to do it. Is there any BADI or User Exit?

    Hi,
    As you said the break point is not triggering did you activate your exit and activated even the project to which your exit is assigned.
    I hope you missed activating your project in CMOD transaction. Please verify it once and if it is not activated then immediately activate it and try debugging again.
    Regards,
    Rafi

  • Processing log output for Purchase order

    Dear All,
    Iam getting some problem when iam creating an IDOC and checking in the Processing log for IDOC number.
    Actually i had created one custom idoc for Purchase order since my client need only some field and in one line for header and line item, I had done it and i can see it in sdata of EDIDD structure. When i create a Purchase order and save it an idoc number is posting and I can see this file in my physical directory indeed.
    Now when iam going into change mode of PO ME22n to see the Processing LOG, It is not showing the IDOC Number in Purchase order output processing log popup.

    The processing log will only show output based standard output control (Table NAST).
    How is your IDoc being created. Via a user exit, BADI. If so then they will not appear on the processing log.
    It is being created as a custom IDOC for which i had written a Z function module and given that in PO processing code which is ME10. When iam checking the standard IDOC for PO it is generating the IDOC in processing log as well.
    Iam just placing my code just have a look at it and suggest if any thing needs to be done.
    FUNCTION Z_IDOC_OUTPUT_ORDERS.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(OBJECT) LIKE  NAST STRUCTURE  NAST
    *"     VALUE(CONTROL_RECORD_IN) LIKE  EDIDC STRUCTURE  EDIDC
    *"  EXPORTING
    *"     VALUE(OBJECT_TYPE) LIKE  WFAS1-ASGTP
    *"     VALUE(CONTROL_RECORD_OUT) LIKE  EDIDC STRUCTURE  EDIDC
    *"  TABLES
    *"      INT_EDIDD STRUCTURE  EDIDD
    *"  EXCEPTIONS
    *"      ERROR_MESSAGE_RECEIVED
    *"      DATA_NOT_RELEVANT_FOR_SENDING
    DATA: xdruvo.                          "Druckvorgang
    DATA: neu  VALUE '1',                  "Neudruck
          h_kappl LIKE nast-kappl,         "Hilfsfeld Applikation
          h_parvw LIKE ekpa-parvw,         "Hilfsfeld Partnerrolle
          h_ebeln LIKE ekko-ebeln.         "Hilfsfeld Belegnummer
      CLEAR control_record_out.
       xdruvo = neu.
      h_kappl = object-kappl.
      h_ebeln = object-objky.
      h_parvw = object-parvw.
      DATA:
           LT_EDIDC LIKE EDIDC OCCURS 0 WITH HEADER LINE,
             L_EDIDC LIKE EDIDC,
             L_SEND_FLAG,
             W_SDATA LIKE EDIDD-SDATA.
      DATA: T_BDI_MODEL LIKE BDI_MODEL OCCURS 0 WITH HEADER LINE.
      DATA: T_EDIDC LIKE EDIDC OCCURS 0 WITH HEADER LINE.
      DATA: T_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE.
      DATA: C_MESSAGE_TYPE LIKE EDIDC-MESTYP VALUE 'ZORDER'.
    *- Call function module to determine if message is to be distributed
    OBJECT_TYPE = 'BUS2012'.
      MOVE control_record_in TO control_record_out.
      CALL FUNCTION 'ALE_MODEL_DETERMINE_IF_TO_SEND'
        EXPORTING
          MESSAGE_TYPE           = C_MESSAGE_TYPE
        IMPORTING
          IDOC_MUST_BE_SENT      = L_SEND_FLAG.
       EXCEPTIONS
         OWN_SYSTEM_NOT_DEFINED = 1
         OTHERS                 = 2.
      DATA : BEGIN OF EKKO_tAB OCCURS 0,
      EBELN LIKE EKKO-EBELN,
      F1 TYPE C VALUE ',',
      BUKRS LIKE EKKO-BUKRS,
      F2 TYPE C VALUE ',',
      BSART LIKE EKKO-BSART,
      F3 TYPE C VALUE ',',
      LIFNR LIKE EKKO-LIFNR,
      F4 TYPE C VALUE ',',
      WAERS LIKE EKKO-WAERS,
      F5 TYPE C VALUE ',',
      BEDAT LIKE EKKO-BEDAT,
      F6 TYPE C VALUE ',',
      WERKS LIKE EKPO-WERKS,
      F7 TYPE C VALUE ',',
      PLIFZ LIKE EKPO-PLIFZ,
      F8 TYPE C VALUE ',',
      EBELP LIKE EKPO-EBELP,
      F9 TYPE C VALUE ',',
      MATNR LIKE EKPO-MATNR,
      F10 TYPE C VALUE ',',
      MENGE LIKE EKPO-MENGE,
      F11 TYPE C VALUE ',',
      MEINS LIKE EKPO-MEINS,
      F12 TYPE C VALUE ',',
      END OF EKKO_TAB.
      DATA SDATA1 LIKE EKKO_tAB OCCURS 0 WITH HEADER LINE.
      DATA EBELN LIKE EKKO-EBELN.
      WRITE OBJECT-OBJKY TO EBELN.
      SELECT T1EBELN T1BUKRS BSART LIFNR WAERS BEDAT  WERKS PLIFZ EBELP MATNR MENGE MEINS
      FROM EKKO AS T1
      INNER JOIN EKPO AS T2 ON T2EBELN = t1EBELN
      INTO CORRESPONDING FIELDS OF TABLE EKKO_tAB
      WHERE
    *T1~KAPPL = 'EF' AND
      T1~EBELN = EBELN.
    *T1~KSCHL = 'YEDI' .
      DATA SDATA LIKE EDIDD-SDATA.
      DATA NDATE LIKE SY-DATUM.
      DATA NMENGE(17) TYPE C.
      LOOP AT EKKO_tAB.
        WRITE EKKO_TAB-MENGE TO NMENGE.
        NDATE = EKKO_tAB-BEDAT + EKKO_tAB-PLIFZ.
        CONCATENATE  EKKO_tAB-EBELP ',' EKKO_tAB-BUKRS ',' EKKO_tAB-BSART EKKO_tAB-EBELN ',' EKKO_tAB-LIFNR ',' EKKO_tAB-BEDAT ','
        NDATE ',' EKKO_tAB-BSART EKKO_tAB-EBELN ',' EKKO_tAB-EBELN ', 0,' EKKO_tAB-MATNR ','
        NMENGE ',' EKKO_tAB-MEINS ',' EKKO_tAB-WERKS INTO SDATA.
        MOVE SDATA TO: W_SDATA, T_EDIDD-SDATA.
        MOVE 'ZORDERS' TO T_EDIDD-SEGNAM.
        APPEND T_EDIDD.
      ENDLOOP.
    *call function 'L_IDOC_SEGMENT_CREATE'
        exporting
             i_segnam = 'ZORDERS'
             i_sdata  = w_sdata
        exceptions
             others   = 1.
    *LT_EDIDC
    call function 'L_IDOC_SEND'
         tables
              t_comm_idoc           = LT_EDIDC
         exceptions
              error_distribute_idoc = 1
              others                = 2.
    *DATA T_BDI_MODEL LIKE BDI_MODEL.
    WRITE OBJECT-OBJKY TO T_BDI_MODEL.
    READ TABLE T_BDI_MODEL INDEX 1.      " maximum 1 recipient
    L_EDIDC-DIRECT = 1.
      L_EDIDC-DOCNUM = DOCNUM. "***
      L_EDIDC-RCVPRN = 'HCM_00_785'.
      L_EDIDC-RCVPOR = 'MM_PO_FILO'.
      MOVE 'ZORDER'   TO L_EDIDC-MESTYP.
      MOVE 'ZPURIDOC' TO L_EDIDC-IDOCTP.
      MOVE 'LS'      TO L_EDIDC-RCVPRT.
    MOVE T_BDI_MODEL-RCVSYSTEM TO L_EDIDC-RCVPRN.
    *MOVE-CORRESPONDING L_EDIDC TO W_EDIDC.
    *- Distribute the iDoc
    BREAK-POINT.
      CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' "IN UPDATE TASK
        EXPORTING
          MASTER_IDOC_CONTROL            = L_EDIDC
        TABLES
          COMMUNICATION_IDOC_CONTROL     = LT_EDIDC
          MASTER_IDOC_DATA               = T_EDIDD
        EXCEPTIONS
          ERROR_IN_IDOC_CONTROL          = 01
          ERROR_WRITING_IDOC_STATUS      = 02
          ERROR_IN_IDOC_DATA             = 03
          SENDING_LOGICAL_SYSTEM_UNKNOWN = 04.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE LT_EDIDC INDEX 1.
      control_record_out-direct = '1'.
      CONTROL_RECORD_OUT-DOCNUM = DOCNUM. " ***
      control_record_out-serial = sy-datum.
      control_record_out-serial+8 = sy-uzeit.
      control_record_out-mestyp = LT_EDIDC-mestyp.
      control_record_out-idoctp = LT_EDIDC-idoctp.
      control_record_out-SNDPRN = 'HCM_00_786'.
      MOVE 'MM_PO_FILO' TO control_record_out-RCVPOR.
      MOVE 'LI'      TO control_record_out-SNDPRT.
      MOVE 'SAPQIS' TO control_record_out-SNDPOR.
    ENDFUNCTION.

  • BADI for Sales order

    Hi Gurus,
      I have to caculate the volume discount based on the goods ordered. So that i have to calculate the discount and update it into Net value in condition tab in va01. Please provide the what is the BADI for that suitable requirement so that it should be executed before saving the order. And also the discount should be displayed in the item level. Please provide me some suitable solution.
    <b>Its Very urgent.</b>
    Points will be awarded
    Regards
    Ravi

    Hi
    Use the Std Include MV45AFZZ for writing the user exits related Sales order
    which is a include in the std sales order program SAPMV45A
    Write the code in the appropriate FORM..ENDFORM.. and see
    see further the following Exits and BAdis for Sales order
    Enhancement
    V60F0001                                SD Billing plan (customer enhancement) diff. to billing pla
    V46H0001                                SD Customer functions for resource-related billing
    V45W0001                                SD Service Management: Forward Contract Data to Item
    V45S0004                                Effectivity type in sales order
    V45S0003                                MRP-relevance for incomplete configuration
    V45S0001                                Update sales document from configuration
    V45P0001                                SD customer function for cross-company code sales
    V45L0001                                SD component supplier processing (customer enhancements)
    V45E0002                                Data transfer in procurement elements (PRreq., assembly)
    V45E0001                                Update the purchase order from the sales order
    V45A0004                                Copy packing proposal
    V45A0003                                Collector for customer function modulpool MV45A
    V45A0002                                Predefine sold-to party in sales document
    V45A0001                                Determine alternative materials for product selection
    SDTRM001                                Reschedule schedule lines without a new ATP check
    SDAPO001                                Activating Sourcing Subitem Quantity Propagation
    Business Add-in
    BADI_SD_SCH_GETWAGFZ                    Scheduling Agreement: Read WAGFZ from S073
    BADI_SD_V46H0001                        SD Customer functions for resource-related billing
    <b>Reward points for useful Answers</b>
    Regards
    Anji

Maybe you are looking for

  • Adobe Photoshop CC 2014 is marked as "trial" (in the CC manager)

    - and asks me on every start wether I want to continue with my trial - even though my subscription is valid and regular Photshop CC works like a charm. Whats up with that?

  • Forgot my administrator password. how can I reset it?

    I have a Mac mini late 2009 edition and the original installation discs with OS X Yosemite installed. I probably need to install the original software that came with it and reset the administrator password. Witch one should I choose, "Archive and ins

  • Extra Row in Combo Box

    hi: When I make a list item a Poplist style it adds another null row to the list. When I change the from poplist to a combo list I get the correct number of items. For some reason an extra 'null' entry is added when the list is a Poplist ? Does anyon

  • User Name in Banner

    How can I include the user's name in the Banner Greeting? Thanks!

  • Help with right clicking and downloads

    how do i save a picture using safari, when i use firefox i right click and select "save as" but on safari, that option isnt available. also, when im downloading something on firefox, off of like rapidshare or megaupload or sendspace, if i click it, i