How to change value of GL account on sales order line item

I am trying to change COGS account based on discount percentage. How do I write formatted search?
discount filed is $[$38.15.1] and I need to change COGS account if discprcnt = 100 on sales order
Thanks

Thanks again Jim and Manikadan
I had to modify the query a little bit to following but I was able to change the COGS account on FMS.
Declare @prcntdisc as nvarchar(20)
Declare @acctcogs as nvarchar(20)
Declare @defaultcogs as nvarchar(20)
SET @prcntdisc = (SELECT $[dln1.discprcnt])
SET @acctcogs = '67000015-01-001-03'
SET @defaultcogs = (SELECT C.FormatCode
              from
               dbo.oitb A
               inner join dbo.oitm B on B.ItmsGrpCod = A.ItmsGrpCod
               inner join dbo.oact C on A.SaleCostAc = C.AcctCode
              where
               B.ItemCode =(SELECT $[dln1.ItemCode])
if @prcntdisc like '100.%' 
begin
Select  @acctcogs
end
else
begin
Select @defaultcogs
end

Similar Messages

  • Change the Profit Center in Sales Order line item's Account assignment tab

    Hi Gurus,
    I need to change the Profit Center at Sales order Line item in Account Assignment Tab. Currently  The Profit center is coming from Material Master for the Line Item's Material as default but I have to change / overwrite  that.
    Can any body provide me how can i achive that means
    Any User exits, substitution or any thing ?
    I tried MV45AFZZ but i am not able to find out the right place where I can change COBL-PRCTR.
    Sony

    Hi
    There is perform which moves the values to VBAP field.
    This PRCTR field is stored in VBAP (i.e., SO line item table)
    USEREXIT_MOVE_FIELD_TO_VBAP
    Hope it works.
    VVR

  • Add field 'asset' in sales order line item account assignment tab

    Hi,
    I would like to add the following field: 'asset' in sales order line item account assignment tab.
    I can enter order, or wbs, but not Asset.
    How can I make this field visable?
    Anybody?
    thanks,
    klundert
    Edited by: Eric Van Zundert on Oct 30, 2010 8:43 AM

    Hi
    There is perform which moves the values to VBAP field.
    This PRCTR field is stored in VBAP (i.e., SO line item table)
    USEREXIT_MOVE_FIELD_TO_VBAP
    Hope it works.
    VVR

  • User Exit to make changes in sales order line item data.

    Hi All,
    I need to know about user exit by whcih I can make changes in sales order line item details --> Account assignment tab --> Sales order no and line item no.
    I want to make changes so as to bring the active maintenance contract no and line item no here instead of sales order no and line item no. So whenever ( Va02 or Va03) we go to sales order line item and se the account assignment tab I should see the contract no there.
    Just let me know the USER EXIT to do the above changes.
    Points will be awarded.
    Regards,
    Satish.

    Hi,
    Please have a look at the following user exits...
    1. user exit_ save_document
    2. user exit_save_document_prepare
    Regards
    sankar

  • Transaction VKM1 - Changes Sales Order Line Items Custom Fileds

    Hi,
    I have a challenge to indentify the impact of VKM1 on a Sales Order Line Item Customer Enhanced Fields. When credit hold for the customer is released in VKM1, I want to prevent some of the changes to the line items in the User Exit. The Problems I am not sure, How VKM1 is calling the Transaction VA02 or those Sales Order User Exits to modify certain customer enhanced fields. I tried Activation of Break Point in Update Task but did not stop at the Break points set up in the User Exit. How does Transaction VKM1 call the Sales Orders to execute changes? Is it through BAPI or Call Transaction VA02 or some thing else.
    Can any One please help me? Appreciate Your Help in advance.
    Thanks,
    Kannan

    VKM1 uses FM SD_ORDER_CREDIT_RELEASE to release orders on credit.

  • How to upload sales order line items?

    SAPGurus,
    For years my customer service department has been asking for a way to upload sales order line items into the VA01 sales order-entry screen.
    Many of our customers submit PO's with huge amount of line items, up to 1,000 lines. Our CS reps need to key in the data line by line (or copy/paste
    approx 17 lines at once from Excel into the VA01 screen), and we are looking for a way to make this process leaner. One idea we have is that user creates the order header, and then has a way to upload the material numbers and quantities in a separate (newly created Z-transaction) screen in one go.
    Obviously rules then need to be built that deal with the various pop-up messages related to e.g. ATP, material status, etc.
    Does anyone have any experience or thoughts on how we could achieve this? A way to make the sales order-entry process a bit less time-consuming? Any feedback would be greatly appreciated !
    Thank you,
    RVS

    Take the inputs from this Blog created by  SUNIL PILLAI                   
    Sales Documents upload  using Standard Direct Input Program in LSMW
    G. Lakshmipathi

  • How to Find Out The Production Order Number For The Sales Order Line Items

    Hi All,
    I want to know the number of production orders for each sales order line item. I know the sales order number .Can anyone tell me how the tables can be linked to get all the production order numbers for each sales order line item.

    I think it depends on your configuration. But check fields KDAUF and KDPOS in table AUFK.  or in table AFPO.
    Regards,
    Rich HEilman

  • How to set Confrimed quantity as 0 in the sales order line item

    hi all
    i have a requirement that my user dont want to see confirmed quantity in the sales order line item.
    scenario is make to order.
    i have set strategy group is 20 -make to order
                                            MRP Type is PD
                                           Lot size -
    EX , still its showing confirmed quantity.
    could pls any one tell me how to set 0 quantity in the sales order line item
    thnx

    Dear Sateesh,
    If the availability check is carried out and stock is not there in our plant, then it will show the confirmed quantity as Zero.
    If you don't want to carry out the availability check,
    To achieve this,
    1. Remove the availability check in the transaction OVZG against your requirement class.
    You can find the requirement type assigned to the sale order in the procurement tab.
    In OVZH transaction, you can find the requirement class assigned to your requirement type.
    2. Remove the availability check for your schedule line category in VOV6.
    In the material master MRP3 view, you ll be having Availability check, there you need to specify the availability check..
    If you specify it as KP(No check), then it will confirm the qty, though the stock is not there in our plant..
    To meet your requirement, you have to prefer user exit.(Correct me if I am wrong)
    Thanks,
    Venkatesh.S.P

  • Cannot change Tax Code from the referenced sales order line

    hi,
    Has anyone ever got this error when creating Sales Order(SO): "*cannot change Tax Code from the referenced sales order line*"?
    The error occur with order type Return.
    This SO is created by copying from another SO.
    Please help.
    Regards & thanks,
    eRie

    hi,
    Has anyone ever got this error when creating Sales Order(SO): "*cannot change Tax Code from the referenced sales order line*"?
    The error occur with order type Return.
    This SO is created by copying from another SO.
    Please help.
    Regards & thanks,
    eRie

  • How to assign values from multiple output(cursor) to fields(line item-one below other) in forms??

    Hi all,
    I have a Form which has text_field columns as below , created from table RECEIVED_FORM_15G. This table is blank.
    1)     CUST_CODE with 1 line item. (Number of Items displayed=1)
    2)     ACCT_FD_NO with 10 line items. (Number of Items displayed=10)
    There are more than 1 ACCT_FD_NO for 1 CUST_CODE.
    When i enter the CUST_CODE and press tab, all the values of ACCT_FD_NO must get displayed. I am taking ACCT_FD_NO values from another table called KEC_FDACCT_MSTR
    and want to display ACCT_FD_NO, one below other (line item). So i put in the following code:
      BEGIN
           FIRST_RECORD;
           FOR CUR_R IN (SELECT  ACCT_FD_NO FROM KEC_FDACCT_MSTR WHERE   STAUS='E' AND ACCT_CUST_CODE=:CUST_CODE)
           LOOP
               NEXT_RECORD;
              :ACCT_FD_NO :=CUR_R.ACCT_FD_NO;
           END LOOP;
        END;
    But the problem is i'm not able to display the captured value in next consecutive line items.
    It is getting displayed in first & second line item only.
    The first value gets displayed in first line item, then the cursor moves from first line item to second line item,
    the second value gets displayed in the second line item, (this is because of NEXT_RECORD in my code)
    later all the values are getting displayed in the second line item only. (I checked it using message call.)
    I want it to display one below the other.
    The problem is the cursor is not moving to third line item after the second line item.
    So the remaining values gets displayed in the second line item only.
    So what is wrong in my code??
    Where should i place the next_record to make the cursor move from one line item to next line item i.e from second line item to third line item
    & third line item to fourth line item & so on....  Please let me know.
    Thank You.
    Oracle Forms Builder 6i
    Oracle 9i.

    The above code is right..
    The only mistake was In the property palette of CUST_CODE, "required" was not set to "Yes" .
    So after setting required to 'YES' , it worked perfectly fine.

  • How to connect DMS with sales order line items

    Hi
    Our client wants to attach some documents in sales oder line items. They have a DMS system in place but how can we connect that to sales order is the quastion. Can you please suggest?

    Hi shrivastava,
    At first you have to create document in CV01n transaction with document type BVV ( as per standard) and add attachments
    Now in VA02, select line item-->EXTRAS--->DOCUMENT, find the document number created in CV01n and click on add
    system will add the attachment to sales order
    regards,
    santosh

  • How to change the currency in Billing plan in SO line item

    Hi Experts
    Pls help in following scenario.
    Company Code Currency: HKD
    Sales Document Currency: INR(Indian Rupees)
    Item Pricing Condition Currency(PR00): 100 USD
    Item Netvalue: 4800INR(System caluculated as per exchange rate type M)
    Document Netvalue: INR 4800
    The sales document item is linked to a billing plan.
    I wanted to maintain 100USD in the billing plan.
    When i goto Sales->item-->Billing Plan, The currency in billing plan screen is document currency and is greyed out.
    How to change the Currency in Billing plan (to Item Condition currency) and maintain the Billing value in USD?
    Pls help.
    Regds
    Hari

    Currency change we wanted to do is not during Invoicing.
    In billing plan itself we want to change the currency setup the billing value in item condition currency.
    Any one, pls help.

  • How to post GR to inventory account for sales order stock

    hello all,
    I made a PO with account assignment category M. But the system is picking consumption G/L account in the PO and posting to the same G/L account in GR. How to make it inventory G/L account?

    Hi,
       When we are giving account assignment in the PO line item means that we are posting the cost to the expence account.i.e.It is procure to consumption.That is why when we make GR for a account assigned PO line item we are not able to post the stock to inventory.
    So in the PO we cannot select a inventory GL account since we are mensioning that the item is accounted for certain account assignment.We can only mension consumption or expence account.
    regards,
    Ramabhupal reddy

  • Sales Order line item status change using STATUS_UPDATE

    Hi all,
    I need to change status of a Sales order item during (VA02) transaction. I have written an user-exit in MV45AFZZ (perform user_exit save_document_prepare- using STATUS_UPDATE FM and passing appropriate values to JEST_UPD and JEST_INS table for the FM. If the user chooses a status while changing the SO line item, it should be over written by another status which I supply in the user-exit.
    How can i achieve this? Please let me know if someone has achieved this?
    Thanks
    Ricky

    Hi Ricky,
    Instead of user exit , if you want to maintain a status update at the sales order item.
    Go to BS02 and create a status profile when you can give the approval and rejection node. also maintain the business transaction according to business requirement
    than go to vov7 and maintain this status profile at the item level.
    Try it out it will definately work.
    Regards,
    SAPSD000 ...

  • Net Value in Sales Order line item

    Dear Experts,
    Need a small favour.
    I need to know, how net value & tax is populated in SO line item.
    I have condition where
    Net Sales-Fix = 5.00 AUD
    Net Sales-Trading = 8.00 AUD
    Net Sales = 5.00 AUD (calculated as per routine for alternative cal type, which is taking lesser value of Fix & Trading).
    Sub-to - 3 (Carry over value to KOMP-KZWI3) is maintained for Net sales.
    But "Net value" in line item is wrong. I want value for  "Net sales" should be the net value.
    Please suggest, what should I do??
    Regards,
    Praveen

    Dear Customer,
    the netvalue is the sum of all condtions which are non statistical and active.
    (excluded taxes).
    If the netvalue shoud be value for "Net sales" then 'Net sales' should be the only active
    non statiscal condtion.
    Otherwise also other conditions have an influence to the net value.
    Please check all conditions in your document.
    I hope that the information are helpful.
    regards
    Claudia

Maybe you are looking for

  • Problem with iTunes in Windows XP

    I am having a problem loading iTunes in Windows XP service pack 2. Every time I click on it, it seems to load for a little while, and then a window pops up saying "iTunes has encountered a problem and needs to close". When I clicked on the details ta

  • ICal events show as all day on iPhone but are not all day how do you fix?

    When I have subscribed to my kids sport calendars some of the events show up in my calendar on my phone at a specific time but some show up as all day yet when you click into it, it shows a specific time. How do I fix this?

  • Trouble using Java on my MacBook

    I have tried everything and I am STILL having trouble using Java and Javascript on my MacBook. I have attempted to delete and reinstall Java. I have run the update. I have checked that both Java and Javascript are turned on in Safari. I am unable to

  • AppleScript and importing images into Address Book

    Hi all: I have a simple AppleScript that will create an Address Book entry. I want to import the picture as well, given a filename, but nothing I've tried will work. I get stuck on the fact that AB expects to be fed a TIFF picture, yet I can't figure

  • Scilab Gateway under Labview 8.2 and 8.5

    Hi Newsgroup, i am a Labview Starter and working for a longer time with Scilab. Herefore, the gateway function is a nice tool for me. When i create a VI with the Scilab Gateway, it works really perfect under Labview 8.2.1 (Jubilee Edition), but under