Change partners (CR/SP) in Sales Document

Hi All,
         I have a requirement where I need to change the partner (forwarding agent CR/SP) in sales order if the shipping condition is manually changed in the order. Which is the best possible way to accomplish this task? I am using USEREXIT_SAVE_DOCUMENT_PREPARE in MV45AFZZ. The code is as follows.
IF SY-TCODE = ‘VA02’
SELECT SINGLE PARTNER INTO V_PARTNER FROM ZCARRIER
  WHERE LAND1 = V_LAND1
  AND   LZONE = V_LZONE
  AND   VSBED = V_VSBED
  AND   TRAGR = V_TRAGR.
  IF SY-SUBRC = 0.
    SELECT SINGLE * FROM LFA1 INTO WA_LFA1
    WHERE LIFNR = V_PARTNER.
    LOOP AT XVBPA WHERE PARVW = 'SP'.
        XVBPA-LIFNR = V_PARTNER.
        XVBPA-ADRNR = WA_LFA1-ADRNR.
        XVBPA-NAME1 = WA_LFA1-NAME1.
        XVBPA-UPDKZ = 'X'.
        MODIFY XVBPA.
    ENDLOOP.
  ENDIF.
ENDIF.
The code above does not accomplish the task completely. I am able to see the updated Partner on the screen of partners tab of the sales order but it doesn’t update the VBPA (Sales Document: Partner) table. I guess I am missing some thing else.  Any help is appreciated.
Thanks,
Giri..

Hello Seshu,
Could you be more specific?
I have to do a similar job. I have to make VA01 to choose forwarder from a list of possible forwarders, and I got to the point that in the partners list ALV from va01, I complete the partner number, but i can't make it take the complete dates about that number, for the rest of the columns in Partner list(Name, street,...).
I tried in debbuger to find ADRC table but it does not exist in INCLUDE MV45AFZZ.
Many thanks,
Elena

