cancel
Showing results for 
Search instead for 
Did you mean: 

Query Syntax

Former Member
0 Kudos

Hi Guys,

Is there any where for me to lookup information of syntax that used in queries? I know stored procedure and able to write simply query with no problem

But i encounter a syntax from other partner like:

$[ORDR.DocNum]

$[38.1.0]

/* SELECT FROM [dbo].[OFPR] T0 */

DECLARE @tdocdate as datetime

/* WHERE */

set @tdocdate /* T0.T_RefDate */ = [%1]

this is the syntax i never encounter before... But i know their function. So where can i get more information on this?

Another question:

/* SELECT FROM [dbo].[OFPR] T0 */

DECLARE @tdocdate as datetime

/* WHERE */

set @tdocdate /* T0.T_RefDate */ = [%1]

This prompts the user to enter Posting Date From parameter before query is run. Now, i want to change "Posting Date From" to "Date Start From", how do i do it? And how do i add a new parameter?

I tried to look on SAP but found nothing about this.

I hope u guys can help..

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

olivier_huet3
Participant
0 Kudos

Hi,

$[ORDR.DocNum] and $[38.1.0] are SAP variables for the formatted search.

When you are on an order window and you run the query, SAPB1 will replace $[ORDR.DocNum] by the num of the order where your are.

This allow the formatted search to get information about the opened order.

$[38.1.0] mean the field 1 of the window 38.

I don't know exactly which window or field it is...

You have to move the mouse cursor over the field, with "system information" enabled (in the "View" menu), to get information... (it will says the numbers for the field)

[%1] mean "parameter 1"

SAPB1 will ask the user for this parameter and then remplace [%1] by the user entry in the query.

I don't know exactly where to find more information about this, but all I've explained should be enough

Hope this help

Regards,

Olivier Huet

olivier_huet3
Participant
0 Kudos

About the "/* ... */", it's SQL comments.

The string between /* and */ will not be executed.... but will be parsed by SAPB1... and so it will know that [%1] is for which field....

(it seems SAPB1 search the nearest field from [%1] in the query string to know which field it is)

Answers (1)

Answers (1)

Former Member
0 Kudos

alright, at least i got the idea...

so now my requirement is this

/* SELECT FROM [dbo].[OINM] T0 */

DECLARE @fdocdate as datetime

/* WHERE */

set @fdocdate /* T0.Itemcode */ = [%3]

let say this query will bring up a box looks like:


---------------------------------------------------
|                                                 |
|   [ ] %0 Item No.        [                   ]  |
|                                                 |
|   [OK]   [Cancel]          [Existing Value]     |
---------------------------------------------------

I want it to be become:


---------------------------------------------------
|                                                 |
|   [ ] %0 Item No. From   [                   ]  |
|                                                 |
|   [OK]   [Cancel]          [Existing Value]     |
---------------------------------------------------

How do i achieve it? I tried this with a user defined field with the name "Item No. From" and it works perfectly. But when i click on "Existing Value", it found nothing since it is not draw from that table..

any idea guys? Thanks