How to retrieve Sales rep name tagged to AR Invoice in a query.

Hi,
We need to display the sales person name which is tagged to the AR Invoice for our internal sales commission tracking.
The problem here is if we use OSLP table to get this information the data retrived is the Sales rep name as seen in the BP data.
In our scenario, even though a slaes rep is linked to a particular customer, sales person are given incentives based on the Products sold hence for certain brand the sales employee for that Invoice is allowed to change.
When we create a query to list invoices and payments against the invoice we are not able to display the sales rep name that is tagged to the Invoice.
Is there a way to display the sale persons name in a query using 'CASE' statement?
or is there wany other way out.
Please advise.
Regards

Hi Gordon,
Thanks for your reply!
The query is as: (Query for displaying the invoice and the payment received by cheque against the invoices )
SELECT T1.CardCode, T1.CardName, T0.DocDate as 'Posting Date', T0.DocNum as 'AR Invoice Number',T0.DocTotal as 'AR Invoice
Total', T0.DocTotalFC as 'AR Invoice Total FC', T1.DocDate as 'Payment Date', T2.DocNum as 'Incoming Payment Number ',
T2.DueDate as 'Check Due Date' , T2.CheckNum as 'Check Number', T2.CheckSum as 'Amount, (select SlpCode, 'Sales Rep Name'=
CASE
when
SlpCode = '8'THEN 'Amir Mehmood'
SlpCode = '7'THEN 'Anwarul Chowdhary'
SlpCode = '2'THEN 'Calvin Ching'
SlpCode = '5'THEN 'Calvin Ong'
SlpCode = '4'THEN 'Darren Ting'
SlpCode = '6'THEN 'Dev Puri'
SlpCode = '12'THEN 'Edison'
SlpCode = '3'THEN 'Janet Teo'
SlpCode = '13'THEN 'Kah Leong'
SlpCode = '-1'THEN 'No Sales Employee'
end)
FROM OINV T0 INNER JOIN ORCT T1 ON T0.ReceiptNum = T1.DocEntry INNER JOIN RCT1 T2 ON T1.DocNum = T2.DocNum where T0.DocDate
>=[%0] and T0.DocDate <=[%1]
PS: the CASE statement above needs correction.
Regards,

