How to extend Project Task in the Purchase Order header?

Hi everybody,
I am facing a problem I am sure is not so hard, but I cannot find my way through it.
So, my objective is to extend the Purchase Order Header with the Project Task ID.
I created the extension field first, as below:
But I just cannot find how to populate it automatically from the data in the Project Task field.
I tried a Relation in a BO extension going through the AccountingBlockAssignement, but it seems to not be functional.
I also tried to make a Reference to the extension field and created an Event After Modify like:
this.projecttaskpo = this.ExtensionForPO.content
The Project Task PO is my reference to the extension field created in the Cloud Solution.
And the ExtensionForPO is my relation to the TaskID:
import AP.Common.GDT;
import AP.Purchasing.Global as Purchasing;
import AP.ProjectManagement.Global as ProjectManagement;
import AP.IS.CodingBlock.Global as Coding;
[Extension] businessobject AP.Purchasing.Global:PurchaseOrder {
  [Relation(Coding:AccountingCodingBlockDistribution.AccountingCodingBlockAssignment.ProjectTaskKey.TaskID)]
  [Label("Project ID")] element ExtensionForPO : TaskID;
    node Item {
I am pretty sure this is not so hard, but I can't figure how to do it.
The Task ID is in the Line Item so I do not understand why it could be so hard to add it in the Purchase Order Header.
Moreover, when I try to make the path directly from the PurchaseOrder, like:
PurchaseOrder.Item.ItemAccountingCodingBlockDistribution.AccountingCodingBlockAssignment.ProjectTaskKey.TaskID
It returns to me that the association between Item and ItemAccountingCodingBlockDistribution is not a node. I know that, but it would be perfect if I could directly go from the Purchase Order BO to the Project Reference and the Project Tasks. But I cannot do that.
Any help on this would be greatly appreciated as it is quite a recurring request from customers.
I could have a misunderstanding in the process of doing it, or even in the code as I am a pure development newbie, so I m open to all propositions.
Thank you all.
Have a nice day.
Jacques-Antoine

Jacques-Antoine,
You can't directly translate a repeating node or element (such as an Item or a Project Task from the Accounting Coding Block of an Item) to a singular node or element.
The reason is that, though your use case may have the elements assumed to be the same for all items, this isn't necessarily the case, so ByDesign won't assume that you can use that kind of logic.
The simplest approach would be to do an On-Save at the Root node of the Purchase Order along the following lines:
this.projecttaskpo = this.Item.GetLast().ItemAccountingCodingBlockDistribution.AccountingCodingBlockAssignment.ProjectTaskKey.TaskID;
i wouldn't actually recommend this code.
You'd need validations for IsInitial, IsSet, and those kinds of functions.
i'd at least use some foreach loop to check that all the accounting coding blocks were for the same task, raise warnings if they weren't, etc.

Similar Messages

  • How to Configure Invoice Address tab on Purchase Order - Header Level

    Hi Gurus
    Please assist
    My client want to add the Invoice address on the Purchase Order level Tab, it must be automatically pull through to all the Purchase Orders as they have one Invoicing address.
    Currently the suppliers send invoices to plants instead of HEAD OFFICE for payment
    Regards
    Susan

    Hi,
    Tax condtions shd be given by functional consultants.ABAPers cant decide the tax condtions.
    you can have these condtions in KONV table.
    In item level vbrp-posnr = konv-kposn.
                      ekpo-ebelp = konv-kposn
    at header level as said in the below thread
    Just see this and get back if any concerns
    Regards
    Edited by: Rasheed salman on Dec 2, 2008 6:20 AM
    Edited by: Rasheed salman on Dec 2, 2008 6:22 AM

  • To change the Purchase order header and line item text

    Hi everybody,
    I need to upload the PO Header and item text for the combinaion of PO and a material.
    Please help???

    Hi,
    Try this beloe code
          Length of the PO item text
          If the length > 132 Chars
      BAPI Function module for changing PO item Text
      commiting the bapi change
    SORT t_bapi BY ebeln ebelp.
      LOOP AT t_ebeln INTO wa_ebeln.
        LOOP AT t_bapi INTO wa_bapi WHERE ebeln = wa_ebeln-ebeln.
          REFRESH t_return.
          READ TABLE t_input INTO wa_input
            WITH KEY ref_num = wa_bapi-ref_num
                     item = wa_bapi-ebelp.
          IF sy-subrc EQ 0.
            APPEND wa_input TO t_output.
            w_len = STRLEN( wa_input-text ).
            wa_potextitem-po_number = wa_bapi-ebeln.
            wa_potextitem-po_item = wa_bapi-ebelp.
            wa_potextitem-text_id = 'F01'.
            wa_potextitem-text_form = '*'.
            wa_potextitem-text_line = wa_input-text+0(132).
            APPEND wa_potextitem TO t_potextitem.
            IF w_len > 132.
              wa_potextitem-po_number = wa_bapi-ebeln.
              wa_potextitem-po_item = wa_bapi-ebelp.
              wa_potextitem-text_id = 'F01'.
              wa_potextitem-text_form = '='.
              wa_potextitem-text_line = wa_input-text+132(123).
              APPEND wa_potextitem TO t_potextitem.
            ENDIF.
          ENDIF.
        ENDLOOP.
        CALL FUNCTION 'BAPI_PO_CHANGE'
          EXPORTING
            purchaseorder = wa_bapi-ebeln
          TABLES
            return        = t_return
            potextitem    = t_potextitem.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait   = ' '
          IMPORTING
            return = wa_bapiret2.
    Regards
    Krishna

  • Is there a way we can default the Requisition header description to Purchase Order header description in iProcurement?

    We would want to default the Requisition Header description to get imported onto the Purchase Order Header description. After the Requisition approval the Purchase Order gets created but the Header description is empty and I expect this to be defaulted. Please suggest available alternatives.

    Try with t.code AUT10 -Audit trail using which you can see the change histories.
    Regards,

  • BAdI or USEREXIT for changing data of purchase order header - ME21N

    hello all,
    I would like to ask you any way to change the field "reason for change" of the Purchase Order  header.
    I tried implementing the method PROCESS_HEADER of IF_EX_ME_PROCESS_PO_CUST
    or changing reason_code of structure ekko in user exits EXIT_SAPMM06E_006 and EXIT_SAPMM06E_006
    but it seems not to work.
    How can i do?..
    sap. v. ecc 6.0

    >
    Shiva Kumar wrote:
    > Use the user exit : EXIT_SAPMM06E_012: This is triggered on saving of a PO...and user can add validations etc in the exit...
    > Cheers
    It doesn't work...
    >
    Martin Voros wrote:
    > you get reference to object IM_HEADER in method PROCESS_HEADER of BADI ME_PROCESS_PO_CUST. On this object you can call two methods - GET_DATA and SET_DATA. GET_DATA returns structure with type MEPOHEADER. You can change your field here and then call method SET_DATA with your modified structure. This should work.
    > Cheers
    ..same thing for this solution...
    the field that i want to change is RSCOD inside structure EREVGRID...it seems to have also get_data and set_data methods ( IF_REVISION_ITEM_DCM ),
    but I don't know which BAdI to implement that has a object type ref to EREVGRID...
    Edited by: E_M on May 13, 2008 11:08 AM

  • Status of Purchase Order Header

    Hello Community,
    in the purchase order header you find a tab status. This has values like Not Delivered, Partially Delivered and Full Delivered. I wonder how this status is set. Is it determined all the time you enter the transaction or is it stored in a database table.
    Basically I would need the table where the actual status of the header is stored. I looked through all tables like EKKO, EKET etc. but could not found it. Do somebody of you has any idea?
    Thanks
    Berthold

    Hi Berthold,
    I did a lot of research on the same topic, but finally came to the conclusion that these values don't get stored in any table but get updated as we enter the transaction's. Also, since being header level data it sums up all the item's in the PO and shows the status i.e. if there are 2 items in the PO the status will add up the ordered, delivered and invoiced quantities of both the items and show the values.
    Thanx,
    Pravin

  • Add customer fields to purchase order header

    Hi ,
    I need to add two additional fields to the purchase order header.
    In std program SAPMM06E screen number 101 i have seen a code
    CALL CUSTOMER-SUBSCREEN CUSTSCR1 INCLUDING 'SAPLXM06' '0101'
    how to make use of this..and add my fields..wht all steps need to be done for this..
    do i hve to append fields to ekko..pls give me details
    ansari

    You have to use [Enhancement|http://help.sap.com/erp2005_ehp_04/helpdata/EN/bf/ec079f5db911d295ae0000e82de14a/frameset.htm] MM06E005, read the enhancement documentation for more information.
    - Look at enhancement via transaction [SMOD|https://www.sdn.sap.com/irj/scn/advancedsearch?query=smod&cat=sdn_all]
    - Implement via transaction [CMOD|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=cmod&adv=false&sortby=cm_rnd_rankvalue]
    Look at [Enhancements|http://help.sap.com/erp2005_ehp_04/helpdata/EN/bf/ec079f5db911d295ae0000e82de14a/frameset.htm] and [Customer Exits|http://help.sap.com/erp2005_ehp_04/helpdata/EN/c8/1975cc43b111d1896f0000e8322d00/frameset.htm] or the old [Changing the SAP Standard (BC)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBCEX/BCDWBCEX.pdf]
    Another source of information begins at OSS [Note 496083 - FAQ: Customer enhancements (User Exits) in purchasing|https://service.sap.com/sap/support/notes/496083]
    Regards

  • BADI-User exit required for updating Purchase order header field -IHREZ

    Hello All,
    We have requirement in our business to update the purchase order header field "our reference" EKKO-IHREZ with some text field. We need a BADI/user exit that can be used for updating this field . We have checked the BADI ME_PROCESS_PO_CUST and unfortunately we are not able to use this BADI as it getting triggered in enjoy SAP transactions ME21N , ME22N etc. We are not creating the purchase order manually and we are using ME59N for creating Purchase order . Hence we are looking for some user exit/BADI that can be used in ME59N for updating the purchase order header field IHREZ.
    Thanks in advance for your immediate response .
    With regards,
    Joseph Anand B

    TRY using the exist u2022     EXIT_SAPLME59_001
    You can also later on add this field by BAPI_PO_CHANGE

  • Need to find how to relate the purchase order table with account assignment

    i need to reterieve the account assignment from the table bbp_pdacc, what is field or any tables that is between BBP_PDACC and Purchase order number or the purchase order items. I am working on the SRM system

    Jacques-Antoine,
    You can't directly translate a repeating node or element (such as an Item or a Project Task from the Accounting Coding Block of an Item) to a singular node or element.
    The reason is that, though your use case may have the elements assumed to be the same for all items, this isn't necessarily the case, so ByDesign won't assume that you can use that kind of logic.
    The simplest approach would be to do an On-Save at the Root node of the Purchase Order along the following lines:
    this.projecttaskpo = this.Item.GetLast().ItemAccountingCodingBlockDistribution.AccountingCodingBlockAssignment.ProjectTaskKey.TaskID;
    i wouldn't actually recommend this code.
    You'd need validations for IsInitial, IsSet, and those kinds of functions.
    i'd at least use some foreach loop to check that all the accounting coding blocks were for the same task, raise warnings if they weren't, etc.

  • How to get the Purchase Order sample form to have 2 detail regions?

    I would like to use the "Purchase Order" sample form as the base, and add one more "detail header" and "detail" subform to it.
    So I copy and paste the "detail header" + "detail" subforms, and position them right beneath the first "detail" subform.
    It works to certain extend.  I can click the "Add Item" button(s), and it would expand the respective "detail" region.
    The problem comes when things get expanded to the 2nd page.
    Say, I first add 5 rows to the 2nd "detail" region, everything still fits in one page;
    then I keep adding rows to the 1st "detail" region, and it begins to expand to the 2nd page....
    everything in the first "detail" region can still fit in the first page,
    the rows in the 2nd "detail" region should get pushed to the 2nd page...
    but when I look at the 2nd page of the form, the "detail header" on the 2nd page is that of the "FIRST" detail header, not the 2nd detail header!!
    So, when you look at the entire form, you have
    First Detail Header
    some First Detail Rows
    2nd Detail Header
    some 2nd Detail rows
    --- end of page 1---
    --- page 2---
    First Detail Header
    some detail rows (can't tell if they belong to the first detail region or 2nd detail region)
    This obviously is not right.
    So, how do I fix it such that the Detail Header on the 2nd page is that of the 2nd Detail header???

    an update:
    I have found out that the detail rows on the 2nd page are all that of the 2nd detail region.
    so, it's like this:
    when you look at the entire form, you have
    First Detail Header
    all the First Detail Rows
    2nd Detail Header
    some 2nd Detail rows
    --- end of page 1---
    --- page 2---
    First Detail Header
    some 2nd detail rows

  • How to set up automatic payment for the purchase order

    Hi, All,
    I have one question how to set up automatically payment for the Rent Office purchase Order?
    There is the requirement from the client. They want to create one kind of purchase order for the Office Rent, then pay the fees in the certain time of every month to the vendor for the rent fees without any invoice. Whatu2019s the normal solution for this kind of purchase order? Is it ERS? Or something else?
    Please give me the details and business flow. Also please tell me how to setup in the SAP and T-code.
    Thanks in advance

    Either you can set up ERS or you can pay directly from the FI side.
    Prerequisites
    Evaluated receipt settlement must be flagged in the purchase order item.
    The vendor must be flagged as being subject to ERS in the vendor master record.
    The goods receipt must refer to a purchase order.
    Goods-receipt-based Invoice Verification must be defined for the purchase order item.
    A tax code must have been maintained in the purchase order item.
    The order price of the materials may not be an estimated price.
    If you flag a vendor as being subject to ERS, the system sets the ERS indicator as a default in each item when you create a purchase order for the vendor. You can prevent this happening for certain vendors by flagging the info record for the material and the vendor as not being subject to ERS.
    In Purchasing, you can delete the default ERS indicator in a purchase order item.
    Choose Logistics Invoice Verification ® Automatic Settlement ® Evaluated Receipt Settlement (ERS).
    The selection screen appears.
    You can use the following criteria to narrow down selection of the transactions to be settled:
    Company code
    Plant
    Goods receipt posting date
    Goods receipt document
    Fiscal year of the goods receipt
    Vendor
    Purchase order and order item
    You can define the selection criteria for the invoice documents by:
    Delivery
    Purchase order
    Purchase order item
    Goods receipt document
    Credit memo
    Invoice
    Currency
    Choose  Execute.
    The system issues a log for Evaluated Receipt Settlement, which displays the following:
    Settled
    In line with your selection criteria, the system displays all the order items that were settled (or if you are working in test mode, which would have been settled).
    Could not be settled
    In line with your selection criteria, the system displays all order items for which ERS is defined but could not be settled. It also lists the reasons.
    If the system reports being unable to invoice a transaction, you should exclude the transaction from ERS to avoid it being included in the log the next time ERS is run.
    Select the item and choose Exclude from ERS.
    The system also generates and possibly sends a message to inform the vendor(s) about the transaction settled, depending on the settings in Customizing.
    You can display the following environment information for the order items selected. To do this, choose Goto ®:
    Display purchase order
    Display invoice
    Display material document
    Display long text

  • How to get the Purchase order Qty in the object dependency

    Hi,
    We are using variant pricing in the purchase order. I have condition type say u201CZVBPu201D for Pallet cost. I defined Pallet cost as 5 USD per each (pallet). I have to calculate Number of pallets = Purchase order Qty/ 5. The number of pallets should be rounded to nearest integer.
    My question is how to get the Purchase order Qty in the object dependency?
    Is there any reference table and field can be used to get Purchase order Qty just like we use MMCOM-VKOND for variant pricing.
    Appreciate your help
    Thanks,
    Srini

    Hi,
    1. I do not have system now so I can not conclusively tell about table field .
    2. Since I did it long back so I also do not exactly remember it, there are more than one place where PO qty appears for example Item overview and Item details - one of the PO qty when used in the characteristic do pull the PO qty which can be used for variant pricing (so request to please update the forum with the correct table and field once you find it - in the meantime if I get opportunity to get to system I will also try and find out ).

  • How to create an inspection lot for each line item of the Purchase order?

    Hi,
    How to create an inspection lot for each line item of the Purchase order ?
    In detail if possible.

    Hi
       please check this
    [thread|Create Inspection Lot;

  • How to view the purchase order output

    Hi all,
    how to view the purchase order output in the transaction me23n?
    How to obtain the purchase order output form?
    Please help..

    HI,
    goto NACE tcode then select the purchase order type and go to output types u cna use standard one NEU and provide the sapcript name and form name default will be there with MEDRUCK and print program.
    then in ME23n click on messages there create ur message type NEU and save it
    then print the purchase order...
    hope u get solved with this
    Regards
    Syed A

  • How to create a smart form using the purchase order

    hi everybody............
    i have created one purchase order, i want to print that PO using smartforms rather than scripts. how can i do it, can anyone help me out in solving the issue. i am using the version sap 4.7
    Edited by: mhyderali on Aug 21, 2009 4:08 PM

    Hi,
    Before answer your question few things i would like to kno:
    1. currently is there any script is printing while displaying output.
    2. do u allready hae a smartform or you are going to develop a smartform.
    3. if you dont have a smartform and there is a script attached then you can convert script into smartform and then you can change in the smart form accordingly.
    4. after devloping a new smart form or converting script into smartform what you need to do is go to V/83 transaction give Output Type which is associated with script and Application area (for purchase order i.e. EF). then press ok screen will display here you can change the name of your form name under the form column.
    6. if you dnt have the Output type then you need to create a output type for the purchase order.
    Please let me know if you have still some question.
    Thanks
    Narendra

Maybe you are looking for

  • How do I update to 3.6 or 4.0 to get on Powerschool?

    They upgraded Power School at my daughters high school. Now I can't pull up her information from school. They told me Firefox must be at 3.6 or 4.0

  • Output to be converted into PDF format

    Hi, I have a "select-options" defined for Purchase order number to which SAP Script is attached. The output can be seen in SAP Script. The requirement is to have the DIALOG BOX supressed that asks for the Print Preview option and the output that was

  • How to cancel a second email address

    I added a second email address needing it for a short time and i did not secure it with spam protection. I need to cancel it as i only get junk on it and have no need for it at this time

  • Oracle row to column transformation

    RDBMS :10.2 Hi, I have a query that composed of there tables and have joins in them. The final result query is giving is as folllow ProductId ComProductId description 055X     035X     Ladies Companion 055X     055X     Adult Companion 112008     112

  • How to remove Fields from Change Office & communication Data..

    Hi, In ESS->Emp Search -->Change office and communication Data..I have to remove a field "License Plate No" as we are not using it.. How to do it.. I have Netweaver studio installed in my pc but i dont know how to use it.. could any one tell me the s