Accessing the tax value of a marketing document row before it is written to

I am creating sales invoices using the DI and I need to check the valu of the tax as calculated by the system so that I can compare it to the value supplied on the data provided and check for rounding errors.
My problem is that none of the fields in document lines that hold the value of tax e.g. priceaftervat, nettaxamount seem to be updated before the record is written. It looks like the value is calculated as the record is written.
Does anyone know if this is the case or am I missing something?
Regards
Gordon

Yes, this is the case. If you want to check it before adding, create invoice draft first, then with getbykey load it to document object, check the values you want and if is everything ok, create invoice from the draft.

Similar Messages

  • Problems while saving the tax values in a Draft Document to AP Invoice

    Hi All
    I have an interface .net where I use a DIAPI to enter values in B1 2007 B (8.60.039) PL 15.
    I have the following cases:
    First case
    - I create a document type oPurchaseInvoices, where I set the tax values for IRPF, INSS, ISSQN (Brazil).
      When i execute the code that inserts this A/P Invoice in SAP, it works perfectly, including by setting the values of the taxes correctly.
    Second case
    - I create a document type oDrafts, and say that this draft is the type oPurchaseInvoices.
      After that I follow the same steps to launch a note entry, laying the tax values(IRPF, INSS, ISSQN) and everything else.
      When i execute the code that inserts this values in the draft, the tax values are not entered and that everything else works perfectly. 
    You can tell me whether the taxes really are not inserted when I issue a draft or I'm leaving to score some parameter.
    I am in the look of your response
    Regards
    Luis Felipe

    Hi Gordon.
    You can see below the part of the code to add the Draft Document.
    oAPInvoice = oCompany.SapCommand.GetBusinessObject(BoObjectTypes.oDrafts)
    oAPInvoice.DocObjectCode = BoObjectTypes.oPurchaseInvoices
    With oAPInvoice
        .Lines.TaxLiable = BoYesNoEnum.tYES
        .Lines.ItemCode = Itemcode
        .Lines.Quantity = Quantity
        .Lines.UnitPrice = Unitprice
        .Lines.TaxCode = Taxcode
        .Lines.WTLiable = BoYesNoEnum.tNO
        .Lines.Usage = "Consumo"
        If oDTO.IRRF > 0 Or oDTO.INSS > 0 Or oDTO.ISSQN > 0 Then
            If oDTO.WtLiable = "Y" Then .Lines.WTLiable = BoYesNoEnum.tYES
            Add tax values
            For i As Int16 = 1 To 3
                vlrImposto = 0
                addTax = False
                If IRRF > 0 And Not addIR Then
                    codImposto = CodeIRRF   (tax code)
                    vlrImposto = IRRF             (tax value)
                    addIR = True
                    addTax = True
                ElseIf INSS > 0 And Not addINSS Then
                    codImposto = "F501"  (tax code)
                    vlrImposto = INSS       (tax value)
                    addINSS = True
                    addTax = True
                ElseIf ISSQN > 0 And Not addISSQN Then
                    codImposto = CodeISSQN  (tax code)
                    vlrImposto = ISSQN            (tax value)
                    addISSQN = True
                    addTax = True
                End If
                If addTax Then
                    (If include more one tax then add line)
                    If i > 1 And vlrImposto > 0 Then .Lines.WithholdingTaxLines.Add()
                    .Lines.WithholdingTaxLines.WTCode = codImposto                     (tax code)
                    .Lines.WithholdingTaxLines.TaxableAmount = Unitprice              (base value calculation)
                    .Lines.WithholdingTaxLines.WTAmount = vlrImposto                   (tax value)
                End If
            Next
        End If
        .CardCode = Cardcode
        .CardName = Cardname
        .HandWritten = BoYesNoEnum.tNO
        .DocDueDate = DueDate
        .DocDate = DocDate
        .TaxDate = TaxDate
        .SequenceCode = -2      '-1=Manual  -2=External
        .SeriesString = "RCB"
        .SequenceModel = 37
        lRetCode = .Add()
    End With
    Regards
    Luis Felipe

  • How can I access the Attribute Values from the Search Region

    Hi all,
    I have a table which contains Company id, department id, and PositonId. For a particular Company and Department there may be multiple records.
    I have to pupulate a table which contains the position and other details that comes under a particular Department and Position based on the selection in the Three comboBoxes.
    Also I have to populate a select many Shuttle to add new postions and records under a particular Department.
    I created a query panel *(Search Region)* for the serch and a table to display the data. That is working fine.
    Now the issue is I am using a view criteria to populate the shuttle with two bind variables ie, DepartmentId and CompanyId.
    If the serach will return a resuktant set in the table it will also pupulate the correct records, otherwise ie, if the if the serch result is empty the corresponding iterator and the attribute is setting as null.
    SO I want to access the attribute values from the Search Region itsef to populate the shuttle.
    I don't know how can I access the data from the Search Region.
    Please Help.
    Regards,
    Ranjith

    you could access the parameters entered in search region by the user as follows:
    You can get handle to the value entered by the user using queryListener method in af:query.
    You can intercept the values entered as described
    public void onQueryList(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    List<Criterion> searchList = qdes.getConjunctionCriterion().getCriterionList();
    for ( Criterion c : searchList) {
    if (c instanceof AttributeCriterion ) {
    AttributeCriterion a = (AttributeCriterion) c;
    a.getValues();
    for ( Object o : a.getValues()){
    System.out.println(o.toString());
    //call default Query Event
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    public void onQueryTable(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    private void invokeQueryEventMethodExpression(String expression, QueryEvent queryEvent){
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory efactory = fctx.getApplication().getExpressionFactory();
    MethodExpression me = efactory.createMethodExpression(elctx,expression, Object.class, new Class[]{QueryEvent.class});
    me.invoke(elctx, new Object[]{queryEvent});
    Thanks,
    Navaneeth

  • To get the count of records and able to access the column value in a single

    Hi
    Is there any way to get the number of records in the query and access the column values
    e.g
    select count(*)
    from
    (SELECT department, COUNT(*) as "Number of employees"
    FROM employees
    WHERE salary > 25000
    GROUP BY department ) a
    This wil only get the Count, if i want to access each row from the inline view how can i do that.

    Your question is not clear.
    Are you looking for total record count as well as count by department ?
    Something like this?
    SQL>
    SQL> with temp as
      2  (
      3  select 1 dept ,10000 sal from dual union
      4  select 1 dept ,25100 sal from dual union
      5  select 1 dept ,30000 sal from dual union
      6  select 1 dept ,40000 sal from dual union
      7  select 2 dept ,10000 sal from dual union
      8  select 2 dept ,25100 sal from dual union
      9  select 2 dept ,30000 sal from dual union
    10  select 2 dept ,40000 sal from dual )
    11  select count(*) over( partition by 1 ) total_count,dept,
    12  count(*) over(partition by dept) dept_cnt  from temp
    13  where sal>25000;
    TOTAL_COUNT       DEPT   DEPT_CNT
              6          1          3
              6          1          3
              6          1          3
              6          2          3
              6          2          3
              6          2          3
    6 rows selected
    SQL>

  • Tax value difference in FI document & report S_ALR_87012357

    Hi Team
    There is tax value difference in FI document and report S_ALR_87012357.why this difference come?
    In FI Document GST input value S$414.89
    In Report GST input value : S$3,599.34
    Why these difference coming ? Please suggest..
    Thank you
    Regard,
    Dharma.

    HI ,
    Its looks like thata document is posted in SGD which looks like document currency . VAT report if you haven't choose any currency then run in local currency . Its look like that which is different from SGD .
    Can you Please click on TAx in document .
    Many Thanks

  • How to Access the Return Value of a Function

    Hi,
    How do I access the return value when calling an Oracle function from .NET using Oracle.DataAccess.Client? The function returns an integer of 0, 1 or 99.
    Dim db_command_oracle As New OracleCommand()
    db_command_oracle.Connection = db_connection_oracle
    db_command_oracle.CommandType = CommandType.StoredProcedure
    db_command_oracle.CommandText = "swsarsi.import_appointments"
    Dim ret_value As New OracleParameter()
    ret_value.OracleDbType = OracleDbType.Int32
    ret_value.Direction = ParameterDirection.ReturnValue
    ret_value.Size = 2
    ret_value.OracleDbType = OracleDbType.Int32
    db_command_oracle.Parameters.Add(ret_value)
    Dim IN_student_id As New OracleParameter()
    IN_student_id.OracleDbType = OracleDbType.Varchar2
    IN_student_id.Direction = ParameterDirection.Input
    IN_student_id.Size = 10
    IN_student_id.Value = student_id
    db_command_oracle.Parameters.Add(IN_student_id)
    db_command_oracle.ExecuteNonQuery()
    messagebox.show(ret_value) ?????

    Your ODP.NET code looks correct. What error are you seeing?
    One thing that will definitely generate an error is that .NET message boxes require that strings be displayed. ret_value is a parameter object. You need to access its value and convert it to a string. At a minimum, you need to change that.

  • Unable to get the tax value in Sales order

    Hi Forum,
    I am preparing a sales order for a customer with a material.
    When I go to the item conditions tab, I see that the correct tax value is being calculated but that tax value is not appearing in the TAX field.
    Net value is appearing correctly in the NET field.
    Please help me which are the areas of concerns i should look for to get the tax amount in the TAX field.
    Many thanks.
    Regards,
    Sheetal

    Dear Sheetal
    Go to V/06, select the tax condition type and execute.  There check whether you have maintained "Condition Class" as D.   If not, maintain D and then retry.
    thanks
    G. Lakshmipathi

  • Accessing the field values in different fields for calculation

    Hi,
    I am creating a report in which I have used breaks for grouping the  customers by their category. I have used summary on the amount field to calculate the sum in the individual category and also for total amount.
    Now, I also want to add an column which could display the percentages of individual contributions.
    So, its like I have to write a query accessing the total percentage, categorized percentage and individual amount.
    My question: How can I access the various fields values in the query of some other field specifically sum and total sum( because it shows the sum([Amount]) for category sum and total sum both)
    -BOBJuser

    Hmmm, I assume you are talking about WebIntelligence here...
    Ok, so let's go: you can access every "object" in the report simply by it's name. Every cell contains either a constant value (e.g. some text) or a formula, the simplest one can be just the value of an "object" from the query.
    There is a formula bar on top which you can activate, where you can easily see the content of a specific cell and also copy/paste the formula from the cell, as well as access all the built-in functions.
    WebI has a built-in calculator which works very similar to a "micro" olap engine, so you can access every sort of aggregate (of a measure) via a correspondig formula, irrelevant in which cell you are using it.
    Nevertheless, there is a "computation context" which depends on the place where you put the formula, e.g. summary row, detail row, etc.
    for more info: see the manual )
    hth, Walter

  • Accessing the "outcome"  value used in the navigation case

    I would like to dynamically create a view based on the outcome value used in the navigation case.
    How can I reference the outcome value from a backing bean?
    For example assume that a page (mypage.faces) can be accessed via outcomeA and outcomeB. I want to know which outcome was used in the navigation case.

    Not without implementing a custom navigationhandler.
    Alternatively you can also set the known outcome in a bean property and use it instead.
    public String submit() {
        this.outcome = "foo";
        return this.outcome;
    <h:outputText value="Outcome was: #{bean.outcome}" />

  • Access the modelReference value

    If I add a modelReference to a command_button like in the following code:
    <h:command_button id="b" label="Click" commandName="Click" modelReference="UserBean.name">
    </h:command_button>and if I catch the request at the ApplicationHanlder like this:
    if (formEvent.getCommandName().equals("Click")) {
          UIComponent c = formEvent.getComponent();
          String model = c.getModelReference();
          treeId = ... //and so on
    ...So my question. Is it possible to get the "real" value of the modelReference. I mean if call the methode .getModelReference() I get the string "UserBean.name"! But I want to get the value!!!
    Any Suggestions??

    I thought, modelReference was replaced by valueRef (and maybe actionRef)
    am i wrong?
    if i am, when do i have to use which of the 3 attributes ?

  • Cluster of control references: want to access the control value

    I want to be able to save and set control values that are saved (XML). I have my controls on about 5 sub vi's. So I thought it'd be a good idea
    to put all the control references in a cluster from the several sub vi's and save and read from one point.
    I can get the cluster values (i.e. the references to the controls), but how to proceed from here? If somebody has a better idea it is very welcome.
    I have also read Ben's nugget here, but it deals with references to controls in a cluster, not references to a reference of a control in a cluster

    Thank you for reading that Nugget!
    I use a GUI Controller in many apps so I can grab refs in sub-VI's.
    Here are some screen shots of them in use.
    The first "GUI Cnt" is a wrapper around the AE and invokes the action "Set Analysis mode" then another call let me get a cluster of the refs so I can choose based on the name.
    This image shows what that action does.
    THis is what happens when going into collection mode.
    That is a small set of what you will find in my image gallery Feel free to browse (yes I know there is a lot of Olivia in there ) and ask if anything catches your interest.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Accessing the email value from the iPhone AddressBook

    Need some help getting the email value from the AddressBook. This is what I have so far ...
    Used to open up the picker and limit to email only
    -(void) browseButtonPressed:(id)sender
    ABPeoplePickerNavigationController* controller = [[ABPeoplePickerNavigationController alloc] init];
    controller.peoplePickerDelegate = self;
    NSNumber* emailProp = [NSNumber numberWithInt:kABPersonEmailProperty];
    controller.displayedProperties = [NSArray arrayWithObject:emailProp];
    controller.navigationBar.tintColor = [UIColor blackColor];
    [self presentModalViewController:controller animated:YES];
    The delegate method in the same class
    - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
    shouldContinueAfterSelectingPerson:(ABRecordRef)person
    property:(ABPropertyID)property
    identifier:(ABMultiValueIdentifier)identifier
    NSString *email = (NSString *)ABRecordCopyValue(person, kABPersonEmailProperty);
    NSLog(@"selected person: %@", email);
    [[peoplePicker parentViewController] dismissModalViewControllerAnimated:YES];
    return NO;
    The NSLog prints the following ...
    selected person: <NSCFType: 0x1d81c0>
    Any idea why it's not printing a string rather I am getting NSCFType ?

    Great Post. One of the few times that I was able to come to a conclusion about the code I need. Here is an example of the delegate method in reference to getting the email address.
    - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
    ABMultiValueRef emails = ABRecordCopyValue(person, property);
    CFStringRef email = ABMultiValueCopyValueAtIndex(emails, identifier);
    NSLog( (NSString *) email);
    self.receiverEmail.text = (NSString *) email;
    [self.tabBarController dismissModalViewControllerAnimated:YES];
    return NO;
    }

  • Access the TNS_ADMIN value in Oracle through Command Prompt

    I am trying to get the TNS_ADMIN value but I m an not getting Expected Results . My tnsNames.Ora are located at the following locations : -
    1) C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN
    2) C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
    As you can see from the belowcode, TNS_ADMIN is not displaying the correct location. Please correct me where I am going wrong.
    C:\>set TNS_ADMIN=%ORACLE_HOME%\network\admin
    C:\>echo %TNS_ADMIN%
    %ORACLE_HOME%\network\admin
    C:\>echo %ORACLE_SID%
    %ORACLE_SID%
    C:\>

    user8980683 wrote:
    I am trying to get the TNS_ADMIN value but I m an not getting Expected Results . My tnsNames.Ora are located at the following locations : -
    1) C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN
    2) C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
    As you can see from the belowcode, TNS_ADMIN is not displaying the correct location. Please correct me where I am going wrong.
    C:\>set TNS_ADMIN=%ORACLE_HOME%\network\admin
    C:\>echo %TNS_ADMIN%
    %ORACLE_HOME%\network\admin
    C:\>echo %ORACLE_SID%
    %ORACLE_SID%
    C:\>
    Neither ORACLE_SID nor ORACLE_HOME have been set in the command window session it looks like.

  • Marketing Documents Rows Item Details

    Hi All,
    Notice that SAP B1 8.8 marketing document's row item details for item document will take the item master data's remark into the item details column for item marketing documents. is there any setting that can remove this function?
    Regards,
    Ken Seng

    Hi Ken.....
    You can use UDF for your purpose else if want want Item Details Field to be used for your purpose then you have to delete the remarks you set in Item Master's Remark Tab because by default sap brings these details from Item Master Remark.......
    Regards,
    Rahul

  • Access the selected values from grid

    I want to select vendor from the list.For this I have loaded vendor list in grid.How to get the value of selected vendor into variable ? For this I have used following code-
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            Dim dtgGrid As SAPbouiCOM.Grid
            Dim strVendorCode As String
            Dim strVendorName As String
            Dim dtgRows As SAPbouiCOM.GridRows
            Dim dtgColumns As SAPbouiCOM.GridColumns
            Try
                If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK And pVal.Before_Action = True And pVal.ItemUID = "dtgGrid" Then
                    dtgGrid = SBO_Application.Forms.ActiveForm.Items.Item("dtgGrid").Specific
                    dtgGrid.Rows.SelectedRows.Add(pVal.Row)
                    strVendorCode = dtgGrid.Rows.SelectedRows.Item(1, SAPbouiCOM.BoOrderType.ot_RowOrder)
                    strVendorName = dtgGrid.Rows.SelectedRows.Item(1, SAPbouiCOM.BoOrderType.ot_SelectionOrder)
                End If
            Catch ex As Exception
                SBO_Application.MessageBox(ex.Message)
            End Try
        End Sub
    But I could not get the value in the variable  strVendorName .

    Hi,
    i would access value with the datatable
    something like:
    oForm = SBOApplication.Forms.Item(FormUID)
    oGrid = oForm.Items.Item("grid").Specific
    oGrid.DataTable.Columns.Item("insertthecolumnname").Cells.Item(i).Value
    regards
    David

Maybe you are looking for

  • Shutdown Problem with KT4AV MS6712

    Here is the problem. I am running XP service pack 1, XP2600 processor FSB 333, 512 mb mem, 40 gig hard drive, dvd rom and cd burner. If I use XP to power down system (shutdown) it actually performs a soft reboot (restart). I have checked to make sure

  • Line Item dIm use

    Hi LIne item dim of the cube increases the loading performance or the query performance. Reagards

  • Database Aplication Tables Reconciliation in real time

    Hi. Is there a way to get database aplication tables trusted reconciliation in real time? I mean, If I add/update a row to a table in the trusted source, some type of agent calls an API in OIM which gets the added/updated row (and creates the user) T

  • How to search records using netbeans

    i'm using netbeans.....how to search records from database pls help me

  • No sound after windows 10 install

    I installed windows 10 Enterprise on separate partition with windows 7 on a different partition it boots fine and lets me choose which system on boot.  Windows 7 works fine as always including sound, so that eliminates hardware issues, but when I boo