Skip to Content

SAP B1 Query user value

Hello,

I have a question. I want to write in this query my values

Example:

T0.[ItemCode] - T0.[InvntryUom] - quantity(my value) - price(my value)

Thank you

SELECT T0.[ItemCode], T0.[InvntryUom] FROM OITM T0 
WHERE 
T0.[InvntryUom] LIKE '%%112965%%'
OR T0.[InvntryUom] LIKE '%%12680%%'
OR T0.[InvntryUom] LIKE '%%16703%%'
OR T0.[InvntryUom] LIKE '%%112341%%'
OR T0.[InvntryUom] LIKE '%%112337%%'
OR T0.[InvntryUom] LIKE '%%91605%%'
OR T0.[InvntryUom] LIKE '%%112163%%'
OR T0.[InvntryUom] LIKE '%%112160%%'
OR T0.[InvntryUom] LIKE '%%113777%%'
OR T0.[InvntryUom] LIKE '%%113796%%'
OR T0.[InvntryUom] LIKE '%%114602%%'
OR T0.[InvntryUom] LIKE '%%90152%%'
OR T0.[InvntryUom] LIKE '%%112289%%'


Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 25 at 11:07 AM

    Hi,

    I am afraid that your question loses a lot in translation, so I am going to take a wild guess at what you mean.

    If you want to show a user value, you can simply do so like this:

    SELECT 'your value here' AS MyValue

    If you mean that you need a user value then you can use a parameter like so:

    /* select * from OITM x */
    DECLARE @MyValue AS NVARCHAR(100)
    SET @MyValue = /* x.ItemName */ '[%0]'
    SELECT @MyValue AS MyValue

    If you mean that you want to calculate a value, you can do so the way you described in your query, but you will have to use numeric fields. ItemCode and InvntryUom are not numeric fields.

    If you mean that you want to enter parameters, you can do so using the [%0] syntax or the syntax I described in the sql above.

    Usually the InvntryUom field is used with values like PIECE, or BOX, or M or Kg. If you are using an unlimited amount of numbers in this field, like the query in your question suggests, it is likely that you are doing something wrong.

    Regards,

    Johan

    Add comment
    10|10000 characters needed characters exceeded