Need example for BAPI query. Please, help.

Hi,
badly need help on BAPI_ACC_ACTIVITY_ALLOC_POST.
Does anybody have some example code for jCO query?
Thanks.
Vladimir

Hi,
Try this code...
package jco;
import com.sap.mw.jco.*;
public class jcosample
   public static void main(String args[])
       JCO.Client myConnection = null;
       JCO.Repository mRepository = null;
       JCO.Function myFunction = null;
       try
       myConnection = JCO.createClient("client","username","password" ,"language","ip address","system no");           
       myConnection.connect();
       mRepository = new JCO.Repository("WIPRO",myConnection);
       try
              if (mRepository == null )
                     System.out.println("NuLL");
              try
                     IFunctionTemplate ft=mRepository.getFunctionTemplate("BAPI_COMPANYCODE_GETLIST");                                                 
                     myFunction=ft.getFunction();                    
              }catch (Exception ex)
                     throw new Exception(ex + "Problem retrieving JCO.Function object.");
        if (myFunction == null)
                 System.exit(1);
              myConnection.execute(myFunction);                                  
              }catch (Exception ex)
                     ex.printStackTrace();
                     System.exit(1);
            myConnection.execute(myFunction);
            JCO.Table codes = null;
              codes =myFunction.getTableParameterList().getTable("COMPANYCODE_LIST");
              int size;
             size =codes.getNumRows();
              if (size == 0)
                  System.out.println("No value matches the selection cretaria");
              else
                 for (int i = 0;i<=size; i++)
                        codes.setRow(i);                      System.out.print(codes.getString("COMP_CODE"));                     System.out.println(codes.getString("COMP_NAME"));
       }catch( Exception e)
              e.printStackTrace();
Hope that helps...
Note: in case for the BAPI that inserts or modified data you must call the BAPI_TRANSACTION_COMMIT also for the changes to get reflected in the Database.
Please let me if that helps you.
Cheers
Kathir~

