Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

query helpe

0 Likes
706
  • SAP Managed Tags

hello,

I need your help with the query below. (my goal is to have the base price which is in the sales documents (INV1, DLV1, RIN1, RDN1) but not found in the OINM table. thank you in advance.

SELECT year(T0.[DocDate]) as 'ANNEE', month(T0.[DocDate]) as 'Mois', T0.[BASE_REF], T0.[Warehouse], T0.[CardCode], T0.[JrnlMemo], T0.[ItemCode], T0.[Dscription], SUM(T0.[OutQty]) - SUM(T0.[InQty]) AS 'TOTAL QTY', SUM(T0.[Price]* ((T0.[OutQty]) - (T0.[InQty]))) AS 'TOTAL CA HT', SUM(T1.[LstEvlPric]* ((T0.[OutQty]) - (T0.[InQty]))) AS 'TOTAL PR', T2.[ItmsGrpNam], T3.[SlpName] FROM OINM T0 INNER JOIN OITM T1 ON T0.[ItemCode] = T1.[ItemCode] INNER JOIN OITB T2 ON T1.[ItmsGrpCod] = T2.[ItmsGrpCod] INNER JOIN OSLP T3 ON T0.[SlpCode] = T3.[SlpCode] WHERE T0.[TransType] IN ('13' , '14' , '15' , '16' ) AND T0.[DocDate] >=[%1] AND T0.[DocDate] <=[%2] GROUP BY T0.[BASE_REF], T0.[Warehouse], T0.[CardCode], T0.[JrnlMemo], T0.[ItemCode], T0.[Dscription],T2.[ItmsGrpNam], T3.[SlpName], month(T0.[DocDate]), year(T0.[DocDate])

hello,

I need your help with the query below. (my goal is to have the base price which is in the sales documents (INV1, DLV1, RIN1, RDN1) but not found in the OINM table. thank you in advance.

SELECT year(T0.[DocDate]) as 'ANNEE', month(T0.[DocDate]) as 'Mois', T0.[BASE_REF], T0.[Warehouse], T0.[CardCode], T0.[JrnlMemo], T0.[ItemCode], T0.[Dscription], SUM(T0.[OutQty]) - SUM(T0.[InQty]) AS 'TOTAL QTY', SUM(T0.[Price]* ((T0.[OutQty]) - (T0.[InQty]))) AS 'TOTAL CA HT', SUM(T1.[LstEvlPric]* ((T0.[OutQty]) - (T0.[InQty]))) AS 'TOTAL PR', T2.[ItmsGrpNam], T3.[SlpName] FROM OINM T0 INNER JOIN OITM T1 ON T0.[ItemCode] = T1.[ItemCode] INNER JOIN OITB T2 ON T1.[ItmsGrpCod] = T2.[ItmsGrpCod] INNER JOIN OSLP T3 ON T0.[SlpCode] = T3.[SlpCode] WHERE T0.[TransType] IN ('13' , '14' , '15' , '16' ) AND T0.[DocDate] >=[%1] AND T0.[DocDate] <=[%2] GROUP BY T0.[BASE_REF], T0.[Warehouse], T0.[CardCode], T0.[JrnlMemo], T0.[ItemCode], T0.[Dscription],T2.[ItmsGrpNam], T3.[SlpName], month(T0.[DocDate]), year(T0.[DocDate])

1 REPLY 1
Read only

jerryjanda
Community Manager
Community Manager
0 Likes
628
  • SAP Managed Tags

Hi, 1m9e8d7:

Welcome to the SAP Community! We're glad you've come here to get answers to your questions. If you're also interested in connecting with community members, please pay a visit to our Welcome Corner. You'll need to sign up, but it's a great way to interact with peers and connect with other experts!

Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.

First, please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Second, feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html, as that will help you when submitting questions to the community.

You should also make sure your e-mail notifications are turned on for "Comments and answers to my questions and questions I follow" at #communications -- so you won't miss any replies to your question.

In addition, I recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

Now for some specific suggestions on how you might improve your question:

* Outline what steps you took to find answers (and why they weren't helpful) -- so members don't make suggestions that you've already tried.

* Share screenshots of what you've seen/done (if possible), as images always helps our members better understand your problem.

* Make sure you've applied the appropriate tags -- because if you don't apply the correct tags, the right experts won't see your question to answer it.

* Use the "insert code" option to make your post easier for members to read.

Should you wish, you can revise your question by selecting Actions, then Edit.

I hope you find this advice useful, and please let me know if you require any additional guidance!

All the best,

--Jerry

Make sure to subscribe to What's New!