Adding Sales Employeed Name to Query
Hi Guys,
I have this query and would like to add to it the name of the Sales Employee that created the Sales Order, I am relatively certain I need to use the OSLP table to get this information but am not so sure on the JOINS required to add it. Any help would be greatly appreciated.
SELECT T0.DocNum as 'SO No.', T0.DocDate as 'Date', DateDiff(DD, T0.DocDate,
GetDate()) AS 'DayDiff', T0.CardCode as 'Customer Code', T0.CardName as 'Customer Name',
T0.NumAtCard as 'Ref/PO No.', (T0.DocTotal - T0.VatSum) as 'SO Amt'
FROM OINV T0
WHERE
DateDiff(DD, T0.DocDate, GetDate()) >= '1' AND DateDiff(DD, T0.DocDate, GetDate()) <= '7'
Many Thanks Sean
Try this:
SELECT T0.DocNum as 'SO No.', T0.DocDate as 'Date', DateDiff(DD, T0.DocDate,
GetDate()) AS 'DayDiff', T0.CardCode as 'Customer Code', T0.CardName as 'Customer Name',
T0.NumAtCard as 'Ref/PO No.', (T0.DocTotal - T0.VatSum) as 'SO Amt',T1.U_Name
FROM dbo.ORDR T0
INNER JOIN dbo.OUSR T1 ON T1.USERID=T0.UserSign
WHERE
DateDiff(DD, T0.DocDate, GetDate()) BETWEEN 1 AND 7
You don't need 100 year. May not even 100 day if you really want to learn.
Similar Messages
-
Sales Analysis by Item Group (Monthly) - To include Sales Employee Name
Hi,
I have added Sales Employee Name in the Sales Analysis by Item Group (Monthly) report by A/R Invoices. I have added this under Repetitve Area Header0. However, the sales employee name showed in the preview is different than the criteria entered. It seems that the report only the first Sales Employee Name in the report.
Anyone have any idea? Thanks in advance
Regards,
MHThat is a good question. You have to find out any unique relationships between your Sales Employee and your sales analysis data if there is. Hope the help below can assist you:
Relate to
This option is relevant for special scenarios only and requires knowledge of SQL.
This field is used for retrieving data related to key records found in tables other than the table linked as default to the current print template.
A key record is a field used as a primary key in a certain table. This key record functions as the identifier of the record, and, therefore, it is required to retrieve any additional data related to it.
Following is an example:
e.g.If you need to print the name of a certain bank, which is not linked to the table used in the current print template, you must first create a Text field of Database source type using the required table and select a key record, such as Bank Code.
Then, you need to create an additional Text field of Database source type. Select the table again, select the required column (such as Bank Name), and enter the unique ID of the field with the key record in the Relate to field.
There might be two or more key records in the same table. In such a case, these two key records are both required for retrieving the data.
Identical bank codes are used in many countries. If you need to print the name of a specific bank, you need to link it to a relevant country, in addition to its relevant bank code.
You are currently working on a print template for Incoming Payments. However, you need to retrieve data (such as the business partner's bank name) linked to the key record Bank Code from the Bill of Exchange for Payment table, rather than from the Incoming Payments table.
In the Relate to field, select the unique ID of the field containing the required key record. In this example, this is a Text field of Database source type containing Bill of Exchange for Payment in the Table field and BP Bank Country in the Column field. The drop-down list contains the unique IDs of all the fields that are situated in the same area as the current field.
This link makes the system retrieve the Bank Code linked to the BP Bank Country field found in the Bill of Exchange for Payment table. -
XL Reporter - Sales Employee Name
Has anyone else had issues getting Sales Employee Name to show up correctly on XLReporter from the default employee linked to a business partner? We can get the Employee code to show up correctly but when adding the name it always displayes "no sales employee" even though there is one specified.
You need select both codes and names. Code can be hidden. Have you tried that?
Thanks,
Gordon -
Require Sales Employee Name when creating SO or AR Invoice
Hi everyone,
I would like to set up my Sales Orders and AR Invoices so that it is required to enter a Sales Employee Name. Is there a way to make it so that if no Sales Employee name is entered, a pop up will require you to go back and enter one in the same manner it does for Posting Date.
Thanks,
HaydenHello,
Add this code in SQL .
Open SQL>Select your Database(Comapny DataBAse)>Programbility>Find([dbo].[SBO_SP_TransactionNotification] ) >right click and modify it.
and paste the code at that place between dot dot line.
This Code for Invoice Docuement.
if (@object_type = '13' and @transaction_type = 'A' )
BEGIN
IF exists ((SELECT OINV.DocEntry
FROM OINV where slpcode = -1 and OINV.Docentry = @list_of_cols_val_tab_del ))
Begin
select @error =@object_type
select @error_message = N'Please fill Sales Employee in Business Partner master Data'
End
END
This Code for SAles OrderDocuement.
if (@object_type = '17' and @transaction_type = 'A' )
BEGIN
IF exists ((SELECT OINV.DocEntry
FROM OINV where slpcode = -1 and OINV.Docentry = @list_of_cols_val_tab_del ))
Begin
select @error =@object_type
select @error_message = N'Please fill Sales Employee in Business Partner master Data'
End
END
If you got any issue revert same.
Thanks
Manvendra Singh Niranjan -
Linking Sales Employee name/code to Employee data
I want to display the phone number and email address for the name that is selected in the Sales Quotation Sales Employee field in my sales quotation form. I am having a hard time making the link between the two tables so I can display the correct information.
Any tips will be welcomed.Thank you. Here are the details of what I did.
The Sales Quote shows:
Sales Employee: Gary and his Employee No. is 41
Owner: Octavio and his Employee No. is 11
In the Print Layout Designer I have the following fields and their results:
Employee:Sales Employee = 14 (I don't know where this number comes from)
Employee:Employee No. = 11 (this is the Owner's employee number)
Employee:Office Phone = phone for Owner
If I reverse the names in the Sales Quote:
Sales: Octavio and his Employee No. is 11
Owner: Employee: Gary and his Employee No. is 41
In the Print Layout Designer I have the following results:
Employee:Sales Employee = 22 (I don't know where this number comes from)
Employee:Employee No. = 14 (this is the Owner's employee number)
Employee:Office Phone = phone for Owner
Maybe you can help explain where the Sales Employee numbers come from? Otherwise I think I know what to do.
Thank you.
Francisco -
FMS to get sales employee in incoming payment screen
Dear Experts,
I have created a UDF in the incoming payment screen, kindly provide a query for the following scenario, whenever customer code is input in the incoming payment the UDF has to populate the Sales Employee name linked to the customer in the business partner master data.
SaravananDear Saravanan,
Please save this query and attach it to your Sales Employee Name UDF:
SELECT T0.\[SlpName\] FROM OSLP T0 INNER JOIN OCRD T1 ON T0.SlpCode = T1.SlpCode WHERE T1.\[CardCode\] = $\[$-5.CardCode\]
Have it refresh when the Customer / Supplier number changes.
As its referencing screen data it will only run as a formatted search and will error if you run it from a query screen.
Regards,
Adrian
PS, as you are adding it to a UDF its good practice to add the - in between the $ and the 5. This will mean it will run the FS manually by pressing shift F2. -
Sales Employee Description is not following into COPA
Dear Experts
I have set sales employee as a characteristic in my operating concern that was triggered from PAPARTNER. From there I developed then run COPA report painter (KE30) for sales employee with ALV display options. In fact the report can only display sales employee code, without the description. I desperately need sales employee description in my report, based on user requirement.
Here we didn't activate HR module. In the same time SD has defined Sales Employee as Partner Function (SE) in customer master data. The Partner Function is looked up the sales employee name from HR table, PA0001 so that they can display sales employee code and name in the customer master data.
From the story above I've tried to do some ways, such as:
Changed display options from ALV to Drilldown -> with this way, sales employee description can appear from the report, but actually I just need the ALV report because of my client didn't accept the report layout except ALV. This is my big problem.
2. I found other threads with similar problem with me, then I tried to follow that instructions that will be described below:
I tried to create new char WW100 with PARVW table for sales employee then follow these steps:
Create 2 derivation rules in KEDR using table look up (table VBPA) for the same partner function
1. In one Der Rule, make the sale order item KDPOS as constant value 0000
2. In the other one, dont make it a constant....Leave it as it is
DERIVATION RULE 1
SOURCE FIELDS
VBPA-VBELN = COPA-KAUFN
VBPA-POSNR = COPA-KDPOS
VBPA-PARVW = GLOBAL-USERTEMP1 (Click on Magnifying lens.. Specify Constant = Your SD Part Function)
TARGET FIELDS
VBPA-KUNNR = COPA-WW100
DERIVATION RULE 2
SOURCE FIELDS
VBPA-VBELN = COPA-KAUFN
VBPA-POSNR = COPA-KDPOS (Click on Magnifying lens.. Specify Constant = 0000)
VBPA-PARVW = GLOBAL-USERTEMP1 (Click on Magnifying lens.. Specify Constant = Your SD Part Function)
TARGET FIELDS
VBPA-KUNNR = COPA-WW100
Unfortunately the ways above still can't solve my problem, the report still only show the sales employee code without description. At the last whether possible if i want sales employee characteristic with origin table coming from PA0001, so that data will derive from HR table? or perhaps any other solution to solve my case?
Please suggest me in detail..
Thanks a lot
Regards,
MaradonaHi Maradona,
I want a clarification - Does the value flow properly to the value field and only the description is not coming?
1. If the value flow is proper and only description is a problem, then check whether compunding has been used in KEA5 for the characteristc WW100? If yes, check the text table for WW100 and compare it with the origin table in terms of the fields in both the tables.
(My guess is that not all the compunding characteristics are available in text table)
2. If value flow is a problem, then compare SE16 and SE16N for any sales order for the denotion of partner function field PARVW. Sometimes the denotion of partner function (two character code) may vary in SE16 and SE16n.
Get back for any more query
BR
Abhi -
Showing Monthly Sales Analysis for Sales Employees (including credit notes)
Hi Experts,
I want to show a report for my director so we can accurately decide upon sales targets for each sales employee for 2012.
The Monthly Report > Invoices by posting date in the Sales Analysis module is not ideal because it does not appear to include credit notes so the totals are incorrect.
How could I create a query which gave me a total for each month of 2011 for every sales employee which includes invoice minus credit notes.
Unfortunately my SQL is not great but I started something which might help - this is only for first 2 months of the year. I presume I would need a select statement for each month if I wanted to have the sales employee name followed by a total for each month. Maybe this is too intensive a query to run anyway.
SELECT T1.[SlpName],
(select(sum(t2.doctotal)-(t3.doctotal)) where (Month(t2.docdate)=1 and t3.docdate=1) FROM OCRD T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode INNER JOIN OINV T2 ON T0.CardCode = T2.CardCode INNER JOIN ORIN T3 ON T0.CardCode = T3.CardCode)
(select(sum(t2.doctotal)-(t3.doctotal)) where (Month(t2.docdate)=2 and t3.docdate=1) FROM OCRD T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode INNER JOIN OINV T2 ON T0.CardCode = T2.CardCode INNER JOIN ORIN T3 ON T0.CardCode = T3.CardCode)Hi,
I have moved your posting here because it belongs here.
You may check this first: Re: Top Customers report
Thanks,
Gordon -
Regarding "Sales Employee" with Activity
*Is it Possible to create sales Employee as USER and it will be shown in Drop DOWN in"Assigned To" in Activity Windows
Is there any Problem if we create users as Sales Employee*
Regard
Nishikant S VirkhareThe sales employee and user are independent entities in the system. But you can make connections e.g. using the user name as the sales employee name. Then the drop down in u2018Assigned tou2019 will allow a choice from the sales employees. If you donu2019t want to choose from all the users, you can differentiate the names belonging to sales employee (e.g. adding the u2018- s.e.u2019 to the name).
-
How to avoid save same employee name under same company name
hi,
i am doing flex4 web application with mxml tags,
i am having one text box and one datagrid and one save button. text box having one company name, data grid having employee names.
when i click save button which is placed in outside the datagrid it will save all the details.
Now my requirement is text box having the same company name and when i enter same employee name in datagrid and click save button means it wont
allow to save that record, and through msg box with some alerts.
How to do this,
Any suggession or snippet code are welcome
Thanks ,
B.venkatesanhi raghs,
i want to add records in cloud.bt while adding the records if we enter existing record details and try to save again na it wont allow to that record.
that time the alert box should show this msg "This record is already existing record in cloud database.
ex: one company name called mobile. i am adding a employee name called raja now i save this record,its data saved in cloud DTO
again try to add same employee name raja under the same compny means it should through error.
I am give my code here please if any suggession tel.
CODE:
private function saveRecord():void
refreshRecords();
model.employeeDetailsReq=new EMPLOYEEDETAILS_DTO();
var lengthindex:uint=model.employeeDetailsReqRecordsList.length;
var i:int;
for (i = 0; i < lengthindex; i++)
if((model.employeeDetailsReqRecordsList.getItemAt(lengthindex).employ ee name==customerdet.selectedItem.employeename)&&
(model.employeeDetailsReqRecordsList.getItemAt(lengthindex).employeeN umber==customerdet.selectedItem.employeeID)){
Alert.show("you cannot Add Same CustomerName and Invoiceno again");
(when this line come the error through like this: Index '8' specified is out of bounds.
else
var dp:Object=employeedet.dataProvider;
var cursor:IViewCursor=dp.createCursor();
var employeename:String = employeename.text;
model.employeeDetailsReq.employename = employeename;
model.employeeDetailsReq.employeeNumber=cursor.current.employeeID;
var sendRecordToLocID:QuickBaseEventStoreRecord = new
QuickBaseEventStoreRecord(model.employeeDetailsReq, new
KingussieEventCallBack(refreshList))
sendRecordToLocID.dispatch();
<mx:Button id="btnAdd" x="33" y="419" enabled="false" label="Add" width="65" fontFamily="Georgia" fontSize="12" click="saveRecord()"/>
employeename and employeeID are datafields of datagrid. datagrid id=customerdet
employeeDetailsReqRecordsList---recordlist of save records
Thanks,
B.venkatesan -
Sales employee wise sales report
Hi,
Can anyone explain me,how to write functional specifications to obtain sales employee wise sales report?
Thanks in advance..
Regards..
Yogi...Hi
This is the standard T Code for sales employee-MCTI
But as per your requirement we hv to create.
Examplemy past implimantation..we hv captured sales employee as partner function.sales employee1& 2 with peoper partner determination proceture.then we hv captured at Billing document Header Partner function.
This Sales employee name has to captured through HR Master data.According U hv to say only the business process and from where data has to captured to ABAPER.
I think it ll help
Regards
JAGA -
BP Master Window, Sales Emp Code used to display Sales Empl Name now displ
BP Master Window, Sales Emp Code used to display Sales Empl Name now displays Sales Emp Code
Our customer has noticed that when they do a search in the BP Master window that one of the
columns that is displayed called the Sales Emplyoyee code s not bringing up the Sales Employee Name
as it once was...
I have checked my local version and in the sales employee code column the name of the sales
employee is displayed NOT the code.
sales employee code column is displaying the code number where once it displayed the name and
even in the play system and in our local version it is displaying the name
as above
Nothing has changed on the system. We have not done any upgrades.
I have checked in SAP notes and could not find any information
Thanks for your help in advance
DHi
There is no option for Sales Employee Name.
However on my system if i select Sales Employee Code it actually shows me the Sales Employee Name.
Which is what my customer orginally had .
For my customer it is now showing Sales Employee Code as Sales Employee Code
However it was previously showing Sales Employee Code and giving a Sales Employee Name instead.
They need the Sales Employee Name not Code
Thanks
D -
Hi All,
how to calculate the sales employee comsission based ont he sales done hy him.
regards
SunilHi
First of all you need to capture the sales employee name in the sales order.
You can do this through creating the Sales Person with transaction PA30/20/40
add the same sales employee in sales order.
You can extract the report based on the sales employee and sales and pay them.
If your company does have HR module impletemed , you can capture the sales employee name in the additional fields provided in the sales order.
regards -
Customer master sales employee
Hi,
Can anyone let me know how to pull the sales employee name from the customer master structure field RF02D-VTXTM?
Thanks for your response.Start with KNVV, but since we don't maintain sales data for customers I can't help any more.
Any one else?
Rob -
Query help for sales employee sales
Hi....
How can we have a query for
Name of sales employee
Item group
Item name
Total selling amount
Total sales order
Total delivery
Total AR invoice
Please help
Thanks a lotHi,
What Total selling amount do you need? Invoice - Credit Memo?
How about the other Total, total count or total amount?
Thanks,
Gordon
Maybe you are looking for
-
I need to know the best usb interface for garage band
need to record at least 4 xlr inputs at same time on seperate tracks price is an issue cheaper is better maybe a usb mixer?
-
IPhone stuck on silent mode after update. Is there a fix for this?
Is anyone else having trouble after the last update?
-
Big bug!!---could not transform resource block data to report in webforms
I setup Oracle 9ias rel2. Use Run_report_object to invoke report. the report output doesnot be consistent with the resource block of forms and seems more record than the later. code like below : declare repid REPORT_OBJECT; v_rep
-
Data source for Region(regio)
I am not able to find Datasource for Region for transformation. so i want to know about data source for region(regio) master data .
-
Just want to check if account is hacked as I see both my apple devices as offline even when I am accessing it from my own Mac! Does this mean my account has been hacked ?