Change item value at Sales Invoice form before create a document

HI,
I am trying to change value for "TrackNo" item on the sales invoice form just before create a sales invoice,
I have the following code:
Dim oForm As SAPbouiCOM.Form
Dim oItem As SAPbouiCOM.Item
Dim oEdit As SAPbouiCOM.EditText
Dim periodo As String
Dim sf As String
Try
   oForm = Nothing
   oForm = entorno.Forms.Item(FormUID)
   oItem = oForm.Items.Item("251")
   oEdit = oItem.Specific
   oEdit.String = "Y"
Catch
End Try
It seems to work only If i have selected the logistics folder ( the folder where the "TrackNo" Item is located)
If I have selected another folder as "contents" or "Accouting" when I create the document it fails.
Can you help me with this problem?
Many Thanks

Buenas Sergio,
Try forcing a click event on the logistic folder. I don´t think there is another option. You are only able to asign the value if the control is visible(and editable).
Regards,
Ibai Peñ

Similar Messages

  • How can I change Posting Date on Sales Invoice form in UI?

    Hello,
    I cannot change the Posting Date on the Sales Invoice form in UI.
    The new date is earlier than the system date, but when I type it on the field on the form, it's not problem!
    I've tried to use the following code in vb.NET:
    SBO_Application.Forms.Item(pVal.FormUID).Items.Item("10").Specific.value = DocDueDate.ToString("yyyyMMdd")
    But I've got an exception: <i>Form - Bad value</i>
    Next step I tried this, but I've got a same message:
    SBO_Application.Forms.Item(pVal.FormUID).Items.Item("10").Click(SAPbouiCOM.BoCellClickType.ct_Regular)
    SBO_Application.SendKeys(DocDueDate.ToString("yyyy.MM.dd"))
    Any idea?
    THX,
    Csaba

    Hi Csaba!
    please, make sure that you've handled Sales Invoice form - just show the message:
    MessageBox.Show(pVal.FormUID)
    edDate = SBO_Application.Forms.Item(pVal.FormUID).Items.Item("10").Specific
    edDate.value = DocDueDate.ToString("yyyyMMdd")
    This has to show you 133. If not then put the IF-statement to check what form you are handling before you try to get the item's handler

  • Sales invoice form

    hi ,
    Iam using standard sales invoice form but the problem the adderss is not printing.
    please help me in this issue.

    Hai Srinivas,
    Tell which address you want. Is it customer, vendor or Plant.
    If it is customer.
    First, fetch the cutomer number and address number  from the KNA1 table.
    Second, pass the address number in the ADRC table to get the address fields.
    Check whether the value is maintained in the back end or not.

  • Changing field values in a Interactive form

    I am trying to modify the fields of a Interactive form after the user presses the go button.  The following code appears in my onSubmit method.
    IPrivateIntPDFv1View.IPDFDataElement element = wdContext.nodePDFData().createPDFDataElement();
    element.setForename("Wrighty08");
    wdContext.nodePDFData().bind(element);
    When I then get the byte[] in the following code it does not have the changes I made above however the changes do appear on screen when the program finishes.  Any ideas?
    IPrivateIntPDFv1View.IContextElement contextElement = wdContext.currentContextElement();
    ByteArrayInputStream byteInput = new ByteArrayInputStream(contextElement.getPDFObject());
    Thanks,
    Ellis

    I am trying to get the byte[] with the new values set.  The implementation of the byte[] retrieval is in the submit-method.  But just before I get the byte[] I am trying to change some values in the interactive form.
    So first I run this code to change the value of a given field in the interactive form.
    IPrivateIntPDFv1View.IPDFDataElement element = wdContext.nodePDFData().createPDFDataElement();
    element.setForename("Wrighty08");
    wdContext.nodePDFData().bind(element);
    Then I get the byte array as follows.
    IPrivateIntPDFv1View.IContextElement contextElement = wdContext.currentContextElement();
    ByteArrayInputStream byteInput = new ByteArrayInputStream(contextElement.getPDFObject());
    The problem is that the changed values are not in the byte[].
    Thanks,
    Ellis

  • Reuse of Sales Invoice form

    Hello,
    I'm developing addon in SAP B1 2005 B Pl35.
    I want to use existing Sales Invoice form again in my developed Addon Module.
    Is it possible?
    How?
    Rgds
    Subrata

    Subrata,
    it is possible to reuse the system forms by activating their menu id. for example, when you will make a seperate module, you will create an xml file where you will give some unique id for each menu.
    on menu click event of each form, you will load the respective form. in case of sales order or invoice , you simply activate the resepective form's menu. like:
    Private Sub sbo_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles sbo_Application.MenuEvent
            If pVal.MenuUID = "xxx" And pVal.BeforeAction = False Then
                sbo_Application.Menus.Item("2050").Activate()
            End If
        End Sub
    '2050' is sales order form's menu id.
    and 'xxx' is the menu id that you have specified in your xml through which you are making user defined menu.
    HTH,
    Binita Joshi

  • Change Item Category in Sales Order for KMAT materials

    Hi,
    How can I change item category in sales order/quote for KMAT materials?
    Currently in the sales order/quote, the item category field is grayed out for KMAT/configurable materials and I can change the item category.
    Please help me.
    Sincerely.
    Ketan

    Dear Ketan,
    I hav exactly the same problem.
    Did you finally succeed?
    Thanks.
    Ben.

  • Item numbers are differing when i am creating billing document.

    item numbers are differing when i am creating billing document with reference to delivery.
    eg:  item 10  Nimusulide
          item 20 paracetomol
    but in invoice it is as follows
    item 50  Nimusulide
    item 100 paracetomol
    plz help me

    Hi,
    In VOFA check field item number increment
    This will be maintained as 50.Change it to 10.
    Reward points if useful
    Regards,
    Amrish Purohit
    Message was edited by:
            AMRISH PUROHIT

  • Change item value before commit

    Hello,
    I have a form in which I issue an execute_query from a mouse click to retrieve database values from a data block onto a form. The user is then able to change the values of these items on the form and commit them via a button on the form. What I want to do is make sure that some of the values, based on another item in the block, are negative and if not, change them to a negative value. before the changes are commited. I can't seem to find the right trigger to accomplish this-- has anyone have an idea on how to do this?
    Thanks in advance.
    Jeff

    Hi,
    How about putting your code in :
    1. Pre-Update or
    2. When-Database-Record
    [Block Level trigger]
    The trigger text could be something like :
    If (:block.col is > 0 ) Then
    :block.col := :block.col * -1;
    End If;
    -- Shailender Mehta --

  • Accessing Selected Value from Payment Terms (Item 47) in AR Invoice Form

    Hi,
    Have just started working in SAP Business One and SDK adn would really appreciate any help I could receive.
    I'm trying to access the selected value from Payment Terms field(Item 47) in the AR Invoice Form.
    Have successfully managed to do this against Customer Code field using the following code-:
    Private Sub eventHandlerTest(ByVal FormUID As String, pVal As SAPbouiCOM.ItemEvent, BubbleEvent As Boolean)
        Dim frm As SAPbouiCOM.Form
        Dim itmCustomer As SAPbouiCOM.Item
        Dim edtCustomer As SAPbouiCOM.EditText
        Dim itmRemark As SAPbouiCOM.Item
        Dim edtRemark As SAPbouiCOM.EditText
        Dim FieldNo As String
        Set frm = SBO_Application.Forms(FormUID)
        Set itmCustomer = frm.Items(pVal.ItemUID)
        Set edtCustomer = itmCustomer.Specific
        If UCase(edtCustomer.Value) = "CALECH1" Then
            FieldNo = "16"
            Set itmRemark = frm.Items(FieldNo)
            Set edtRemark = itmRemark.Specific
            edtRemark.String = "E"
        End If
    End Sub
    However when doing the same thing for Payment Terms I get the error "Run-time error '13': type mismatch" on the line
    Set edtOrderType = itmOrderType.Specific
    Thanks

    Hi,
    On the new invoice's form item 47 is ComboBox and I guess it's stay in the same type when you open existing invoice. So try to work with this item like with ComboBox. But if you need only get some information about existing invoice, you don't need to fork with the screen objects - you can get all you need from the DI Document object. Open Document object with Invoice type, find invoice and check PaymentGroupCode property.
    Best regards,
    Mark

  • Changing Item Values before saving Purchase Requisition in me51n, set_data function

    Hello,
            I have written a user exit, which is called whenever changes are made to a purchase requisition. User Exit is MEREQ001 , function module EXIT_SAPLMEREQ_010 . My requirement here is that the Requisitioner should be 135 for every PR item under certain conditions. Therefore whenever there is any change made to the PR, before saving the PR item, I need to set the Requisitioner to 135, give a status message saying that the Requisitioner is set to 135 and save the Pr with the changed values. Following is the code I have written in EXIT_SAPLMEREQ_010. However, the set_data function called below does not change the PR values. Pls help
    data: lt_item type mmpur_requisition_items,
           wa_item type mmpur_requisition_item,
           wa_itemdet type mereq_item,
           wa_itemref type ref to if_purchase_requisition_item,
           w_message type i.
    constants: c_135 type afnam value '135'.
    call method im_req_header->get_items
         receiving
                 re_items = lt_item.
        loop at lt_item into wa_item.
         wa_itemref = wa_item-item.
         wa_itemdet = wa_itemref->get_data( ).
         if wa_itemdet-afnam ne c_135.
           w_message = 1.
           wa_itemdet-afnam = c_135.
           call method wa_itemref->set_data( wa_itemdet ).
         endif.
       endloop.
      IF w_message = 1.
        MESSAGE 'Requisitioner defaulted to 135 for all items' TYPE 'I'.
      ENDIF.

    Hi Sachin,
               I am able to get a reference to if_purchase_requisition_item in my code (wa_itemref ) and am also able to access each of the line items in the PR in the work area wa_itemdet.
    At this point in the code ( wa_itemdet-afnam = c_135 ) , the work area value is set to '135', However, call method wa_itemref->set_data( wa_itemdet ), does not change the values of the work area wa_itemdet . Pls help

  • Developer 10g Capture All CHANGED Item Values

    Still learning this application one module at a time so be kind :)
    What is the most efficient way to capture all the data block item values that have changed on the form at say the pre-update trigger?
    I'm thinking of testing for:
    RECORD_STATUS = 'CHANGED'
    and if true then assign the first item to v_item using:
    v_item := 'block_name' || '.' || get_block_property('block_name',first_item)
    Then loop through each item in the block and test the DATABASE_VALUE against the form value and if they are not equal the assign the DB value to a variable and the form value to a variable and build a string of text to be displayed to the user by using:
    IF GET_ITEM_PROPERTY(v_item,DATABASE_VALUE) <> :BLOCK_NAME.ITEM_NAME THEN
    v_dbvalue := GET_ITEM_PROPERTY(v_item,DATABASE_VALUE);
    v_frmvalue := :BLOCK_NAME.GET_ITEM_PROPERTY(v_item,ITEM_NAME);
    v_string := v_string || 'Old value was ' || v_dbvalue || ' and new value is ' || v_form value;
    Then advance to the next item by resetting the v_item variable to the next item using:
    v_item := 'BLOCK_NAME' || '.' || GET_ITEM_PROPERTY(v_item,NEXTITEM);
    And repeat the process until there are no more items in the block:
    EXIT WHEN 'BLOCK_NAME' || '.' || NULL;
    So what would be the most efficient way to do this?

    The form holds information that is inserted by a technician then the manager of the technician has to approve the info and submit it to the director for final approval.
    So what I do is capture any of the changes that the technician makes and put that sting into an email and send it to the manager so they know that changes were made to the record and they can approve or decline the changes before submitting it on to the director.
    My successful POST-UPDATE trigger at the form level ended up like:
    <<
    p_html := 'Catalog item ' || :ITEMS.MANUFACTURER || ' - ' || :ITEMS.MODEL_DESC || ' ' || :ITEMS.MODEL || ' has been modified and the results are as follows: <br> ';
    v_item := 'ITEMS' || '.' || get_block_property('ITEMS',first_item);
    <<item_loop>>
    loop
    exit when v_item = 'ITEMS' || '.' || null;
    v_dbvalue := GET_ITEM_PROPERTY(v_item,DATABASE_VALUE);
    v_itemname := GET_ITEM_PROPERTY(v_item,ITEM_NAME);
    v_block := 'ITEMS';
    v_name := v_block || '.' || v_itemname;
    v_frmvalue := NAME_IN(v_name);
    IF v_dbvalue <> v_frmvalue THEN
    p_html := p_html || 'OLD VALUE WAS: ' || v_dbvalue || '<br>AND NEW VALUE IS: ' || v_frmvalue || '<br>';
    END IF;
    v_item := 'ITEMS' || '.' || get_item_property(v_item,nextitem );
    >>
    The p_html variable is the string that I send to the email package to send out via our mail service.
    Maybe this will help someone with a similar need.
    Cheers,
    Max

  • Change item value when a specific item has changed... how can i do that?

    Hi guys, i need to ask something...
    Is it possible to have a process or a computation, that gives value to an item, only when one specific item has changed.
    I have other items on my page too, but this two are related, and i need to give a specific value to the first one, only when the value of the second has changed...
    Help please
    tsveti:)

    Hey Farhan, i guess i need some help on that easy javascript...
    i havent done much thing with it so i have almost none experience with js....
    So in 'HTML Form Element Attributes' for the second item I m trying this :
    onchange="javascript:{document.getElementById('P1_SUBPROJECT').value = '-1';}"
    but when i change the value of this second item, the first one (P1_SUBPROJECT) dont get -1
    what am i doing wrong?

  • Issue while changing Item Category during Sales Order Creation

    Hi,
    Requirement:
    Requirement is to change the item category of Sales Order item while creating the sales order.
    Rule is: If item category is IRAT then it should be changed to IRLN.
    For this, I am using the user exit "USEREXIT_SAVE_DOCUMENT_PREPARE" available in the include MV45AFZZ.
    Issue:
    Using the above mentioned exit, Item category is getting changed to the desired value in the created sales order BUT value of Billing Status (VBUP-FKSAA) which is supposed to get changed is blank.
    For example, Sales order is created from VA01 and item category is changed manually to the value mentioned above, then for the sales order created we have VBUP-FKSAA = 'A'. But when value of Item category is not changed manually and it is changed from the exit, then value of VBUP-FKSAA is blank.
    I have to find a solution which would change the value of Billing Status according to the change in the value of Item Category.
    Please suggest a relevant solution.
    Thanks a lot for responding.
    Abhinav.
    Edited by: Abhinav Jain on Apr 9, 2010 6:47 PM

    Hi Abhinav,
    I have a simmilar problem. In my case I am changing Reason of Rejection in the user-exit, but net value is not getting updated. Did you solve your problem? Any other way to change a field of a sales order item?
    Thanking you in advance,
    Nisha

  • Unable to Change Item Category in Sales order

    Hi all,
    I am creating sales order with reference to sales contract but at the time of sales order we don't have en off stock to deliver to customer , so we have deiced to Third party sales process
    But the problem is while creating a sales order with reference to Sales contract the line item of the sales order in grad Mode ( Not changeable mode )
    Can any one guide me how sales order line item should be in active mode so i can change the Item category as a TAS third party item category
    Help me regards this
    Thanks
    Rajesh

    hi,
    You can  the item category field (VBAP-PSTYV)  editable , if item is configurable (item category TAC), then change item category to TAS.
    by using include  MV45AFZZ -  FORM USEREXIT_FIELD_MODIFICATION.
    when screen 4001 or 4003.
       IF VBAP-PSTYV = 'TAC'.
               SCREEN-INPUT = 0.
              MODIFY SCREEN.
            ENDIF.

  • How to Change Item catgegory in sales Order

    Hi all,
    I am creating sales order with reference to sales contract but at the time of sales order we don't have en off stock to deliver to customer , so we have deiced to go for Third party sales process
    But the problem is while creating a sales order with reference to Sales contract the line item of the sales order line item in grad Mode ( Not changeable mode )
    Finally i find out why sales order line item in gray mode Due to Structure Scope Using in item category TAS as D to Explore the BOM In Contract and Sales order  that a reason system gray out sales order line item
    Can any one guide me how sales order line item should be in active mode so i can change the Item category as a TAS third party item category
    Help me regards this
    Thanks
    Rajesh

    Hi all,
    Thanks for replay
    all ready i maintain manual item category in VOV4 the movement i am creating sales order with reference to contract the sales order line item showing in GRAY  mode i cant choose manual item category while i choosing F4 its showing TAS but i cant select that item category because sales order line in gray mode
    and Find out the reason why sales order line item coming in Gray Mode because i am Using Structure Scope D  In Item Category
    to Explore Variant config 
    can any one suggest me how to change the item category
    Thanks
    Ram

