cancel
Showing results for 
Search instead for 
Did you mean: 

can any one help me with tbis? please (only for expert sql masters)

0 Kudos
1,504

Hi, I am a kind beginner in writig sql querries, but this is quite chellenging.

Every end of week I choose invoice, add BP + choode to create invoice from many Delivery Note (say 30 pcs) (deelivery notes from last week). This is a kind of long invoice. In this moment I am ready to add invoice. However in order to have dates in the infoice right want to create querry that will get me he latest DocDate from these 30 delivery notes. The problem is that in this moment the data I see in the invoice are not in any table (temporary dokument). Please help. Maybe there is posibility to get max() from docdates on this temp dok.

PS. I have Sap B1 SQL 9.2 version.

MANY THANKS!

Regmards, Tomek

Vlad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Before we start imagining about your Schema, can you please give us the table definition, sample data, and what you expect? Based on your description I would suggest you to look at window functions (to extract the first record from the group), but I want to be sure what you expect.

Thanks

And yes, I am not the expert you are looking for 😞 the experts are so rare and ordinary people have to somehow survive.

0 Kudos

Creating the invoice is standard process so no need to add table names I think. The issue is this: - is there any possibility to to get date from temporary document (temporary invoice)?

I tried to use this $[$38.44.0] which refers to DeliveryNote Docnum in ODLN. however with this $[$38.44.0] I get only Docnum (of delivery note) in first row (row = 1). While I need to have the highest docnum in the whole temporary invoice, not the maximum from first row only 🙂 I hope this will help to understand the problem better. Thanks!

Vlad
Product and Topic Expert
Product and Topic Expert
0 Kudos

No, it won't, but thank you for the answer. I see that you need the real expert, who knows the standard process. Let us wait if somebody helps you.

p.s. friends-experts, I know that you are aware of the business processes, but here is a small tip that I have googled.

Accepted Solutions (0)

Answers (1)

Answers (1)

VolkerBarth
Contributor

I don't have the answer, either, and without any table definition and sample data I can't provide one, but as you are not using the database system SQL Anywhere but SAP B1, I would recommend to ask your question on the general SAP Q&A site - or better, search if it isn't already contained:

Find Questions & Answers

A first search lists hundreds of questions there to that system, so I hope you'll find the according experts there.