Current Position:Home > SAP Business one Freight Query

SAP Business one Freight Query

Update:11-30Source: network consolidation
Advertisement
Hi experts,
i have created a query in B1 query generator and saved .
The purpose of the query is to calculate some values based on the group of the BP and the item code too.
I used User-defined value but i get an error anytime i change my quantity.
But if i use only one side of the query without the else if statement query it works, but if i use with the else if i get the error attached in the image file.
Please review the query below and tell me what is causing this error.
Urgent help is needed.
Regards
Justice
IF (SELECT OCRD.GroupCode FROM OCRD WHERE OCRD.CardCode = $[$4.0.0]) = '102' AND (SELECT OITM.ItemCode FROM OITM WHERE OITM.ItemCode = $[$38.1.0]) = 'TP000003'
BEGIN
SELECT $[$38.11.Number] * -0.539840
END
       ELSEIF (SELECT OCRD.GroupCode FROM OCRD WHERE OCRD.CardCode = $[$4.0.0]) = '102' AND       (SELECT OITM.ItemCode FROM OITM WHERE OITM.ItemCode = $[$38.1.0]) = 'TP000005'
        SELECT $[$38.11.Number] * -0.886961
       END

The Best Answer

Advertisement
Hi Justice...
Just apply your logic in this way
Select CASE when a.CardCode = '102' and ItemCode='TP000003' then  $[$38.11.Number] * -0.539840
        else $[$38.11.Number] * -0.886961 end  from OCRD a
        left outer join OITM b on a.CardCode=b.CardCode
Regards
Kennedy
  • SAP Business one Freight Query Update:11-30

    Hi experts, i have created a query in B1 query generator and saved . The purpose of the query is to calculate some values based on the group of the BP and the item code too. I used User-defined value but i get an error anytime i change my quantity. B

  • SAP Business Explorer not working Update:11-30

    Dear Moderators, This is to have some advice regarding the problem in my system for Business Explorer. I am not able to open SAP Business Explorer's Query Designer, Report Designer and Web Application Designer. Error Descriptions: 1. SAP BEx  Query D

  • Benefits of SAP Business Warehouse Reporting compared with the Query-tools? Update:10-11

    Hello experts, I've been creating reports with SAP Query tools, but been faced with few problems. First of all, there are restricted possibilities in terms of joining tables, and thus I cannot include all the data required for the report. One solutio

  • How to add drop down list for query manager report in sap business one Update:10-11

    Hi Every one, I need drop down list for parameter selection in sap business one Query Manager.I have two Parameters 'Sales Order','Invoice'. Please suggest. Thanks and Regards DEVHi, you need to use this : /*select from [dbo].[OINV] T2*/ DECLARE @Inv

  • Query on SAP Business Object and Content shipment.. Update:11-30

    I know about SAP Business Suite... & SAP Business One... But what is : 1. SAP Business Object and 2. Content Shipment The definitions on the SAP Release & Maintenance Strategy and other docs on SDN were not too clear for my understanding. I want t

  • SAP Business One UI/DI API SQL query Update:11-30

    I am using SAP Business one UI/DI API with C#, how do I get data from the database using a select statement? I would like to obtain items from the database using a condition 'WHERE' and fill a matrix with the information.ok - here's a c# sample: oFor

  • SAP Business One Ver. 9.0 SQL Table Name Update:10-11

    Dear All, This is useful SQL Table Name for SAP Business One Ver.9.0 in details Name     Description AAC1    Asset Classes - Depreciation Areas - History AACP    Periods Category-Log AACS    Asset Classes - History AACT    G/L Account - History AAD1 

  • SAP Business One iPad Apps Sales Catalog photo problem Update:10-11

    Dear all, I have a question about the iPad SAP Business One Mobile Apps Sales Catalog. Inside the Sales Catalog, it will show the Item group with pictures and when you look inside the item group, it will show the Item image which is set up in the Ite

  • DW on SAP business one Update:10-11

    Dear Experts, We are looking for DW option on Business one data for reporting. As I am new to this can you please suggest the best approach. Also is there any Rapid deployment Solution(RDS) for this? Thanks in advance.Hi You can use query generate To

  • Business Impact Study on SAP Business One Training Update:10-11

    Dear SAP Business One Community, SAP is investing in finding out how the SAP Business One training is affecting your daily business. Please fill out this survey to help us finding out how effective the SAP Business One training is, and how well it me