How to use Jco to read a transparent table?

For example I want to use java to read table T002,
I can use Jco, but does anybody know how to use Jco to read a data table?
Best regards,
Lament

Hi,
if its exposed Using RFC you can use JCo. Other wise you could give a try accessing it using JDBC.
Regards
Ayyapparaj

Similar Messages

  • How to use OO40 to read geometry objects ??????????

    How to use OO4O to read & write geometry objects?

    What is OO4O ?
    Joel P�rez

  • How can I modify data from a Transparent Table without ABAP code.

    Hi,All
    How can I modify data from a Transparent Table (like TCURR),  and important thing is I want do all that with no ABAP code here. It is like that we always do that in a Oracle database use TOAD or PLSQL third party tools, with no script code here.
    I had fond that there is a way can do that:
    1, type 'se11',and Display Database table 'TCURR', click Contents, then click Execute to display all data
    2, type '/h' and let debugging on
    3, select one of this data then click 'Display',enter in debugging system.
    4, then make a breakpoint in the code. But... display a dialog let I type a 'ABAP Cmnds', I want to know what can be type in for that?
    and, My system is ECC6.
    thank you all
    Edited by: xuehui li on Aug 20, 2008 6:30 PM

    Hello,
    Your approach (with Vijay's suggestion) MAY work.  However, depending on how tight security is at the company that you are working at you may or may not be able to acutaly change the value of the SHOW field to EDIT.  This will be especially true if you are working in a Production environment.  Vijay's other comment is true as well.  This is not a recommended approach to change data (especially data with a financial impact like TCURR) in a production environment.  The auditors will not be impressed.
    Explore the option of a maintenace view or look at tcode TBDM to upload a file which includes daily rates from providers like Reuters or try tcode s_bce_68000174 which is a maintenance view on TCURR.
    Regards
    Greg Kern

  • How to use Innerjoin b/w these 2 tables VBAK and CDHDR ?

    Hi,
              How to use Innerjoin b/w these 2 tables VBAK and CDHDR for retrieving of changed sales order data ?I nned the A select stmt with INNER JOIN for changed sales data.
    Thanks & Regards,
    gopi.

    Hi Gopi,
    You can use the code similar to below to read the changes to Sales order from CDHDR AND CDPOS
    FORM GET_CHANGES .
    * Get all the changes to Sales Order as well as Deliveries. Suppress
    * Non relevant change
      DATA : BEGIN OF SO_VBELN OCCURS 0 ,
           VBELN LIKE CDHDR-OBJECTID,
           END OF SO_VBELN.
      DATA : BEGIN OF DL_VBELN OCCURS 0 ,
           VBELN LIKE CDHDR-OBJECTID,
           END OF DL_VBELN.
      DATA TEMP_SO_VBELN LIKE SO_VBELN OCCURS 0 WITH HEADER LINE.
      DATA DATE_UNTIL LIKE SY-DATUM.
      DATA TIME_UNTIL LIKE SY-UZEIT .
      DATA DATE_FROM LIKE SY-DATUM.
      READ TABLE S_CHADT INDEX 1.
      LOOP AT IT_VBAP.
        AT NEW VBELN.
          MOVE IT_VBAP-VBELN TO TEMP_SO_VBELN.
          COLLECT TEMP_SO_VBELN.
        ENDAT.
      ENDLOOP.
      IF TEMP_SO_VBELN[] IS NOT INITIAL.
        SELECT OBJECTID AS VBELN FROM CDHDR
             INTO TABLE SO_VBELN
               FOR ALL ENTRIES IN TEMP_SO_VBELN
             WHERE  OBJECTCLAS EQ 'VERKBELEG'
             AND OBJECTID EQ TEMP_SO_VBELN-VBELN
             AND USERNAME IN S_CHABY
             AND UDATE IN S_CHADT.
      ENDIF.
      LOOP AT IT_LIPS INTO WA_LIPS.
        AT NEW VBELN.
          MOVE WA_LIPS-VBELN TO DL_VBELN.
          COLLECT DL_VBELN.
        ENDAT.
      ENDLOOP.
    * Changes in Sales Order.
      IF NOT  SO_VBELN[] IS INITIAL.
    * Get partner functions
        SELECT * INTO TABLE IT_TPART
          FROM TPART WHERE SPRAS EQ SY-LANGU.
        SELECT A~TABNAME A~FIELDNAME A~DATATYPE B~DDTEXT
           INTO CORRESPONDING FIELDS OF TABLE IT_FIELD
           FROM DD03L AS A INNER JOIN
                DD04T AS B
                ON A~ROLLNAME EQ B~ROLLNAME
                AND A~AS4LOCAL EQ B~AS4LOCAL
              WHERE ( A~TABNAME EQ 'VBAK'
                      OR A~TABNAME EQ 'VBAP'
                      OR A~TABNAME EQ 'VBEP'
                      OR A~TABNAME EQ 'VBPA'
                      OR A~TABNAME EQ 'VBUK'
                      OR A~TABNAME EQ 'VBKD' )
               AND  A~AS4LOCAL EQ 'A'
               AND A~AS4VERS EQ '0000'
               AND A~ROLLNAME NE SPACE
               AND B~DDLANGUAGE EQ SY-LANGU.
    * Preapare the exclusion table
        R_EXCL_FIELDS-OPTION = 'EQ'.
        R_EXCL_FIELDS-SIGN = 'I'.
        LOOP AT IT_FIELD WHERE DATATYPE EQ 'CURR'.
          R_EXCL_FIELDS-LOW = IT_FIELD-FIELDNAME.
          APPEND R_EXCL_FIELDS.
        ENDLOOP.
        R_EXCL_FIELDS-LOW = 'ARKTX'.
        APPEND R_EXCL_FIELDS.
        R_EXCL_FIELDS-LOW = 'LGORT'.
        APPEND R_EXCL_FIELDS.
        R_EXCL_FIELDS-LOW = 'TDDAT'.
        APPEND R_EXCL_FIELDS.
        R_EXCL_FIELDS-LOW = 'LDDAT'.
        APPEND R_EXCL_FIELDS.
        R_EXCL_FIELDS-LOW = 'MBDAT'.
        APPEND R_EXCL_FIELDS.
        R_EXCL_TABL-OPTION = 'EQ'.
        R_EXCL_TABL-SIGN = 'I'.
        R_EXCL_TABL-LOW = 'KONVC'.
        APPEND R_EXCL_TABL.
        R_EXCL_TABL-LOW = 'VBKD'.
        APPEND R_EXCL_TABL.
        LOOP AT SO_VBELN.
          REFRESH ITAB_CDHDR.
          DATE_FROM = S_CHADT-LOW.
          DATE_UNTIL = S_CHADT-HIGH.
          CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
            EXPORTING
              DATE_OF_CHANGE             = DATE_FROM
              OBJECTCLASS                = 'VERKBELEG'
              OBJECTID                   = SO_VBELN-VBELN
              TIME_OF_CHANGE             = TIME_UNTIL
              DATE_UNTIL                 = DATE_UNTIL
              USERNAME                   = ' '
            TABLES
              I_CDHDR                    = ITAB_CDHDR
            EXCEPTIONS
              NO_POSITION_FOUND          = 1
              WRONG_ACCESS_TO_ARCHIVE    = 2
              TIME_ZONE_CONVERSION_ERROR = 3
              OTHERS                     = 4.
          IF SY-SUBRC NE 0.
            CONTINUE.
          ENDIF.
          LOOP AT ITAB_CDHDR WHERE USERNAME IN S_CHABY.
            REFRESH IT_CDSHW.
            CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
              EXPORTING
                CHANGENUMBER            = ITAB_CDHDR-CHANGENR
              TABLES
                EDITPOS                 = IT_CDSHW
              EXCEPTIONS
                NO_POSITION_FOUND       = 1
                WRONG_ACCESS_TO_ARCHIVE = 2
                OTHERS                  = 3.
            IF SY-SUBRC EQ 0.
              PERFORM GET_ACTION .
            ENDIF.
          ENDLOOP.
        ENDLOOP.
      ENDIF.
    * Changes in Delivery
      IF NOT DL_VBELN[] IS INITIAL.
        REFRESH : IT_CDHDR , IT_CDPOS.
        SELECT  OBJECTCLAS OBJECTID CHANGENR USERNAME UDATE
               FROM CDHDR INTO CORRESPONDING FIELDS OF TABLE IT_CDHDR
             FOR ALL ENTRIES IN DL_VBELN
           WHERE  OBJECTCLAS EQ 'LIEFERUNG'
           AND OBJECTID EQ DL_VBELN-VBELN
           AND USERNAME IN S_CHABY
           AND UDATE IN S_CHADT
           AND CHANGE_IND EQ 'U'.
        LOOP AT IT_CDHDR.
          CONCATENATE SY-MANDT IT_CDHDR-OBJECTID
           INTO IT_CDHDR-TABKEY .
          CONDENSE  IT_CDHDR-TABKEY.
          MODIFY IT_CDHDR.
        ENDLOOP.
        IF NOT IT_CDHDR[] IS INITIAL.
          SELECT  * INTO TABLE IT_CDPOS FROM CDPOS
               FOR ALL ENTRIES IN IT_CDHDR
             WHERE  OBJECTCLAS EQ IT_CDHDR-OBJECTCLAS
             AND OBJECTID EQ IT_CDHDR-OBJECTID
             AND CHANGENR EQ IT_CDHDR-CHANGENR
             AND TABNAME EQ 'LIKP'
             AND TABKEY EQ IT_CDHDR-TABKEY
             AND FNAME IN ('WADAT','LFDAT','ROUTE','VSBED')
             AND CHNGIND EQ 'U' .
          LOOP AT IT_CDPOS .
            CLEAR  IT_DL_CHG-FLAG_RED.
            CASE IT_CDPOS-FNAME.
              WHEN 'WADAT'.
                MOVE 'Goods issue date changed' TO IT_DL_CHG-ACTION.
              WHEN 'LFDAT'.
                MOVE 'Delivery date changed' TO IT_DL_CHG-ACTION.
                MOVE 'X'  TO IT_DL_CHG-FLAG_RED.
              WHEN 'ROUTE'.
                MOVE 'Route Changed' TO IT_DL_CHG-ACTION.
              WHEN 'VSBED'.
                MOVE 'Shipping Condition Changed' TO IT_DL_CHG-ACTION.
              WHEN OTHERS.
            ENDCASE.
            AT NEW CHANGENR .
              READ TABLE IT_CDHDR WITH KEY OBJECTCLAS = IT_CDPOS-OBJECTCLAS
                                           OBJECTID = IT_CDPOS-OBJECTID
                                           CHANGENR = IT_CDPOS-CHANGENR
                                           BINARY SEARCH.
              MOVE IT_CDHDR-USERNAME TO  IT_DL_CHG-ERNAM.
              WRITE IT_CDHDR-UDATE TO  IT_DL_CHG-ERDAT.
            ENDAT.
            IT_DL_CHG-COUNTER = IT_DL_CHG-COUNTER + 1.
            MOVE IT_CDPOS-OBJECTID TO IT_DL_CHG-VBELN.
            MOVE IT_CDPOS-VALUE_OLD TO IT_DL_CHG-OLD_VAL.
            MOVE IT_CDPOS-VALUE_NEW TO IT_DL_CHG-NEW_VAL.
            INSERT TABLE IT_DL_CHG.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.                    " GET_CHANGES
    Cheers
    VJ

  • How to use FIELD-SYMBOLS to declare a table

    How to use FIELD-SYMBOLS to declare a table?

    hi yong,
    this will be very general:
    FIELD-SYMBOLS : <gf_table> TYPE ANY TABLE.
    or
    to do like a specific table from your program
    FIELD-SYMBOLS : <gf_table> TYPE itab.
    itab is of course your internal table from your program.
    ec

  • How to use JCo from IPC 5.0

    Hi,
    We just upgraded CRM from 4.0 to 5.0, and now I´m trying to do the necesary changes in the pricing formulas, but there´s one problem.
    With IPC 4.0 we could use JCo to make calls to R/3 4.6c to retrieve additional data (performance not an issue), but with IPC 5.0 this doesn´t seem possible any more.  Could anyone please let me know how can I call a RFC from IPC 5.0????
    Thanks,
    Jonatan Urfalino

    Correct, inside IPC 5.0 the only thing you can find is a parallel JCo implementation that is not a standard one, but just a fachade that SAP made to comunicate from java to ABAP using shared closures. This JCo cannot (as far as I know) be used to comunicate to other systems, only to the host on which IPC is running.
    The solutions:
    1) If you want to comunicate to an old R3 system (that is my case) you can use the internal JCo to call a BAPI in the abap stack wich internally calls the bapi in the other system. the performance is not so bad because the first call is made with shared closure within the same system,and the second one is a standard RFC call.
    2) If the destionation system is also an ECC 6.0 or any that supports web services, the solution proposed by Leonardo is excellent indeed! Except for one issue, that Leonardo already mentioned already: the web services's performance.

  • How to use JCo Provider Service w/Sneak Preview and Test Drive

    I have both SAP Web AS Sneak Preview (6.40) and MiniWas 6.20 Test Drive installed on a single system.  I have implemented a Java server program which can be RFC called from an ABAP program using JCO.
    The only disadvantage to this process is that I must manually run the server program each time I bring up the J2EE system.
    I would like to set things up so that when I start the WebAS 6.40 J2EE system, the server function can be automatically registered (if I'm using the correct terminology - not at all sure about that...).  It looks to me that I should be able to use JCo Provider Service to do what I want to do, but I don't know how to do any of the session bean creation and I esp. can't seem to find out how to run the  J2EE Visual Administrator, which the documentation I've found leads me to believe needs to be used.
    Is there a tutorial, or example, that will lead me through this entire process?  I have the ABAP calling program working OK, and I have the Java JCo server program working ok - I just want to create something in Java that will operate like a good old C Language function installed as an RFM.
    Can anyone help? Is it possible?

    Stefan:
    Well, I guess I'm stuck at the first step.
    As I understand it, I have to use the Visual Administrtor to register the Web AS 6.40 Sneak Preview system as an RFC destination.  When I bring up the Visual Administrator, it has essentially two tabs showing: Dispatcher and Server.  It's inviting me to define a connection and Login.  So, Q1: Is it inviting me to login to the J2EE or the Web AS?  Either way, I am never able to login - I get this error:
    com.sap.engine.services.security.exceptions.BaseLoginException: Cannot create new RemoteLoginContext
    I used all of the NetWeaver sneak preview defaults when installing, and I recorded these:
    Type               Account
    OS User            Compaq-laptop/J2EAdm
    OS User            Compaq-laptop/SAPServiceJ2E
    DB User            SAPJ2EDB
    J2EE Engine User   Administrator
    J2EE Engine User   Guest
    Q2:  Is it possible to do what I'm trying to do with the Sneak Preview system? 
    Or am I trying to connect and logon to the Web AS 6.20 Test Drive (I don't think so...)?  I used the defaults when installing the Test Drive, and have these users:
    BCUSER
    DDIC
    Is it one of these I should be logging onto?
    Also, Visual Administrator wants a port specified on the J2EE Engine connection paramters - what port should I be specifiying?
    Can you get me past this dilemma, Stefan?  Thanks...

  • How to use multiple visa read in one program

    hi
    i am working at Hameg HM8143 power supply i want to measure voltage and current simultaneiously and use the measured values for further calculations. for this i used two visa read blocks.
    >>>>>>the measured values are shown in the same visa read string however i want it to be shown sepetately,
    >>>>>>One of the VISA read block gives error. so i want to know how to use VISA read to get current and voltage simultaneously in seperate strings
    >>>>>>than how to convert strings to numbers  for using them for my calcultions.
    i am attaching screen shot as well
    Attachments:
    screenshot.JPG ‏164 KB

    you can not use a single serial to send 2 commands simultaniously?
    There is a single serial line so one command has to be before another.  This doesnt mena that you can not read from 2 seperate threads but will have to ensure that there is a locking mechanism to make sure that your queries are atomic.  In labview encapsulating all communications can be done with an action engine which will allow for concurrent execution with automatic blocking of your resource (serial device).
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • How to use a FILTER in a normal table in ABAP WEB DYNPRO

    Hi Experts,
    I need to Filter my table in UI using the 'onFilter' event,
    BUT I want the first row of the table to be my INPUTS  to do the filtering - JUST LIKE IN ALV TABLE,
    since i dont want to use an ALV table, i want the same to be done in a transparent table...

    Dear pramodh,
    Here u can achieve filter option in transparent table by creating a button(Toggle) in table.
    1.Now you need to apply filter in OnToggle event.
       wd_this->table_control->apply_filter( ).
    2.when the Filter button is pressed  IS_FILTER_ON attribute will turn ON and FILTER will be set.
       And Automatically the First row is set for INPUTS.
    The Following Code is required to get Handler for Table and also to SET FILTER.
    method WDDOMODIFYVIEW .
        DATA: wd_table TYPE REF TO cl_wd_table,
              w_is_filter_on TYPE wdy_boolean.
        wd_context->get_attribute( EXPORTING name = 'IS_FILTER_ON'
                                   IMPORTING value = w_is_filter_on ).
        wd_table ?= view->get_element(  '<give ur table ID>' ).
        wd_this->table_control ?= wd_table->_method_handler.
        IF w_is_filter_on = abap_true.
          wd_table->set_on_filter( 'FILTER' ).
        else.
          wd_table->set_on_filter( '' ).
        ENDIF.
    endmethod.
    I believe u know about Table Handler. And i can help if u need.
    Thanks & Regards,
    Rakesh Vanamala.

  • HOW TO USE A SINGLE PERFORM FOR VARIOUS TABLES ?

    perform test TABLES t_header.
    select
           KONH~KNUMH
           konh~datab
           konh~datbi
           konp~kbetr
           konp~konwa
           konp~kpein
           konp~kmein
           KONP~KRECH
           FROM konh INNER JOIN konp
                  ON konpknumh = konhknumh
           into table iTABXXX
            "ANY TEMPERARY INTERNAL TABLE.
           for all entries in t_header
           where
                 konh~kschl = t_header-kschl
             AND konh~knumh = t_header-knumh.
    endform.
    how can I use above perform for various internal tables of DIFFERENT LINE TYPES but having the fields KSCHL & KNUMH.

    u can use single perform....
    just see this example......hope this is what u r expecting....
    tables : pa0001.
    parameters : p_pernr like pa0001-pernr.
    data : itab1 like pa0001 occurs 0 with header line.
    data : itab2 like pa0002 occurs 0 with header line.
    perform get_data tables itab1 itab2.
    if not itab1[] is initial.
    loop at itab1.
    write :/ itab1-pernr.
    endloop.
    endif.
    if not itab2[] is initial.
    loop at itab2.
    write :/ itab2-pernr.
    endloop.
    endif.
    *&      Form  get_data
          text
         -->P_ITAB1  text
         -->P_ITAB2  text
    form get_data  tables   itab1 structure pa0001
                            itab2 structure pa0002.
    select * from pa0001 into table itab1 where pernr = p_pernr and begda le sy-datum and endda ge sy-datum.
    select * from pa0002 into table itab2 where pernr = p_pernr and begda le sy-datum and endda ge sy-datum.
    endform.                    " get_data
    Regards
    vasu

  • How to use selectOneList in a updateable data table column

    Hi,
    Could someone tell me how to use selectOneList (source from a vo X) in an updateable data table column (from another vo Y)?
    I successfully created a page with the data table. However, strange things happened:
    1) the values populated on the selectOneList column don't match the underlying value in vo Y. in fact, every rows in the column got the same value.
    2) when I update one of the rows, the column value in every other rows turns to the new value.
    3) when I sort other columns in the table, the values shown in the selectOneList column get toggled between blank and some incorrect value.
    I believe it is something related to the fact that the same iterator is used to the source view object. If this is the case, how can I solve it?

    See #7 here:
    http://radio.weblogs.com/0118231/stories/2005/06/24/jdeveloperAdfScreencasts.html

  • How to use Connection.clientinfo with v$session table

    Hi everyone,
    I'm trying to keep tabs on the number of connections I create (via python and cx_Oracle) by monitoring Oracle's v$session table.
    From the cx_Oracle docs, it appears the preferred way to write my "module" and "action" parameters to v$session is via the Connection.clientinfo method.
    I tried creating a connection and using that method, but the results did not appear in the v$session table. Below is how I called the method:
    cnx.clientinfo(module="name of module", action="myaction")
    Is that the correct way to use "clientinfo"?
    The cx_Oracle docs don't provide any usage examples (that I could find), and only point to the Python DB API specs. I didn't notice a mention of this method there:
    http://www.python.org/dev/peps/pep-0249/
    Can anyway show me an example of how to use the "clientinfo" method? Also, is it necessary to have "write" permission for my username in order to access v$session? If so, perhaps that's my problem...

    C:\Documents and Settings\tchsensoy>python
    Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32
    import cx_Oracle
    con = cx_Oracle.connect("player/player@pground")
    cur = con.cursor()
    con.module="query module"
    con.action="dual query"
    con.clientinfo="Husnu Sensoy"
    # Run below SQL after running this line ....
    cur.execute("select dummy from dual")
    con.close()
    exit()select s.PROGRAM, s.CLIENT_INFO, module, action from v$session s where username = 'PLAYER' and program = 'python.exe';
    PROGRAM CLIENT_INFO MODULE ACTION
    python.exe Husnu Sensoy query module dual query
    Hüsnü Şensoy
    Edited by: HSensoy on 19.Eki.2009 02:58
    Edited by: HSensoy on 19.Eki.2009 02:59
    Edited by: HSensoy on 19.Eki.2009 03:00

  • How to use JCO and RFC

    Hi guys, please help me out
    I'm new to JCO and do not have any idea about it.
    Here is my situation, for testing, I want to call an ABP RFC FM in SAP just to return a single text message to Java application through parameter.
    (Of course, I have access to SAP from my company and I do not have any Java compiler in my computer).
    From my understanding, there 2 main things to concern (Please correct me if i'm wrong and please tell me the steps I should do)
    1) Software installation and configuration
       What software do I need to install on my computer, is
       it JCO, SAPGUI, Java Compiler? What kind of
       configurations do I need for JCO?  
    2) Programming
       a) SAP side
          Write an ABAP RFC FM just to return a text message
          to Java application through parameters (No problem
          with this step)
       b) My computer side
          Write a Java application to call ABP RFC FM
          Do you guys have any simple source code example for
          this?? Please remember that this Java application
          simply call an ABAP RFC FM to get just a single
          text message.
    I really appreciate your help
    Thank you

    Hi Dean,
    USe Eclipse for Java programming.
    If you are downloading the latest version of JCO, make sure you have latest version of SAP Gui as there are version issues as the librfc.dll needs to be of compatible version.
    As far as your sample code is concerned, here it is ...
    import com.sap.mw.jco.*;
    public class CallFunction extends Object {
         public static void main(String args[]) {
              CallFunction app = new CallFunction();
         int count;
         JCO.Client mConnection;
         JCO.Repository mRepository;
         public CallFunction() {
              try {
                   // Logon info
                        mConnection = JCO.createClient("500", // SAP client
                                                   "username", // userid
                                                   "password", // password
                                                      null, // language
                                             "server name", // application server host name
                                                    "00"); // system number
                   mConnection.connect();
                   mRepository = new JCO.Repository("MY_connection", mConnection);
              } catch (Exception ex) {
                   ex.printStackTrace();
                   System.exit(1);
              JCO.Function function = null;
              try {
                   function = this.createFunction("ABAP_FM");
                     mConnection.execute(function);
                   System.out.println(
                        function.getTableParameterList().getValue("Exporting_Message"));
              } catch (Exception ex) {
                   ex.printStackTrace();
                   System.exit(1);
         public JCO.Function createFunction(String name) throws Exception {
              try {
                   IFunctionTemplate ft =
                        mRepository.getFunctionTemplate(name.toUpperCase());
                   if (ft == null)
                        return null;
                   return ft.getFunction();
              } catch (Exception ex) {
                   throw new Exception("Problem retrieving JCO.Function object.");
    Here in this mention ur function module in place of ABAP_FM and exporting parameter in place of Exporting_Message.
    Regards,
    Tanveer.
    Please please reward some points if found helpful.

  • How to use an alpha channel or transparency?

    I'm trying to make a game and I want to have a background and on top of that sprites. But the sprites need to be transparant in some parts. I have tried with gif's and png's but nothing works. Can anybody help me?
    this is my code, I don't use paint because I render actively in fullscreen exclusive mode
    private void initResources() {
    Image img;
    gc = getGraphicsConfiguration();
    try {
    img = ImageIO.read( new File("c:\\test.png") );
    sprite = gc.createCompatibleImage(100, 100, Transparency.TRANSLUCENT);
    if ( img != null && sprite != null )
    ((Graphics2D)sprite.getGraphics()).drawImage( img, null, null );
    catch ( IOException ioe ) {
    System.err.println(ioe.toString());
    private void renderFrame(Graphics2D g2) {
    g2.setPaint( Color.BLACK );
    g2.fillRect(0,0,800,600);
    g2.drawImage( sprite, 0, 0, null );
    g2.dispose();
    }

    Hm, seems like I found a partial solution myself using an AlphaComposite. Problem now is that it only works with gif's and not with a png.
    private void renderFrame(Graphics2D g2) {
    g2.setPaint( Color.BLACK );
    g2.fillRect(0,0,800,600);
    g2.setComposite( AlphaComposite.getInstance( AlphaComposite.SRC_OVER ) );
    g2.drawImage( sprite, 0, 0, null );
    g2.dispose();

  • Error SCardConnect return code = 80100009 / How to use another SC reader?

    Hello,
    I have 2 card readers connected to my PC. One for harddrive encryption which is part of our internal security and another one for my development (Gemplus GemPC433-SL7). I have installed the OpenCard framework for the first time on my PC because I would like to write a small SmartCard Client application reading some data from a file stored in a smart card.
    My problem is that I would like to use the Gemplus card reader to do this but when I start the batch "GetSmartCard.bat" it seems that it is trying to read the card from the smartcard reader used for my harddrive encryption. Then I get the error PC/SC Error SCardConnect return code = 80100009.
    Can you please tell me how can I force OCF to use the other card reader (GemPC433-SL7)?
    Thanks in advance for your replies.
    Alain

    I managed to get the Gemplus terminal by using the following code. I can detect is the card is inserted by using "terminal.isCardPresent(0);" but when I execute the line "SmartCard sc = SmartCard.waitForCard(cr);"
    I get the error : "opencard.core.terminal.CardTerminalException: Pcsc10CardTerminal: PCSC Exception in method SCardGetStatusChange: error executing SCardGetStatusChange
    return code = 8010002e"
    package com.hitec.chipandpin;
    import opencard.core.service.SmartCard;
    import opencard.core.service.CardRequest;
    import opencard.opt.iso.fs.FileAccessCardService;
    import opencard.opt.iso.fs.CardFile;
    import opencard.core.terminal.CardTerminal;
    import opencard.core.*;
    import java.io.*;
    import opencard.core.terminal.*;
    import opencard.core.service.*;
    import opencard.core.util.*;
    import java.util.Enumeration;
    public class InitFile {
      public static void main(String[] args)
        System.out.println("initializing file...");
          try {
          // initialize framework
            SmartCard.start();
          // get the enumeration of presently registered card terminals
            Enumeration terminals = CardTerminalRegistry.getRegistry().getCardTerminals();
            CardTerminal terminal = null;
            while (terminals.hasMoreElements()) {
              terminal = (CardTerminal) terminals.nextElement();
              if (terminal.getName().indexOf("Gemplus GemPC433") != -1) {
                //Gemplus terminal found
                break;
            // wait for a smartcard with file access support
            CardRequest cr = new CardRequest(CardRequest.ANYCARD , terminal, FileAccessCardService.class);
            SmartCard sc = SmartCard.waitForCard(cr);
            FileAccessCardService facs = (FileAccessCardService)sc.getCardService(FileAccessCardService.class, true);
            CardFile root = new CardFile(facs);
            CardFile file = new CardFile(root, ":c009");
            String entry = args[0].replace(':', '\n');
            byte[] bytes = entry.getBytes();
            int length = bytes.length;
            byte[] data = new byte[file.getLength()];
            if (data.length < length) {
              length = data.length;
            System.arraycopy(bytes, 0, data, 0, length);
            // write the data to the file
            facs.write(file.getPath(), 0, data);
            System.out.println(entry);
          catch (Exception ex) {
            ex.printStackTrace(System.err);
    finally { // even in case of an error...
          try {
            SmartCard.shutdown();
          } catch (Exception e) {
            e.printStackTrace(System.err);
        System.exit(0);
    }Can anyone of you help me to solve this problem?
    Thanks in advance.
    Alain.

Maybe you are looking for