Similar Messages

  • Hi! I'm in the middle of updating the softwear and its not moved and it's been over half an hour. Will it load as I need it for work! Please help!!

    Hi! I'm in the middle of updating the softwear and its not moved and it's been over half an hour. Will it load as I need it for work! Please help!

    hold down the home/sleep button together until you see the apple logo and then releaswe.

  • Need example for using query string parameters in Web Dynpro

    Hello,
    Is it possible to transfer a Web DynPro application parameters at the query string (URL)?
    Can someone please show me an example of how to pass it and how to retreive it using code inside an application?
    Thank you in advance

    Hi,
    when launching WD apps in the Portal you have to define a WD iView in the Portal. This can be started using the NavigationTarget parameter.
    Parameters (ie. Business Parameters) that should be passed to the WebDynpro application can be defined in the iView itself - the iView attribute is called "Application Parameters". Here you can also define variable expressions like "emailaddr=<User.email>" so that the value of the email address is evaluated on runtime.
    This way you don't have to care about URL encodings at all
    The following user expressions can be used:
    <User.displayname>
    <User.uniquename>
    <User.firstname>
    <User.lastname>
    <User.salutation>
    <User.jobtitle>
    <User.department>
    <User.email>
    <User.telephone>
    <User.mobile>
    <User.fax>
    <User.streetaddress>
    <User.city>
    <User.zip>
    <User.country>
    <User.state>
    <User.timezone>
    udo

  • I have one of the old macbooks and wish to hook it up to my tv. do i need a mini dvi to hdmi adapter plus a 3 rca phono lead with a jack for the sound. please help as im useless at this stuff. cheers

    i have one of the old macbooks and wish to hook it up to my tv. do i need a mini dvi to hdmi adapter plus a 3 rca phono lead with a jack for the sound. please help as im useless at this stuff. cheers

    First we need to know which one of the 9 different models of MacBook you have. To see which model you have go to the Apple in the upper left corner and select About This Mac, then click on More Info (and then System Report if you’re running 10.7 Lion). When System Profiler comes up check the Model Identifier and post it back here.
    The Late 2008 model 5,1 Aluminum Unibody and the Late 2009 model 6,1 and Mid 2010 model 7,1 White Unibody have a Mini DisplayPort. The Early 2006 model 1,1 through Early 2008 model 4,1s plus the Early and Mid 2009 model 5,2s have Mini-DVI ports. Each would take a different adapter to connect with the TV.

  • I have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    i have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    Using those instructions you may also be able to select PayPal if that is allowed in your country.

  • HT201328 my iphone 4G buy from japan, i need to use in indonesian, please help me, i spent much money for this phone.....

    my iphone 4G buy from japan, i need to use in indonesian, please help me, i spent much money for this phone.....

    froggy_vic wrote:
    so even if your phone is unlocked you wouldn't be able to use it anywhere else.
    Absolutely not true. There is no difference, spec wise, between the iPhone sold in Japan & the GSM iPhone sold everywhere else. iPhones in Japan use UMTS 2100.

  • I created an account but haven't yet purchase any products yet! I'm a publisher launching  a magazine so i need something for design and making a layout for magazine! Please help is there a number i can talk to someone ?

    created an account but haven't yet purchase any products yet! I'm a publisher launching  a magazine so i need something for design and making a layout for magazine! Please help is there a number i can talk to someone ?

    Adobe Connect Support phone numbers
    or
    Cloud Plans https://www.adobe.com/products/creativecloud/buying-guide.html

  • I have been trying to put some of my music and artwork, on youtube. Youtube says you need an encoder to upload music. But the problem is the only encoders available are for windows. Please help, thank you

    I have been trying to put some of my music and artwork, on youtube. Youtube says you need an encoder to upload music. But the problem is the only encoders available are for windows. Please help, thank you

    The formats YouTube supports can be found here:
    http://www.google.com/support/youtube/bin/answer.py?answer=55744
    Since YouTube supports AAC, the file format iTunes uses by default, it's probable you don't need any sort of converter.
    If you continue to have problems with uploading to YouTube, I'd suggest you ask for assistance in their forums:
    http://www.google.com/support/forum/p/youtube?hl=en
    Regards.

  • I have updated my 4S i phone with ios 8.1.2, while activating i forgot my password, i am able to sign in my apple id in pc but not not able to sign in my i phone and  message- your apple id has been disable for security reasons please help

    I have updated my 4S i phone with ios 8.1.2, while activating my iphone, i forgot my password. I am able to sign in my apple id in pc (manage my account) but not not able to sign in my i phone and  message- your apple id has been disable for security reasons please help.
    my apple id is with extension @ gmail.com but for activation it is mentioned that it is linked with extension of @me.com

    Hi ulhas1frombanihal,
    Welcome to the Support Communities!  Because your account has been disabled, you will need to contact Apple ID account security to straighten this out.
    Contact Apple for help with Apple ID account security - Apple Support
    http://support.apple.com/en-us/HT5699
    I hope this information helps ....
    - Judy

  • How to create authorisation object for save button please help in abap

    how to create authorisation object for save button please help in abap

    Hi
    In general different users will be given different authorizations based on their role in the orgn.
    We create ROLES and assign the Authorization and TCODES for that role, so only that user can have access to those T Codes.
    USe SUIM and SU21 T codes for this.
    Much of the data in an R/3 system has to be protected so that unauthorized users cannot access it. Therefore the appropriate authorization is required before a user can carry out certain actions in the system. When you log on to the R/3 system, the system checks in the user master record to see which transactions you are authorized to use. An authorization check is implemented for every sensitive transaction.
    If you wish to protect a transaction that you have programmed yourself, then you must implement an authorization check.
    This means you have to allocate an authorization object in the definition of the transaction.
    For example:
    program an AUTHORITY-CHECK.
    AUTHORITY-CHECK OBJECT <authorization object>
    ID <authority field 1> FIELD <field value 1>.
    ID <authority field 2> FIELD <field value 2>.
    ID <authority-field n> FIELD <field value n>.
    The OBJECT parameter specifies the authorization object.
    The ID parameter specifies an authorization field (in the authorization object).
    The FIELD parameter specifies a value for the authorization field.
    The authorization object and its fields have to be suitable for the transaction. In most cases you will be able to use the existing authorization objects to protect your data. But new developments may require that you define new authorization objects and fields.
    http://help.sap.com/saphelp_nw04s/helpdata/en/52/67167f439b11d1896f0000e8322d00/content.htm
    To ensure that a user has the appropriate authorizations when he or she performs an action, users are subject to authorization checks.
    Authorization : An authorization enables you to perform a particular activity in the SAP System, based on a set of authorization object field values.
    You program the authorization check using the ABAP statement AUTHORITY-CHECK.
    AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'
    ID 'ACTVT' FIELD '02'
    ID 'CUSTTYPE' FIELD 'B'.
    IF SY-SUBRC <> 0.
    MESSAGE E...
    ENDIF.
    'S_TRVL_BKS' is a auth. object
    ID 'ACTVT' FIELD '02' in place 2 you can put 1,2, 3 for change create or display.
    The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.
    This Authorization concept is somewhat linked with BASIS people.
    As a developer you may not have access to access to SU21 Transaction where you have to define, authorizations, Objects and for nthat object you assign fields and values. Another Tcode is PFCG where you can assign these authrization objects and TCodes for a  profile and that profile in turn attached to a particular user.
    Take the help of the basis Guy and create and use.
    Regards
    ANJI

  • I am looking for a good development application for IOS. Please help me.Thanks.

    I am looking for a good development application for IOS. Please help me.Thanks.

    Xcode is required to submit your app to the App Store. So at some point (even if it is just to submit) you will need to use it.

  • HT3630 How to creat an app-enabled accessories for iPhone? Please help me to get an answer..

    How to creat an app-enabled accessories for iPhone? Please help me to get an answer..

    To get hardware interfaces and API's via hardware you
    need to join the MFi program.  That info is here:
    https://developer.apple.com/programs/mfi/
    To get the additional software to be able to download
    and test code on any iDevice, you must join the
    iOS Developer Program.  That info is here:
    https://developer.apple.com/programs/ios/
    Both programs require fees and NDA agreements,
    especially hardware as most vendors that supply
    components development tools will not sell you any
    of their tools unless you are a member of the MFi
    program.

  • Our iTunes will not open.  It reads that we need the English version? Please help.

    Our iTunes will not open.  It reads that we need the English version? Please help. 
    If I download a new iTunes will I lose everything we have?

    Same issue for me.  Was running 10.5.3 due to the bug in 10.6 with Apple TV.  Upgraded to 10.6.1 since it was supposed to solve the issues.  ANd no I can;t open iTunes at all.
    Annoyed that 10.6 was shipped with the bug with the Apple TV sortting of titles.
    Really p*ssed off that 10.6.1 which was supposed to fix this has totally borken iTunes for me.
    Time to try to revert to 10.5.3 again.
    Apple, what's happened with Q/A.
    (My setup - latest patched Lion, upgraded via Automatic update; so nothing out of the ordinary.)

  • How use set up with office 2011 for mac as I did keep tried put download but it's always 'update' download. I want get start set up new office 2011 for mac? please help me

    how use set up with office 2011 for mac as I did keep tried put download but it's always 'update' download. I want get start set up new office 2011 for mac? please help me

    You must be using an update CD.  You need the software that has the full version first - install that, then you can use the update one if needed. I know, cuz I made the same mistake - lol

  • HT201303 My ipad has been disabled.  I need to enable it.  Please help!

    Hello, my ipad has been disabled for sometime and I need to enable it.  Please Help!

    FORCE IPAD INTO RECOVERY MODE
    1. Turn off iPad
    2. Turn on computer and launch iTunes (make sure you have the latest version of iTune)
    3. Plug USB cable into computer's USB port
    4. Hold Home button down and plug the other end of cable into docking port. Do not release button until you see picture of iTunes and plug (very important)
    5. Release Home button.
    ON COMPUTER
    6. iTunes has detected iPad in recovery mode. You must restore this iPad before it can be used with iTunes.
    7. Select "Restore iPad"...
    Note: Data will be lost

