How to avoid, that a CPD-Customer will used in Sales ORDER?

Hi,
i will avoid, that the user inserts an CPD-Customer in sales orders.
It's only in quotation allowed.
Therefore i use include MV45AFZB with following code.
FORM USEREXIT_CHECK_VBAK USING US_DIALOG.
DATA: WA_KTOKD TYPE KTOKD.
IF VBAK-VBTYP <> 'B'.
  SELECT SINGLE KTOKD FROM KNA1 INTO WA_KTOKD
         WHERE KUNNR = VBAK-KUNNR.
  IF WA_KTOKD = 'CPD'.
    MESSAGE E010(ZZ) WITH
            'CPD-cutomer is not allowed!'.
    MOVE 'ENT1' to FCODE.
    EXIT.
  ENDIF.
ENDIF.
My problem is, that the user cannot chage the customer numer when error appears.
Is there another way to realize what i need, or is there a way to make the customer-Number
changeable in this case?
Hope anyone can help-
Regards, Dieter

Dieter
Have you tried using order block?
Firstly define an order blocking reason for CPDs and assign it to all relevant order types in config.
SPRO/IMG/Sales and Distribution/Sales/Sales Documents/Define And Assign Reason For Blocking
And then block all CPD customers using VD05 ( there will not be many, so it shouldn't take time).
Alternately
make it a warning in the code you wrote and copy the same code as an error while saving the order using
MV45AFZZ - USEREXIT_SAVE_DOCUMENT_PREPARE or USEREXIT_SAVE_DOCUMENT
Hope this helps.

Similar Messages

  • How  to grow the report of customer's openitem with sales order

    How  to grow the report of customer's open item with sales order?
    Now we can get the customer's open item with invoice No easily,but our end user need the the customer's open item also with sales order .And because a invoice to multi sales orders. I can do nothing.
    Now I have a idea that a develivey No with one sales order , and one invoice with a sales order's develivery ,then one inovice to one sales order .  I want to  know if other company have use this idea. Or have other solution for my problem.

    Hi Yuzhou Yang ,
      Yes you are right. In FI transaction you can get the sales invoice wise , reference field of the header data.
      As you are aware that while creating a sales order , no FI entry is generated.
      In my opinion you can get the required report through customization.
    Thanks
    D.K.Lakshmi narayana

  • How to find out which formulas have been used in sales orders of a period

    Hi Experts,
    I am trying to find out how much my users actually use the formula and average pricing. Therefore, I am trying to build a quick viewer by relating tables. In order to use the F&A pricing, they use one particular condition type ZFA1. By linking tables vbak and KONV via KNUMV, I can see in which orders they have used ZFA1, but I also want to find out which Formula they have chosen from the repository. As this is visible for the user from the sales order, there should be a table that stores it, but I cannot find it. Does someone know the table and can help me on this topic?
    If you provide the solution, I will definitely give you the reward points. Thank you in advance!
    Greetings
    Petra

    Hi Petra,
    Please try to check the table OICQ7 with KNUMV from VBAK.
    KR,
    Sergey

  • How to avoid that some text [instructions] will be printed in PDF (forms)?

    The idea is that some texts may be seen in the screen but not printed when the form is filled up.
    Adobe has information on this in ECycle but could not find any reference in Acrobat X or Indesign.
    It may be a solution to convert a frame text to a button and change thus its appeareance; but converting many continous texts in a form to single frames is a very dispensing task.

    Place the text in a text field and set its visibility properties to "Visible, but doesn't print".
    Alternatively, if the text is a part of the running text of the PDF and can't be placed in a form field, place a white form field on top of this text, and set that field's visibility to "Hidden but printable", so it would in effect hide the text underneath it when the file is printed, but will be invisible when viewed on screen.

  • I'm receiving some personnal SMS (through iOS 5 imessage) on an old iphone I've already sold. How to avoid that?

    Hi,
    I used to have an iPhone 3GS, which I recently upgraded to iOS 5 and sold. This device doesn't have any of my personnal information inside anymore (several resets and reinstall iOS5 from an blank iTunes on a seperate computer) and doesn't have my chip inside anymore.
    I am using a new smartphone (not Apple) now and when I text friends who have iPhone (with iOS 5 and iMessage), I receive some of the personnal responses on the old iPhone. It seems those messages are sent through iMessage...
    How to avoid that? I sold this iPhone and I don't want the buyer to receive my personnal message + I don't want to miss them on my new phone!
    Thanks for the help.
    Franck.

    I would suggest you read the user guide.  There IS no Facetime App for the iPhone.
    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf
    < Edited By Host >

  • When I am opening photoshop elements 10 I see my desktop picture into photoshop elements 10 ans I don't know how to avoid that

    when I am opening photoshop elements 10 I see my desktop picture into photoshop elements 1- and I don't know how to avoid that. Does anybody know I can get rid of that picture, so that I only see the workspace of Elements?
    Thanks a lot

    What I said--go to the Window menu and turn on the application frame.

  • How to avoid Java Studio Creator 2 to use the regional settings?

    How to avoid Java Studio Creator 2 to use the regional settings to select the language that will be used to display the IDE in a certain language?
    My country settings are set to Belgium (French) but I want to have my IDE running in English.
    What should I change in the defautl properties of JSC2 to avoid this behaviour?
    Please, don't tell me to change my regional settings, it is not a valid answer :-)
    Best regards,
    Abdelkrim BOUJRAF

    just modify creator.conf in directory etc/
    add: -J-Duser.language=en
    in the netbeans_default_options line:
    like this:
    netbeans_default_options="-J-Duser.language=en -J-Xms96m -J-Xmx384m -J-XX:PermSize=32m -J-XX:MaxPermSize=128m -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled -J-Xverify:none -J-Dnetbeans.javacore.background_scanning=true -J-Dsunappsrvint.home=\"C:\Program Files\Sun\Creator2\SunAppServer8\""

  • How to have a custom Item Number in Sales Order Items

    Hello Experts,
    We are creating a sales order using IDoc, sales order gets created but, its not taking value what we are populating in Item Number field for Item. Defualtly its filling 10,20 and so on...
    Is there any thing that I need to maintain, so that SAP accepts the custom number for Item number.
    Please help,
    Thanks,
    Suma

    Hi Suma,
    In VOV8, you can see the fields Number system..here u can see sub item increment u can enter 12 here then the next item number will be 500012, 500024 and so on. But if u want to maintain external number range then follow this steps.
    Determine which external number ranges are provided for the relevant
    document type. Choose the function "Maintain number range" of the
    document type (for example: Purchase order -> Maintain number range)
    for this purpose.
    Choose a number range and note its number.
    Enter the number of the desired number range.
    Thanks,
    Raja

  • We are using EBS 12.1.3.  When we input a sales order from a customer we input the sales order and specify the date the customer wants it.  This isn't always the date that we intend on manufacturing it though.  I need to put a customer due date in, but be

    We are using EBS 12.1.3.  When we input a sales order from a customer we input the sales order and specify the date the customer wants it.  This isn't always the date that we intend on manufacturing it though.  I need to put a customer due date in, but be able to put a date in another field that MRP can read in the event we choose to manufacture based on another date.  For example, early.
    Any help would be appreciated.

    What you are experiencing is 100% related to Malware.
    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • How to attach that object_library to a form using jdapi?

    Hi!
    I am doing a migration process from Forms 6i to Forms 10g, and I need to attach an object_library object to a specific form using jdapi. The object_library that I want to attach is the web_util object_library.
    How to attach that object_library to a form using jdapi?
    Thanks.

    I had never used JDAPI before reading your post, but the attached code creates a minimal WebUtil-enabled form from scratch -- adapting it to update an existing form should be fairly straightforward. I've only been coding in Java for about a year, so consider this only as a starting point -- there may be better, easier ways of doing this.
    import oracle.forms.jdapi.*;
    public class Driver {
      public Driver() {
        /* create a minimal form */
        FormModule frm = new FormModule("JDAPI_DEMO");
        Block dummyBlock = new Block(frm, "BLK_DUMMY");
        Canvas dummyCanvas = new Canvas(frm, "CVS_DUMMY");
        Item textItem = new Item(dummyBlock, "TXT_DUMMY");
        textItem.setCanvasObject(dummyCanvas);
        /* open WebUtil object library */
        ObjectLibrary olWebUtil = ObjectLibrary.open("c:/ora10g/forms/webutil.olb");
        /* attach WebUtil PL/SQL library */
        AttachedLibrary alWebUtil = new AttachedLibrary(frm, "c:/ora10g/forms/webutil.pll");
        /* loop through each tab in object library */
        for (JdapiIterator it=olWebUtil.getObjectLibraryTabs(); it.hasNext();) {
          ObjectLibraryTab olt = (ObjectLibraryTab) it.next();
          /* loop through each object in tab */
          for (JdapiIterator it2=olt.getOwnedObjects(); it2.hasNext();) {
            JdapiObject obj = (JdapiObject)(it2.next());
            String className = obj.getClassName();
            /* handle module parameters */
            if (className.equals("ModuleParameter")) {
              ModuleParameter mp =
                new ModuleParameter(frm, obj.getName(), (ModuleParameter) obj);
            /* handle object groups */
            if (className.equals("ObjectGroup")) {
              ObjectGroup og = new ObjectGroup(frm, obj.getName(), (ObjectGroup) obj);
        frm.compile();
        frm.save("c:/jdapi_demo.fmb");
      public static void main(String[] args) {
        Driver drv = new Driver();
    }

  • My new iphone won't flip sideways, how do i make it so it will use the wide screen?

    my new iphone won't flip sideways, how do i make it so it will use the wide screen?

    Is rotation lock on?  If it is, you'll see most of a circle at the top of the screen with a lock in it.
    Double click the home button, swipe the bottom row left-to-right, look at the leftmost icon.  If there's a lock there, click it.  Then click the home button.

  • How to club the downpayment and periodic billing scenario in Sales Order

    Hi experts,
    Could you please let me know how to club the downpayment and periodic billing scenario in Sales Order.
    Requirement is :  If you have 10 lacs total amount and out of that 50% should be the downpayment and rest of the amount should be distributed among three equated  instalments for 2 months each (periodic billing). This should work with one line item in sales order. Pls provide relevant inputs how to work out this scenario.
    Your help would be appreciable.
    regards....Diwakaran

    Hi Yang,
    Workflow is the best approach for any issue related to business objects.
    Since you want call FM BAPI_SALESORDER_CHANGE, it will change SO. It means everytime any SO is changed there will an event being triggered.
    object type: BUS2032
    event: Changed
    simple solution:
    1. Please create object type (SWO1) and its super type should be BUS2032.
    2. Add your own method and attach your custom FM which actually updates the qty & PR)
    3. Create Task (PFTC_INS)
    in basic data:
    - provide object type which you have created
    - provide method which you have added
    goto triggering events tab
    - Choose Object Category as BOR object type
    - provide object type (better give BUS2032)
    - provide event as CHANGED
    Please have look into very nice video blog which helps you to create your workflow.
    blog: [Creating your first SAP Business Workflow]
    Regards,
    Sukhbold Altanbat.

  • Customer error message in sales order on save

    Hi Friends,
    as per requirement i have to raise the error message and system should enable the field to change values. This should happen when condition is not met on Saving of Sales order.
    For this, i have used the user exit USEREXIT_SAVE_DOCUMENT_PREPARE. But the problem is system throwing error message and all r in display mode only. as per my requirement system should allow to change the error value field.
    i have verified many posting in this SDN, but nothing is working out.
    Please guide me, how to raise the error message and system should enable that filed.
    My doubt is where should i raise the error message in sales order (MV45AFZZ)??? if any badi to raise the error message also fine for me. I tried many ways like... message with display like..... and set / get parameters and badis....  but not able to find the correct solution.
    Thanks in Advance.
    Bala

    Hi
    You need to use check for enahcement spot, which will be help to you.
    Bcz you are throwing custom error message in the standard transaction, once the error is display, you could not able to change the values. your prob can be solved by using the enhancement sport.
    This is include name (Include:MV45AF0B_BELEG_SICHERN).
    In the above include, you need to create a enhancement spot after this spot (ENHANCEMENT 16  OI0_COMMON_SAPMV45A.)  
    write your custom code and while displaying an error message. set flag = 'x', then use below code. It will display error message once you press ENTER, you will get the sale order in change mode, you change the values.
      IF flag = 'X'.
              fcode = fcode_gleiche_seite.
              perform fcode_bearbeiten.
              ch_subrc = 4.
              exit.
            ENDIF.

  • Custom push button in sales order

    HI gurus,
                   I need to create a custom button(push button) in VA01 in custom tab additional data 1(header level).Please let me know the steps..
    Moderator message: please search for available information first.
    Edited by: Thomas Zloch on Mar 3, 2011 2:13 PM

    hi,
    yes u can do that,
       in table definition se11,
    append the sales order item structure and include ur custom field with proper data element and domain for data type allocation,and
    u will have to change the screen with screen exit to fit in new custom field where ever required, and lastly
      u will have to write a logic in sales order user exit include to pass the value to std table when perform happens.
      if these three points are met then u will achieve this.
      should take abapper's help
    reward if helps !!!!!!!!!!!!!

  • How can i find differnet output types for a given sales order ?

    hi all,
    answer my question please........?
    how can i find differnet output types for a given sales order ?

    hi
    check in NACO transaction if you have assigned access sequence to your output ytpes and if you have ticked checkbox "Access to output conditions" - otherwise it will not even try to access condition records.
    From help :
    Access to output conditions
    Indicates whether the system determines the output by searching for valid
    condition records.
    Procedure
    If you want the system to search condition records for the appropriate
    output, mark the field.
    Note
    If you leave the field blank and if you are processing sales, shipping,
    or billing documents, the system automatically determines output from
    information stored in the customer master record.
    regards
    ravish
    <b>plz reward points if helpful</b>

Maybe you are looking for