BAPI_BUPA_SEARCH_2

Please provide me a sample source code for execution of  "BAPI_BUPA_SEARCH" or "BAPI_BUPA_SEARCH_2" BAPI.
Basic problem I am getting is at
JCO.Structure addrDataStr=input.getStructure("ADDRESSDATA")
I am not able to set the proper value in JCO.Structure. Please help me.
Following is the code I am trying to execute
     JCO.Client mConnection = null;
    IRepository mRepository;
    public JCO.Function createFunction(String name) {
        try {
            return mRepository.getFunctionTemplate(name.toUpperCase()).getFunction();
        } catch (Exception ex) {
            ex.printStackTrace();
        return null;
    private void getBussinessPartner(){
        try {
            mConnection = JCO.createClient("800","userID","******","EN","SAPCRMSystem_IP","00");
            // Open the connection
            mConnection.connect();
            mRepository = new JCO.Repository("SharedRepository", mConnection);
            JCO.Function function = this.createFunction("BAPI_BUPA_SEARCH_2");
            // Fill in input parameters
            JCO.ParameterList input = function.getImportParameterList();
            JCO.Structure addrDataStr=input.getStructure("ADDRESSDATA"); //SEARCHRESULT
            addrDataStr.setValue("Germany","COUNTRY");
            //addrDataStr.setValue("Frankfurt", "CITY1");
            mConnection.execute(function);
            if(function.getExportParameterList()!=null){//It is always null
                JCO.Structure returnStructure = function.getExportParameterList().getStructure(0);
                for (int i = 0; i <  returnStructure.getFieldCount(); i++) {
                    System.out.println( returnStructure.getField(i).getName()+" : " + returnStructure.getString(i));
        }catch (Exception ex) {
            ex.printStackTrace();
            System.out.println("Caught an exception: \n" + ex);
        finally {
            // do not forget to close the mConnection connection
            if (mConnection != null) mConnection.disconnect();

not needed now. resolved it.

Similar Messages

  • BAPI FM FOR READING EMAIL AND GIVING PARTNER INFO

    Hello All,
    As I am new to SAP,
    As per my requirement, I need to check my partner through email. User will give email and then I should get related partner details, here I cannot use  table. So i need FM for fetching partner by giving email and (  text ).
    Regards,
    Mithuunn.

    Try BAPI_BUPA_SEARCH_2.  According to the documentation:
    This function module enables you to search for business partners.
    You can enter the telephone and fax number, the e-mail address and the address attributes 'country', 'region', 'city' and 'postal code' as search criteria. The business partner role and central business partner data, such as business partner number and the match code fields MC_NAME1 and MC_NAME2 constitute additional search criteria.
    While the e-mail address and the URI address have to be entered in full, the address attributes and central data may contain wildcards (in the form of '*'). However, bear in mind that you must enter the country when using a wildcard to search for the telephone number, otherwise an error message is issued.
    Read the Function Module Documentation for more...
    Hope this helps!

  • Automatic sap mail to mrp controller

    Hai friends
    After MRP run automaticaly mail trigger to mrp controller .
    For this requirement ,what are the settings needed ?

    Hy,
    For trigering automatic SAP mail to MRP controller you have to go with User Exit,
    User Exit for MRP is
    User Exit is  M61X0001
    Function Module EXIT_SAPLM61C_001 and
    Include ZXM61U02
    In above Include you have to apply funbction module which triggers the automatic mail
    Some of the Function module relevent to sending mail are,
    /SPE/TPOP_SMTP_SETTINGS_READ
    BAPI_BUPA_SEARCH
    BAPI_BUPA_SEARCH_2
    BKK_ACCNT_STAT_GET_EMAIL
    BUPA_PARTNER_CONTACT_SEARCH
    CRM_IC_EMAIL_LINK
    EXIT_SAPLBPFC_001
    EXIT_SAPLEL35_003
    EXIT_SAPLFCIM_280
    EXIT_SAPLJGWWW_004
    EXIT_SAPLMLSX_010
    EXIT_SAPLMLSX_011
    EXIT_SAPLVED4_004
    EXIT_SAPMJGWWWIU1_016
    EXIT_SAPMJGWWWIU1_017
    FTR_MIR_EXECUTE_MESSAGEMAIL
    HR_EFI_BC_POLL_MAILBOX
    HR_EFI_XI_POLL_MAILBOX
    HR_FBN_GENERATE_SEND_EMAIL
    HRIQ_STUDENT_EMAIL_GET
    HRWPC_RQ_MAIL_TO_MANAGER
    QFOA_MAIL_REJECTED_RESULTS
    QFOA_MAIL_SENDING
    QFOA_UD_LONGTEXT_SENDING
    WFDBP_GET_GROUPWARE_EMAIL
    WFDS_GET_GROUPWARE_EMAIL
    I don't know the total function but I am trying my best and share the knowledge upto my best level.
    For completing the total function you have to take help of both Abaper and basis person.
    We have also set automatic mail function not for MRP but for DMS.
    Regards,
    Dhaval
    Edited by: Dhaval on Jun 24, 2008 11:19 AM

Maybe you are looking for

  • Error when refresh security filter in Planning 11.1.1.3

    Dear All, I found a error when I refresh securty filter in planning. The error is related to the user who deleted in Microsoft Active Directory. The shared service cannot find the user. How can I solve the error? Regards

  • Virtual Windows 7 machine with 4GB RAM

    I'm currently upgrading my iMac to 8GB RAM, I have a 2.66GHz processor , will I be able to install Windows 7 in a virtual machine using VMWare Fusion 4 with 4GB of dedicated RAM?

  • Gradient Mesh Tool won't work over a standard gradient

    How can I get the Mesh Tool to work over a gradient? If I place an RGB image and create a gradient mesh over it I can select each individual point and then use the color picker to pick a color underneath by clicking the placed image. However, if I cr

  • Does the macbook pro have a 'dv terminal'?

    I have macbook pro and panasonic dv video camera. Panasonic manual says I can use a dv interface cable to connect the camera to the computer if the computer has a dv terminal. Does the mac have a dv terminal? is it one of the firewire ports? many tha

  • ICal won't take data. Data disappeared from iCal

    iCal won't take data. All events disappeared from iCal. Help!