Search combination of Org Name1 and Person First + Last Name

Hi Everybody,
Business Case:
We have organizations witch have persons who are in a relationship to the organization. It must not be "contact person of". When a Person calls now our employee he had to find the correct person. To make this search easier i need a combined search for organization name1 and person fist + last name. The result must be all persons with a relationship to the company searched.
Environment:
SAP CRM 4.0 SP9 with Add On for Service Industries.
User Interface: PC-UI.
Is there a function module or class to do this search?
Regards
Gregor

Hi Everybody,
I've found a solution by implementing this Function module and adding it to the Query method:
FUNCTION z_org_pers_search.
*"*"Lokale Schnittstelle:
*" IMPORTING
*" REFERENCE(NAME_ORG1) TYPE BU_NAMEOR1
*" REFERENCE(NAME_ORG2) TYPE BU_NAMEOR2 OPTIONAL
*" REFERENCE(NAME_LAST) TYPE BU_NAMEP_L
*" REFERENCE(NAME_FIRST) TYPE BU_NAMEP_F OPTIONAL
*" CHANGING
*" REFERENCE(CT_PARTNER_KEYS) TYPE CRMT_BSP_OBJECTKEY_TAB
* Daten definition for partner search with COM_BSP_SEARCH_BP
DATA: ls_search_criteria TYPE comt_bsp_bp_seareq_incl,
ls_control TYPE comt_bsp_search_control.
* Daten definition result tables
DATA: it_org_keys TYPE bup_partner_guid_t,
it_org_with_rel TYPE bup_partner_guid_t,
it_pers_keys TYPE bup_partner_guid_t,
ls_org_with_rel LIKE LINE OF it_org_with_rel,
ls_pers_keys LIKE LINE OF it_pers_keys.
* Search for Organizations
ls_search_criteria-bp_name1 = name_org1.
ls_search_criteria-bp_name2 = name_org2.
ls_control-organizations = 'X'.
CALL FUNCTION 'COM_BSP_SEARCH_BP'
EXPORTING
* IV_PARTNER1 =
is_search_criteria = ls_search_criteria
is_control = ls_control
* IV_MAX_HITS =
* IV_CHECKS = 'X'
* IMPORTING
* EV_HITS =
* ET_BUT020 =
CHANGING
ct_partner_keys = it_org_keys.
* Search for Persons
FREE: ls_search_criteria, ls_control.
ls_search_criteria-bp_name1 = name_last.
ls_search_criteria-bp_name2 = name_first.
ls_control-persons = 'X'.
CALL FUNCTION 'COM_BSP_SEARCH_BP'
EXPORTING
* IV_PARTNER1 =
is_search_criteria = ls_search_criteria
is_control = ls_control
* IV_MAX_HITS =
* IV_CHECKS = 'X'
* IMPORTING
* EV_HITS =
* ET_BUT020 =
CHANGING
ct_partner_keys = it_pers_keys.
SELECT partner2 AS partner INTO CORRESPONDING FIELDS OF TABLE it_org_with_rel FROM but050
FOR ALL ENTRIES IN it_org_keys WHERE partner1 = it_org_keys-partner.
DELETE ADJACENT DUPLICATES FROM it_org_with_rel COMPARING partner.
LOOP AT it_org_with_rel INTO ls_org_with_rel.
READ TABLE it_pers_keys WITH KEY partner = ls_org_with_rel-partner INTO ls_pers_keys.
IF sy-subrc = 0.
APPEND ls_pers_keys-PARTNER TO ct_partner_keys.
ENDIF.
ENDLOOP.
ENDFUNCTION.
Best regards
Gregor