Maybe you are looking for

  • Quering Problem With Int

    my jsp file is : <jsp:useBean id="user" class="com.mycompany.DelData" scope="page"/> <HTML> <BODY> <b> Your Data Deleted<BR> <% user.del(); %> </BODY> </HTML> And the DelData.java file is: package com.mycompany; import java.sql.*; public class DelDat

  • Image on Displaying for IBOT in Outlook 2003

    Hey Everyone I Succesfully Extecuted the IBOT based on a Conditional Request, Everything is working fine but I am unable to display the Image on the EMAIL ( I am sending the email as HTML Format) , My BI Server and Answers request has an image on it.

  • N78 - N-GAGE 1.40.1557 trouble after software upda...

    Everything worked fine with my N78, except minor RealPlayer issues, but after software update 12.046 to 13.056 N-Gage application won't launch games, won't uninstall old n-gage ones, won't install new n-gage trials. The phone's application manager st

  • Question about PSE 12

    The latest version of Photoshop  - for the first time - now has the ability to convert jpg files into stl files.  So my question - Is it possible that  capability of conversion of jpgs into stl files has also been enabled In the latest version PSE12?

  • A question for SQL*Form 3.0 (within Open VMS)

    Hi, I've seen a command line IAP_UL EVACNTDIR:REPORT_PAR within a SQL*form. Since it's within Open VMS, I do not know how to refer to such place - 'EVACNTDIR'. Does anyone know this? Thks & Rgds, HuaMin