How to create an AccountingEntry with reference to a SalesOrder?

Dear community,
I would like to create an accounting entry (journal entry voucher) that allocates some costs to a sales order. Take a look at the attached ByD screenshot to see what I mean. I am trying to replicate this manually created journal entry voucher with the studio... Unfortunately, my code is not working and I'm getting the error the "Sales document is missing".
What else do I have to set? Here's my current code...
var accEntry = AccountingEntry.Create();
accEntry.AccountingClosingStepCode = "010";
accEntry.AccountingDocumentTypeCode = "00088";
accEntry.BusinessTransactionTypeCode = "634";
accEntry.CompanyID = "1000";
accEntry.EntryDate = Context.GetCurrentUserDate();
accEntry.PostingDate = Context.GetCurrentUserDate();
var elOfSOB : elementsof AccountingEntry.SetOfBooks;
elOfSOB.SetOfBooksID.content = "8060";
// Line item 1
var item1 = accEntry.Item.Create();
item1.ChartOfAccountsCode = "ZAT1";
item1.ChartOfAccountsItemCode.content = "570000";
item1.TransactionCurrencyAmount.content = 500;
item1.TransactionCurrencyAmount.currencyCode = "EUR";
item1.DebitCreditCode = "1";
Entry.SetOfBooks.Create(elOfSOB);
var acit = item1.SalesLedgerAccountItem.Create();
acit.CostRevenueElementCode.content = "570000";
acit.OperationalDocumentReference.ObjectTypeCode.content = "114";
acit.OperationalDocumentReference.FormattedID = salesOrder.ID.RemoveLeadingZeros().content;
acit.OperationalDocumentReference.UUID.content = salesOrder.UUID.content;
acit.OperationalDocumentReference.ObjectID.content = salesOrder.ID.content;
acit.OperationalDocumentItemReference.ObjectNodeTypeCode.content = "1080";
acit.OperationalDocumentItemReference.FormattedID = salesOrder.Item.GetFirst().ID.RemoveLeadingZeros();
acit.OperationalDocumentItemReference.UUID.content = salesOrder.Item.GetFirst().UUID.content;
acit.OperationalDocumentItemReference.ObjectID.content = salesOrder.Item.GetFirst().ID;
// Line item 2
var item2 = accEntry.Item.Create();
item2.ChartOfAccountsCode = "ZAT1";
item2.ChartOfAccountsItemCode.content = "570000";
item2.TransactionCurrencyAmount.content = -500;
item2.TransactionCurrencyAmount.currencyCode = "EUR";
item2.DebitCreditCode = "2";
item2.ProfitCentreUUID = ProfitCentre.Retrieve("P1100").UUID;
accEntry.SubmitForPosting();
accEntry.Post();
Thank you for your help!
Best regards,
Georg

Hi Colin,
If you want your time reference characteristic to be 0CALMONTH, then you must ensure that all other time characteristics in the cube can be derived from this characteristic. the infocube by default chooses the most refined time charactersistics as its time reference characteristic.
That is in the cube you could then have characteristics lik 0CALQUARTER, 0CALYEAR...You cannot have 0CALWEEK or 0CALDAY since these cannot be defined from a value in 0CALMONTH.
Please check below the SAP help for your reference.
http://help.sap.com/saphelp_nw70/helpdata/EN/80/1a62ebe07211d2acb80000e829fbfe/frameset.htm
Hope it helps,
Best regards,
Sunmit.