Similar Messages

  • Remove First & Last Name Validation in Get Support

    Hi All,
       I have enabled the self management of password for portal users. I have to remove the First & Last Name validation  and make it optional, I have also made (ume.logon.logon_help.name_required = false)  in configtool and taken the restart of the server, but still it is validating the names.
    If anyone have removed the validation for the above, can help me.
    Thanks in advance.
    Regards
    Ponnusamy

    Hi Ponnuswamy,
    the right place to remove the validation is the par file of the login page.
    Get the par file from the portal. unzip the par file.
    under the PORTAL-INF\lib u will find the umelogonbase.jar
    Extrat the jar. get the java file named
    SAPMLogonLogic.java.
    Modify the piece of code in the java file.
    private void performForgotPassword()
            throws IOException, UMException, FeatureNotAvailableException {
            String methodname = "performForgotPassword";
            if (trace.bePath()) {
                trace.entering(methodname);
            try {
                String longUid = this.proxy.getRequestParameter(LogonBean.LONGUID);
                if (longUid != null) {
                    longUid = longUid.trim();
                // check for email id
                String email = this.proxy.getRequestParameter("email");
                String lastName = this.proxy.getRequestParameter("lastname");
                String firstName = this.proxy.getRequestParameter("firstname");
                String noteToAdmin = this.proxy.getRequestParameter("notetoadmin");
                IUser userFrom = UMFactory.getUserFactory().getUserByLogonID(longUid);
                if (email.equalsIgnoreCase(userFrom.getEmail()) &&
                        firstName.equalsIgnoreCase(userFrom.getFirstName()) &&
                        lastName.equalsIgnoreCase(userFrom.getLastName())) {
                    // email matched, assign a new password and email to user
                    String newPass = UMFactory.getSecurityPolicy().generatePassword();
                    IUserAccount ua = UMFactory.getUserAccountFactory()
                                                       .getMutableUserAccount(longUid);
                    ua.setPassword(newPass);
                    ua.save();
                    ua.commit();
    this is the original coding.
    remove the check for last name and first name in that
      if (email.equalsIgnoreCase(userFrom.getEmail()) &&
                        firstName.equalsIgnoreCase(userFrom.getFirstName()) &&
                        lastName.equalsIgnoreCase(userFrom.getLastName()))
    complie the java file. get the class and store it in the umelogonbase.jar . put the jar back in the original place. deploy the par.
    u will get the desire result.
    cheers,
    Sithi

  • Display first last name ecord

    source schema like 
    <ns0:empdetails xmlns:ns0="http://BizTalk_Server_Project3.Schema1">
      <employee>
        <FirstNmae>Kapil</FirstNmae>
        <lastname_x0020_></lastname_x0020_>
      </employee>
      <employee>
        <Firstname>Kiran</Firstname>
        <Lastname>Kumar</Lastname>
      </employee>
      <employee>
        <Firstname>Naresh</Firstname>
        <lastname>Kumar</lastname>
      </employee>
     </ns0:empdetails>
    destination will be 
    <employee>
        <Firstname>Kiran</Firstname>
        <Lastname>Kumar</Lastname>
      </employee>
    the first last name record should come and igoner another records if contains last name or not .

    You can acheieve this using Scripting functoid ( Script Type "Inline XSLT Call Template"). Refer to below XSLT script to use. Map output from this scripting functoid to destination node. 
    <xsl:template name="Employee">
    <xsl:if test="boolean(/*[local-name()='empdetails' and namespace-uri()='http://BizTalk_Server_Project3.Schema1'] /*[local-name()='employee' and namespace-uri()=''][lastname!= ''])">
    <employee>
    <Firstname>
    <xsl:value-of select="/*[local-name()='empdetails' and namespace-uri()='http://BizTalk_Server_Project3.Schema1'] /*[local-name()='employee' and namespace-uri()=''][lastname!= ''][1] /*[local-name()='Firstname' and namespace-uri()='']"/>
    </Firstname>
    <Lastname>
    <xsl:value-of select="/*[local-name()='empdetails' and namespace-uri()='http://BizTalk_Server_Project3.Schema1'] /*[local-name()='employee' and namespace-uri()=''][lastname!= ''][1] /*[local-name()='lastname' and namespace-uri()='']"/>
    </Lastname>
    </employee>
    </xsl:if>
    </xsl:template>
    Thanks,
    Pavan
    MCTS-Microsoft Biztalk Windows Server 2010

  • Searching for OR Finding Contacts other than Alpha by First/Last Name

    Am I missing something? Or, is it not possible to FIND contacts by any means other than alpha on the first or last name field?
    It's such an elementary function of a "PDA" that I failed to inquire about the ability to LOOK-UP information with some simple SEARCH tool or utility.
    Even CALENDAR events...when did I schedule that appointment with Dr. Smith? FIND "Smith".
    I know "the girl" worked for some pharmacy? SEARCH for "pharmacy".
    Am I missing something? Where can I SEARCH for "HELP"?
    Thank you,
    Joe

    I too am having the same issue. I have about 900 "company" clients. I do business with the company yet can't perform any 'search' in the iphone contacts for that company. I absolutely am shocked by this. spent 45 minutes on the phone with apple and they said i was the first person to ever bring this up.
    I have to say that this is frustrating. Why can't I perform any search. Perhaps I'd like to visit a client that is within the same city i am visiting - i can't sort or search by anything except for the individual contact name.....crap. any thoughts (besides going in to outlook and putting the company name itself under the contact name - that would take forever)

  • In User groups user name is shown as ADLDSMembershipProvider:UserID and not with First & Last Name

    Hello,
    In SharePoint site Groups for some users, user name is coming up with ADLDSMembershipProvider:UserID and not with the correct first name and last name. 
    Can some one please advice how i can get the correct first name and last name for the users, below screenshots for your
    reference.
    Please advice.
    Regards,
    Purvish Shah

    Hello,
    What version of sharepoint you are using?
    It seems that you have also configured custom membership provider with AD LDS. To verify this go to central admin and check the web application properties to confirm what auth method is being used.
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Embedded PDF filename = first+last name

    Hello,
    I am currently setting up a website for a sports club and they would like a fillable pdf for online registration that will then be emailed to them upon completion.
    Firstly somehow I need a identifier field I believe if I can use say the first two letters of the first and last name plus the seconds modifier it will be unique. Which they can use as a reference.
    If anyone has any ideas on how to acheive this please let me know =)
    Secondly when the user clicks save or email it would be really handy for the filename to automatically change to the unique identifier.
    Thirdly I'll be embedding this PDF in a joomla article, does anyone have any ideas if I could create a button that would send the pdf as an attachment automatically through joomla when a user presses the submit button in the PDF?
    I have searched all morning (6 hours now) and havn't got far at all, so I decided to come here. Any help is very much appreciated!

    Renaming the file is something that you need to do server-side when you're
    generating the PDF file, before serving it to the user. If the file is not
    generated by a server but is simply offered to the user as a static file on
    the server, then it's not possible.
    I don't know much about Joomla, but I don't think you could achieve this
    with a script from within a PDF, either.

  • Reg supplier/vendor contact first & last name info

    Hi,
    I have a vendor number. For this I need further info like Contact first and last name info.
    Do we have any FM or table which I can get this data.
    Thanks in advance.
    Deepak.

    Hi Deepak,
    as I understand your posting, you are not looking for the Vendors name but for the maintained contact data. If thats correct, please take a look at table KNVK if you search the table with your vendor number in field lifnr, it will give you all maintained contact data.
    FM WY_KNVK_FOR_VENDOR_CUSTOMER might help.
    Hth
    Ute
    P.S. If you find this answer helpful, please reward points.

  • First, Last name fields in Numbers -- Three columns on iWeb page

    I'm new to this (both Numbers and iWeb) and I'm trying to help someone with their page (it's for a local candidate).  They have an excel spreadsheet with names and a bunch of other stuff.  they want to put the list of first and last names on their "supporters" webpage, separated by a space, without having to do it manually -- at this point about 900 such names.
    I can get the names out of Excel and into Numbers, obviously.  And I think I know how to get the list into iWeb, if I can generate it (using an iWeb snippet, which I'd also love help with if anyone here knows THAT as well).
    What I can't seem to do is create a list, in three columns, with First name (single space) last name.  Whatever I put in the formula bar seems not to do anything. And I haven't even BEGUN to figure out how to generate the three-column list.
    Any help would be gratefully appreciated.  As dunce-worthy as possible -- believe me, I won't be offended if anyone talks down to me.

    Hi d,
    I think it's the "three column specification that's throwing me. You might need to clarify that.
    The names are currently entered with First names in one column and Last names in the adjacent column. Here's a way to combine the first and last names into a "full name".
    In the "Full" column, the formula is:
    =B&" "&C
    In Last, First, the formula is:
    =C2&", "&B
    To list the names in a three column table in iWeb, you may need to start with a three column table in Numbers. This one pulls the names from column D (Full) of the table above, and distributes them into three columns. The original table has had four names added, and has been sorted.
    Note that the original table has been named "Data".
    The Data table contains the formula(s) shown above.
    The second table, "Aux", calculates the number of cells needed in each of the three columns so that no column is more than one cell longer than the shortest. Doing this calculation in an auxiliary table greatly simplifies the formulas needed in the final table.
    This table contains a single formula, entered in B2, and filled right to D2. Note that A2 is referenced in the formulas in the final table, "3 Columns". A2 may be empty, contain text, or contain the number zero.
    B2 (and fill right): =QUOTIENT(COUNTA(Data :: $C),3)+IF(MOD(COUNTA(Data :: $C),3)>COLUMN()-2,1,0)
    The third table, "3 Columns" displays the names in three columns.
    It contains a single formula, placed in A1 and filled right to column C and down to row 10.
    3 Columns::A1 (and fill right and down): =IF(ROW()<=Aux::B$2,OFFSET(Data :: $A$1,SUM(Aux::$A$2:A$2,ROW()),3),"")
    Descriptions and further examples for the functions used may be found in the iWork Formulas and Functions User Guide. The guide may be downloaded via the Help menu in Numbers.
    Regards,
    Barry

  • Address book. First & last names order problem

    Hi all, I'm having an issue with address book names not appearing in the right order, or more to the point first and last names not appearing in the right order - in fact it's exactly the same as:
    http://discussions.apple.com/thread.jspa?messageID=7471811#7471811
    However that solution doesn't work.
    Essentially, when I go into address book / prefs and click sort by firstname/lastname - the list updates, but when I click 'before last name' / 'following last name' nothing happens at all. The list is ordered by first name - as I want it, but I'm still getting the surname first.
    This has transferred over to my Touch as well so it's very frustrating! any ideas?
    thanks very much for your time

    Hi
    You want the first name first.
    Investigate this.
    Close Address Book
    Open the ~/Library/Preferences/com.apple.AddressBook.plist with Property List editor which comes with XCode.
    Look for the entry
    *ABNameDisplay Number 1*
    and change the 1 to 0 (zero)
    and save. This sets the name order to 'Before last name'
    If you don't have Xcode it might be on your Install DVD.

  • User first/last name assigned to user id?

    Hi All,
    Is there a table out there which links User Idz to First?last name of user?
    let me know
    ciao!

    usr01 usr02 and addr are the main tables.

  • Outlook task & Contacts first, last name swap

    Hi,
    Sorry if this has been raised before.
    I'm using Windows XP SP2 / Outlook 2003 / Nokia 6275 / Bluetooth. Synching Outlook and phone works successfully except for two small issues:
    * Completed Tasks in Outlook do not delete from phone even though Settings > Calendar options states "PC Sync removes recently completed To-do items from mobile phone".
    * My Outlook contacts are all stored "last name, first name" and sync correctly to phone. However once every month or so some Outlook records (not all) get corrupted and name field is changed to "first name last name"
    Any ideas?

    I am not sure what you mean. If you mean Last name/first name to First name/Last name Go into contacts>options>Settings>Name display and set according to your needs. There are three options there.

  • Contacts first & Last name

    Good day,
        Can anyone help in switching my contacts in X3 from last - first display to First - Last Display.
    Thanks

    I am not sure what you mean. If you mean Last name/first name to First name/Last name Go into contacts>options>Settings>Name display and set according to your needs. There are three options there.

  • How to break first,last name from rows to columns?

    drop table t1;
    create table t1
    (c1 varchar2(100)
    insert into t1
    values(' <First Name >david </First Name>');
    insert into t1
    values(' <Last Name > smith </Last Name >');
    insert into t1
    values(' <First Name >Harry </First Name >');
    insert into t1
    values('<Last Name > Bird </Last Name >');
    select * from t1;
    C1
    <First Name >david </First Name>
    <Last Name > smith </Last Name >
    <First Name >Harry </First Name >
    <Last Name > Bird </Last Name >
    4 rows selected.
    out put should be
    First Last
    David Smith
    Harry Bird
    Thanks

    If homework I'd probably be looking at the string manipulation functions. If a real application I'd be looking at a different table design, and given that these look like xml tags that are or should be defined in a schema, using XMLDB.
    Niall Litchfield
    http://www.orawin.info/
    drop table t1;
    create table t1
    (c1 varchar2(100)
    nsert into t1
    values(' <First Name >david </First Name>');
    insert into t1
    values(' <Last Name > smith </Last Name >');
    insert into t1
    values(' <First Name >Harry </First Name >');
    insert into t1
    values('<Last Name > Bird </Last Name >');
    select * from t1;
    C1
    <First Name >david </First Name>
    <Last Name > smith </Last Name >
    <First Name >Harry </First Name >
    <Last Name > Bird </Last Name >
    4 rows selected.
    out put should be
    First Last
    David Smith
    Harry Bird
    Thanks

  • Inverting first & last names in reports

    Post Author: jweckerly
    CA Forum: Crystal Reports
    Can anyone tell me the syntax for breaking down a string that contains a persons name? We store names by last name first, separated by commas. When I generate a report I would like to reverse them to have the first name before the last name. Thanks

    Post Author: kcheeb
    CA Forum: Crystal Reports
    In a formula field in CR you could do the following. Not 100% sure if I have the InStr functions arguments in the correct order, but you should be able to look that up
    LastName = Left(Name, InStr(',',Name) - 1)
    FirstName = Mid(Name, InStr(',',Name) + 1))
    FirstName + " " + LastName

  • ISync adds a "-" to contacts with First/Last Name Blank

    Hello, I'm using iSync 2.3 with a Nokia 8800 (S40) and Sonyericsson T610.
    When a contact's name is First name:John Last name:Smith, it syncs properly to my phones as "John Smith".
    With First name: John Smith Last name: empty, it syncs as John-Smith-.
    Same goes with a blank first name. Some of the contacts only have a first name written in, anyone knows how I can get rid of the extra -s?

    I'm not aware of anyone called just "John"! Everybody I know has at least a first name and a last name... therefore that is the data I enter into Address Book and iSync works fine for me and all my Sony Ericsson phones.
    If you don't provide the required data, you can't really expect iSync to work correctly.
    There is a reason for this... its because most phones don't split First and Last Name into two fields like Address Book does. So, if you have a contact named just "John" with no last name, when you sync, how does iSync know whether "John" is a First or Last name?
    To get around this iSync adds a '-' into the blank field, so that when syncing back it knows where to put the data.
    The solution is extremely simple, just provide Address Book with a first and last name (which AFAIK everyone has).

Maybe you are looking for