How to delete a PO at header level - Restrict to a specific order type

Hi,
Deletetion of PO at header level is not recomended but still in my project they are using it to delete a particular PO type and should not allow to delete the other PO types. Recently Support Pack upgrade was done. After this activity deletion is not happening. Hope the relevent code got over writed with the original.
Here creation and change of PO will be done from a third party system through IDOC. Deletion of PO at header level should be possible only through IDOC.
Can some one give me the idea where(BAdI/Enhancement) we need to write the code to allow the deletion of PO of a particular type?
Regards,
Balaram Devineni

Hope you are referring to "setting of deletion indicator at header level of PO" (EKKO-LOEKZ = 'L').  Standard method CL_PO_HEADER_HANDLE_MM->PO_CANCEL may be helpful (you may have to integrate this with IDOC processing function module).  Wiki post [Purchase Order Cancellation (Header) using ABAP Classes|http://wiki.sdn.sap.com/wiki/display/ABAP/PurchaseOrderCancellation%28Header%29usingABAPClasses] will be a good reference.

Similar Messages

  • Delete sales employee in header level with BAPI_CUSTOMERQUOTATION_CHANGE

    hi  experts,
    I try to delete sales employee in header level, but i always get the error message:
    FB call: insufficient parameters
    The sales document is not yet complete: Edit data
    Sales document 0007002015 was not changed
    Please give a light  how to delete sales employee successfully . Thank you very much!!
    My program:
    REPORT z_test_change_partner .
    DATA:
          order_header_inx LIKE bapisdh1x,
          order_header_in LIKE bapisdh1,
          return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
          quotation_item_inx LIKE bapisditmx OCCURS 0 WITH HEADER LINE,
          partners LIKE bapiparnr OCCURS 0 WITH HEADER LINE,
          partnerchanges LIKE bapiparnrc OCCURS 0 WITH HEADER LINE
    order_header_inx-updateflag = 'U'.
    quotation_item_inx-updateflag = 'U'.
    quotation_item_inx-itm_number = '000010'.
    APPEND quotation_item_inx.
    CLEAR partners.
    partners-partn_role = 'VE'.
    partners-partn_numb = '00001000'.
    APPEND partners.
    CLEAR partnerchanges.
    partnerchanges-document = '0007002015'.
    partnerchanges-itm_number = '000000'.
    partnerchanges-updateflag = 'D'.
    partnerchanges-partn_role = 'VE'.
    *partnerchanges-p_numb_old = '00001111'.
    *partnerchanges-p_numb_new = '00001000'.
    APPEND partnerchanges.
    CALL FUNCTION 'BAPI_CUSTOMERQUOTATION_CHANGE'
      EXPORTING
        salesdocument                = '0007002015'
       quotation_header_in          = order_header_in
        quotation_header_inx         = order_header_inx
      SIMULATION                   =
      BEHAVE_WHEN_ERROR            =
      INT_NUMBER_ASSIGNMENT        =
      LOGIC_SWITCH                 =
      NO_STATUS_BUF_INIT           = ' '
      TABLES
        return                       = return
      QUOTATION_ITEM_IN            =
       quotation_item_inx           = quotation_item_inx
       partners                     = partners
       partnerchanges               = partnerchanges
      PARTNERADDRESSES             =
      CONDITIONS_IN                =
      CONDITIONS_INX               =
      QUOTATION_CFGS_REF           =
      QUOTATION_CFGS_INST          =
      QUOTATION_CFGS_PART_OF       =
      QUOTATION_CFGS_VALUE         =
      QUOTATION_CFGS_BLOB          =
      QUOTATION_CFGS_VK            =
      QUOTATION_CFGS_REFINST       =
      SCHEDULE_LINES               =
      SCHEDULE_LINESX              =
      QUOTATION_TEXT               =
      QUOTATION_KEYS               =
      EXTENSIONIN                  =
    LOOP AT return.
      WRITE / return-message.
    ENDLOOP.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       wait          = 'X'
    IMPORTING
      RETURN        =

    Hi Edith,
    Thank you very much for your reply.
    I changed my program by following your steps in the reply. Now the BAPI is showing error messages: "Instance 7200000060 of object type PurchaseOrder could not be changed" and "Price without service not allowed".
    Please refer my code below.
    poitem-po_item = '0010'.
    poitem-pckg_no = '0000001964'.
    poitem-item_cat = '9'.
    APPEND poitem.
    poitemx-po_item = '10'.
    poitemx-po_itemx = 'X'.
    poitemx-pckg_no = 'X'.
    poitemx-item_cat = 'X'.
    APPEND poitemx.
    Parent line
    poservices-pckg_no = '0000001964'.
    poservices-line_no = '0000000001'.
    poservices-ext_line = '0000000000'.
    poservices-subpckg_no = '0000001965'.
    poservices-matl_group = '01040107'.
    *poservices-delete_ind = 'X'.
    *poservices-quantity = ' '.
    *poservices-base_uom = ' '.
    *poservices-gr_price = ' '.
    APPEND poservices.
    CLEAR: poservices.
    Child line.
    poservices-pckg_no = '0000001965'.
    poservices-line_no = '0000000002'.
    poservices-ext_line = '0000000010'.
    poservices-quantity = '1'.
    poservices-service = '000000000005000010'.
    poservices-base_uom = 'EA'.
    poservices-gr_price = '150'.
    poservices-subpckg_no = '0000000000'.
    poservices-matl_group = '01040107'.
    poservices-delete_ind = 'X'.
    APPEND poservices.
    CALL FUNCTION 'BAPI_PO_CHANGE'
      EXPORTING
        purchaseorder = '7200000060'
      TABLES
        return        = return[]
        poitem        = poitem[]
        poitemx       = poitemx[]
        poservices    = poservices[]
        posrvaccessvalues = posrvaccessvalues[].
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    Regards,
    Revanth

  • Deleting multiple POs are header level

    Hi,
    We are in SRM 5.0, is there any function module by which we can delete old POs at header level.
    Rgds,
    Madhan

    See the foll link:
    Re: How to delete a PO in SRM

  • How to print material document in header level?

    Hi Guys,
    How to print material document from header level. I can only print them in item level. But i want that in header level. For example, I have 4 movements inside a material document and I want to issue only one output from the header level.
    I can see the option Goto -> Additional Function -> output, but it is disabled. Please let me know hot to acheive this and if you need further info on this. Please throw some light on this.
    Thanks
    Yasin.

    HIi
      Your question is not clear.  What exactly you want to be.
    1.  To print material header in your smart form / Sap Script what is the problem. Itu2019s quite easy you can do it. Let me know what problem you are facing.
    2. The option is disables because of business functionality ask your functional guys to help you on the same.
    Regards
    Swati

  • Order management header level updation process for iStore order.

    Hi all,
    I worked on OM header level updation process for iStore order.only card holder name,expiration date updated using OE_ORDER_PUB.process_order but Credit card number,card type not updated for istore order in OM.so please help to me.
    CODE:
    SET SERVEROUTPUT ON;
    DECLARE
    v_api_version_number NUMBER := 1;
    v_return_status VARCHAR2 (2000);
    v_msg_count NUMBER;
    v_msg_data VARCHAR2 (2000);
    -- IN Variables --
    v_header_rec oe_order_pub.header_rec_type;
    v_line_tbl oe_order_pub.line_tbl_type;
    v_action_request_tbl oe_order_pub.request_tbl_type;
    v_line_adj_tbl oe_order_pub.line_adj_tbl_type;
    -- OUT Variables --
    v_header_rec_out oe_order_pub.header_rec_type;
    v_header_val_rec_out oe_order_pub.header_val_rec_type;
    v_header_adj_tbl_out oe_order_pub.header_adj_tbl_type;
    v_header_adj_val_tbl_out oe_order_pub.header_adj_val_tbl_type;
    v_header_price_att_tbl_out oe_order_pub.header_price_att_tbl_type;
    v_header_adj_att_tbl_out oe_order_pub.header_adj_att_tbl_type;
    v_header_adj_assoc_tbl_out oe_order_pub.header_adj_assoc_tbl_type;
    v_header_scredit_tbl_out oe_order_pub.header_scredit_tbl_type;
    v_header_scredit_val_tbl_out oe_order_pub.header_scredit_val_tbl_type;
    v_line_tbl_out oe_order_pub.line_tbl_type;
    v_line_val_tbl_out oe_order_pub.line_val_tbl_type;
    v_line_adj_tbl_out oe_order_pub.line_adj_tbl_type;
    v_line_adj_val_tbl_out oe_order_pub.line_adj_val_tbl_type;
    v_line_price_att_tbl_out oe_order_pub.line_price_att_tbl_type;
    v_line_adj_att_tbl_out oe_order_pub.line_adj_att_tbl_type;
    v_line_adj_assoc_tbl_out oe_order_pub.line_adj_assoc_tbl_type;
    v_line_scredit_tbl_out oe_order_pub.line_scredit_tbl_type;
    v_line_scredit_val_tbl_out oe_order_pub.line_scredit_val_tbl_type;
    v_lot_serial_tbl_out oe_order_pub.lot_serial_tbl_type;
    v_lot_serial_val_tbl_out oe_order_pub.lot_serial_val_tbl_type;
    v_action_request_tbl_out oe_order_pub.request_tbl_type;
    v_msg_index NUMBER;
    v_data VARCHAR2 (2000);
    v_loop_count NUMBER;
    v_debug_file VARCHAR2 (200);
    b_return_status VARCHAR2 (200);
    b_msg_count NUMBER;
    b_msg_data VARCHAR2 (2000);
    BEGIN
    DBMS_OUTPUT.PUT_LINE('Starting of script');
    -- Setting the Enviroment --
    mo_global.init('ONT');
    fnd_global.apps_initialize ( user_id => 1013438
    ,resp_id => 21623
    ,resp_appl_id => 660);
    mo_global.set_policy_context('S',204);
    -- Header Record --
    v_header_rec := oe_order_pub.g_miss_header_rec;
    v_header_rec.request_date := SYSDATE;
    v_header_rec.header_id := 251413;
    v_header_rec.credit_card_holder_name :='esakki';
    v_header_rec.credit_card_number := 'XXXXXXXXXXXX3510';
    v_header_rec.credit_card_expiration_date := to_date('01-JAN-2014','dd-mon-yyyy');
    v_header_rec.credit_card_code := 'MASTERCARD';
    v_header_rec.payment_type_code := 'CREDIT_CARD';
    v_header_rec.sold_to_org_id := 131747;
    v_header_rec.sold_from_org_id := 204;
    v_header_rec.ordered_date := SYSDATE;
    v_header_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
    v_action_request_tbl (1) := oe_order_pub.g_miss_request_rec;
    -- Line Record --
    v_line_tbl (1) := oe_order_pub.g_miss_line_rec;
    DBMS_OUTPUT.PUT_LINE('Starting of API');
    -- Calling the API to update the header details of an existing Order --
    OE_ORDER_PUB.PROCESS_ORDER (
    p_org_id =>204
    ,p_operating_unit => NULL
    p_api_version_number => v_api_version_number
    ,p_init_msg_list => fnd_api.g_false
    ,p_return_values => fnd_api.g_false
    ,p_action_commit => fnd_api.g_false
    , p_header_rec => v_header_rec
    , p_line_tbl => v_line_tbl
    , p_action_request_tbl => v_action_request_tbl
    , p_line_adj_tbl => v_line_adj_tbl
    -- OUT variables
    , x_header_rec => v_header_rec_out
    , x_header_val_rec => v_header_val_rec_out
    , x_header_adj_tbl => v_header_adj_tbl_out
    , x_header_adj_val_tbl => v_header_adj_val_tbl_out
    , x_header_price_att_tbl => v_header_price_att_tbl_out
    , x_header_adj_att_tbl => v_header_adj_att_tbl_out
    , x_header_adj_assoc_tbl => v_header_adj_assoc_tbl_out
    , x_header_scredit_tbl => v_header_scredit_tbl_out
    , x_header_scredit_val_tbl => v_header_scredit_val_tbl_out
    , x_line_tbl => v_line_tbl_out
    , x_line_val_tbl => v_line_val_tbl_out
    , x_line_adj_tbl => v_line_adj_tbl_out
    , x_line_adj_val_tbl => v_line_adj_val_tbl_out
    , x_line_price_att_tbl => v_line_price_att_tbl_out
    , x_line_adj_att_tbl => v_line_adj_att_tbl_out
    , x_line_adj_assoc_tbl => v_line_adj_assoc_tbl_out
    , x_line_scredit_tbl => v_line_scredit_tbl_out
    , x_line_scredit_val_tbl => v_line_scredit_val_tbl_out
    , x_lot_serial_tbl => v_lot_serial_tbl_out
    , x_lot_serial_val_tbl => v_lot_serial_val_tbl_out
    , x_action_request_tbl => v_action_request_tbl_out
    , x_return_status => v_return_status
    , x_msg_count => v_msg_count
    , x_msg_data => v_msg_data
    DBMS_OUTPUT.PUT_LINE('Completion of API');
    IF v_return_status = fnd_api.g_ret_sts_success THEN
    COMMIT;
    DBMS_OUTPUT.put_line ('Order Header Updation Success : '||v_header_rec_out.header_id);
    ELSE
    DBMS_OUTPUT.put_line ('Order Header Updation failed:'||v_msg_data);
    ROLLBACK;
    FOR i IN 1 .. v_msg_count
    LOOP
    v_msg_data := oe_msg_pub.get( p_msg_index => i, p_encoded => 'F');
    dbms_output.put_line( i|| ') '|| v_msg_data);
    END LOOP;
    END IF;
    END;
    OUTPUT:
    Starting of script
    Starting of API
    Completion of API
    Order Header Updation Success : 251413
    Thanks,
    saran

    Forgot to mention :Soruce is Oracle EBS

  • How to add a specific order type into any particular report

    Hi All,
    How to add a specific document type(order type) into any particular report in order to review OTD performance.
    I need to add one specific order type to existing reports which will help to check the performance of the delivery type for that particular order type to the users.
    Thanks,
    Raj

    Hi Rajesh,
    thanks for the reply when i tried as the way you said.. but the system is asking more details like varient. so if you can clearly specify the process for order type (VOV8-- table TVAK) so it will helpful for me.
    Thanks
    Raj

  • How to delete value in the header line of itab

    dear all,
    i have create an internal table.
    i would like to delete value of the header line after have used read table to read the contents.
    how can i do it ?

    If your internal table is something like this:
    data: begin of i_mara occurs 0.
    include structure mara.
    data: end of i_mara.
    That clears the matnr field of the header line...
    CLEAR i_mara-matnr.

  • OTC . How is freight calculated in OM header level

    Hi
    We have this business scenario where Freight is calculated at order header.
    But we were checking the API for that
    WSH_INTERFACE_GRP.Create_Update_Freight_Costs
    This is done at Delivery or Delivery detail level.
    So CANT we have freight costs at order header level???
    Basically i have say 3 labels created for an order i need to generate freight for these 3 labels. Please not 3 labels DOES NOT correspond to 3 lines.
    So can i create Freight lines for these 3 labels for that order header Id.
    And also another question is for RETURN orders we wont have any deliveries then how are freight cost calculated
    Regards
    Gibin

    FUNCTION ZSAVE_NOTES_SAVE.
    *"*"Local interface:
    *" IMPORTING
    *" VALUE(OBJECT_ID) TYPE CRMT_OBJECT_ID
    *" VALUE(OBJECT_TYPE) TYPE CRMT_SUBOBJECT_CATEGORY
    *" REFERENCE(HEADER) TYPE THEAD OPTIONAL
    *" REFERENCE(TEXT) TYPE TDTXTLINES
    *" TABLES
    *" LINES STRUCTURE TLINE
    TYPES : BEGIN OF STRUC,
    GUID TYPE CRMD_ORDERADM_H-GUID,
    END OF STRUC.
    DATA : WA_STRUC TYPE STRUC,
    IT_STRUC LIKE TABLE OF WA_STRUC.
    TYPES : BEGIN OF STRUC1,
    TDOBJECT TYPE STXH-TDOBJECT,
    TDNAME TYPE STXH-TDNAME,
    TDID TYPE STXH-TDID,
    TDSPRAS TYPE STXH-TDSPRAS,
    TDTITLE TYPE STXH-TDTITLE,
    TDLINE TYPE STXH-TDTXTLINES,
    END OF STRUC1.
    DATA : WA_STRUC1 TYPE STRUC1,
    IT_STRUC1 LIKE TABLE OF WA_STRUC1.
    SELECT SINGLE GUID FROM CRMD_ORDERADM_H INTO WA_STRUC WHERE
    OBJECT_ID = OBJECT_ID AND OBJECT_TYPE = OBJECT_TYPE.
    SELECT SINGLE TDOBJECT TDNAME TDID TDSPRAS TDTITLE TDTXTLINES FROM STXH
    INTO WA_STRUC1 WHERE TDNAME = WA_STRUC-GUID.
    APPEND WA_STRUC1 TO IT_STRUC1.
    CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
    CLIENT = SY-MANDT
    HEADER = HEADER
    INSERT = ' I '
    SAVEMODE_DIRECT = ' X '
    OWNER_SPECIFIED = ' SAPUSER '
    * LOCAL_CAT = ' '
    * IMPORTING
    * FUNCTION =
    * NEWHEADER = HEADER
    TABLES
    LINES = LINES
    EXCEPTIONS
    ID = 1
    LANGUAGE = 2
    NAME = 3
    OBJECT = 4
    OTHERS = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    COMMIT WORK.
    ENDFUNCTION.
    Have alook at the follolwing threads
    Probelem with SAVE_TEXT
    SAVE_TEXT FUNCTION MODULE
    save_text?
    there are many more examples.

  • How to attach documents to QM02 Header level

    Hi,
    I have the requirement to implement a BAPI to attach the documents which has been submitted on the portal to be created in the Header level of the Quality Notification(QM02).
    I have gone through few forums which are related to GOS attachments. But i colud not able to understand.
    Please help me on this regard,
    Thanks in advance,
    Sathi

    Friends,
    This is very urgent, please give me your valuable suggesions.
    Thanks,
    Sathi

  • BAPI_SALESORDER_SIMULATE How to get the conditions on header level?

    Hi,
    is it possible to get the pricing conditions on header level (sales order) with the Bapi BAPI_SALESORDER_SIMULATE?
    We only found the information on item level?
    Thanks a lot.

    hope its possible,
    If don't specify any item no for condition type in bapi, then it will be consider as header condition.
    make sure condition should be header condition.
    hope it will work.
    Regards,
    Marreddy

  • Which structure field contains the header level net price of sales order ?

    Hi Friends,
    I am writing a pricing routine for calculating ZSMR condition value in sales order header level. The formula for calculating is   (NET PRICE / NET SALES COST) / NET PRICE.
    Which structure contains the net price of the sales order in header level. KOMK structure does not contains the net price value.
    Any ideas is highly appreciable.
    Thanks,
    Sakthidoss.

    Sivanand,
    I can not use VBAK as I have not saved the sales order yet and before that I need to calculate the pricing condition. In the sales order header level, net price is showing. I want to know which structure contains that net price value.
    You have any thoughts whether I am in correct path?
    I will certainly appreciate your help by rewarding points.
    Edited by: dossgs on May 20, 2010 2:13 PM

  • How to fill conversion table TAUUM in BW for conversion of Sales Order Type

    When importing sales order data from SAP ECC to SAP BI, conversion routine AUART can be used to convert Sales order Type from its internal representation to an external representation.  (For example, the standard sales order has an internal Sales Document Type code TA, and an external code OR).
    The standards SAP conversion routine AUART uses table TAUUM as a lookup table.  This table has lots of data in SAP ECC, but it is empty in SAP BW.
    How can we copy data from table TAUUM in ECC to  table TAUUM in BW?
    Do we have to create a maintenance view on the table, and type in the entries? Or is there a more automated way?

    Hi Jay,
    Make sure the extract structure is active. You can check the same from LBWE > 11: SD Sales BW> MC11VA0STI is active.
    If the extract structure is active. Inorder to fill the setup table. First delete the setup table for the application area 11 from SBIW transaction. Then fill the set-up table for the application area 11 as you did for deliveries.
    Then check whether data source is pulling data.
    Let me know if there is an issue even after following the above steps.
    Thanks & Regards,
    Namrata

  • How can i create a playlist of various artists in a specific order? No matter how I do it, when I burn it, it burns in a different order

    Everytime I make a playlist with various artists, the order changes when it burns.  Help!

    Topic : Change the burn order? - [http://discussions.apple.com/thread.jspa?threadID=2711389]
    itunes won't burn playlist in right order
    How do i move songs in my playlists so there are in a specific order?

  • How to delete a table at dictionary level

    Hi All,
          i have deleted custom table zaccount from database, usin se14 transaction.
    now i want to create a new table using same name zaccount, but it is showing me error that table already exists in data dictionary. now i am trying to delete from data dictionary also, but it is giving me error that table is refrenced at multiple levels
    guys how can i forcefully delete it from datadictionary.
    thanks and regards
    Al-salfi

    Your table was active and had data right and also it was referred at various places in different contexts.
    okay now please type the table name in SE11; can you see if yes fine you caught the problem display the table do not delete directly; click on where used list to generate a list of different places where the table has been referred.
    at all those points remove the references as per the context and do not forget to activate. so once you have done that and the where used list returns no result means all references moved then again delete the table.
    You won't have any more issues with the table
    this problem happens because of the active name tab of the table that is yet present but inconsistent as the changes to the dictionary definition have been made inconsistent by your earlier efforts.

  • How to put the value in Header test while creating the sales order

    Hi ,
    I am creating the Sales order using the Idoc Orders05 .
    I have to pass the value in the header text 1. the value is a transaction id which is a string value.
    If anyone has an idea how to do this using the the Orders Idoc. it would be a great help
    Thanks
    Nikhil

    If you have access to idoc before calling the processing Function module, Adding header text segments E1EDKT1 and E1EDKT2 to the idoc will create the header text.
    Regards
    Sridhar

Maybe you are looking for