How-to extend the Sales Order with the Project ID?

Hello ByD Community,
My problem is the following:
I want to add an extension field to the Sales Order Header, which would be the Project ID assigned to this Sales Order.
My use case only involve one Project ID per Sales Order, and the task will be the same from a Line Item to another. So I can only use the GetFirst() to retrieve only the first Line Item.
Past week, I asked a similar question for the Purchase Orders and I succeeded to do it after a hint from Dan!
As for the Purchase Order, I thought the Project Assignment was built through the SalesOrder.Item.ItemAccountingCodingBlockDistribution.AccountingCodingBlockAssignment.ProjectReference, but it seems that it is different.
So as soon as I try to check if this Association IsSet() it just returns me that it is not!
I succeeded to bluntly push the TaskUUID in my Extension field for testing purpose, without any check and verification, but not the Project ID neither with good validations.
I also tried to see with the SalesItem Association instead of the Item Node, but it is the same. Any time I try a different check it returns me the N/A for my field, which is my last condition if the association is not set! What is driving me crazy is that you have the Project ID is shown on the top of the Sales Order, but I just cannot find how to retrieve it in the Studio!!!
Here is my sample code in my After-Modify event (I also tried with a On-Save) where the ProjectIDSalesOrder is my extension field in the Cloud Solution:
import ABSL;
if (this.Item.GetFirst().ItemAccountingCodingBlockDistribution.IsSet())
  if (this.SalesItem.GetFirst().ItemProduct.ProductCategoryHierarchyProductCategoryIDKey.ProductCategoryInternalID.Matches("130"))
       this.ProjectIDSalesOrder = this.SalesItem.GetFirst().ItemServiceTerms.ProjectTaskUUID.content.ToString();
     /*what I need actually is : this.ProjectIDSalesOrder =      this.Item.ItemAccountingCodingBlockDistribution.AccountingCodingBlockAssignment.GetFirst().ProjectReference.ProjectID.content;*/
  else {this.ProjectIDSalesOrder = "No project assigned";}
else {this.ProjectIDSalesOrder = "N/A";}
If anybody could help me on this, it would be greatly appreciated.
Thank you community!
Best regards.
Jacques-Antoine

Hello all,
To follow up on this issue, I found that a QueryByElements is available in the SalesOrderOverview node. And we can Query the SalesOrder by ProjectID.
Fine! However, we cannot retrieve the ProjectID. It is never proposed as a result in the Query. We can query againt a ProjectID but not retrieve it.
As the ItemAccountingblockDistribution association seems to never be set, we can't retrieve the ProjectID from it neither.
I will post an incident to see if the ProjectID can be released as an entity in the SalesOrderOverview. QueryByElements results, so as to be able to use it.
Thanks for your attention.
Jacques-Antoine

