Wrong Org unit determination when a user is assign to multiple Org unit

Hi Experts,
I have a user who is assigned 3 org units. All the three fall under the same parent of Org unit.
Now when the user logs in & executes the tcode CIC0, she gets a pop up asking to selet a Org unit out of the 3 available option.
No matter what the user selects, system always pick the first Org unit ignoring the selection made by user.
We are using SAP CRM 4.0 win client version.
I went through the below link but this did not have any solution
Multiple business roles and org data determination
Please help!!!
Please refer the screenshot
http://img213.imageshack.us/img213/989/cic0q.jpg

Hi Joaquin,
When the user log in he gets a pop up asking to choose a Org unit, please refer the screenshot in my previous post.
No matter what he selects, it the first Org structure gets assigned.
Please refer the screenshot below
The business activity screen shows the 1st Org unit. Hence user thinks he has selected the the 2nd org unit creates a Business activity but that gets assign to the wrong org unit unless it is changed manually.
http://img528.imageshack.us/img528/2821/businessactivityscreen.jpg
Is it because they both have the same profile

Similar Messages

  • Duration of PageFlow - What determines when a user is done?

    Hi All,
    I am having a problem where data that I store in the pageFlow scope is being destroyed before the user is done using the flow.
    There is a reference to the lifetime of the flow here:
    http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/netui/guide/conDatabindingXScript.html?skipReload=true
    It says:
    “data is maintained separately for each user for the duration of the page flow.”
    My question: What defines the duration of the page flow?
    Thanks in advance for any help or pointers to documentation,
    Chris

    Answering my own question:
    From http://dev2dev.bea.com/products/wlworkshop81/articles/wlw_internals.jsp
    The lifetime of a JPF depends on the actions taken
    in the page flow. In general, a page flow is
    instantiated when it is first requested (either the JPF
    or one of its JSPs/actions) and is released when the user exits the page flow. The user exists the page flow
    if there is a request for another page flow (or a
    JSP/action in another page flow). The current page flow is also released when the HTTP session expires. Message was edited by cope360 at Jan 13, 2005 4:07 PM

  • Wrong persistent unit

    Dear sdn members,
    I am using NetBeans 5.5 , database PostgreSQL 8.1, Sun Application Server 9, and hibernate.I copied following jars from Hibernate to lib directory of my application server
    # From hibernate entitymanager 3.2.0 cr2
    * hibernate-entitymanager.jar
    * lib/hibernate-annotations.jar
    * lib/jboss-archive-browsing.jar
    * lib/javassist.jar
    # From Hibernate Core 3.2.0 cr4
    * hibernate3.jar
    * lib/antlr-2.7.6.jar
    * lib/asm-attrs.jar
    * lib/asm.jar
    * lib/c3p0-0.9.0.jar
    * lib/cglib-2.1.3.jar
    * lib/commons-collections-2.1.1.j
    * lib/commons-logging-1.0.4.jar
    * lib/concurrent-1.3.2.jar
    * lib/dom4j-1.6.1.jar
    * lib/ehcache-1.1.j
    * lib/log4j-1.2.11.jar
    Than I tryied to generate entity classes from my database.All passed ok, but when I try to generate JSF from entity classes and run project , two exceptions appear in my browser
    javax.servlet.ServletException: Unable to retrieve EntityManagerFactory for unitName HibernateApp
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
         com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
         com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
         org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
    java.lang.IllegalStateException: Unable to retrieve EntityManagerFactory for unitName HibernateApp     com.sun.enterprise.util.EntityManagerFactoryWrapper.getDelegate(EntityManagerFactoryWrapper.java:80)     com.sun.enterprise.util.EntityManagerFactoryWrapper.createEntityManager(EntityManagerFactoryWrapper.java:91)     hibernatesample.controller.CustomerController.getEntityManager(CustomerController.java:47)
         hibernatesample.controller.CustomerController.getItemCount(CustomerController.java:187)
         hibernatesample.controller.CustomerController.getLastItem(CustomerController.java:197)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    and here is my persistence.xml file
    <persistence version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
    <persistence-unit name="HibernateApp" transaction-type="JTA">
    <jta-data-source>konekcija</jta-data-source>
    <properties>
    <property name="hibernate.show_sql" value="value"/>
    </properties>
    </persistence-unit>
    </persistence>I would be very grateful if some could point me on the cause of my exceptions.
    with best regards,
    Nikola

    Hi Joaquin,
    Thank you for the reply, but i do not want this to enable. This is an additional popup & is already suppressed which not the issue in my case.
    When a user is assigned to multiple Org units, they get a popup asking the user to select the Org they want to login. But no matter what the user selects, the system will assign it to the first Org unit sorted based Org Id.
    Please refer the screenshot
    [http://img213.imageshack.us/img213/989/cic0q.jpg]
    Even if i select the 2nd Org unit, system still selects with the first one

  • A program to trace when a user is logged in/out the system

    Hi,
    How would I write an ABAP to determine when the user is logged into a SAP system, what transaction code has been launched by the user, and when the user exits or changes a transaction code?
    Or is there a FM that provides this information?
    Thanks,
    RT
    Message was edited by: Rob  Thomas

    Hi,
    You can find some information in STAT and STAD transactions. But these information will be only available for programs with atleast some screens
    either a report list screen or a selection screen or a module dialog.
    There are also quite a no of BAPIS related to User logons.
    Cheers
    VJ

  • Determining when session expires

    I want to be able to track the amount of time that the user spends on my site. I am going to insert a record into a database when the user logs on. I also want to insert a record when the user's session expires either from timing out or closing the browser window or leaving my site. Is it possible to determine when a user's session ends, particularly when it ends via the last two ways.
    Thanks!

    First, you can use a javax.servlet.http.HttpSessionBindingListener object put into the session as an attribute and implement the valueUnbound() method to do the database update. This will be called when you invalidate the session (unless you remove the attribute manually first).
    So the problem is when will the session be invalidated..... There are really 4 things you are looking for:
    1) session times out
    2) user logs out (assuming you provide a log out link that invalidates the session)
    3) browser closes
    4) user leaves site (I assume you mean just goes to some other site in the same browser window)
    1 and 2 are okay, cuz it invalidates the session and calls the valueUnbound method of the object you create as mentioned above.
    For 3 and 4, you can do this in one of 2 ways:
    A) Use frames in your web pages and in the top window, you can have a Javascript call some logout page. However, I'm not convinced that this will work in all situations.
    B) Have an applet in the pages that does something to keep the connection alive. This requires an applet and a JVM in the client to run it. Probably not a good thing to rely on for public sites.
    So really, there is no foolproof or simple way to handle 3 and 4, except to use session timeouts and rely on that.

  • How to Customize the Error Message when a user enters a wrong password

    Hi Gurus
    Pls Help out me that
    How to Customize the Error Message when a user enters a  wrong password ?
    I need the Help to Customize the messege ?
    How  we can do
    Pls Tell me indetail

    Firstly many appologies I have given you slightly duff information here, I had been editing the file above for email notification texts not logon / password texts.
    The file you need is actually a portal .par file and can be found in the deployment/pcd directory.  The file you need is called com.sap.portal.runtime.logon.par (with a .bak extension at this time). 
    You need to copy this file to a local machine and unzip the contents.  The files you need to edit are contained in a further jar file which can be found in the \PORTAL-INF\lib directory - it is called umelogonbase.jar.  It too needs to be extracted and the file you need to edit is logonMessages_xx.properties (where the xx is the language code you are using).
    In this file you will find lines like:
    NUMERIC_REQUIRED=Invalid new password (must contain digits)
    You need to identify which texts you wish to modify and edit the text to the right of the equals sign.  Once complete rezip the umelogonbase.jar file and then the com.sap.portal.runtime.logon.par (this time name it without the .bak extension.  Then logon to the portal and upload the new par and you should see your new logon messages.
    Haydn

  • Sales area determined based on user/employee when creating an account?

    Hi Experts.
    Can anyone tell me how to implement the following:
    When a user creates an account, the sales area should be filled out with the sales area of the employee of the user. In case of more sales areas, a pop-up should appear to choose from (simlar to transactions).
    Thanks and regards, Mia

    Hi Mia,
    Pls inform if you found teh solution for above.
    Even we are facing the same problem of getting User Default sales Area for BP.
    Regards,
    Rahul

  • Customs Declaration: wrong legal unit displayed

    Hi, we have a funny situation in the customs declaration doc CULOEX where in the organisation data tab all the available legal units are shown, when only one is assigned to the FTO in the config.
    When we select the correct LU, the wrong one disappears. This does not look right and could confuse users anyone else had the same problem?
    Thx
    Philip

    Check one more time the legal unit assignments to the foreign trade org.
    check your legal reg determiniation also. Might be it is trying to determin the country that is not assigned properly.

  • How to get the Useru2019s position when the user doesnu2019t have CP relation

    We have a custom program which will add / delete attributes (In transaction PPOSA_BBP). It is working fine for users which were assigned with CP relation But it fails for users which doesnu2019t have CP relation (since we are getting the position of users form HRP1001 then we are retrieving the existing attributes based on the position after that updating the attributes) as we are getting the position from HRP1001 it fails for users were no CP relation.
    Help us how to get the Useru2019s position when the user doesnu2019t have CP relation. Suggest us any function module or how to query the HRP1001 or some other table if exists
    Regards
    Paul

    Hi Paul,
    Have a look at these tables.
    Using table BUT000 the central business partner data are stored, f.e. partner type, partner names, partner number, partner guid, person number, etc. In table BUTBKK the bank data to a business partner are stored.
    Central business partner address data
    The table ADRC is used for the address of a business partner. Table BUT020 links the business partner number with the address number. Using table BUT021 several addresses to a business partner with different usages (modes), f.e. correspondence or delivery address, can be stored. The personal data of a business partner person are stored with key person number in table ADRP. The person number is assignd to a business partner person in table BUT000. Communication data of business partners as e-mail, telephone, fax, etc. are stored in the tables ADDR1 u2013 ADDR12. The business address of a contact person or an employee consists of the organization address (company resp. org.-unit) and of an address addition, which describes f.e. a building, a room number, etc. The address addition is stored in table ADCP and is identified by the keys address number of the organization address and person number.
    Relationships between business partners
    Table BUT050 contains the relationships between a business partner organization and a business partner person using relation types. The relation types are defined in table TBZ9, f.e. the relation type u2018has employeeu2019 corresponds to identifier u2018BUR010u2019, the relation type u2018has contact personu2019 corresponds to identifier u2018BUR001u2019. Table BUT051 stores communication data of a contact person relationship (compare to table ADCP). Table BUT052 stores several address numbers to one business partner relationship (including a standard flag).
    Hope this helps,
    Kind Regards,
    Matthew

  • Assign a user ID (purchaser) to multiple position in org structure

    Hello,
    We have SRM ECS 5.0.
    We would like that the buyers can be assigned to multiple purchasing groups in order they can view all the SC related to those purchasing groups in the Worklist of the sourcing cockpit.
    Is it possible ?
    I'm able to assign the user ID to several position created under the purchasing groups in the organizational structure, but then when I log on to the webUI, in the sourcing cockpit I can only see the SC from 1 purchasing group in the Worklist tab.
    For example:
    user buyer1 is assigned to position "purchasing group 1 position" and to "purchasing group 2 position" in the org structure.
    First he was created under "purchasing group 1 position", then I added the user to the position "purchasing group 2 position".
    When I log on to the system with this user, in the sourcing cockpit, in the worklist tab, I can only see SC for purchasing group 1.
    Thanks for your help.
    Marc

    Hi Marc,
    SRM does not allow one particular purchaser assigned to multiple purchasing groups at the same time. It is like you cannot ride two horses at the same time.
    However, you can follow the below workaround if you want a particular purchaser to do buying for multiple purchase organizations.
    first, let assign the buyer 1 to purchasing group 1 (which is inturn assigned to purchase organization 1). Now, in order to enable the buyer to do purchasing for purchasing group 2 (which is inturn assigned to Purchasing organization 2) and purchasing group 3 (which is in turn assigned to Purchasing Orgaization 3), you can follow the below steps:
    1. Go to the responsibilities tab of the purchasing group 1.
    2. Assign the purchasing organization 1 first in the org unit table.
    3. Then, assign the purchasing orgaization 2 and and 3 in the org unit tab.
    Now, the purchaser will be able to see  shopping cart or purchase order for his own Purchase organization as well as purchase org 2 and 3.
    I hope, it helps you to meet the requirement.
    Thanks and regards,
    Ranjan

  • I need to host a Shared PDF on SharePoint. If it is on SharePoint can only one person comment at a time? I know documents have to be checked out when using SharePoint. I need multiple users to be able to comment in real time and see comments in real time.

    I need to host a Shared PDF on SharePoint 2010. If it is on SharePoint can only one person comment at a time? I know documents have to be checked out when using SharePoint. I need multiple users to be able to comment in real time and see comments in real time. Is this possible?

    try here:
    http://www.bbb.org
    File a complaint with them. Verizon will call you to fix the blunder.
    But remember it is always up to the customer to insure what they are getting and what it costs. Don't trust the word of a sales person who makes their living on getting that sale. Lies, deceit or false promises will be and have been used by sales people for thousands of years.
    Good Luck

  • Identify when a user has change value in USEREXIT_CHECK_VBAP before saving

    I originally posted and closed this question, but I am still struggling with the code.
    The req is now to also update the value of VBAP-LPRIO, so I now have to use the Exit : USEREXIT_CHECK_VBAP.
    The issue is that my solution must take into account when a user manually overwrites a value and not replace it with a value determined in the user exit.
    My problem is that the user might do the following
    1 - Create a sales order and enter a new item line, press enter
    2 - The user exit is triggered, and I check that XVBAP-UPDKZ = I  (user add a new line)
    3 - The user-exit determines the new value and populates the field
    4- the user then click on the item line, and then manually changes the value of VBAP-LPRIO
    5- The user-exit is triggered again, and because  XVBAP-UPDKZ = I , my code is triggered and updates the field.
    What I want is to identify that a user has manually changed the value and not overwritte the value.
    1 - I have check YVBAP and it is blank, as the user has not saved the sales order.
    2- The values of VBAP and XVBAP are the same..
    3 - I cannot re-read the database (KNVV) table as the user could have populate the value with the same value.
    What I need is how to identify when a user has made a change to a field before they save the sales item, as YVBAP is never filled.
    Previous post----
    Hello,
    I am writing a bit of code that will overwrite the payment terms in a sales order item based on a number of factors. (ship-to, incoterms, document type, etc)
    I am using the following program MV45AFZB at Exit : USEREXIT_CHECK_VBAP. I am using this exit as the users need to see the payment terms after an item has been entered into the sales order and not have the value determined at sales order save.
    I am not using USEREXIT_MOVE_FIELD_TO_VBAP as it is only triggered once at the time of creation and not when I change the document. I need it in USEREXIT_CHECK_VBAP as users could change the incoterms in VA02, so the code must be redetermined.
    My code is working as expected, however, I have a problem when a user enters a sales order item line and then manually changes the payment terms, as my code then is over writes the users values.
    The flow is as follows
    As user creates a sales order
    They populate the sales order header
    They populate material number and qty
    User exit USEREXIT_CHECK_VBAP is triggered and correctly determines the payment terms
    The user then double clicks on the sales order item and decides to overwrite the payment terms.
    My user-exit is retriggered and check to see if XVBAP-UPDKZ = I (insert)
    As it is still an insert, my code triggers.
    I have tried to check YVBAP, but no entry exist as it stills is seen as in insert? What I really need to know that while it is still an insert, the user has change the field value and my code should not over write the users value.

    When do you need to update LPRIO ? When user makes the change at the Payment terms on line item?
    Regards,
    Naimesh Patel

  • Error message "Enter a Printer" when the user clicks on PO out put preview

    Dear SRM Gurus,
    We are using SRM 5.5 extended classic scenario. When the user presses on Output Preview of PO we are getting a message that "Enter a Printer" and not able to see the preview. This messge we are getting for some particular PO's and for other we are able to see the preview.
    Please do the needful..
    Thanks and Regards,
    Chandra Sekhar.

    Hi
    <u>Please maintain default  Printer for Organizational user in PPOMA_BBP (Attribute  - PRI)...</u>
    <u><b>In PPOMA_BBP, your purch org must be defined under (or at the same level as) a company. This company org id (defined in function tab) will be used to read address and use it as "contact" addresse. Check this point, correct if necessary and tell me if this is ok.</b></u>
    <u>Also go through the useful related links -></u>
    Re: PO output
    Re: Add a Printer ?  -> LP01
    Re: Adding Send Medium to Vendor Record
    Re: Offline approval of SC
    <u>Do let me know.</u>
    Regards
    - Atul

  • Trigger partner determination when ship-to is changed on the sales order

    Hi,
    Here is my scenario...
    I am defaulting my rail carrier partner function based on the ship-to party partner function into the sales order using the standard configuration i.e. by maintaining SH as entry in the "source" field for rail carrier partner function of the sales document partner determination procedure. Every thing is fine until the ship-to party in the order is not changed by the user. when the user changes the ship-to party the carrier is not re-determined (the old rail carrier partner function which defaulted into the order from the old ship-to party record stays in the document). I know standard SAP doesn't re-determine partners. Can anyone came accross this issue?
    I would like to know if there is an user exit that i could use and write a code to trigger parter determination when a ship-to partner is changed in the sales order.
    -Sree.
    Edited by: SREE on Sep 15, 2008 4:40 PM

    Hi,
    Try to use user exit FORM USEREXIT_SAVE_DOCUMENT_PREPARE in program MV45AFZZ.
    Regards,

  • RegisterPointerInputTarget() breaks InjectTouchInput() on Windows 8.1 when the user physically touches the screen.

    This is a "working on Windows 8.0 but broken on 8.1" problem.
    My application is a full screen magnifier. When magnification is turned on, there is no longer a 1:1 relationship between touch screen coordinates and desktop coordinates.
    So I need a way to allow the user operate the computer, such as dragging or pinching something on the desktop (icon/window/whatever). So when they drag their finger(s) across the touch screen, I need to capture that, translate the touch coordinates from magnified
    pixels coordinates into original desktop pixels and then inject new input to the app. I also want the ability to capture the touch input and not pass it to the app (so I can have gestures/whatever to control the magnifier viewport location). I might also want
    to inject input when the user is not touching the real screen.
    So I am capturing all touch input RegisterPointerInputTarget() and simulating touch input using InjectTouchInput() (after translating coordinates from the screen to the magnified desktop).
    My code for simulating touch input works fine in isolation (as does the SDK sample). My code for capturing all touch input also works fine. However, if they are both used at the same time it’s not happy, although I am not getting any error codes back from the
    API.
    Specifically, attempts to simulate a touch and hold or a touch and drag are not working whenever the user is physically touching the real touch screen. Further diagnosis indicates that the touch input messages are not arriving in the target application. The
    moment the user physcially touches the screen, any simulated input in progress gets cancelled and all subsequent calls to InjecttouchInput() are ignored - but no error code is returned.
    Because I am capturing all real input using RegisterPointerInputTarget(), I would expect all real physical input to be redirected to my window (which it does) and be able to call InjectTouchInput() at any point to simulate input. The simulated input would go
    to the target app and not be captured by my own process.
    This all worked fine in Windows 8.0 but is broken in  windows 8.1.
    I have written a basic test application that does two things.
    1.       Uses RegisterPointerInputTarget() to consume all touch input.
    2.       Uses InjectTouchInput() to simulate some output. In this case, it just does a click, followed by a down, a drag and an up – which handily draws a line in the paint application if you arrange your windows carefully.
    If I run this, it works until you physically touch the screen with your finger. The moment you do this, InjectTouchInput stops working (no error code), but the paint app receives a mouse up and the line stops. The hwnd to capture all touch input does receive
    WM_POINTER... messages and I an returning 0 from this function (have tried other return codes, nothing makes any difference).
    So it looks like that if you use RegisterPointerInputTarget(), any physical input is captured, but it also breaks any simulated touch gestures that are currently in progress.
    Source code is below, which you can drop in as a replacement for the main .cpp file in your injecttouch sample code from the win8 sdk (and set uiaccess=true and code sign it!). It does it in two threads, however this doesn’t seem to matter, it does the same
    thing with one thread. Am I doing something wrong?  (and yes, I know that calling Sleep() is not wise - my real app doesn't do this)?
    - Mike.
    // allow use of Windows 8 headers
    #undef WINVER
    #define WINVER 0x0602
    #include "stdafx.h"
    #include <debugoutx.h>
    #include <process.h>
    * WinMain *
    * Application entrypoint *
    static HWND touch_hwnd = NULL;
    static ATOM touch_window_atom = NULL;
    LRESULT CALLBACK TouchThread_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
    switch (message)
    case WM_CLOSE:
    DestroyWindow(hWnd);
    touch_hwnd = NULL;
    break;
    case WM_NCPOINTERUPDATE :
    case WM_NCPOINTERDOWN :
    case WM_NCPOINTERUP :
    case WM_POINTERENTER :
    case WM_POINTERLEAVE :
    case WM_POINTERACTIVATE :
    case WM_POINTERCAPTURECHANGED :
    case WM_TOUCHHITTESTING :
    case WM_POINTERWHEEL :
    case WM_POINTERHWHEEL :
    // case DM_POINTERHITTEST :
    case 0x250:
    case WM_POINTERUPDATE :
    case WM_POINTERDOWN :
    case WM_POINTERUP :
    // consume pointer mesages
    dprintf(L"msg %x\n",message);
    return 0;
    break;
    case WM_TIMER:
    break;
    default:
    dprintf(L"msg %x\n",message);
    return DefWindowProc(hWnd, message, wParam, lParam);
    break;
    return 0;
    void Inject(POINTER_TOUCH_INFO &contact)
    Sleep(1);
    while(1)
    DWORD bRet = InjectTouchInput(1, &contact);
    if (bRet==0)
    DWORD temp = GetLastError();
    if (temp==ERROR_NOT_READY)
    Sleep(1);
    continue;
    else
    DebugBreak();
    break;
    static int start = 400;
    static int end = 800;
    bool SimulateInput(POINTER_TOUCH_INFO &contact)
    static int x = start;
    if (x==start)
    contact.pointerInfo.ptPixelLocation.x = x;
    // inject a touch down
    contact.pointerInfo.pointerFlags = POINTER_FLAG_DOWN | POINTER_FLAG_INRANGE | POINTER_FLAG_INCONTACT;
    Inject(contact);
    else if (x==(start+1))
    Sleep(10);
    contact.pointerInfo.pointerFlags = POINTER_FLAG_UP ;
    Inject(contact);
    else if (x==(start+2))
    contact.pointerInfo.pointerFlags = POINTER_FLAG_DOWN | POINTER_FLAG_INRANGE | POINTER_FLAG_INCONTACT;
    Inject(contact);
    else if (x==end)
    contact.pointerInfo.pointerFlags = POINTER_FLAG_UP ;
    Inject(contact);
    PostMessage(touch_hwnd,WM_QUIT,0,0);
    return false;
    else if (x<end)
    // drag
    contact.pointerInfo.ptPixelLocation.x = x;
    // contact.rcContact.left = x - 4;
    // contact.rcContact.right = x + 4;
    contact.pointerInfo.pointerFlags = POINTER_FLAG_UPDATE | POINTER_FLAG_INRANGE | POINTER_FLAG_INCONTACT;;
    Inject(contact);
    x++;
    return true;
    void thread2(void *)
    // create window to capture global touch input.
    if (!touch_window_atom)
    WNDCLASS wc;
    wc.style = 0; // Class style(s).
    wc.lpfnWndProc = TouchThread_WndProc; // Function to retrieve messages
    wc.cbClsExtra = 0; // No per-class extra data.
    wc.cbWndExtra = 0; // No per-window extra data.
    wc.hInstance = GetModuleHandle(0); // Application that owns the class.
    wc.hIcon = NULL;
    wc.hCursor = NULL;
    wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    wc.lpszMenuName = NULL; // Name of menu resource in .RC file.
    wc.lpszClassName = L"MarsTouchInputCapture"; // Name used in call to CreateWindow.
    // Register the window class and return success/failure code.
    touch_window_atom = RegisterClass(&wc);
    touch_hwnd = CreateWindowEx(WS_EX_NOACTIVATE,L"MarsTouchInputCapture",L"Magnification",0,0,0,1,1,NULL,NULL,GetModuleHandle(0),NULL);
    // capture global desktop touch input
    if (RegisterPointerInputTarget(touch_hwnd,PT_TOUCH)==0)
    DWORD err = GetLastError();
    MessageBox(NULL,L"RegisterPointerInputTarget(PT_TOUCH) failed",L"error",MB_OK);
    if (RegisterPointerInputTarget(touch_hwnd,PT_PEN)==0)
    DWORD err = GetLastError();
    MessageBox(NULL,L"RegisterPointerInputTarget(PT_PEN) failed",L"error",MB_OK);
    // message loop
    MSG msg;
    while (GetMessage(&msg, NULL, 0, 0))
    DispatchMessage(&msg);
    UnregisterPointerInputTarget(touch_hwnd,PT_TOUCH);
    UnregisterPointerInputTarget(touch_hwnd,PT_PEN);
    int
    WINAPI WinMain(
    _In_ HINSTANCE hInstance,
    _In_opt_ HINSTANCE hPrevInstance,
    _In_ LPSTR lpCmdLine,
    _In_ int nShowCmd)
    POINTER_TOUCH_INFO contact;
    BOOL bRet = TRUE;
    MessageBox(NULL,L"Break on Load",L"Attach Debugger",MB_OK);
    // assume a maximum of 10 contacts and turn touch feedback off
    InitializeTouchInjection(10, TOUCH_FEEDBACK_NONE);
    // initialize the touch info structure
    memset(&contact, 0, sizeof(POINTER_TOUCH_INFO));
    contact.pointerInfo.pointerType = PT_TOUCH; //we're sending touch input
    contact.pointerInfo.pointerId = 7; //contact 0
    contact.pointerInfo.ptPixelLocation.x = 400;
    contact.pointerInfo.ptPixelLocation.y = 480;
    contact.touchFlags = TOUCH_FLAG_NONE;
    contact.touchMask = TOUCH_MASK_ORIENTATION | TOUCH_MASK_PRESSURE;
    contact.touchMask = 0;
    contact.orientation = 90;
    contact.pressure = 32000;
    // create thread/window for global capture
    _beginthread(thread2,0,NULL);
    while(SimulateInput(contact))
    Sleep(1);
    return 0;

    I have almost same situation. But there are some different. I am using RegisterPointerInputTarget to redirect all touch message to my window. and use InjectTouchInput to simulate each flag, which means, WM_POINTERDOWN,WM_POINTERUPDATE,WM_POINTERUP. If user
    touches monitor, I simulate DOWN, if user swipes their finger, I simulate UPDATE, if user lifts finger, I simulate UP.
    Then the interesting point is, system consider user's finger as primary pointer, and my injected touch as secondary pointer. windows desktop and windows explorer skip all my injected touch. I really hate that.
    However IE and chrome will accept my injected touch, they don't caret about primary pointer.
    In order to fix this problem, I call AccNotifyTouchInteraction before calling InjectTouchInput.
    According to the MSDN, AccNotifyTouchInteraction will notify the destination window before InjectTouchInput. But this idea still fails, which is disappointing.

Maybe you are looking for