cancel
Showing results for 
Search instead for 
Did you mean: 

sap b1 query generator selection parameter

0 Kudos

when i use this query

SELECT

T1."ItemCode",

T1."Dscription",

T1."Quantity",

T3."OnHand" ,

t0."DocDate"

FROM

OWTQ T0

INNER JOIN

WTQ1 T1 ON T0."DocEntry" = T1."DocEntry"

INNER JOIN

OITM T2 ON T1."ItemCode" = T2."ItemCode"

INNER JOIN

OITW T3 ON T1."ItemCode" = T3."ItemCode" AND T1."WhsCode" = T3."WhsCode"

WHERE

T0."CANCELED" = 'N'

AND T0."DocStatus" = 'O'

AND T1."FromWhsCod" = 'WR1000'

and Month(T0."DocDate") = [%0]

parameter display as date but i want it be number to can enter number of month

Accepted Solutions (1)

Accepted Solutions (1)

SonTran
Active Contributor
0 Kudos

Hi,

You can refer this for the same.

Hope this helps,

Son Tran

0 Kudos
Thank you
 your article is very useful

Answers (1)

Answers (1)

Johan_H
Active Contributor
0 Kudos

Hi,

If you only give the number of the month, how does the query know which year?

You could just leave it be and use the year and month of the chosen date:

YEAR(T0."DocDate") = YEAR([%0]) AND MONTH(T0."DocDate") = MONTH([%0])

Now if the user enters for example today's date 8th of December 2023, the query will return results for all of December of 2023.

Regards,

Johan

0 Kudos

yes , thank you

but i want user enter number of month and number of year not enter date