Similar Messages

  • How to retrieve the parameter names from a JSP page ? Urgent Please

    Hello,
    Can anybody tell me how to retrieve the parameter names from the JSP
    page. (without using getParameterNames() method.)
    The problem with the getParameterNames() method is I get the Jumbled output.
    I need it very badly
    With regards
    Ananth R
    email:[email protected]
    [email protected]

    Dear duffymo,
    My primary intention is to convert the JSP form information into a XML file.
    If I do not get the Parameter names in the correct order how can I maintain
    tag order in XML file.
    For ex: (JSP PAGE VIEW)
    Name--
    FirstName
    MiddleName
    LastName
    Address--
    Street1
    Street2
    City
    Country
    &so on
    (XML File to be generated)
    <Name>
    <FirstName>Value</FirstName>
    </Name>
    <Address>
    <street1>value</street1>
    </Address>
    & so on
    If I use getParameterNames() to get all the parameter names(Which form the tag names in the XML file ) the Enumeration object it returns will not be in the same order as the text fields in JSP.From this I can not construct a meaningful XML file.
    order means: Order of entry on the page, from top to bottom
    That's it
    Waiting for your responses

  • How to retrieve various file names from a filepath of application server

    Hi All,
    I am using a FILEPATH  of application server which can have multiple file names i want to retrieve data from all the existing files.
    i am using FM "GET_NAME_FILE" but it is applicable only for file name.
    so my question is how to fetch various file names of particular filepath.
    Thanks in advance.

    Hello Mayank,
    You can use the below FM and code
    PARAMETERS: p_file TYPE rlgrap-filename.
    ***AT Selection-Screen*******
    AT SELECTION-SCREEN ON  VALUE-REQUEST FOR p_file.
    ***Function  module for F4 help from Application  server
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    * EXPORTING
    *   DIRECTORY              = ' '
    *   FILEMASK               = ' '
       IMPORTING
       serverfile             =  p_file
       EXCEPTIONS
       canceled_by_user       = 1
       OTHERS                 = 2
      IF sy-subrc = 0.
        MESSAGE 'Successful'  type 'I'.
      ENDIF.
    Regards,
    Mithun Shetty

  • How to retrieve the Field Name of a Table

    Hi guys,
    I'm trying to retrieve the field name of a table in java, but i don't know how to do it. Could somebody help me?Let say i have a table name Itemmaster, then
    i want to retrieve its field and display to dos prompt.
    Example :
    Item No.
    Description
    Quantity
    It is possible to retrieve the fields?
    What could be the possible command in java using packages Java.sql.*?
    Thanks in advanced...
    Best regards,
    Dharry

    The ResultSet class, which is how query results are returned in JDBC, has methods to get at the metadata for the table queried, including column names:
    ResultSet resultSet=statement.executeQuery("select * from table");
    resultSetMetadata=resultSet.getMetaData();
    resultSetMetadata.getColumnLabel(column+1);

  • How to get Sales rep information for each customer

    Hi
    For each record in ra_customers, I want to find associated Sales rep for each customer.
    Can some one please tell me what table stores this information?
    Thanks
    Aali

    Try
    SELECT rc.customer_name, rc.customer_number, jrs.NAME
      FROM jtf_rs_salesreps jrs, ra_customers rc
    WHERE rc.primary_salesrep_id = jrs.salesrep_idHope this helps,
    Sandeep Gandhi

  • How to Retrieving Mandatory Filed name from Tcode.

    Hi,
    I need to retrieve mandatory field names from tcode like (mm01)  using abap programming..
    How to find that field name is mandatory?
    Thanks and Regards,
    Meena

    Hi Meena,
    I guess you need to manually find it out and make z-table which can be used for further logic.
    Once you have table for required fields, you can even add/remove any field depending on your requirement.
    I also faced the same issue and we maintained it in ztable as follows.
    MANDT  
    FIELDNAME   
    STATUS
    For STATUS , create fixed domain values as "REQUIRED", "HIDDEN", "GRAYED OUT".
    I hope this will help you.
    Regards,
    Rahul Mahajan

  • How to retrieve Process Role Name

    Hi @ all,
    can anyone tell me how to retrieve the Name of the actual processing Role in a web dynpro callable object.
    Until now I just found out how to get the technical name in the execute() method. Unfortunately it's not the human readable name.
    e.g.
    String name  = executionContext.getProcessRoleInstance().getProcessRoleTechName();
    Thanks and Regards
    Robert

    Hi Robert,
    After you created a process, block, action, and your WD GP interface callable object and would retrieve this information in custom way you can use the following coding:
    <code>
    String processId = executionContext.getProcessId() ;
    IGPRuntimeManager runtimeManager = GPProcessFactory.getRuntimeManager() ;
    IGPProcessInstance process = runtimeManager.getProcessInstance(processId, getCurrentUser()) ;
    IGPProcess processTemplate = (IGPProcess)process.getTemplate() ;
    int gpRolesSize = processTemplate.getRoleInfoCount() ;
    String roleDisplayName = null ;
    for (int i = 0; i < gpRolesSize; i++)
           IGPRoleInfo role = processTemplate.getRoleInfo(i) ;     if (role.getRoleName().equals(roleTechName))
                roleDisplayName = role.getText()
                break ;
    </code>
    Best regards,
    Aliaskei

  • How do I keep the name tags in Picasa Web Albums from appearing on the images by default? With Explorer, name tags only appear when mousing over the image, but with Firefox, all the tags appear on the picture as soon as it is loaded, which looks messy.

    I use Picasa to create web albums, and I tag people who appear in the pictures. With Explorer, the name tags do not appear on the pictures until I mouse over a specific person, at which point the tag appears. With Firefox, the name tags appear as soon as the picture is loaded, and only disappear when you mouse over the people in the picture. This makes the picture look messy; by default, one would want to see a picture without tags all over people's faces.
    The only way to "fix" this is to disable the name tags completely (or tell people to use Explorer!), but this is not an ideal solution, since I would like to be able to share albums with people's names in them.

    I use Picasa to create web albums, and I tag people who appear in the pictures. With Explorer, the name tags do not appear on the pictures until I mouse over a specific person, at which point the tag appears. With Firefox, the name tags appear as soon as the picture is loaded, and only disappear when you mouse over the people in the picture. This makes the picture look messy; by default, one would want to see a picture without tags all over people's faces.
    The only way to "fix" this is to disable the name tags completely (or tell people to use Explorer!), but this is not an ideal solution, since I would like to be able to share albums with people's names in them.

  • How to change sales rep territory

    Hi,
    We have a new sales rep. covering the mid west territory.  What is the best way to change the whole terriority?  We tried changing it in the "Administration, set-up, general, sales employees"  The territory was updated to the new sales person  but all previous invoices belonging to the old salesman were changed to the rew salesman too.
    Thanks.
    Chloe

    Perhaps use DTW to upload the change to the business partner master data.

  • How to retrieve child attribute names in XML?

    How do I retieve only the child attribute names from the XML.
    XML:
    <catalog>
         <book>
               <author></author>
               <title></title>
               <genre></genre>     
               <price></price>    
         </book>
    </catalog>Expecting result:
    author
    title
    genre
    price
    I tried with the SAX Parser and class extending DefaultHandler it returns catalog and book aswell which I do not want to retrieve.
    public void startElement(String namespaceURI, String localName,
                                     String qName, Attributes atts)  {
                   System.out.println(qName)
    //this returns catalog and book along with the other attribute names
    }

    gsry wrote:
    jverd wrote:
    Your problem is not clear. Are you saying you want only the leaf nodes? Or are you saying you want all the /catalog/book child nodes, even if they're not leaf nodes? Or something else?I do not know what leafy nodes mean but i want to retrieve all the child nodes (tag names).
    <catalog>
         <book1>
               <author1></author1>
               <title1></title1>
         </book1>
         <book2>
               <author2></author2>
               <title2></title2>
         </book2>
    </catalog>In this example i want to retrieve author1, title1, author2, title2
    Also, you're still not specific enough. For instance, what if there's another layer before author and title. Do you want that? What about if there's another level under author and title, do you want that? Can those situations even happen?
    Do you want nodes at a certain level?
    At a certain level and below?
    Always author and title nodes, regardless of where they appear?
    Always author and title, but only if they're immediately enclosed by book? Or by book<some number>?
    Author and title only when they're under /catalog/book?
    If you can't specify your requirements precisely, it's going to be awfully hard for someone to help you.

  • Update sales rep name

    Dear Experts,
    we need to update the salesrep names, could you send me how and which T code do that?
    Regards
    Amir

    Dear Amir,
    Just check with my post in to thread:
    [Sales Employee|Re: Sales Employee]
    I hope, this would help you, some extent.
    Best Regards,
    Amit

  • How to retrieve form user name?

    Hi !
    If I catch from v$session module name (i.e. CEXCABMR form) how to get the name to ask user what is he/she doing on that form....
    You know "CEXCABMR" is not a good name for them....
    THX

    THX that was in the same time as my solution:
    set linesize 220;
    set pagesize 1600;
    set head on;
    col form_name for a15;
    col user_form_name for a36;
    col language for a3;
    col app_us for a25;
    col app_hr for a25;
    col creation_date for a20;
    col last_update_date for a19;
    accept form_name char prompt 'Input SHORT form name (Enter for all): ';
    break on form_name on user_form_name
    SELECT DISTINCT
      form_name,
      ftl.user_form_name,
      (select application_name from apps.fnd_application_tl tl where tl.application_id=atl.application_id and language='US') app_us,
      (select application_name from apps.fnd_application_tl tl where tl.application_id=atl.application_id and language='HR') app_hr,
      to_char(ftl.creation_date,'dd.mm.yyyy hh24:mi:ss') creation_date,
      to_char(ftl.last_update_date,'dd.mm.yyyy hh24:mi:ss') last_update_date
    FROM
      apps.fnd_form frm,
      apps.fnd_form_tl ftl,
      apps.fnd_application_tl atl
    WHERE
          frm.form_name like '&form_name%'
      and frm.form_id = ftl.form_id
      AND ftl.application_id = atl.application_id
    ORDER BY 1,3,2
    ;

  • Reinstalled PSE7 - how to retrieve albums and keyword tags? [Was: Question]

    Hiya
    Using Photoshop Elem’7- I have had a major problem with my pc and I have gone back to factory settings, I have reloaded the Photoshop software – I can see all my photo’s back on my hard drive and also on Photoshop but I cannot retrieve my albums and keyword tags
    Can anybody help me on this topic?

    Hi
    This is actually the Photoshop forum, and you would do better in the Elements forum. 
    http://forums.adobe.com/community/photoshop_elements
    But it seems that Elements creates a catalog file where I suspect it keeps the info you are looking for.
    This is one link, but you could try Google with Adobe Photoshop Elements catalog location, ot just go ask in the other forum.
    http://don26812.wordpress.com/2009/06/18/photoshop-elements-catalog-file-the-critical-link /

  • How to retrieve Sales report on Web page

    hi,
       I want to fetch sales report on web page and accessable only admin,so how to do this ?

    import java.net.*;
    import java.io.*;
    public class httptest
        public static void main(String[] args) throws Exception
         URL url =
             new URL("http://www.bonjour.fr/bonjour_fichiers/affichepa2.cfm");
         HttpURLConnection c = (HttpURLConnection)url.openConnection();
         c.setDoInput(true);
         BufferedReader br = new BufferedReader(new InputStreamReader(c.getInputStream()));
         String line;
         while( (line=br.readLine()) != null ) {
             System.out.println(line);

  • How to retrieve  sales Order details from BAPI_SALESORDER_GETLIST

    Hi Experts,
    I am using Visual Studio 2003 and SAP.Net Connector for Microsoft .NET 1.0.3 .
    I need to get the details of sales order.Following is the code snip.
    protected ConnectorDemo2.BAPIRETURN bapireturn;  /*Manually Added */
    proxy.Connection =  SAP.Connector.SAPLoginProvider.GetSAPConnection(this);
    proxy.Bapi_Salesorder_Getlist("0000000006","","","","","","0001","0",
    out bapireturn,ref bapiordersTable1);
    I already check records in SAP R/3 system for data Cust No=00000006 and Sales Org=0001.
    Please let me know about out parameter and if anyone is having correct list of ref and out parameter.
    Help will appreciated and points will rewarded.
    Thanks
    Sunil Pawar
    Edited by: Sunil Pawar on Nov 26, 2008 1:54 PM

    To Solve the problem I created one custome RFC and call BAPI_SALESORDER_GETLIST in it and my problem get solved.
    This is just work around but still not found why no data when using OUT parameter.
    CALL FUNCTION 'BAPI_SALESORDER_GETLIST'
      EXPORTING
        CUSTOMER_NUMBER             = Z_CUSTOMER_NUMBER
        SALES_ORGANIZATION          = Z_SALES_ORGANIZATION
    IMPORTING
      RETURN                      =
      TABLES
        SALES_ORDERS                = Z_SALES_ORDERS
    Thanks
    Sunil Pawar

Maybe you are looking for