Passing customer id(logged in user)  to BAPI

Hi,
I am creating a sales order application where in i have to pass the user id (customer  logged in through portal) .
I have made the MODEL RFC as ticket, and meta data as user id password where i have passed the service user and password.
Now my problem is that there will be 'N' customer ids in Portal but we are not creating any customer ids in SAP ECC. We are planning to pass the user id of portal logged in user to ECC (which will be customer id) and get the data based on the customer id passed.
Question is how do i pass customer id to BAPI, ? Do i have to make the MODEL JCO as user/password or ticket should be fine as i am getting information for only customer logged in Portal ?
How and where do i write the the following piece of code ? Should it be in wdDo init() or in the execute method of Controller ?
try{
IUser user = WDClientUser.getLoggedInClientUser().getSAPUser();
IUserAccount[] acct = user.getUserAccounts();
if(acct[0] != null)
String strUserid = acct[0].getLogonUid();
customer=strUserid.substring(0,strUserid.indexOf("."));
if(customer.equalsIgnoreCase(customer))
wdContext.currentYOURRFC_InputElement().setCustomer(customer);
}catch(Exception ex)
ex.getMessage();
Should the above code be in the component controller before i execute the BAPI ?
your help is appreciated.
Regards
PN

Hi Portal Newbie,
Your tickets and userid/password works as following:
Tickets: When u select SAP logon ticket (SLT), EP generates a ticket with the user id of the logged in user, attached to the ticket. Now when it reaches R/3 it will check for the same user id. If no such user id is exits it will throw an error. To over come this u can define a reference system where u can do the user mapping.
UIDPD: When u select this option u have to manually enter the user id and password in JCo. So when a EP user logs in the UID and password mentioned in JCo will be passed, not the EP user id, and R/3 will look for that user and execute the BAPI. And i guess u dont want that.
Solution:
As far as i have understood u dont want the same number of users in EP and R/3, (might be a licensing issue) and want only a few user IDs in R/3.
1. Select UIDPD in JCo, and in your BAPI add another field like "user_id" through which u can send the user id to R/3 and execute a query which shall return the value corresponding to that particular user. [issue: there is a limit to the JCo connections created for a user.] Also there is an api to handle JCo connection in webdynpro. There u can set the user id, password and client number. But here also the user id that you set should be present in R/3.
2. Select SLT in JCo and configure a reference system. You have to perform user mapping for every user. Now when a user logs in the ticket will contain the user id of EP and also the one u have mapped, ie the R/3 user. Make sure the R/3 user id exists in R/3. Now the sy-unam in BAPI will contain the R/3 user id. I guess there is an option to retrieve the EP user id from the ticket, but im not sure.
In your kind of scenario its always recommended to have same number of user ids in EP and R/3. If user names are same then there is no need to configure reference system.
Regards,
Piyush.
ps: reference system is just a system that we create in EP but in UME settings we have to specify this system as the reference system.