Similar Messages

  • Prof Analysis characteristic changes KEA5 Customer Master to Sales Document

    hello gurus
    I need some help with this pa configuration change. our office in india wants to amend the 2 characterictics in bold in pa transaction kea5. currently they look at origin table - customer master sales data. charac details below No other changes will be made
    charac     desp     sht text     datatype     lngt     origin table     orig field descrip
    bzirk     sales district     sistrict     char     6     knvv     bzirk
    vkbur     sales office     sales sff.     char     4     knvv     vkbur
    business want to change these two characteristics from knvv to pick up the details from sales document order - table vbak for sales office and vbkd for sales district, so it matches with their mcsi. please note a number of changes are required on bw. But I am only concerned about pa changes, my colleagues will pick up bw changes.
    please can I get some help with this configuration task, as I've never configured pa - It appears to be more complexed than regular fico config. I believe it is a fairly small change via transaction kea5, is that correct
    please kindly provide the following information - 5 points below
    1. intend on deleting these two characteristics linked to knvv and then linking to vbak and vbkd respectively.
    2. the characteristice for vbak and vbkd already exist in config kea5, so I don't believe I need to recreate anything new, just pull in the fields, and link to the relevant characteristics.
    3. please can you confirm if I only need to amend kea5 to configure the above scenario? Or are there any other tables/areas in spro I need to amend.
    4. please can you provide me with step by step details on what I need to do to configure this new characteristic and scenario correctly.
    5. finally please can you provide me details of what testing I need to do to test this change.
    Thank you all very much.
    Awaiting feedback from all pa gurus, thanks in advance
    Thanks
    Jay
    Edited by: Jays77 on Jan 6, 2011 1:17 PM
    Edited by: Jays77 on Jan 6, 2011 1:18 PM
    Edited by: Jays77 on Jan 6, 2011 1:19 PM

    Hello Ajay / and All -
    Thanks very much for your feedback. I have carried out your configuration via KEDR, and created the derivation rule. Is it really as straight forward and I dare not say that easy, to create a new characteristic value.
    Is there absolutely no additional configuration required via kea0 - Maintain Operating Concern or kea5 maintain characteristic values. I agree we have added this derivation rule and I can to some extent understand what we've done, but in kea5 and kea0, the old characteristic value and fields are still there - as detailed below. So it is still mapping to the old characteristic values, I can only assume this derivation rule overwrites what is in kae5 and kae0, is that correct.
    charac  desp             sht text  datatype  lngt origin table orig field descrip
    bzirk      sales district  sistrict   char         6        knvv           bzirk
    vkbur    sales office     sales sff. char     4        knvv           vkbur
    I just want to make extra sure, I don't need to delete these old characteristic values, and add the new characteristic values to KEA5 and KEA0. The new characteristic values are not on kae5 and kae0 - hence my concern.
    Please kindly confirm configuration if any addition config is required, or only changes via KEDR as explained in your previous reply.
    Thanks again for your help - Much Appreciated.
    Jay
    Edited by: Jays77 on Jan 6, 2011 3:02 PM

  • STWAE-Change a statistics currency in sales document

    Hi,
    I have 5 Sales Order and 4 Bills with a statistics currency and I need to change this statics currency by another.
    Someone known if is it possible this change? How?
    Thanks in advance!
    XeviG.

    Hi,
    Document currency is the currency appearing at the header of the document under "Pricing and Statistics " tab. The field label is "Doc Currency". Hence there is no mistaking it. It can flow from the customer master , or can be manually entered in the sales order.
    Condition record currency is the currency one enters at the line item level.
    System will always convert the item level value into document currency value. For instance, if the line item amount is 100 USD and doc currency is INR, then condition value will be 4000 INR, if the exchange rate is 40 INR / USD. Also please note that net value of the line item and sales document will always be in document currency.
    Muraleedharan.R
    091 9880028904

  • Price change made in billing docu. should reflect in sales docu.

    All,
              My requirement is, when we change the price in a billing document(invoice) it should reflect back in the sales document. Is it possible to do this and if so how do we do this? Can any one please help me out.
    Thanks
    Visu

    Hi Vijay,
    No it is not possible. You can only update the pricing in sales document and it can be updated in invoice and not vice versa. But in order to do that you need to do the credit note and reverse PGI and do the returns delivery if it is delivery related billing, but if it is order related billing then you can just create a credit note and change the price in the sales document and then invoice again.
    Reward points if the answer is helpful
    thanks
    regards
    ravi

  • Change the order type for a sales document already created

    Hi gurus,
    please let me know if there is any possibility for changing the order type for sales document (sales order) already created,
    thank you

    Hi,
    Rambabu is correct. Check the  alternate sales document types which your current sales document type is having in VOV8 transaction. You can have the current sales document type replaced with the assigned alternate sales document type 1 or alternate sales document type 2 during run time in the during creation  or change mode  subject to the current sales order is not having any subsequent document. Re-pricing will happen accordingly and all the things of order will get redetermined.
    Hope this explains.

  • Why should we create a new sales document type

    I want to know the actual reason behind creating new sales document type when the standard document is available

    General procedure when setting up sales document types
    You have three options for configuring new sales document types:
    1. Change an existing sales document type.
    2. Copy an existing sales document type and change it according to your requirements.
    3. Create a new sales document type.
    Recommendation
    For small changes, SAP recommends that you copy similar existing sales document types in the standard SAP R/3 System and make the appropriate changes. Small changes might, for example, be, a changed description, a different number range or a different increment for the numbering of items.  The name is to start with the letter Z as SAP keeps this range free in the standard system.
    This procedure has the following advantages:
    All the specifications of the existing sales document type are copied. In particular, the data concerning, for example, partner determination, pricing or document flow which you would otherwise have to edit manually is copied.
    You can test your new sales document types in respect to the settings made without having to edit the other settings.
    When copying sales document types, item categories and schedule line categories, the SAP R/3 System automatically creates a log with the copied data. Using the log, you can check whether all of the copied data applies to your sales document type or whether you need to make changes.
    Actions
    1. If you need to make further changes, you should define new sales document types. To do this, you enter an alphanumeric key with a maximum of four characters for a sales document type and a textual description for the key.
    2. Maintain the specifications on the detail screen according to your requirements.

  • Deleted sales Document - Unique issue

    Hi Experts,
    We have created a contract (VA41)in the system, but failed to save or deleted by somebody. How can I see the document whether it is deleted?
    I treid with tables Tables CDHDR, CDPOS
    Use Change doc. Obje = VERKBELEG (sales documents)
    But no results, can anybody suggest?
    Prase

    Try this,
    GOTO SE16—Enter table name VBUK—Press table contents (F7)—GOTO Settings and Field for selection—select Field name BLOCK and enter
    In BLOCK enter ‘A’ i.e. Document has been selected for archiving and execute.
    Sthen

  • Delta changes in R/3 sales document are not coming into CRM

    Hi Middleware experts,
    We are on CRM 5.0 SP 005 with ECC 5.0 SP 007 and using the scenario X for sales documents replication.
    Now the order is created in CRM and successfully transfered to R/3. I can see 3 Bdocs in SMW01 with green lights. First Bdoc says 'R/3 adapter is called', second Bdoc says 'the order is successfully saved' and displays a warning 'The sales document is not yet complete: Edit data' and third Bdoc has no messages. Also I do not see any struck queues in CRM and in R/3
    I am able to edit the sales document in both the systems as per the scenario X. Now I have completed and saved the document in R/3. Surprisingly these changes are not coming into CRM and no new entries in SMW01. Also R/3 SMQ1 and CRM SmQ2 doesn't show any entries. I am also not able to debug, since I do not see any Bdocs in SMW01.
    Now, if I changes the document in CRM and these changes are coming into R/3.
    Also all documents created in R/3 are successfully going into CRM including delta changes in R/3.
    I do not have any clue on what is happening? Highly appreciated, if you can help me.
    Thanks,
    PK

    Hi PK,
    In R3AC1 only we put the filter. So if you do not have any other filter then make sure that you are changing the order which was created not before the date mentioned.
    I would recommend you to just deregister the CRM system in R/3 Transaction SMQS and do some changes in the orders and check any queues are getting created corresponding to that order, If yes that means filter is not an issue. Then debug the queue and find the exact problem. Also make sure that the order you are changing in R/3 is of the same order type what you have mentioned in the filter.
    Make sure to registor back the CRM other wise all the queues will get stuck in R/3 outbound.
    <b>Reward points if it helps!!</b>
    Best regards,
    Vikash.
    Message was edited by: Vikash Krishna

  • Populating the Partners from Sales document (Customer/Sales order/delivery)

    Hi All,
    Is there any way to Populate the Partners which are mantained in Sales document (Customer/Sales order/delivery) into Customer Quality notification (Q1)
    Presently only Sales to party and ship to party is getting populated when we create Q1 notification.
    Thanks in advance
    jay

    Explore :
    Quality notification>Notifcation creation->partner->Define partner fuction procedure->Assign Partner Functions to Notification Type--->
    Check here whether you can get here the partner function.

  • Error while changing CRM Sales Document in R/3

    Hi All,
    I have done the download of customizing, condition & business objects in CRM 4.0.
    Now when I create a sales order in CRM, it gets replicated in R/3. I can see the order in tcode VA03.
    But when I try changing the same sale order in R/3 using tcode VA02, I get the following error:
    "Sales document &1 (5001169) is currently being processed (by user RFCUSER)"
    Would appreciate help from the group.
    Many thanks !

    Hi Krishna,
    The middleware user is locking the order so the document has not distributed through the system properly. 
    Try looking at the inbound queue (transaction SMQ2) and outbound queue (SMQ1) for errors.  Also look at the BDocs in error (SMW01).
    When CRM sends an order to R/3 it waits for a confirmation to be returned, looks like the problem is here, maybe in your delta downloads not being set correctly.
    Cheers
    Andrew

  • Error in Change Log of Sales Documents

    When i try to see the Change Log of sales document (Tools> Change Log) I get an error message
    No matching records found " (ADOC)(ODBC - 2028) [Message 131-183]
    What can it be ?

    Yes it should, but maybe those documents were created before the "History / Log" in General Settings > Services were changed from 0 to (example) 99.
    Only after this action, information will be recorded in the Chang Log.
    Regards
    Carin

  • Change the condition type based on sales document type

    Dear ALL,
    I have created a condition Zxxx which is a fixed calculation type for the documents created by the upload from external tool to SAP.  I created this condition because external tool is using a 15 place decimal which SAP doesn't allow and if the normal condition type Zyyy is used SAP calculates once in SAP and there are rounding issues.  What the Zxxx condition type does is accept whatever value is sent up from external tool to SAP, regardless of the quantity.  The problem is that whenever they create a credit with reference, in SAP and they want to do a partial credit, the Zxxx doesn't take the partial quantity into consideration and doesn't change the value. 
    Is there a way to force SAP to change the condition type from Zxxx to Zyyy based on sales document type without recalculating the whole document because that would again, cause rounding issues.  We would need to have the calculation done only on quantities changed in the credit memo request .
    please advice me. your inputs are highly appreciated.
    TIA
    KOGI

    Dear ALL,
    someone please help me with this issue. your inputs are higly helpful.
    TIA
    KOGI

  • Mass Change billing block on Sales document.

    Hello Experts,
    I have 5000 sales documents which are blocked with billing block on header level. Please suggest me how to MASS remove all these billing blocks from these sales documents.
    Thank you.

    create a CATT script of LSMW to record the change sales order process, and then run through the data.

  • How to change schedule line fields when save sales documents in va01/va02

    Hi, every Experts,
    I want to change schedule line when save the sales documents in va01 or va02, such as change delivery block or schedule line category.
    of course, can use user exit USEREXIT_SAVE_DOCUMENT_PREPARE, but I do not know to use this user exit, I am newer about ABAP.
    Please help me , thanks.
    best regards
    Passion Wu

    Hi,
    For changeing schedule line: select line item, GOTO --> item --> schedule lines --> enter the confirmed qty.
    USEREXIT_SAVE_DOCUMENT_PREPARE program is MV45AFZZ
    For your reference
    USEREXIT_SAVE_DOCUMENT_PREPARE - Can I use in button, but skip
    regards,
    Mohanprabu C

  • Sales document header-- head text changes not working in VA01 if we rasie with reference to quotation

    Hi,
    Greetings!!
    We have raised a quotation, in this quotation we have manually updated Job number (1234) and project number (9876) in header--> header text and saved the quotation.
    With reference to this Quotation we raised a sales order(VA01)  and here we have changed job number from 1234 to ABCD and project number  from 876 to EFGHIJ and saved the sales document but system by default takes quotation  job and project number only. If we go to change mode of sales document (VA02) our changes working fine.
                    ould you please let us know how we can overcome this issue?  Or this is standard  behavior or what?
    Regards,
    Sree

    Hi,
    Text determination configuration is done in VOTXN
    check VOTXN for your text determination procedure and under access sequence check if there is any routine added

Maybe you are looking for

  • External HD for use with Time Machine

    I have a new MacBook Pro with 320GB HD. I want to buy an external HD to use with Time Machine for a back up. HOw much capacity should I be looking at for the external? Is 500GB enough or is it possible to partition a 1TB unit for use as backup and ex

  • I have just won an iphone 3gs in a raffle but when i put in my sim it tells me that it is not supported how can i get the iphone to work

    I have just won an iphone 3gs in a raffle but when i put in my sim it tells me that it is not supported how can i get the iphone to work?

  • Web Service access with J2EE1.3?

    Hi, I'm relatively new to the whole Web Services technology, so my question might be dumb... but anyway: What I'm trying to do is to write some code to access a Web Service (I'm not trying to make one, it's supplied by an outside provider). We curren

  • IPhoto printing a border when it shouldn't

    One specific picture in iPhoto is printing out with a border, no matter what I do. I have the paper size set as custom (7.5x5.5), and I have tried printing with print size set to both borderless and custom (also 7.5x5.5). How do I get it to print edg

  • Viewing a file

    I am very new to java server pages and I want to take a file that is saved in my database and let the administrator view that file. These files can be images or .doc's. I want to use a select statment and a where clause to choose the file. I think I