Maybe you are looking for

  • RFC for role maintenance

    We are in the process of developing an ASP.NET web application which will be used to raise requests for user and role creations in SAP. We will be making use of Sonic ESB to update SAP through IWAY SAP adapter. IWAY SAP adapter supports RFC’s, Bapi’s

  • How to populate table programmatically??

    Hi, I want to populate a fresh table from my result set which i am getting from firing query in database which is written in my Managed Bean. The data of result set populate my table which is on my ADf page. How I can do this, please help me.... Jdev

  • BSEG table value can't apply formula

    I download amount column for BSEG into excel, for example, in excel, the document number 400000235 has amount 51.866,60, when I apply formula column X=1.5*amount column, it shows #value!, if I change to 51866.6, it works fine, I have more than 2000 l

  • Backup in ARCHIVELOG Mode

    Dear Sirs, Actually I've a non archivelog mode RDBMS, but I wan't to make a hot backup. Could I make a hot backup after I turn the ARCHIVELOG mode ON, then turn it off again after Back - Up ? And how do I make the hot backup ? Thank you for the atten

  • Exchange Rates Upload .. TBEX

    Hi all, I have tried using the TBDM in 4.7 without success. The TBEX transaction works perfectly. I have several questions: 1. What is the type of file I should be using? a *.txt, *.dat, *.xls? 2. When I use a *.txt type of file I get the following e