Similar Messages

  • Passign currenlty logged in user into transaction iview

    Hi Experts,
    I have query regarding the currenlty logged in user.
    Problem:
    I want to pass a currently logged in user as parameter to transaction iView.
    for example: zsapd.abc=userid. this userid should sent currently logged in user dynamically.
    How can we achieve that? is there any possible way? i have a screen field in my transaction iview, but only thing is i couldn't get the currenlty logged in user.
    Please help me, your inputs will be appreciated.
    Thanks & Regards,
    Lakshmi.

    Hi,
    Can any body suggest me to complete the below task.
    Regards,
    Sireesha.B

  • My Tasks View in my custom task list fails to display the tasks assigned to me (that is the currently logged in user)

    Hi
    I am new to sharepoint 2010.
    I created a custom task list, where I  have many tasks assigned to users (I had tasks assigned to me as well). I created a view as "My tasks "and having a filter as Assigned To is equal to [Me]. When I do that my view fails to show the
    tasks assigned to me. This happens same with the Sharepoints 'My Tasks' view as well. I tested by creating some test tasks under my name and when I selected 'My Tasks' view no tasks are getting displayed.
    Please help.
    Thanks,
    Gokulkumar.

    Hi,
    According to your post, my understanding is that you wanted to display the tasks assigned the current logged in user.
    In my environment, if I used the System Account, My Task view didn’t display any tasks.
    However , if I used other users except the System Account, My Task view could display current user tasks correctly.
    I recommend to use other accounts except System Account to log in site. Then everything will work well.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Custom report software installed with last logged on user.

    Can someone please help, I'd like to create a custom report: Specific software installed on a computer which includes last logged on user. I can do this by query but need a custom report for none ConfigMgr users.

    SELECT DISTINCT
    TOP (100) PERCENT dbo.v_GS_COMPUTER_SYSTEM.Name0 AS [Computer name], dbo.v_GS_ADD_REMOVE_PROGRAMS.DisplayName0,
    dbo.v_GS_ADD_REMOVE_PROGRAMS.Version0, dbo.v_R_System.User_Name0, dbo.v_R_System.User_Domain0 AS [User domain],
    dbo.v_GS_COMPUTER_SYSTEM.Domain0 AS [Computer domain], dbo.v_R_System.AD_Site_Name0 AS [Computer AD Site]
    FROM dbo.v_GS_ADD_REMOVE_PROGRAMS INNER JOIN
    dbo.v_GS_COMPUTER_SYSTEM ON dbo.v_GS_ADD_REMOVE_PROGRAMS.ResourceID = dbo.v_GS_COMPUTER_SYSTEM.ResourceID INNER JOIN
    dbo.v_R_System ON dbo.v_GS_COMPUTER_SYSTEM.ResourceID = dbo.v_R_System.ResourceID
    WHERE (dbo.v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 LIKE N'Adobe Shockwave Player%')
    ORDER BY [Computer name]
    Keep in mind that this query will only find x86 software titles. Use 
    v_ADD_REMOVE_PROGRAMS
    instead to get both.
    http://www.enhansoft.com/

  • Passing custom fields to BAPI

    Hi All,
    How can i handle the Quantity field using BAPIPAREX?
    EX.
    I have added the following custom fields to the standard table EKKO.   
        zf_base        (Price per ton, CURRENCY)
        zreq_tons      (Tons Required,QUANTITY)
        zpo_issue_date (PO Issue date,Date)
    Here I am using the bapi 'BAPI_PO_CREATE1' to create Purchase Order. How can i pass the above fields to BAPI.

    U dont have to create a Z verion. u can use extensionIN parameter. take a look at the bapi funtion module documentation. here is the hint,
    <b>Customer's Own Fields (Import Parameters)</b>
    This table allows you to add to the import parameters of the BAPI without modifying it.
    The customer enhancement SAPL2012 allows you to add to or modify the PurchaseOrder.Change and PurchaseOrder.CreateFromData1BAPIs by:
    •     Adapting existing SAP database tables
    o     Adding customer-specific fields to SAP tables
    o     Including existing database fields
    •     Including additional customer-specific database tables
    The following BAPI Table Extensions are available:
    •     BAPI_TE_MEPOHEADER
    •     BAPI_TE_MEPOHEADERX
    •     BAPI_TE_MEPOITEM
    •     BAPI_TE_MEPOITEMX
    •     BAPI_TE_MEPOACCOUNTING
    •     BAPI_TE_MEPOACCOUNTINGX

  • Get username and password of the currently logged-in user in CRM and pass it to the plugin

    Hi,
    I am integrating CRM Online and SharePoint Online. Right now I am using Office365 trial version for both. Hence, the same username and password works for both.
    I want to create sub-site in SharePoint on create of an entity record. Currently, I am passing the admin credentials. But, I want to pass the credentials of the currently logged-in user in CRM to the plugin which is getting executed on create of account entity.
    So that I can then create sub-site in SharePoint using the current user credentials instead of admin credentials.
    Is there way to achieve this?

    Hello,
    You would not be able to get login/password of currently logged in user. I believe usage of admin credentials is the best way to achieve your goal.
    Dynamics CRM MVP
    My blog

  • Best way to find the Customer of the logged in user

    Background: We're a tool provider. When our users grant the tool oauth access to their accounts, we need to get the customer ID and name as well as a list of accounts under the customer.
    What is not clear to us is how best to get the Customer name. It seems we need to make 2 requests; the first one is to use
    GetUserRequest to get the logged in user details, and then use the username as a filter with a
    SearchCustomersRequest call.
    The GetUserRequest returns the customer ID but not the name.  Hence, the need to use SearchCustomersRequest.
    We can't use GetCustomersInfoRequest because it requires us to provide a
    CustomerNameFilter which we obviously don't have.
    Is the above correct? Have we missed something anywhere?

    Yes you will need at least 2 calls e.g. GetUser -> SearchCustomers or
    GetUser -> SearchAccounts -> GetCustomer. Do any agencies use your tool? Keep in mind that an agency user cannot access the full client Customer details, i.e. in the same way that GetCustomer(clientCustomerId) will return a code 1001
    permissions error, SearchCustomers won't return the client's Customer object. This is by design since linking a client account to an agency only grants account level access - not customer level access. To ensure you get a full list of all accounts that a user
    can access (whether or not agency), please consider the GetUser -> SearchAccounts -> GetCustomer call pattern. For a related code example, see
    Search Customers by User in C#. 
    I hope this helps! Please reach out with any further related questions or concerns. 

  • How to get current logged-in user name in data access driver or in universe

    In universe, to get the current log in user is via @Variable('BOUSER').
    Right now, I need to be able to get the user name in the data access driver. I am writing a customized data access driver because we need to patch some where clause on the the query generated by the universe based on the logged-in user info. I only think of using end_sql parameter or adding an universe level filter to patch the @Variable('BOUSER') to the query, which would not work if user want to use customized query.
    Can anyone tell me how to get currentBO user name from connection server ? or how @Variable('BOUSER') is translated into the logged-in user name in the universe?

    I do not know your EJB Service. But you should pass the credentials of the current logged on portal user to your service. That's not by default I think.
    I had a similar problem with CAF developed webservices. I had to turn on permission checks in my web service and passed the credentials via logon ticket.
    Regards, Bernd

  • How do I only allow logged in users to see Wiki?

    I have set up a server and the website, but it only works if you forward the urls, in the DNS machine records, to the public ip address of my of my router. I only want to allow logged in users to be able to click on a wiki homepage link to see it. Also, typing in the internal ip address of a device on my network doesn't get me to my server unless I allow the Internet to see the wiki.
    So I would like to...
    1. Make users log in to be able to see anything, like people, profiles, and wikis.
    2. Allow intranet access to server with host names and server ip address
    3. Allow logged in VPN users to see the site (I'm guessing this would go along with number 2)
    4. If I need to add a custom site, how would I add the site so it would pop up when the URL is typed in and have a login window to be able to go the wiki site
    5. I don't want to mess up Profile Manager either
    I've tried many different things and can get one thing to work, but not the other.
    Thanks in advance!!!

    Files to change:
    /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/coreclientbase/pu blic/javascripts/sprockets.js
    /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/coreclient/app/co ntrollers/application_controller.rb
    /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/coreclient/app/he lpers/entity_url_helper.rb
    /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/coreclient/app/mo dels/sources/my_documents.rb
    /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/coreclient/app/mo dels/sources/my_favorites.rb
    /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/coreclient/app/vi ews/layouts/application.html.erb
    /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/coreclient/config /routes.rb
    /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/coreclient/config /initializers/register_apple_plugins.rb
    Folder to delete to remove iPad version of wiki
    /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/coreclientmobile/ public
    There are way to many lines of code in these files that are different to go through one by one.  I have put the files in google docs (server 2.2.1 mods). 
    There is a great program at the mac app store called CompareMerge you can go through the files line by line to see what is different. 
    Before doing anything I recommend coping all files that you are changing/deleting some where safe so if something goes wrong you can go back to the originals.
    Once all files have been replaced/deleted you have to open the server app and stop/start wikis

  • Sharepoint 2013 delivers documents through IIS too good! Need to restrict by logged in user

    I have a Sharepoint 2013 app that lets external users (https://) pull data from SQL to create links on the page that the user can click on to get documents to pop-up in the browser so they can view/save them.  The page sends the user's ID as a parameter
    and the stored proc uses that to return only the documents that user is allowed to see.  Took forever to figure out... looks great... my employer is going to be impressed and save money... yada, yada yada!  Problem is:  If you knew the name
    of a directory on the mapped location and knew the filename (somehow), and you had a login that got you to the site, you could successfully put that address in your address bar and the document would come up!  That's a bad thing!  I need to only
    let users see documents they have access to.
    I have been playing with the app pool settings and advanced settings for the sub-site, but it still lets me pull items that the logged-in user doesn't have permissions on the server to get to.  I haven't been able to prove it, but I suspect that IIS
    is sending another login credential to the directory to retrieve the file... something like "admin" or something that can have wider access.
    Here is my setup:  I have a directory on another server that is mapped to the Sharepoint Server box.  I have a Virtual Directory that points to that mapped drive.  My Sharepoint Page is on a site of its own and is called with the URL "https://reportcenter.<company
    name>.com".  There is only one page on the site.  When the page opens it provides links to documents on the Virtual Directory.  When you click on any of them the files appear in the browser just fine.  Sharepoint is running on a
    Windows 2012 R2 Standard OS.  The test user I am using is "Client1" and they are a member of the "SP_Clients" group which is not a member of anything else in Active Directory.  In the file directory I went to the Share list and
    made sure my test user and the SP_Clients group is not in the list... if the system tried to use Client1 there is no way they should get access.
    Any thoughts on what I can do to stop Clients from getting to files they shouldn't be?

    Thank you for your question and reply.
    No, the identity is not passed as a URL property.  The way it works is that SP verifies the user and sends them to the default page after they sign-in.  Once there, the page evaluates the UserID value and that values is passed to a stored procedure
    as a parameter.  The user can't get to the page unless they are verified by SP, they can't somehow go around this. 
    Now, once the page loads they click on one of files they wish to see (a link on the page that was created from the results of the stored procedure call).  The link points to a virtual directory setup in IIS that points to a mapped drive where the files
    are located.  The security on the files is set on the directories in their actual location.  I just need SP to pass the user's ID to the file directory and check the sharing rights on the file to see if this user has rights to get it.  It seems
    like SP is passing some other credential (probably SP_Admin, or Admin or something) which has the ability to read the file and therefore pass it back to the screen.
    I can't put the documents in SharePoint... they have to be in a file directory. The reason is that we have an elaborate program that runs every month to create these files and places them in the correct directories.  Somehow changing that application
    to create the files and place them programmatically in a SharePoint directory is beyond the scope of the project.  Under the circumstances, it would be much simpler to just provide the user a list of the documents they have access to and have them click
    on a link on a page and have the document appear in their browser.  Everything actually works, but I just have this last piece where SP is not 'telling' the file directory the UserID of the logged in user and therefore all the documents are available.
    All that needs to be done, is to make sure the userID is passed to the file directory so it can be checked against the security there to see if the user can have the file or not.
    I hope that makes sense.  I look forward to hearing back from you with your thoughts on this and how this can be accomplished.
    Thanks,
    Scott

  • 1. TACAS+ Accounting and Logged in Users report is not working on ACS 4.1(1

    Hi,
    I am facing problem with ACS 4.1 accounting, TACAS+ Accounting and Logged in Users report are not working, the csv file is been generated but nothing is showened in the file.
    I have checked the documents related to ACS 4.1, it says that there is a bug related to command accounting “CSCsg97429 - TACACS+ Command Accounting does not work in ACS 4.1(1) Build 23”.
    Tried upgrading the same with the patch applAcs-4.1.1.23.3.zip, still it is not working.
    Other reports are working fine.
    1. TACAS+ Accounting - not working
    2. Logged in Users - not working
    3. TACAS+ Administration - working
    4. Passed Authentication - working
    5. Failed Attempts - working
    Any suggestions or any idea, please revert.
    Regards
    Vineet

    Hi,
    Thanks
    Yes I have configured the command “aaa accounting exec default start-stop group tacacs+”
    As I have mentioned all the other reports are working. Which user and when he has logged in and what commands he has used. Only the TACAS+ Accounting and logned user is not working.
    Regards,
    Vineet

  • Status Report with Last Logged on User on a deployment

    Hi all,
    I have been trying to find a report that will telling me the deployment status of an application and against the workstations the last logged on user.
    Is there such a report or will I have to customize a report to do that?
    Cheers

    Hello,
    a report that will telling me the deployment status of an application
    You can refer to compliance report.
    For last logged on user, you can find the information in client propertities. If you want to query the information, you need create a customized report.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • How to get current logged in user's star rating in SharePoint 2013

    Hi,
    Currently,  I am developing a custom web part to show star rating for documents, everything is done.
    However,when user hover on the star I want a tooltip message("Your current rating is 1..."), similar to what we have 
    in libraries(or what the sharepoint by default provides in libraries) . So can I get the user specific rating depending upon 
    the logged in user using code(.net or CSOM anything will work)

    using the below code you can get the rated by user along with the rating , it's easier to just notify the user that her already rated the document 
    var acontext = new SP.ClientContext.get_current();
    var lists=acontext.get_web().get_lists();
    var l =lists.getByTitle("Documents"); //your document libraty
    var aitem=l.getItemById(27);//Item id
    acontext.load(aitem, "RatedBy", "ID", "Ratings");
    acontext.executeQueryAsync(function(){
    var RatedBy= aitem.get_item('RatedBy');
    if (!SP.ScriptHelpers.isNullOrUndefined(ratings)) {
    for (var i = 0; i < RatedBy.length; i++) {
    var user = RatedBy[i];
    if (user.get_lookupId() == _spPageContextInfo.userId) {
    //show that you already rate it
    break;
    },function(s,e){alert(e.get_message());});
    another way is to use CAML query to check if the current user id is within the RatedBy multi user field
    Hope that helps|Amr Fouad|MCTS,MCPD sharePoint 2010

  • VAT REPORT BASED ON CURRENT LOGGED IN USER

    Hi Guys,
    I am Working for a client and it they are having 9 branches and for each branch there will be  divided by different Series and different Tax Codes and  they want a  TAX Report based on the User Logged in.Each User Will be Assigned a branch and in the tax code an UDF(Location) has been created and for each tax code location has been entered there.
    So when User 1 of Branch 1 is running the report then the report should show only the record of that particular Branch 1 and
         When User 2 of Branch 2 is running the Report then it should show only branch 2 records .
    I Tired using an FMS to record the Current User Logged in but i am unable to include this in the below query.
    SELECT T0.U_NAME FROM OUSR T0 WHERE INTERNAL_K = $[USER]
    In the Below query , the Report needs to be filtered automatically based on the Current user Logged in(User who is running the report).
    There will be different Branches and Each Branch has One O Two Licenses and whenever the User1 Of Branch 1  runs the report then the report should display only the record related to that particular branch within the given date range.
    So ,to differentiate the Tax codes for each Branches we have created an UDF(Location) in tax codes and enter the branch name in the UDF and also each branch will have 3 different document series and each series.
    Instead of Giving the Location as a Parameter to choose we need to filter the report by the User logged in .
    SELECT distinct  M.DocNum AS 'AR Inv. #', M.DocDate as 'Date',
    l.targettype AS 'TARGET TYPE',
    t4.series,T4.SeriesName,
    case when T4.SeriesName='LOC/HOF' then 'HEAD OFFICE'
           when T4.SeriesName='LOC/CHN' then 'CHENNAI'
            when t4.seriesName ='INS/CHN' THEN 'CHENNAI'
            WHEN T4.SERIESNAME ='STF/CHN' THEN 'CHENNAI'
            WHEN T4.SERIESNAME ='INS/HOF' THEN 'HEAD OFFICE'
           end Location,L.TAXCODE,T6.RATE,
    case when t.statype ='1' then  'VAT'
           WHEN T.STATYPE ='4' THEN 'CST'
           END TAXTYPE,T.STATYPE,
    M.CARDCODE,M.CardName as 'Customer Name',M.NumAtCard as 'Bill No. & Dt.',M.DiscSum,M.RoundDif,
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',M.VATSUM,
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =1  ) as 'VAT  SALES',
    (SELECT SUM(TaxSum) FROM INV4 t where t.docentry=m.docentry and statype=1  ) as '  VAT COLLECTED ',
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =4  ) as 'CST  SALES',
    (SELECT SUM(TaxSum) FROM INV4 where statype=4 and  DocEntry=M.DocEntry   ) as ' CST COLLECTED ',
    (Select Sum(LineTotal) FROM INV3 Q Where Q.DocEntry=M.DocEntry) as 'FREIGHT',
    M.DocTotal as 'Total (Rs.)'
    FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry
    LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
    INNER JOIN NNM1 T4 ON M.SERIES=T4.SERIES
    LEFT JOIN OSTC T6 ON T6.CODE= L.TAXCODE
    LEFT JOIN OUBR T7 ON  T7.NAME = T6.U_LOC
    LEFT JOIN OUSR T8 ON T8.BRANCH = T7.CODE
    WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')
    AND  TARGETTYPE !='14' and taxrate !='0'  A
    ND T6.RATE != '0'
    and t6.u_loc ='[%2]'
    GROUP BY
    M.DocNum,M.DocDate,M.CARDCODE,M.CardName,M.NumAtCard,M.DocEntry,
    M.DiscSum,M.WTSum,
    M.DocTotal,M.Series,T4.SeriesName,
    T4.REMARK,M.RoundDif,M.VATSUM,T.STATYPE,T.TAXRATE,Q.LINETOTAL,t4.series,
    l.targettype,t.docentry,L.TAXCODE,T6.RATE
    Pls Gimme Some Ideas guys for designing this report .
    Thanks And Regards,
    P.V

    Hai Gordon,
    Thanks for the suggestion but i am sorry to say that after adding the said  Condition  to the below query it is showing the Below error.
    QUERY :
    SELECT distinct  M.DocNum AS 'AR Inv. #', M.DocDate as 'Date',
    l.targettype AS 'TARGET TYPE',
    t4.series,T4.SeriesName,
    case when T4.SeriesName='LOC/HOF' then 'HEAD OFFICE'
           when T4.SeriesName='LOC/CHN' then 'CHENNAI'
            when t4.seriesName ='INS/CHN' THEN 'CHENNAI'
            WHEN T4.SERIESNAME ='STF/CHN' THEN 'CHENNAI'
            WHEN T4.SERIESNAME ='INS/HOF' THEN 'HEAD OFFICE'
           end Location,L.TAXCODE,T6.RATE,
    case when t.statype ='1' then  'VAT'
           WHEN T.STATYPE ='4' THEN 'CST'
           END TAXTYPE,T.STATYPE,
    M.CARDCODE,M.CardName as 'Customer Name',M.NumAtCard as 'Bill No. & Dt.',M.DiscSum,M.RoundDif,
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',M.VATSUM,
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =1  ) as 'VAT  SALES',
    (SELECT SUM(TaxSum) FROM INV4 t where t.docentry=m.docentry and statype=1  ) as '  VAT COLLECTED ',
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =4  ) as 'CST  SALES',
    (SELECT SUM(TaxSum) FROM INV4 where statype=4 and  DocEntry=M.DocEntry   ) as ' CST COLLECTED ',
    (Select Sum(LineTotal) FROM INV3 Q Where Q.DocEntry=M.DocEntry) as 'FREIGHT',
    M.DocTotal as 'Total (Rs.)'
    FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry
    LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
    INNER JOIN NNM1 T4 ON M.SERIES=T4.SERIES
    LEFT JOIN OSTC T6 ON T6.CODE= L.TAXCODE
    LEFT JOIN OUBR T7 ON  T7.NAME = T6.U_LOC
    LEFT JOIN OUSR T8 ON T8.BRANCH = T7.CODE
    WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')
    AND  TARGETTYPE !='14' and taxrate !='0'  AND T6.RATE != '0'
    AND $[USER] in (SELECT USERID FROM OUSR WHERE BRANCH = T7.CODE)
    GROUP BY
    M.DocNum,M.DocDate,M.CARDCODE,M.CardName,M.NumAtCard,M.DocEntry,
    M.DiscSum,M.WTSum,
    M.DocTotal,M.Series,T4.SeriesName,
    T4.REMARK,M.RoundDif,M.VATSUM,T.STATYPE,T.TAXRATE,Q.LINETOTAL,t4.series,
    l.targettype,t.docentry,L.TAXCODE,T6.RATE
    ERROR
    1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'USER'.
    2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'GROUP'.
    3). [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement 'User-Defined Values' (CSHS) (s) could not be prepared.
    Regards,
    P.V

  • Current logged in user in PCM

    Hi,
    Is there anyway I can access the current logged in user details in Oracle PCM? We're trying to create a custom report that would show details per user. And I'd like to make it generic rather than have to create one per user. Any advices/suggestions would be appreciated.
    Thank you.
    Chandini

    Hi,
    Thanks for your response.
    if not in the database, is this information stored in the session somewhere within PCM? And would we be able to access it, more importantly? It should be stored somewhere, especially if PCM allows you to customize the dashboard etc for the currently logged in user.
    If there is no way, then we'll have to create one report per user which is so not a good option.
    Thank YOu,
    Chandini

Maybe you are looking for