on 03-16-2008 1:50 PM
I use the following Query to Transfer The Document Date in a Purchase order to Document Date in Purchase Invoice:
SELECT T0.[TaxDate] FROM OPOR T0 WHERE T0.[CardCode]=$[OPCH.CardCode]
Can anyone tell me please:
1. Do I need to change the syntax of the query to make it work?
2. I use the query to change the Document Date in the AR Invoice when I COPY (convert) the order to an Invoive. What would be the Refresh condition since no Fileds will be changing in the COPY process.
Thanks for your help
Robert
PS Without this Forum I would have given up on SAP but I am grateful for your contributions but I am getting there..
Robert,
You can try this query
SELECT T0.TaxDate FROM [dbo\].[OPOR\] T0 WHERE T0.DocEntry=$\[PCH1.BaseEntry]
Please make sure you have made the BaseKey column at the A/P Invoice rows visible (from Form Settings)
This may work only when trigerred manually by highlighting the row and pressing Shift+F2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suda
I have Copied and pasted your Query but It gives me a Syntax error near PCH1. I am using B1 2007 and I wonder if the syntax is different.
Thanks
Robert
My Query Generator gives me the following but this is wrong as well?
SELECT T0.[TaxDate] FROM OPOR T0 , PCH1 T1 WHERE T1.[DocEntry] =$ T1.[BaseEntry]
I don't think the Syntax changed. Please confirm if you process is to copy the Purchase Order directly to AP Invoice (and you do not use the GRPO step)
The reason I ask asking is I am looking to fetch the PO's TaxDate by referencing it using the BaseEntry in the PCH1 (rows table)
There is nothing wrong with the syntax of my query.
Please also tell me which field you are using the Formatted Seach on the AP Invoice and how you are trying to execute it.
Suda
If you derive the invoice from only one purchase order, you can solve the problem
1. First of all you can select the base order, from which the invoice was derived. You can use the Remarks field, that contains the order number (if you checked Base document number in the General documents setting)
2. you can set autorefresh when the Remarks changes.
3. in the query you should refer to the current remarks field by $\[OPCH.Comments]
4. you should use the charindex, substring and cast or convert functions to get the numeric order number
5. then you can get the document date from the order with this order number.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Istvan
Thank you for the idea of placing a chagable field in the Remarks field. I will try this and I hope it works. However, in B1 2007 there is also a bug in the QPLD which causes the QPLD to behave strangely so I am a bit reluctant to activate QPLD for everyday work.
I hope SAP will sort this out soon but i am not sure what is the best way of reporting a BUG, do you know?
Thanks a lot
Robert
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.