Similar Messages

  • How to create excise invoice with reference thorugh credit memo

    Hi All,
    Please provide any solution for the following qurey:
    How to create excise invoice with reference thorugh credit memo

    Hi murali,
    i am unable to understand your requirement i think there is no like this scenario requirement for any client
    if any requirement is there kindly explain detail
    cheers

  • How to create table view with reference table

    Hi experts,
    How to create table view with reference table in SE11, plz gve me stp by stp procedure.
    pints grnded for hlp.

    Hi
    Go to Tcode se11 choose view and enter the name and create a popup opens up choose database view option
    enter the description
    On the left hand side choose the table name.
    Click on view fields tab and choose your table fields.Here you can choose which fields you want in your view.
    Save and then activate.
    Hope this helps.
    Regards,
    Harish

  • How to create caracter set with reference(or create it anyhow)on 5.0

    I have difficulty (only on version 5.0 and 4.7) to create caracter set with reference(or create it anyhow). On version 4.6 there is no problem (I can do that like described in course BC305).
    Transaction "spad"->Full administation-> character set->change-> character
    set-> character set->create using template(or just create)
    I have intention to modify char set afterwards
    How could I do that in version 5.0 ECC?

    and therefore in this forum with minor chances to get an answer.
    regards
    Peter

  • How to create excise invoice with reference delivery document

    hi all sd guru
    please guide me how to create excise invoice by taking reference of delivery no.
    thankx in advance
    san

    HI
    FACTORY SALES
    IN CASE OF FACTORY sales you have to create a billing document either Proforma or Commercial.
    Then you can reference the billing doc i9n J1IIN for creation
    DEPOT SALES
    In case of depot sales you can create a excise invoice with reference to delivery document.
    For this after creation of delivery goto J1IJ  and slect the rg23d from menu
    you can create an excise invoice with delivery in depot sales.
    In factory it is not possible to create a excise invoice with delivery doc.
    regards
    Prashanth

  • How to create a Contract with reference to a Sales-Order(VA01) with a BAPI

    Hi,
    my name is Wadim and i need help.
    My problem:
    I am creating a sales-order(VA01) with the BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'.
    After that i have to create a contract(VA41) with reference to this order. I found the BAPI "BAPI_CONTRACT_CREATEFROMDATA" and it has the same interfaceparameters like the salesorder-bapi. but there are no parameters to get a connection to the sales-order.
    Is it even possible to get a connection to a sales-order with a bapi???
    thanks for help
    regards mark
    Edited by: Krapp Wadim on May 20, 2010 9:19 PM

    Hi Wadim,
    I have a similar requirement to create order lines in an existing contract with reference using  BAPI_CUSTOMERCONTRACT_CHANGE.  The order lines get created in the contract. However, the condition types from the order line which i'm referencing are not getting referenced and are not getting added in the Contract's line after referencing.
    Did you come across any such issue ? If yes , could you suggest the solution ?
    Regards,
    Venkat.

  • How to create a complaint with pre-decessor document Inovice?

    Hello experts,
    I need create a complaint with reference to a pre-decessor document type Invoice (apart from other types such as sales order and service order). Can someone enlighten me
    1) how to create an invoice in IC Web Client and backend?
    2) how to create a complaint with reference to this created invoice in IC Web client and backend?
    Thanks a lot!!!

    Hi Easwar
    Thanks  a lot for answering the question.
    Yes I do have CRM Billing documents. But the problem is
    a) either the billing document doesn't have Transfer to Accounting status Transferred or
    b) a transferred billing document, but all items have error "Unable to offset billing item 90003458 0000000060" etc.
    Do you know
    1) how I can make a billing document have "Transferred" status? Pressing "Transfer to Accounting" button in the billing document overview page will only set the status to "Being transferred". And it's always being tranfered.
    2) What does the error "Unable to offset billing item ... "mean? How to get rid of them?
    Thanks a lot!

  • Create condition record with reference to existing condition record

    how to create condition record with reference to existing condition record?

    Hi,
    See this link :
    http://help.sap.com/saphelp_47x200/helpdata/en/de/7a8534c960a134e10000009b38f83b/frameset.htm
    You can create with reference with Tcode : VK14 (or VK34)
    Or in VK12, you can copy condition records with copy rules.
    Regards,
    Lionel

  • Can I use the BAPI_PO_CREATE1 to create a PO with reference to a PR?

    Hi experts.
    I have a big question. I have been spend many hours in this site to find an answer about if I can use the BAPI_PO_CREATE1, to create a Purchase Order with reference to a Purchase Requisition. I could n ot find nothing about this.
    Can somebody tell me if can I use it?
    There are some threads that say "It is posible", but I would like to know the Structure name and the field name where I have to put the Purchase Requisition in the BAPI to create my PO.
    I hope that somebody can help me.
    Thanks a lot!!
    Best Regards.
    Jesus Martinez
    ABAP Developer
    Comala, Colima, Mexico

    I know this is an ancient topic, but in order to have all the necessary info together: (for everyone's future reference)
    How to create a PO with reference to a Purchase requisition which is properly released and assigned:
    Bapi_po_create1
    POHeader: document type (also POHEADERX)
    POItem : item number, plant, storage location, PR number, PR item (also POItemx)
    and that should be all! it would be useful if SAP clarified that in their documentation because this is a very common scenario...

  • How to create shipment document with out inbound delivery document

    Dear Friends
    How to create shipment document with out outbound/inbound delivery document.
    In my client scenario, there is no inbound delivery for normal purchases.
    Just there are raising the PO to vendor, then they are doing MIGO for goods receipt.
    Can we do shipment creation with reference to PO?
    If it is possible, how it will be?
    Please let it solve
    With regards
    Lakshmikanth

    Dear Sameer,
    Please go to transaction VT01N here you enter Transportation planning point and shipment type then press enter.
    Now system will take you to the shipment document creation screen here you click on Select deliveries or press F6 now system will take you to the select outbound deliveries screen in this screen you enter selection data then execute, now deliveries will get assigned to that shipment.
    After assigning the deliveries enter the remaining data then complete the shipment finally save the shipment document.
    For more information please go through this SAP help link
    Note:- Shipment process need to be carry out for the deliveries before PGI.
    http://help.sap.com/saphelp_47x200/helpdata/en/f5/04898047bd11d2bf750000e8a7386f/frameset.htm
    I hope this will help you,
    Regards,
    Murali.

  • Re: Creating credit memo with reference to Sales Order in ICWC

    Hello gurus
    I am new to CRM and we hv ECC 6.0 & CRM 6.0 in our environment.
    We have a process where a Credit Memo Request is created with reference to a Sales Order.
    Now till this point we had launched VA01 in the ICWC and were creating the CMR with reference to the Standard Order.
    Henceforth we want to move this to the CRM ICWC.
    In ICWC we create Standard Sales order using Work Center IC_BT_SLO tied to the Navigation profile.
    I am looking for some way of copying this order to a Credit Memo Request in the ICWC.
    I tried adding the Complaints button on the navigation profile ... however it creates a new CMR ... not sure how to enable copying it from the Original Sales order in ICWC
    Any thoughts ?
    Thanks
    Vinit

    closed
    Edited by: vinit parkar on Sep 1, 2011 4:25 PM

  • Create sales order with reference to 10 quotation

    Create sales order with reference to 10 quotation I want to put all quotation means take reference in one sales order how I can do it because when tried va01 and taken reference of question it allow to put only one question number how can I do it for multiple question
    Ahmed

    Hi Raj,
    If you come back to initial screen after coping the first quotation ,then system will ask you whetehr to save or cancel the data,if we select save then it will be saved immediately,else it will cancel.So ,it is not possible to copy more than one quaotation in standard SAP.The only option is to deveop a BDC with the help of abaper.
    We can only create this when header data is same in all the quotations.
    Regards,
    Pasapula.
    Edited by: Pasapula on Jul 24, 2009 9:48 AM

  • Create Sales Order With Reference to Billing Document Using BAPI_SALESORDER

    Hi,
    How can i create a sales order With Reference to Billing Document Using BAPI_SALESORDER_CREATEFROMDAT2?
    Thanks in advance,
    Alejandro.

    I have to create sales order with reference to existing billing document. I have tried to following bapis.
    1. BAPI_SALESORDER_CREATEed
    I have successfully created document with following details.
    -->ORDER_HEADER_IN:
    DOC_TYPE =                  ZRK
    SALES_ORG =              3000
    DISTR_CHAN   =            00
    DIVISION =                    00
    ORD_REASON =            100
    SD_DOC_CAT   =          L
    CURRENCY       =         EUR
    REF_DOC          =         100000028
    REF_DOC_CA    =         M
    -->ORDER_ITEMS_IN:
    ITM_NUMBER    =           000010
    MATERIAL          =          701791
    TARGET_QTY     =          0000000001000
    CURRENCY        =          EUR
    REF_DOC           =          100000028
    REF_DOC_CA     =          M
    -->ORDER_PARTNERS:
    PARTN_ROLE      =          SP
    PARTN_NUMB      =         W12001
    COUNTRY             =         NL
    by providing this input i am able to create the document but it is not picking up the net value. so i have passed some extra paramters in  ORDER_ITEMS_IN
    COND_TYPE          =        PNET
    COND_VALUE        =        14,56
    COND_D_UNT        =         PC.
    folowing error is occured: Condition PNET is missing in pricing procedure A V Z0000.
    is it something related to configuration problem?
    2.BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2
    I have used same test data that is used for BAPI_SALESORDER_CREATEFROMDATA (where in i coudl succefully create doc). but here i encounterd following error.
    Unpermitted combination of business object BUS2032 and sales doc. category L.

  • Bapi To create sales order with reference of sales order.

    Hi all,
          Having requerment To create sales order with reference of onother  open sales order.
    Example: there open sales order which having qty of 20 for that 10 qty as already billed , for remain  10 qty as to create the new sales order with reference to the excsiting one.
    Please guide me how do it.
    Regards,
    Santosh
    Edited by: santosh jajur on May 15, 2010 11:47 AM

    Hi Santhosh,
    check this thread.
    Re: Open Sales Order Migration
    The last part of the thread says done.
    hope you get a hint from that.
    Also this one
    Re: how to create open sales order using BAPI....?
    http://abaplovers.blogspot.com/2008/02/bapi-sales-order-create-code.html
    Regs,
    SuryaD.
    Edited by: SuryaD on May 15, 2010 9:09 PM
    Edited by: SuryaD on May 15, 2010 9:10 PM
    Edited by: SuryaD on May 15, 2010 9:11 PM

  • BAPI to create Sales Order with reference to contract

    Hi All,
    I am trying to create Sales Order with reference to Contract, but although the
    order gets created, it does not contain reference document information. 
    The BAPI I am using is BAPI_SALESORDER_CREATEFROMDAT2. 
    Would someone know which parameters I have to papulate,or have any other suggestion
    how to accomplish my task? 
    Thank you so much, 
    Mayank

    Hi - Try Filling these three fields in the Item details.
    REF_DOC
    REF_DOC_IT
    REF_DOC_CA
    Reward points if helpful

Maybe you are looking for

  • Can I create a corporate iCloud account?

    I am in charge of managing the deployment of the Apple devices to our internal associates.  I would like to be able to monitor the iPad and iPhone in the event it is lost or stolen.  I would like to be able to create additional sub account under the

  • TS3366 iOS 7: Back and Forward Gesture in Safari and Mail conflicts with Panning Gesture

    Back and Forward Gesture in Safari and Mail is different than the back and forward gesture used to swipe between Home screens.  The simple swipe with the thumb straight does not work in Safari and Mail, it conflicts with the Panning gesture.  It shou

  • Audio disabled in Skype when using Digital Camcorder

    Hello guys, I have a question regarding using DV Camcorder for Skype videochat. I have Mac Pro, OS X Leopard. I am using digital Camcorder which is connected to Mac via FireWire connection. The problem is, that person I chat with is seeing my video f

  • How to unlock icloud in my iphone ?

    Hello ! i have a 1 iphone locked icloud ! that will be lost! and recent me not found redistribute it! I bought one of the old phone shop ! they do not remember the old account icloud ! how to active my iphone ? account privacy practices is in 04/17/2

  • Cannot download Oracle 9i Disk2 Database

    So that we may better diagnose DOWNLOAD problems, please provide the following information. I have tried about three times to download the second and third disk. I was able to download the first disk, but the other two don't seem to finish. - Server