Similar Messages

  • Link sales order with the PO

    A s per my business requirement, we create a sales order and according to this sales order if the material is not available in stock we want to create purchase order to the vendor for the materials which not available, How I link the sales order with the purchase order?
    Can you please any one help and advise me how this scenario can be handled in SAP

    Hello,
    Are you looking to map cross docking or third party sales in your system. In both of these cases, purchase order is created which is link to sales order via purchase requistion. The only difference, here in these scenario's is that goods movement doesn't take place within the plant.
    If this is so, then, you have customize, item categories and schedule lines used for them accordingly.
    Ideally , in the aabove mentioned scenario (cross docking, third party sales) material are not kept in stock.
    Br,
    Tushar

  • How we can give the confirmation of the sales order to the customer.?

    how we can give the confirmation of the sales order to the customer.?
    after the we generate thge sales order how we will give the confirmation to the customer automatically or in any way in SAP SD

    A confirmation can be given to the Sold to party for the sales order by means of an output type, which is the  most used functionality.
    You can create an output which can be a word or PDF document, or an email , fax etc. Based on the kind of confirmation you want to give (Document, email, fax) do corresponding settings in the output for printers, email settings, fax settings etc. and enable this output to be triggered during sales order creation by assigning the output to output procedure for sales documents. This part of configuring an output is done by Functional team while the email, fax settings are done by basis team in combination with tech team.
    The output should have a smartform and corresponding report program to populate the smartform. This part should be taken care of by the technical team.
    Once all these things are done, if a sales order is created, the output will be triggered which will send a confirmation document, email , fax as per the configuration to the sold to party. If you want the confirmation to be send to more partner functions, that is also configurable in the output configuration.
    Pls reward points if it helps.

  • Error while creating the sales order with billing reference

    hi alll
    i am getting error while creating the sales order with billing reference.The line items are coming in grey.I am not able to change the items as well as the quantity field.Can u guide me
    cheers
    shalsa007........

    Dear SAP SD 007
    I can confidently tell that an enhancement or an user exit has been applied in your scenario
    You have to check that
    Normally when creating a sales order with respect or referring billing documents the qty will be in editable mode and it is standard problem
    Your people has solved the standard problem by enhancement
    Usually OR--LF-PGI----F2 (SAY THE QTY IS 25 UNITS)
    Now you are creating returns order with reference to F2 in the return order type Re there is a standard issue that user can edit the qty to 30 from the original 25
    To solve this only your people have used userexit
    Line items and qty greyed out means definately there is some enhancement or user exit applied
    You have to check that
    Regards
    Raja

  • LSMW program to upload the sales order with multiple line items.

    Dear SD and PP Gurus,
    I am new to creating LSMW Program.
    I want to create a LSMW program to upload the sales order with multiple line items. I have read on SDN that it can be done on two phases. First Create Header Data than line items. IS IT TRUE??, Or
    Is there any procedure by which we can load the sales orders with multiple line items in a single run (part).
    I want to use Batch process, not a BAPI or IDOC procedure.
    I have created a program with
    object 0090
    Method 0000
    Program Name RVINVB10
    Program Type D
    Source Structure 1 - For Header and Source Structure 2  for Line Items.
    Mapped Field INDET (With Fix Value 1), ORDERTYPE, SALESORG, DISTCHANNEL, DIVISION, CUSTOMER, PONUMBER , DELVDATE, PRCGDATE, PMTTERM
    INCOT1 INCOT2 with Source Structure - 1 and
    Field INDENT (With Fix Value 2),  ITEMNO, MATCODE, MATQTY, SUOM, PLANT, BATCH, AMOUNT with Structure-2
    than maintained Structure relation ship, field Mapping, Specified Files, Assigned files, Read Data and other process,
    At final stage (Start Direct Input program RVINVB10) it is giving a message - Table name not allowed.
    Please tell me where I am wrong.
    Thanks in advance.
    DSC

    Dear SD Gurus n Experts,
    I have solved the above problem. But there is another problem appearing regarding the date format. Now system generating a message: Date . . is not valid.
    While I am using Date: YYYYMMDD format in flat file, which is SAP's Standard Format.
    In SDN Link: LSMW upload Sales Order using VA01/VA02     I have found that there are some date fields which are mandatory to filled. Here I have mapped
    VDATU - Requested delivery date,  BSTDK - Customer purchase order date,  PRSDT - Date for pricing and exchange rate,  BSTDK_E - Ship-to party's PO date, FKDAT - Billing Date, KORDT - Delivery Date,
    and PRGRS - Date type is Constant = D
    Can any one tell me, where is the priblem.
    With thanks,
    DSC

  • How to display the sales order in the line item in FB03

    Hi Experts,
    I have a requirement to display the sales order in the line item of t-code FBO3, could anybody suggest an userexit or BADI for the same.
    Thanks in advance.
    RP.

    >
    S. Rajesh Paul wrote:
    > Hi Experts,
    >
    > I have a requirement to display the sales order in the line item of t-code FBO3, could anybody suggest an userexit or BADI for the same.
    >
    > Thanks in advance.
    >
    > RP.
    I assume, you want to display sales order number in accounting document..... .
    This is not something you can do it through the BADI..
    You will have to change the G/L account field group (if it is already not there). you can then assign sales order number when posting to FI.  In the field group, better choose sales order number and item number as optional fields.
    If you can see the sales order field (may be empty) - you have to enter the sales order number when you post it.
    Good luck

  • How to create a Sales order with ref to Contract using Function Module

    How to create a Sales order with ref to Contract using Function Module BAPI_SALESDOCU_CREATEFROMDATA ?

    We have a unique situation where we like change the sold-to customer of the sales order
    once order has been created. These orders have been created using either by function module
    BAPI_SALESDOCUMENT_COPY or using BDC (VA01, Copy with reference).
    These two processes work abosolutely fine except someone might have change the sold-to
    customer of the ship-to customer of the original sales order. If this the case then the new
    sales order will be created with the old sold-to and with not the new sold-to.
    We tried using BAPI_SALESDOCUMENT_CHANGE and commit afterwards. We checked
    the returned parameteres of the BAPIs and they are all successful but sold-to remains the
    same old one.
    Any help would be much more appreciated.

  • Re: Printing Cancelled line items in the sales order on the packing slip

    Hi gurus,
    Currently we have a unique requirement in our company. Our wholesale customers send the Purchase order to us via EDI. Now saw they have requested an order containing 10 materials out of which we can fulfill only 8. the other 2 due to some reasons cannot be fulfilled.
    So the business wants to keep the other 2 line items to be entered in the sales order with a cancelled status.
    Now correct me if I am wrong, only the confirmed line items will be copied from a sales order to a delivery document. So thats the reason why these cancelled line items cannot be printed on the packing slip.
    However somehow the business wants the packing slip tp have the 2 line items printed on it with the reason of not being delivered. this is to facilitate the customer to know why those items couln't be fulfilled by our company. Now we cannot use a manual work-around of letting the customer know about the impossibility of not fulfilling the other 2 items as there are a lot of orders that come thru EDI per day.
    Can anyone suggest a solution to this requirement asap.
    Thanks in advance
    Vinit

    Hi Vinit,
    This requirement makes a lot of sense, that is to be able to inform your customer that some item(s) of the sales order could not be delivered, not even partially.
    A possible solution would be to allow for zero quantity in the delivery item (check customizing and mark "zero quantity allowed" in the item category).
    Then in the packing split, it would be easy to print the delivered quantity (0) and the sales order quantity (whatever it was), because you have the "null" item available in the delivery.
    Personally I am not found of having have delivery items with zero quantity, but they are useful in that case, and they can also be useful to automatically "close" the sales order item (instead of having to do it manually if the goods can't be served).
    Note: Usually in Consumer Goods, if you can't serve part of a sales order to a customer, you have to close it, because the Retailer's next Sales Order will include the remaining quantity.
    Hope it helps.
    Best Regards,
    Franck Lumpe
    Freelance SAP ERP Consultant

  • Issues in creating the sales order with oe_order_pub.process_order api

    Hi All,
    I am trying to create a sales order with BOOKED status using oe_order_pub.process_order api, and I am getting response as
    <X_RETURN_STATUS>E</X_RETURN_STATUS>
              <X_MSG_COUNT>1</X_MSG_COUNT>
              <X_MSG_DATA>ONTOE_LOCK_ROW_DELETED</X_MSG_DATA>
    Can any one help me in fixing this issue ..!
    Thanks,
    Vamsi…
    Edited by: user11147471 on Jul 9, 2009 2:02 AM

    When using the API, are you trying to create the order as booked using the booked flag or the book action?  I would recommend using the action if you are not. To troubleshoot, I would try the API without booking and then use the following article to determine the issue:
    Unable To Setup A Credit Card Bank Account For The Customer. CC Information On The Order Is Not Valid (Doc ID 1450936.1)

  • What to do with the Sales Order once the Production Order is TECO?

    Hi everybody,
    What to do after a Production Order is confirmed, GI, GR, and the Production Order is Technically Complete?
    In MD04, I can still see the Sales Order, and I can see also the line with CSTOCK (Customer Stock).
    What to do now to complete the scenario?
    Thanks in advance,
    Rudy.

    Thank you!
    But I get the following message in VL01N:
    "No schedule lines due for delivery up to the selected date "
    What does it mean exacly?
    I have a Confirmed Production Order.
    I have a quantity in CSTOCK.
    So, what is missing here?
    Thanks in advance!
    Rudy

  • Any batch process to release the sales order with status profile

    Hi,
    The sales manager need to release the sales order 1 by 1.
    This is very tedious.
    Is there a process for her to release selectively?
    For example,
    if the sales value of the order is visible and within the approval limit or too small,
    she could release, says, more than 10 sales order in a single click.
    Possible?????
    Bye

    Hi,
    I like to perform a mass release of multiple Sales order from the proposed custom report.
    I would like to built the releasing coding into the report.
    I need some references on how to set the release.
    Maybe, there is a standard function for me to pass it in and it would release the sales order status.
    if that the case, it is BONUS.
    Otherwise, there must be some steps that need to be built to set the release.
    what I am asking, is there any such routines that would define the steps to release the sales order in coding?
    I understand there would be a change in status aftef the released and it is also vital to enable the audit log for future investigation.
    Having a BAPI would result the audit issue as the system would have taken care of it.
    I hope it is clearer now as to why I am requesting a sample of the standard routine.
    If there is no such routine, do let me be aware of it.
    Thanks

  • Issue in V_V2: Can system rescheduling the sales order with out stock

    Hello All,
    I created sales orders with one material. For that material the stock is zero now. The system has not confirmed the qty in sales orders while creating.
    After that as per the client we ran the V_V2 for rescheduling, but system has not rescheduled any schedu lines in any sales orders.
    Is it due to lack of stock?
    One more point is we do not have Delivery proposal option in sales order. Only One time delivery option.
    Is it due to this setting?
    Please help me to solve this issue.
    Regards
    Lakshmikanth

    Hi
    Because there is checking rule set at order level , thats why once stocks is not there due to unavailabilty of stocks system not allow to go for V_V2.
    for this u hav to deactivate under oVZ8/9
    thanks
    mk

  • How to create an Invoice for the sales order using the T-Code VF01

    Hello Experts,
    How to create an Invoice for a sales order using the T-Code VF01?
    Thanks in advace,
    Suma

    hi,
    Make the following settings-
    1. Create sales document and billing type
    2. assign billing type in sales document type config VOV8
    3. Activate itemcategory as sales order related billing
    4. Maintain copy control header and item level between sales order and billing
    5. Maintain pricing procedure for sales order and billing
    6. Define Output procedure in case to print invoice
    Regards
    Goutham

  • How to close automatically sales order with open items ?

    Hi,
    There is a request from a client:
    he would like to be able to close the open items of a sales order which are not billed automatically according to a specific calendar. Moreover he would like to specify that ,generally speaking, the customer does not want to be delivered another time if there are leftovers in the sales order.
    I read in other posting that manually you can close open items in a sales order by adding a reason of rejection for the line item. Nevertheless, I do have one question about that. Imagine we only have one line of 100 pieces and we only deviver 90 pieces. When we put a reason of rejection in the sales order item of 100 quantity, what exactly will happen? How the system will know it only has to reject the 10 non delivered pieces and not the 100 pieces mentionned in the line item ? I also read that the price would change to zero but how can this be correct if we have 90 pieces to bill ?
    Thanks a lot for all your answers.
    Stéphanie

    Dear Stephanie,
    the reason for rejection change the status of the item itself to completed and it move the item from "active to be processed" to a simply statistical status.
    In the scenario you mentioned, as the reason for rejection is applied to the full item, you will set the full item as statistical, but your 90 pieces will continue being delivered and even eventually invoiced.
    Some discrepancies you may find only running some statistical reports, where also the net values information would not be in line as per your expectation.
    In order to prevent this discrepancy issue, I would advice you to contact a good abaper and develop a program that may massively rejects open items with not confirmed quantities, creating a new item for the open quantity if the sales line is partially confirmed.
    It means that, in your scenario:
    Order A > Item 1 for 100 pieces
                               > only 90 pieces delivered & invoiced
                               > 10 pieces open
    the result would be the following:
    Order A > Item 1 for 90 pieces
                               > 90 pieces delivered & invoiced
                  > Item 2 for 10 pieces rejected
    In this way you keep under control any report you may generate out of your sales and you can set as statistical items only quantities not processed further.
    I hope this explanation may help you.
    For any additional information on the reason for rejection I would remind you to SAP documentation and if you have the possibility to try to customize ans set your system with reason for rejection in order to discover directly with your eyes how these work.
    Regards,

  • How to Restrict Return Sales Order with reference to a cancelled invoice

    SAP Standard is allowing to create Return Sales Order with reference to a cancelled invoice which practically should not be allowed.
    Has any body worked on this problem and what could be the possible solutions so that return sales orders can not be created against a cancelled invoice.
    Kindly share your possible solutions.

    Hi Standard Process will not allow to create a Sales Order With Cancelled invoice,
    Kindly go through at Copy Controls
    T.CODE:VTAF
    in that some body might have maintained between S1 invoice to RE Sales Document.
    Remove the settings then u will be not able to create Sales Order w.r.t to Cancelled Document.
    Rewards if Usefull
    B.Shyam Sunder
    SAP SD Consultant

Maybe you are looking for

  • Import a pdf document to an active x control

    I want to display a PDF file in active x window.

  • Help! adobe acrobat X pro. Cannot edit a pdf.

    help! I have adobe acrobat X pro. Cannot edit a pdf. watched videos, followed directions, nothing. Tried tools, edit document text, recognize text, then tried even to change font, nothing.

  • Pse 7.0 can you add a 3rd party layer style to existing category?

    I've seen and understand the instructions I found on installing a layer style from a third party, but it shows creating a new category for each one through the xml.  I have a bunch of free layer styles that actually fit into existing categories (like

  • How to attach a DOM object as stream to SOAP message?

    Hi friends, I want to attach a parsed XML document (DOM object) to SOAP message, but but I do not want to attach it as a String, instead, I want to attach it as a binary format, given a DOM object. Any one can help tell me what can I do for it? and w

  • Uncompressed 8-bit Preset problems

    Hi, I'm trying to solve a jaggy text problem by creating a new uncompressed 8-bit sequence (which I've never used before). I try using the preset for Uncompressed 8-bit and click OK... but then I get the following message: "Video Compressor Uncompres