Writing customer code in SALES ORDER MODULE using UI API.

Hi Experts,
I have a problem in writing a data in Sales Order fields...
here's the scenario
after i select the business partner code in my UI i want it to write the customer code in customer textbox of the Sales Order module.
but after i write the error appears.
error: {"Item - Can't set value on item because the item can't get focus.  [66000-153]"}
Please help me in this problem.
thanks,
Edited by: Joey Bryan Dante on Aug 26, 2011 7:38 AM

Dim oItem As SAPbouiCOM.Item
                            Dim oItems As SAPbouiCOM.Items = oForm.Items
                            oItem = oItems.Item("3")
                            Dim oEdit As SAPbouiCOM.EditText
                            oEdit = oItem.Specific
                            oEdit.Value = oCardCode
this is my code.
thanks,

Similar Messages

  • Default Customer code in Sales order

    Hi Experts ,
         Is there any option in SAP B1 to set a 'Cash' Customer as default when the sales order is loaded , After adding a document and in New Document Menu click. If there is no option in SAP B1, how can I do it using SDK. I already wrote code in '1282' menu click, and sales order Form Load. But i cant able to set the Default customer after adding a Sales order and the document refreshed to a new document.
    I tried to do the same in FORM_DATA_ADD , BeforeAction=False and ActionSucess=True, but it cause some problem if document total is ZERO, when system message is pop up..
    Is there any solution for this.
    Thanks .

    Hi,
    You can solve it with the following work-around:
    create a query that will always return the relevant CardCode (for example: Select '1') and save it in the Query Manager.
    In the Sales Orders form, in the Card Code field, create a FMS with the above query. Define it to always refresh on change in filed Doc Num,
    This setup will set card code '1' in the field after a new Order was created, of when pressing "Add" menu.
    It does NOT work when clicking "Sales Orders" menu, but you said you've already solved it by code.
    Another thing - if your handle several Document Series for Sales Orders, or  your users set DocNum manually, you might set the FMS to be refreshed upon change of some other appropriate field.
    Beni.

  • Populating Customized fields in Sales Order Creation using BAPI

    Hi All,
    I have a requirement that, I need to populate 2 customized fields which are appedned in the VBAK tables through Append structure. I am using BAPI_SALESORDER_CREATEFROMDAT2 FM for creating it.
    Could anybody tell me how to send these 2 coustomized field values in this BAPI using EXTERNIN parameter.
    Regards
    Rajesh
    [email protected]

    Hi,
    To add data to custom fields there are two appraoches.
    <b>1)</b>Using the <b>EXTENSIONIN</b> in the Tables option in the FM <b>BAPI_SALESORDER_CREATEFROMDAT2</b>
    Check the Documentation for the same,
    <b>Customer Enhancement for VBAK, VBAP, VBEP</b>
    <i>Description</i>
    You can use this parameter to transfer user-specific enhancments to a BAPI. The customer has to complete the EXTENSION structure and the system automatically continues processing it. If you have not defined any user-specific fields, then you can transfer a blank EXTENSIONIN structure.
    <b>Technical information about Customer Enhancements</b>
    The following description uses an example to explain how to proceed with customer enhancements to the SD tables VBAK, VBKD, VBAP and VBEP.
    The customer has added their own fields to table VBAP using the INCLUDE structure CUTEST. This structure contains 2 fields:
    CFIELD1, CHAR 10
    CFIELD2, CHAR 3.
    The customer also requires that these two fields can be maintained with the BAPI.
    1. Maintain structure CUTEST in table VBAP
    2. Because the BAPIs work with checkboxes, you must also define a CUTESTX checkbox for the customer structure. It should be structured like this:
    Field name       Data element
    CFIELD1            CHAR1
    CFIELD2          CHAR1
    3. Define these customer structures in the structures VBAPKOZ und VBAPKOZX using INCLUDE or APPEND.
    4. Add the customer structures to the BAPE_VBAP and BAPE_VBAPX BAPI structures using the APPEND technique.
    5. Adjust the following structures for customer enhancements to table VBAK:
    a) VBAKKOZ
    b) VBAKKOZX
    c) BAPE_VBAK
    d) BAPE_VBAKX
    6. Adjust the following structures for customer enhancements to table VBEK:
    a) VBEPKOZ
    b) VBEPKOZX
    c) BAPE_VBEP
    d) BAPE_VBEPX
    7. Generally, the data should be added to the BAPI interface in the internal communication structures (VBAKKOM, and so on). There, you can process the data in the SD tables (VBAK, and so on).
    8. If the EXTENSIONIN parameter contains customer data, you must complete at least the key fields in the relevant standard parameters.
    <i>For example:</i>
    You want to change customer field VBAP-CFIELD2 for item 20 to "XYZ" in order 4711.
    The following entries are expected:
    Import:     BAPIVBELN-VBELN       = '0000004711'  Document number
                BAPISDHD1X-UPDATEFLAG = 'U'           UPDKZ for doc header
    Tables:     BAPISDITM-ITM_NUMBER  = '000020'      Item number
                BAPISDITMX-ITM_NUMBER = '000020'      Item number
              + BAPISDITMX-UPDATEFLAG = 'U'           UPDKZ for item
    You must complete the EXTENSION table as follows:
    STRUCTURE                          VALUEPART1       1234561234567890123
    BAPE_VBAP                       0000004711000020                 XYZ
    BAPE_VBAPX                      0000004711000020       X
    <b>Further Information</b>
    You can find more information in the BAPI programming guide in the chapter for enhancements to BAPIs.
    Notes
    You must complete the STRUCTURE field with the name of the relevant enhancement structure (BAPE_VBAK, BAPE_VBAP, BAPE_VBEP). You can complete the remaining fields with the append structures from the enhancement structures.
    At the moment, you can use the BAPI to store enhancements in the following structures:
    VBAK : An enhancement to header data requires an append structure to BAPE_VBAK and an enhancement to structure VBAKKOZ.
    VBAP : An enhancement to item data requires an append structure to BAPE_VBAP and an enhancment to structure VBAPKOZ.
    VBEP : An enhancement to schedule line data requires an append structure to BAPE_VBEP and an enhancement to structure VBEPKOZ.
    VBKD : If you are using an enhancement for header data, you must add an append structure to BAPE_VBAK. You also need to enhance structure VBAKKOZ. If it is for item data, you need to add an append structure to BAPE_VBAP. You must also enhance structure VBAPKOZ.
    If you also want to work with checkboxes, each X-structure must also contain an append structure.
    For example:
    A customer has created an order and wants to include the material long text (50 digits long).
    The EXTENSIONIN structure must be completed with BAPE_VBAP. Two fields have fixed definitions in this structure. These are in the VBAP host key (VBELN, POSNR). The customer sets up an append structure that contains field ZMAT50.
    Because the VBELN is normally blank when you create an order, the data can look like this:
    STRUCTURE   |BAPE_VBAP
    <b>2)</b> Create the Sales Document using the FM and when successfully craeted you will get the Sales Document No in the Export parameter <b>SALESDOCUMENT</b>.
    After its created and Committed using <b>BAPI_TRANSACTION_COMMIT</b> , do a <b>BDC</b> recording for the same to (<b>VA02</b> Change Sales Order) update the fields only and save the document.
    Regards,
    AS

  • Need sales order creation using bapi in oops

    need code for sales order creation using bapi in oops

    hi rocky,
              could you pls give a bit explanation on what you are expecting.
    regards,
    Pavan

  • Function Module to fetch Customer Number from Sales Order or Process Order

    Hi Gurus,
    I am looking for a Function module which gives me customer number from Sales order or Process order.
    Please let me know of any FM's available.
    Regards,
    Madan

    Hi,
    Thanks for your response.
    I am actually looking for function modules which take "Sales Order" or "Process Order" as input (import parameter) and return Customer Number as output (export parameter).
    Please suggest some function modules you know any.
    Many Thanks,
    Madan

  • Need code for sales order create report using bapi's

    need code for sales order create report using bapi's

    Hi,
    Go through below link
    http://www.saptechies.com/bapi_salesorder_createfromdat2/
    <b>Reward points if it helps,</b>
    Satish

  • Need code for Sales order creation in oops using xi as integration server

    Need code for Sales order creation in oops using xi as integration server.

    hi rocky,
              could you pls give a bit explanation on what you are expecting.
    regards,
    Pavan

  • One time customer postal code in sales order

    hi
    For the one-time customer, it is required to input the postal code in sales order. How to disable it? As I already disable it in customer master. pls advice. thanks

    Dear Friend,
    The mandatory feilds in the customer Masters can be set to non mandatory in the account group sequence.
    Go to transaction OBD2 account group change.
    Then select your account group of your customer.
    Tehn select the address feilds you will find the customizing of the entries.
    Whether it is mandatory supperreses or optional entries.
    Now you can make it optional entry.
    reward points if helpful,
    regards,
    Amlan Sarkar

  • Error in sales order creation using bapi

    Hi,
    Iam trying to create sales order by using BAPI_SALESORDER_CREATEFROMDAT1 and when iam trying to execute
    the function module by passing all th eparameters and iam getting the error as
    inspite of entering sold_to_party and ship_to_party details in table ORDER_PARTNERS
    "enter the sold_to_party or ship to party details"
    please help me out in this isue its an urgent.
    Thanks.
    sayed.

    Can you share the codes ?
    Thanks.
    Ashish

  • Need to copy a custom field from sales order to billing document

    Hi All,
    I have a requirement, I need to add a new field in the sales order header part and even a field in the billing document, once i add this field up in both the documents in the header part i need to create a copy routine using the VOFM tran, can any body help me on what's the procedure to add a field in billing document and does the copy routine transfer the data ( Custom Field ) from Sales Order to the Billing Document, if yes can somebody help me with the procedure on how to and code of it.
    solved it myself ....
    Regards.
    Message was edited by: seshi
            seshi

    Hello,
    Regarding item 1, is it in the region of the global links (ie logout, home, preferences, etc.)? If not, have you tried creating a link via personalizations to the region you wish to have the link displayed (item type = link, destination = fully qualified name of your .xml page/region?
    Regarding item 2, you may have to create the custom subtab programatically using the controller for the region of the current subtab layout.
    Regarding item 3, you can also add a submit button to the page button bar region via personalizations. You can then add any logic you want to the button in the controller for the page.
    Hope this helps.

  • Report for Sold to Party code against Sales order number

    Hi,
            Is there any standard report to take out the Sold to Party code against Sales order number as i have the sales order number.
    I don't want to use Tables ,so pls tell standard report if any.

    Dear   Monty garg.
    You can use u201CVA05Nu201D to find the sales orders which have been created against for the particular customer/sold to party.
    Please let me know if any further clarifications pertinent to this.
    Thanks&Regards
    Raghu.k

  • Security object for shipping conditions (T-Code VA02-sales order)

    Hi
    I need to gray out filed-VSBED (shipping conditions) in T-code VA02 (sales order change) for users, what could be the security object to be used for this requirement?
    Regards
    sri

    The functional requirement till doesnt seem very clear to me , why would someone want to grey this field? (unless you have a strong case that you use different document types for normal orders, express deliveries, normal service, free of charge and a whole lot of possibilities)
    Your SD consultant should guide and let you know that:
    Shipping conditions are defined in customizing
    you can eithe assign particular shipping conditions to particuar sales document types to make it as a default
    (or) you can have the shipping conditions defined in the customer master
    the ones set up in SPRO take a preference, but as you rightly noticed - if a use wishes to change the shipping conditions proposed by the system he would be able to do that, and this CANNOT be controlled with authorization objects
    The only option you would have, is to find out if the users who are not suppposed to change the conditions beong to the same user group (or make a logical assesment on the common binding feature in the set of users)
    then evaluate if you want to make the program changes such that the changes affect only the particular set of users
    Note: Changes you make in ABAP do not necessarily apply to the complete user base - it depends on how well you analyse and plan the requirement

  • Error in creation of sales order bu using BAPI_SALESORDER_CREATEFROMDAT2

    Hi ,
    I am trying to create sales order by using bapi.
    after passing all the parameters to bapi iam getting message as shown below.
    SALES_HEADER_IN has been processed successfully             
    SALES_ITEM_IN has been processed successfully               
    <b>Order receipt/delivery not possible, credit customer blocked</b>
    I had passed scedule line data ,and  BAPI_TRANSACTION_COMMIT
    also still iam getting this message.
    please help me out of this problem.
    Thanks,
    Shuja.

    Hi Shuja
    I guess the message is just a warning eventhough the order is created. The warning message states that Auto-Delivery can not be created.
    Please check below to understand how the customer is blocked:
    1. Manual Block -> Transaction XD03
    -->Menupath: Extras->Blocking Data
    2. Credit Block -> Transaction FD33
    --> In the overview screen check the difference of value between Credit Limit & Credit Exposure
      I guess in the case whereby Credit Limit value is less than Credit Exposure also this can happen.
    Please try using a different Customer. Also simulate via transaction VA01.
    Hope this helps.
    Kind Regards
    Eswar

  • Customer Name on Sales Order not in Data Collections

    Hi,
    I am looking for some help. My company just did an upgrade from 11i to R12 in the middle of May. As part of the upgrade we installed ASCP. We have noticed that certain customers are not being collected when running Standard Data Collections. We have open sales orders in the system for the customer. The sales order are being collected properly and appear in the plan. When we show the Customer field in the 'Supply/Demand Screen' in ASCP, the field is blank for select customers. Is there anything on the customer master or sales order line that would prevent the customer name from being collected? Any insight would be helpful.
    Thanks
    Rich

    You can go to order organizer screen select the OA NO which you are not able to see in the ASCP workbench, go to line items---using show field get the Demand visible
    tab on screen-----default value should be 'Y' if blank then then that could be the one of the reason.

  • How to resrve the stock to the customer against the sales order

    hi,
    sap gurus,
    good morning to all,
    how to reserve the stock to the customer against the sales order if this process is not MAKE TO
    ORDER SCENARIO.
    the prices of the products will be often changing drastically so
    he is following MAKE TO STOCK Process in his production process.
    so with out using m.t.o. process how to reserve it against the customer.
    for eg:
    in the market when the customer/dealer/stockist coems to know that prices are going to increase
    then obviously he tends to purchase in bulk quantities and reserve it in godown.
    so how to map that process.
    help me on this.
    regards,
    balaji.t
    09990019711

    Dear Balaji,
         This can be done By MM consultant through movement type. to move the stock from unresticted stock to customer stock.
    Regards,
    Sudhir

Maybe you are looking for