SELECT_LIST_FROM_LOV only updates some records

I am looking for help trouble shooting an error with my code. I created htmldb_items for a checkbox and a static list of values. When I insert the records to a table, and not all of the records have been selected, the SELECT_LIST_FROM_LOV value is not usually correct. It appears "i", the count variable isn't pairing g_f01 and g_f02 correctly.
When all the records are updated/selected to be inserted to the table, they insert correctly.
--APPLY PROCEDURE
For i in 1..htmldb_application.g_f01.count
Loop
INSERT INTO x.tablename(role_id, deactivate_flag, deactivate_reason)
(Select role_id,
htmldb_application.g_f01(i),
htmldb_application.g_f02(i)
From x.tablename);
End Loop;
End;
--HOW I CREATED ITEMS IN QUERY
Select role_id,
htmldb_item.checkbox(1,urol_id, Decode(deactivate_flag,''Y'',''CHECKED'', null)) Deactivate,
htmldb_item.SELECT_LIST_FROM_LOV(2, deactivate_reason, ''deactivate_reason_lov'',null,''No'') Reason
From x.tablename
Thanks for any pointers or clues you can give me!
Annette

Scott,
Thank you! That explains why the index values are different for the g_f01 and g_f02.
The loop isn't working for me when I change it to loop on g_f02. I don't know how to selectively get the other value. The loop needs the index reference.
So, if you can point me to an example, great. Otherwise,
I'm thinking of using a radio button instead of the checkbox since that will have a value for every record. A co-worker is trying to solve it in his app by saving the results to a temporary table and selecting out of that.
Thank you!
Annette

Similar Messages

  • How to only update existing records when loading master data ?

    Hello experts, I need your lights one more time.
    Here is my need :
    I have created an infoobject (IO) which is a very simple version of 0material, let's call it Znewmat --> Znewmat has material type and trademark as attributes, those two fields are available in 2 different datasources :
    - 0MATERIAL_ATTR for material type (field MTART)
    - 0MAT_SALES_ATTR for trademark (field MVGR2)
    When loading my new IO from 0MATERIAL_ATTR I use a filter (at DTP level) to get only a few material types (I get something like 1000 records),
    here is my issue : when I load from 0MAT_SALES_ATTR the field "material type" is not available to keep the same filter as for 0MATERIAL_ATTR and existing records are updated with the trademark, but I also get 5000 records I don't need, and my master data is "polluated" with useless lines.
    *and my question : is there a way while performing the second loading to ONLY UPDATE EXISTING RECORDS AND NOT ADD ANY
    NEW RECORDS ? (i didn't find anything in main options of my DTP)*
    (I'd like to avoid the solution to update the 0MAT_SALES_ATTR datasource to add the missing field)
    Thanks in advance for any help, points will be distributed.
    Guillaume P.
    Still no idea ?

    in the start routine of transformation from 0MAT_SALES_ATTR to znewmat do the following:
    select materials from /BIC/PZNEWMAT into i_mat
    for all entries in source_package where material eq source_package-material.
    loop at source_package.
    p_ind = sy-tabix.
    read table i_mat with key material = source_package-material.
    if sy-subrc ne 0.
    delete i_mat index p_ind.
    endif.
    this way you'll only update records that have previously been loaded by 0MATERIAL_ATTR DS
    loading sequence:
    first load ZNEWMAT from 0MATERIAL_ATTR. then activate ZNEWMAT. then load 0MAT_SALES_ATTR to ZNEWMAT.
    M.

  • How to set Display Only for some records in CAT2 Worklist

    Hi,
    I have a requirement to modify an attributes for some records in the Worklist of CAT2.
    We have an external system where we book our time. Weekly we import data from that external system into CATSDB using BAPI for every single employee.
    We would like when the user wants to modify his time sheet to be able to add/modify all records except those which were imported from the external system. Which means that those records should be in Display only mode / grayed out / before release.
    Is there any user exit or BADI that could help to modify that attribute and that will be triggered before displaying the Worklist ?
    Please advise !
    Thanks,
    Stefan

    I've solved the problem.
    First I've added customer field in CI_CATSDB structure and when I am importing the data I am populating that field with 'X', which means that this is record from the external application.
    I've created enhancement implementation in Function group->CATS, screen->2003 MODULE->D2000_MODIFY_LOOP, subroutine->modify_d2000_loop where I am checking the field mentioned above if it is 'X' I am modifying the screnn-output = off.
    It works, thak you for your help.
    Regards,
    Stefan

  • Ipod only updated SOME songs...

    I listened to about 70 songs, and my Ipod updated something like half of them in Itunes. Why would this be?

    Do you have any songs in your library unchecked? The iPod has an option which you'll find in the Summary tab that when set means that it doesn't update unchecked songs: iTunes: Understanding the Symbols Next to Songs

  • Update new records and delete old record? Urgent

    Iam updating some records from internal table to Data base table.
    Please suggest me
    INSERT DBTable FROM TABLE itab.     
    UPDATE DBTable FROM  itab.
    Delete existing records.
      DELETE  DBTable FROM TABLE itab_old.
    Please suggest me

    Got you..
    Iam colecting some records to internal table from Data base table
    based on year and month.
    Then changing the date and months in interenla table
    then inserrting this modified records of internal table into datta base table.
    Finaly delete the old records with old dates.
    Here is the suggestion..This is a logic and not the exact code..
    DATA: ITAB TYPE STANDARD TABLE OF ZTABLE WITH HEADER LINE.
    DATA: ITAB_OLD TYPE STANDARD TABLE OF ZTABLE WITH HEADER LINE.
    SELECT * FROM ZTABLE
           INTO TABLE ITAB.
    ITAB_OLD = ITAB.
    ITAB-NEW_DATE = SY-DATUM.
    MODIFY ITAB TRANPORTING NEW_DATE WHERE KEY_FIELD = 'DS'.
    Deletion part.
    DELETE ZTABLE FROM TABLE ITAB_OLD.
    Insertion part
    INSERT ZTABLE FROM TABLE ITAB.
    Thanks,
    Naren

  • Updating the  records  problem urgent

    Hi All,
    i have developed search page by using the query region. in that i have created update image icon to navigate update page to update the records. i have 4 search records, when i click the go button 4 records are come to the advance table. i will select any one of the row and select update icon to update the records by using the apply button in update page.when i click the apply button its navigate to the search page and showing only updated records row only. i did not get all 4 rows in advancetable.I re-query on the page, but I can’t get the other 3 rows back unless I close the page and come back in.
    here i am not facing any error, after update the records and come back to the main page i am not getting all records only updated row records Only 1 of the four rows only appear.
    can any one help me its urgent
    Thanks in advance.

    Hi Avajain, thanks for your reply.
    i have used below code for apply button.
    if (pageContext.getParameter("Apply") != null)
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("apply");
    OAException message = new OAException("POS","MODPOS_PROGRAM_UPDATED_CONF",
    null,OAException.CONFIRMATION,null);
    pageContext.putDialogMessage(message);
    pageContext.forwardImmediately("OA.jsp?page=/xxaam/oracle/apps/pos/program/webui/SupProgramPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    AMCODE
    public void apply()
    getTransaction().commit();
    Thanks

  • How to get only updated records for a column using loading type INSERT

    Hi,
    Good morning all,
    I have source1 containg 3 columns bill_cd,bill_desc,bill_date and
    source2 has the columns bill_cd,bill_key,source_id.
    My target has the columns bill_cd,bill_date,bill_desc .
    Now the requirement is, bill_cd in target should not repeated when we run the mapping more than one thime. it should get only updated records not the previous records using only INSERT Loading type(for target) not to use update/insert.
    How can we achieve this logic in mapping level.
    Anybody Please give me some solution immediately.
    Thanks in Advance,
    Siv

    Thanks Herzog for your reply,
    Here bill_cd is not unique. Yes,I want only new records using INSERT as loading type. Suppose when the map runs for the first time, bill_cd is loaded with values 1 to 5.
    Now, in the source I have got new records 6 to 10 for bill_cd and when I run the mapping again I need to get only records for bill_cd from 6 to 10 using INSERT as loading type.
    Is it possible to achieve this at mapping level?
    Regards,
    Siv.

  • It's been 4 days now my App Store show 2 message it means that I have to update some applications but every time I open my App Store and press update it only shows blank page but if I press genius, top charts, featured, search I can browse them

    It's been 4 days now my App Store show 2 message it means that I have to update some applications but every time I open my App Store and press update it only shows blank page but if I press genius, top charts, featured, search I can browse them

    It's been 4 days now my App Store show 2 message it means that I have to update some applications but every time I open my App Store and press update it only shows blank page but if I press genius, top charts, featured, search I can browse them

  • Update DBTAB updating only part of records

    Hello Gurus, Need your help.
    I have an Update Dbtable with Internal Table statement in my ABAP. My IT (Internal table) is a hashed table with same keys and fields as my DB table. Suppose I have 30K records in my IT, ultimately only say 9K records gets updated eventhough all the 30K records exists in the DB table. Next time when I run, it might update 9500 entries but not all again. So this statement is behaving quite badly. Am not doing any Commits, which automatically happens after I run the program. So can you suggest me something, which can solve my issue? or is there anything bad which am doing?
    Regards
    Shrirama

    Here it is.
    Line: -
    <TABLES /bic/ay2ws1za000.>
    TYPES: BEGIN OF ty_docno,
           doc_number TYPE /bic/ay2ws1za000-doc_number,
           s_ord_item TYPE /bic/ay2ws1za000-s_ord_item,
           END OF ty_docno,
           BEGIN OF ty_status,
           doc_number TYPE /bic/ay2ws1za000-doc_number,
           s_ord_item TYPE /bic/ay2ws1za000-s_ord_item,
           rejectn_st TYPE /bic/ay2ws2za000-rejectn_st,
           END OF ty_status.
    DATA: l_is_datapack LIKE STANDARD TABLE OF /bic/ay2ws1za000.
    Data: l_ih_datapack like hashed table of /bic/ay2ws1za000 with unique
    key /BIC/Y_REQSID /BIC/Y_PACKNO /BIC/YRECNO.
    DATA: l_ih_docno TYPE HASHED TABLE OF ty_docno WITH UNIQUE KEY
    table_line,
          l_is_status TYPE SORTED TABLE OF ty_status WITH NON-UNIQUE KEY
          doc_number s_ord_item.
    DATA: ls_docno TYPE ty_docno.
    DATA:  l_answer(1)              TYPE c,
           l_error(1)               TYPE c,
           l_tab1(16)               type c,
           l_tab2(16)               type c,
           l_tab3(16)               type c,
           l_tab4(16)               type c.
    FIELD-SYMBOLS: <ls_datapack> TYPE /bic/ay2ws1za000,
                   <ls_docno> TYPE ty_docno,
                   <ls_status> TYPE ty_status.
    REFRESH: l_is_datapack[],
             l_ih_docno[],
             l_is_status[].
    CLEAR  l_answer.
    clear l_tab1.
    clear l_tab2.
    clear l_tab3.
    clear l_tab4.
    Selecting records to update from 4 tables.
    SELECT * FROM /bic/ay2ws1za000
      APPENDING TABLE l_is_datapack
      WHERE /bic/y_reqsid eq '0003424029' AND
            calquart1 NE '9'.
    SELECT * FROM /bic/ay2ws1za100
      APPENDING TABLE l_is_datapack
      WHERE /bic/y_reqsid eq '0003424029' AND
            calquart1 NE '9'.
    SELECT * FROM /bic/ay2ws1za200
      APPENDING TABLE l_is_datapack
      WHERE /bic/y_reqsid eq '0003424029' AND
            calquart1 NE '9'.
    SELECT * FROM /bic/ay2ws1za300
      APPENDING TABLE l_is_datapack
      WHERE /bic/y_reqsid eq '0003424029' AND
            calquart1 NE '9'.
    Collecting the doc number for lookup.
    LOOP AT l_is_datapack ASSIGNING <ls_datapack>.
      ls_docno-doc_number = <ls_datapack>-doc_number.
      ls_docno-s_ord_item = <ls_datapack>-s_ord_item .
      ASSIGN ls_docno TO <ls_docno>.
      COLLECT <ls_docno> INTO l_ih_docno.
    ENDLOOP.
    Lookup into another table. infact 7 tables appending IT.
    IF l_ih_docno[] IS NOT INITIAL.
      SELECT doc_number s_ord_item rejectn_st FROM /bic/ay3ws2aa000
        APPENDING TABLE l_is_status
        FOR ALL ENTRIES IN l_ih_docno
        WHERE doc_number = l_ih_docno-doc_number AND
              s_ord_item = l_ih_docno-s_ord_item .
      SELECT doc_number s_ord_item rejectn_st FROM /bic/ay3ws2ab000
        APPENDING TABLE l_is_status
        FOR ALL ENTRIES IN l_ih_docno
        WHERE doc_number = l_ih_docno-doc_number AND
              s_ord_item = l_ih_docno-s_ord_item.
      SELECT doc_number s_ord_item rejectn_st FROM /bic/ay3ws2ba000
        APPENDING TABLE l_is_status
        FOR ALL ENTRIES IN l_ih_docno
        WHERE doc_number = l_ih_docno-doc_number AND
              s_ord_item = l_ih_docno-s_ord_item.
      SELECT doc_number s_ord_item rejectn_st FROM /bic/ay3ws2bb000
        APPENDING TABLE l_is_status
        FOR ALL ENTRIES IN l_ih_docno
        WHERE doc_number = l_ih_docno-doc_number AND
              s_ord_item = l_ih_docno-s_ord_item.
      SELECT doc_number s_ord_item rejectn_st FROM /bic/ay3ws2bc000
        APPENDING TABLE l_is_status
        FOR ALL ENTRIES IN l_ih_docno
        WHERE doc_number = l_ih_docno-doc_number AND
              s_ord_item = l_ih_docno-s_ord_item.
      SELECT doc_number s_ord_item rejectn_st FROM /bic/ay3ws2bd000
        APPENDING TABLE l_is_status
        FOR ALL ENTRIES IN l_ih_docno
        WHERE doc_number = l_ih_docno-doc_number AND
              s_ord_item = l_ih_docno-s_ord_item.
      SELECT doc_number s_ord_item rejectn_st FROM /bic/ay3ws2za000
        APPENDING TABLE l_is_status
        FOR ALL ENTRIES IN l_ih_docno
        WHERE doc_number = l_ih_docno-doc_number AND
              s_ord_item = l_ih_docno-s_ord_item.
    SELECT doc_number s_ord_item rejectn_st FROM /bic/ay3ws2zb000
        APPENDING TABLE l_is_status
        FOR ALL ENTRIES IN l_ih_docno
        WHERE doc_number = l_ih_docno-doc_number AND
              s_ord_item = l_ih_docno-s_ord_item.
    ENDIF.
    LOOP AT l_is_datapack ASSIGNING <ls_datapack>.
    updating the fields by reading from IT.
      READ TABLE l_is_status ASSIGNING <ls_status>
      WITH KEY doc_number = <ls_datapack>-doc_number
               s_ord_item = <ls_datapack>-s_ord_item
               BINARY SEARCH.
      IF sy-subrc = 0.
        <ls_datapack>-rejectn_st = <ls_status>-rejectn_st.
      ENDIF.
    ENDLOOP.
    sort l_is_datapack[] ascending by /BIC/Y_REQSID /BIC/Y_PACKNO
    /BIC/YRECNO.
    Delete adjacent duplicates from l_is_datapack[] comparing /BIC/Y_REQSID
    /BIC/Y_PACKNO /BIC/YRECNO.
    l_ih_datapack[] = l_is_datapack[].
    refresh l_is_datapack[].
    refresh l_is_status[].
    refresh l_ih_docno[].
    IF l_ih_datapack[] IS NOT INITIAL.
    Updating the original tables with this new read field.
        UPDATE /bic/ay2ws1za000 FROM TABLE l_ih_datapack .
        IF sy-subrc NE 0.
          write /'/bic/ay2ws1za000-inserted 0 records'.
        else.
          write /'/bic/ay2ws1za000-inserted records successfully'.
        ENDIF.
        UPDATE /bic/ay2ws1za100 FROM TABLE l_ih_datapack.
        IF sy-subrc NE 0.
          write /'/bic/ay2ws1za100-inserted 0 records'.
        else.
          write /'/bic/ay2ws1za100-inserted records successfully'.
        ENDIF.
        break-point.
        UPDATE /bic/ay2ws1za200 FROM TABLE l_ih_datapack.
        IF sy-subrc NE 0.
          write /'/bic/ay2ws1za200-inserted 0 records'.
        else.
          write /'/bic/ay2ws1za200-inserted records successfully'.
        ENDIF.
        UPDATE /bic/ay2ws1za300 FROM TABLE l_ih_datapack.
        IF sy-subrc NE 0.
          write /'/bic/ay2ws1za300-inserted 0 records'.
        else  .
          write /'/bic/ay2ws1za300-inserted records successfully'.
        ENDIF.
        refresh l_is_datapack[].
    ENDIF.
    Line: -
    Most of the times, it update around only 9500 entries.
    Edited by: Sriram k on Jul 28, 2009 7:34 AM I dont know how to show the new lines...:(

  • Master - some records : Detail - for only a few i(not all)records in master

    Hi
    I have a requirement like master and detail. However I do not wish to see the details of everything that is there in the master but only a few records (based on some criteria). Example:
    Id Desc Col3 Col4
    1 1 desc 1col3 1col4
    2 2 desc 2col3 2col4
    3 3 desc 3col3 3col4
    id col5 col6 col7
    3 abc def ghi
    4 4 desc 4col3 4col4
    How can I have such a layout in which detail shows details of only selected records present in the master?
    Any help appreciated big time.
    Thx!

    1. create two queries. master and detail and link on the fields of interest.
    2. on the layout, have repeating frames. one for the master and inside the master frame, a repeating frame for the detail.
    hope this is what you are looking for..

  • Sql query to Load only new records,or update old records

    Hi,
    I need a query (not stored procedure) to insert only new records otherwise update existing records.
    I tried by creating "Merge statement in SQl", but the sql query is wrong,it is not updating,always inserting records(replicating..1,2,4,8,16,32..).
    below is my sample query,
    Here "FACT_mytbl -FCT" is my fact table.(which need to update if already records found ,otherwise insert as new records).
    *Inside select ---the table   E_tbl1,E_tbl2  is the business logic table ,using this two table only ,"FACT_mytbl" was created  .So the "S" alias will be the source
    table and "FCT" will be target table. based on this we have to insert or update records.   
      ---Query starts-------------------------------------                    
     MERGE INTO [FACT_mytbl]  FCT
     USING  (
           SELECT 
           FCT1.ID
          ,FCT1.PKcol1
          ,FCT1.FKcol1
          ,FCT1.col1
          ,FCT1.col2
         , FCT1.col3     
       FROM  [FACT_mytbl] FCT1 WITH(NOLOCK)        
       LEFT JOIN dbo.E_tbl1 CT WITH(NOLOCK)
    ON CT.PKcol1=FCT1.PKcol1
       LEFT JOIN dbo.E_tbl2 CT1 WITH(NOLOCK)
    ON CT1.PKcol1=FCT1.PKcol1
       ) S  
       ON FCT.PKcol1 = S.PKcol1 
     WHEN MATCHED AND (FCT.PKcol1 ! = S.PKcol1 ) THEN
     UPDATE SET       
           FCT.col1
          ,FCT.col2
          ,FCT.col3     
     WHEN NOT MATCHED THEN 
     INSERT VALUES
           S.ID
          ,S.PKcol1
          ,S.FKcol1
          ,S.col1
          ,S.col2
         , S.col3     
    --query ends----------------
    any suggestions,
    Thanks,
    R.B

    Hi Bhupesh_Rajasekaran,
    According to your description, if you want to insert only new records which does not exist in destination and update existing records which does exist in destination. We usually accomplish these in two statement.
    1.A join statement to update records.
    2.A insert statement for new records.
    Also we can use MERGE in SQL Server to insert, update at the same time. You specify a "Source" record set and a "Target" table, and the join between the two. You then specify the type of data modification that is to occur when the records between the two
    data are matched or are not matched. For more information, there is an similar example about merge in SQL Server, you can review the following article.
    http://www.codeproject.com/Tips/590085/Merge-in-SQL-Server
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Has anyone noticed that the 1st iPad out cannot install some apps because it can only update to the iOS 5.1.1.

    Has anyone noticed that the first iPad only updates to iOS 5.1.1. So some apps will not install.

    Yes, lots of people have noticed.

  • Ever since the ios5 update some of my ipod songs come out as duplicate and only on my ipod not on my itunes why is that? how can i fix it?

    ever since the ios5 update some of my ipod songs come out as duplicate and only on my ipod not on my itunes why is that? how can i fix it?

    Hey Ryan, When you looked at Get Info as Illaass instructed did you compare all the info listed in iTunes Get Info on the computer's copy? When you looked at the song(s) that are separated, do they list anything different like a featured artist? Or a different composer / song writer? Sometimes that will trick the the software into thinking it is 2 different albums. Make the info about the album and artist match, then sync to your iPod. The songs should go back where they belong on your iPod. Good luck. Cheers.

  • I want to update a record in the DB from my menu

    Hi everybody,
    I have an menu applet and I want to fill a DB record when i choose an item from my menu.
    This is my code and I want a connection with the database to update the record word_path:
    please help me !!
    thanks in advance
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.net.*;
    import java.util.*;
    import netscape.javascript.*;
    public class PopupMenuApplet extends Applet implements MouseListener, ActionListener {
    String title, img, bgcolor, text, font, size, style, menufont, menustyle, menusize, data;
    String actions[], targets[];
    Menu menus[];
    MenuItem menuItems[];
    int fontsize, menufontsize;
    CardLayout cardlayout;
    PopupMenu mainMenu;
    Image bgImage = null;
    boolean parseError = false, imgError = false;
    URL imgUrl;
    Label label;
    Font labelFont, menuFont;
    //Construct the applet
    public PopupMenuApplet() {
    //Initialize the applet
    public void init() {
    cardlayout = new CardLayout();
    title = getParameter("title");
    if (title == null) title = "Menu";
    // the colors for bgcolor and text are used only for the applet label
    // Java 1.1 menus themselves don't support colors, although some Unix implementations
    // allow a menu's background color to be inherited from the object it's attached to.
    bgcolor = getParameter("bgcolor");
    if (bgcolor == null) bgcolor = "white";
    else bgcolor = bgcolor.toLowerCase();
    text = getParameter("text");
    if (text == null) text = "blue";
    else text = text.toLowerCase();
    // font, size and style are used for the applet's text label (if any)
    font = getParameter("font");
    if (font == null) font = "SansSerif";
    size = getParameter("size");
    if (size == null) fontsize = 11;
    else
    try {
    fontsize = Integer.parseInt(size);
    } catch(NumberFormatException f) {
    fontsize = 11;
    style = getParameter("style");
    if (style == null) style = "plain";
    labelFont = new Font(font, translateStyle(style), fontsize);
    // menufont, menusize and menustyle default to font, size and style if undefined,
    // but they can be also defined explicitely in case we want the popup menu to look different
    // from the applet's text label (if any)
    menufont = getParameter("menufont");
    if (menufont == null) menufont = font;
    menusize = getParameter("menusize");
    if (menusize == null) menufontsize = fontsize;
    else
    try {
    menufontsize = Integer.parseInt(menusize);
    } catch(NumberFormatException f) {
    menufontsize = 11;
    menustyle = getParameter("menustyle");
    if (menustyle == null) menustyle = style;
    menuFont = new Font(menufont, translateStyle(menustyle), menufontsize);
    data = getParameter("data");
    parseData(data);
    this.addMouseListener(this);
    this.setBackground(translateColor(bgcolor));
    this.setForeground(translateColor(text));
    this.setFont(labelFont);
    this.setLayout(cardlayout);
    img = getParameter("img");
    if (img != null) {
    try { // absolute URL
    imgUrl = new URL(img);
    bgImage = this.getImage(imgUrl);
    } catch(MalformedURLException a) {
    try { // relative URL
    imgUrl = new URL(this.getDocumentBase(), img);
    bgImage = this.getImage(imgUrl);
    } catch(MalformedURLException r) {
    imgError = true;
    bgImage = this.getImage(this.getDocumentBase(), img);
    } else {
    label = new Label(title);
    label.setAlignment(1);
    label.addMouseListener(this);
    this.add(title, label);
    //Start the applet
    public void start() {
    //Stop the applet
    public void stop() {
    //Destroy the applet
    public void destroy() {
    //Get Applet information
    public String getAppletInfo() {
    return(
    "Title:\t\tPopupMenuApplet\n" +
    "Version:\t1.1.1\n" +
    "Date:\t\t11/15/2001\n" +
    "Author:\t\tErwin (http://www.centric.nl/)\n" +
    "Description:\tA configurable menu applet based on the\n" +
    "\t\tJava (TM) 1.1 PopupMenu class."
    //Get parameter info
    public String[][] getParameterInfo() {
    String pinfo[][] =
    {"title", "String", "Menu title"},
    {"img", "URL", "Background image"},
    {"bgcolor", "Color or Hex RGB value", "Menu background color"},
    {"text", "Color or Hex RGB value", "Menu foreground color"},
    {"font", "Font name", "Menu font name"},
    {"size", "Integer", "Menu font size"},
    {"style", "Sum of BOLD,PLAIN,ITALIC", "Menu font style"},
    {"menufont", "Font name", "Menu font name"},
    {"menusize", "Integer", "Menu font size"},
    {"menustyle", "Sum of BOLD,PLAIN,ITALIC", "Menu font style"},
    {"data", "Menu item names, actions and targets", "Menu data"},
    return pinfo;
    public void paint(Graphics g) {
    if (bgImage != null)
    g.drawImage(bgImage,0,0,this);
    if (imgError)
    this.showStatus("PopupMenuApplet: invalid URL for img parameter " + img);
    if (parseError)
    this.showStatus("PopupMenuApplet Error: unbalanced braces in data parameter tag.");
    public void mousePressed(MouseEvent e) {
    public void mouseReleased(MouseEvent e) {
    public void mouseClicked(MouseEvent e) {
    popup();
    public void mouseEntered(MouseEvent e) {
    popup();
    public void mouseExited(MouseEvent e) {
    public void actionPerformed(ActionEvent e) {
    int elt = Integer.parseInt(e.getActionCommand());
    String cmd = actions[elt];
    String target = targets[elt];
    if (cmd.length() > 7 && cmd.substring(0,7).equalsIgnoreCase("script=")) {
    // catch exception thrown by the appletviewer (but not a browser)
    // just so we can test the menu appearance with the appletviewer.
    try {
    cmd = cmd.substring(7); // trim the "script=" identifier
    if (target.equalsIgnoreCase("_self") || target.equalsIgnoreCase("_parent")
         || target.equalsIgnoreCase("_top"))
    target = target.substring(1).toLowerCase(); // allow for leading underscore HTML syntax
    cmd = target + "." + cmd;
    JSObject win = JSObject.getWindow(this);
    win.eval(cmd);
    } catch(Exception n) {
    this.showStatus("PopupMenuApplet: Error running script " + cmd);
    } else {
    try { // absolute URL
    URL dest = new URL(cmd);
    this.getAppletContext().showDocument(dest, target);
    } catch(MalformedURLException a) {
    try { // relative URL
    URL dest = new URL(this.getDocumentBase(), cmd);
    this.getAppletContext().showDocument(dest, target);
    } catch(MalformedURLException r) {
    this.showStatus("PopupMenuApplet: invalid URL " + cmd);
    public void popup() {
    if (!parseError)
    mainMenu.show(this,this.getSize().width/2,this.getSize().height/2);
    private Color translateColor(String c) {
    if(c.equalsIgnoreCase("white"))
    return(Color.white);
    else if(c.equalsIgnoreCase("lightgray"))
    return(Color.lightGray);
    else if(c.equalsIgnoreCase("gray"))
    return(Color.gray);
    else if(c.equalsIgnoreCase("darkgray"))
    return(Color.darkGray);
    else if(c.equalsIgnoreCase("black"))
    return(Color.black);
    else if(c.equalsIgnoreCase("red"))
    return(Color.red);
    else if(c.equalsIgnoreCase("pink"))
    return(Color.pink);
    else if(c.equalsIgnoreCase("orange"))
    return(Color.orange);
    else if(c.equalsIgnoreCase("yellow"))
    return(Color.yellow);
    else if(c.equalsIgnoreCase("green"))
    return(Color.green);
    else if(c.equalsIgnoreCase("magenta"))
    return(Color.magenta);
    else if(c.equalsIgnoreCase("cyan"))
    return(Color.cyan);
    else if(c.equalsIgnoreCase("blue"))
    return(Color.blue);
    // allow for Hex RGB values (and an optional leading #, as in HTML syntax)
    else if (c.length() == 6 || (c.length() == 7 && c.charAt(0) == '#')) {
    if (c.length() == 7)
    c = c.substring(1);
    return(new Color(hexToInt(c.substring(0,2)),
    hexToInt(c.substring(2,4)),hexToInt(c.substring(4,6))));
    else
    return(Color.white);
    private int hexToInt(String c) {
    try {
    return(Integer.parseInt(c, 16));
    } catch(NumberFormatException h) {
    return 0;
    private int translateStyle(String s) {
    int style = 0;
    String token = null;
    StringTokenizer st = new StringTokenizer(s,",+ \t\n\r");
    do {
    try {
    token = st.nextToken();
    } catch(NoSuchElementException n) {}
    if (token.equalsIgnoreCase("PLAIN"))
    style += Font.PLAIN;
    else if (token.equalsIgnoreCase("BOLD"))
    style += Font.BOLD;
    else if (token.equalsIgnoreCase("ITALIC"))
    style += Font.ITALIC;
    } while (st.hasMoreTokens());
    return style;
    private void parseData(String s) {
    // menuItem counters start at -1 so that at first increment, they get set to
    // the first array subscript value of 0
    // menu counters start at 0 so that at first increment, they get set to
    // the array subscript value of 1, the first value (0) being reserved for the main menu
    int levelCtr = -1, menuCtr = 0, menuItemCtr = -1;
    int levelCount = 0, menuCount = 0, menuItemCount = -1;
    int parentMenuPtr[];
    String itemToken = null, datatoken = null;
    String title = "", action = "", target = "_self";
    boolean newMenu = false;
    if (s == null || s.indexOf("{") == -1) {
    parseError = true;
    return;
    StringTokenizer braces = new StringTokenizer(s,"{}",true);
    StringTokenizer braceCtr = new StringTokenizer(s,"{}",true);
    StringTokenizer asterisks;
    // Get the number of menus and menuItems for which to allocate array space
    do {
    try {
    itemToken = braceCtr.nextToken();
    } catch(NoSuchElementException i) {}
    if (itemToken.charAt(0) == '{') {
    if (newMenu)
    menuCount++;
    newMenu = true;
    levelCtr++;
    if (levelCount < levelCtr) levelCount = levelCtr;
    } else if (itemToken.charAt(0) == '}') {
    if (newMenu)
    menuItemCount++;
    newMenu = false;
    levelCtr--;
    } while (braceCtr.hasMoreTokens());
    if (levelCtr != -1) {
    parseError = true;
    return;
    // allocate one more element than the counter values , since the first subscript value is 0
    actions = new String[menuItemCount+1];
    targets = new String[menuItemCount+1];
    menuItems = new MenuItem[menuItemCount+1];
    menus = new Menu[menuCount+1];
    parentMenuPtr = new int[levelCount+1];
    mainMenu = new PopupMenu(title);
    menus[0] = (Menu)(mainMenu);
    this.add(mainMenu);
    itemToken = null;
    newMenu = false;
    // Parse the data Param and build the menu and menu items
    do {
    try {
    itemToken = braces.nextToken();
    } catch(NoSuchElementException i) {}
    if (itemToken.charAt(0) == '{') {
    if (newMenu) {
    menuCtr++;
    menus[menuCtr] = new Menu(title);
    menus[menuCtr].setFont(menuFont);
    menus[parentMenuPtr[levelCtr]].add(menus[menuCtr]);
    parentMenuPtr[levelCtr+1] = menuCtr;
    newMenu = true;
    levelCtr++;
    } else if (itemToken.charAt(0) == '}') {
    if (newMenu) {
    menuItemCtr++;
    actions[menuItemCtr] = action;
    targets[menuItemCtr] = target;
    menuItems[menuItemCtr] = new MenuItem(title);
    menuItems[menuItemCtr].setFont(menuFont);
    menuItems[menuItemCtr].addActionListener(this);
    menuItems[menuItemCtr].setActionCommand(new Integer(menuItemCtr).toString());
    menus[parentMenuPtr[levelCtr]].add(menuItems[menuItemCtr]);
    newMenu = false;
    levelCtr--;
    } else if (!itemToken.trim().equals("")) {
    asterisks = new StringTokenizer(itemToken,"*");
    try {
    title = asterisks.nextToken();
    // a menu separator is a -, but allow for hr as well, as in HTML syntax
    if (title.equals("-") || title.equalsIgnoreCase("HR"))
    title = "-";
    } catch(NoSuchElementException i) {
    title = "-";
    try {
    action = asterisks.nextToken();
    } catch(NoSuchElementException i) {
    action = "";
    try {
    target = asterisks.nextToken();
    } catch(NoSuchElementException i) {
    target = "_self";
    } while (braces.hasMoreTokens());

    Ok, well you'll need to do something like this. Now this part is a little dependent on your database server:
           try {
                Class.forName("org.gjt.mm.mysql.Driver").newInstance();
                Connection c = DriverManager.getConnection(
                                                           "jdbc:mysql://{database-server}/{database-name}:3306?user={username}&password={password}");
                Statement Stmt = c.createStatement();
                int count = Stmt.executeUpdate(cmd);
                if(count>0) {
                     System.out.println("count: " + count);
            } catch (Exception e) {
                e.printStackTrace();
        }That was some sample code for a MySQL database.
    Note that the applet can only contact the server that is was loaded from, so you might want to do a getCodeBase() or something like that to get the server address.
    Hope this is helpful.

  • HTTPS, DNS and dynamically updating DNS records

    Hello to you all, if you are able to help with a DNS problem that I'm having then please accept my thanks and appreciation in advance.
    First some background information, I recently  moved my server from my studio to my house where a new purpose built studio will soon be erected. At my old studio any requests for myurl.com came in via the IP (whether that be http, https, ftp etc) from the domain registrar and the router would send the request to the relevant port number whether that be 80 for http or 443 for https etc and all was well as this location had a fixed IP address. Unfortunately at my new location whilst I have a much faster connection I do not have a fixed IP. To get around this I have the following set up (not ideal for a business I know but perfectly OK for home hosting); I set up two psuedo nameservers at no-ip.com (ns1myurl.com and ns2myurl.com) which tracks the changes in my IP address and updates its records accordingly, my registrar then sends any requests to these 'nameservers' and no-ip then forwards it on to my server. So far so good.
    The problem arises once the requests get to my server, whilst I have DNS set up, I can only recieve requests from a straight request to the server ie myurl.com will display the site without any problem, but if I then put a www in front of that or try to access the https part of my site (which is set up as a seperate site on the same server) then the server throws an error. I have tried to put an alias (CNAME) into the zone but it does not want to resolve the request. I have searched around but to no avail, I am totally new to DNS so am currently on a steep learning curve and fumbling around in the dark.
    The first thing that I need to get working is the request to be resolved correctly and then (and this is where the real fun starts!) is to dynamically update the IP in the DNS records as the IP changes. I will probably have to get help in on this as I understand that this requires BIND of which I know nothing about, first though I'd like to get the pages to be served up correctly. Advice, hints, tips or links to tutorials all greatly appreciated. Full set up listed below.
    Many thanks, David.
    Xserve PPC G5 running 10.5.8 unlimited set up as standalone OD master
    Xraid
    APC UPS
    CradlePoint MBR1200 Gateway router which acts as the DHCP
    http://myurl.com and https://myurl.com set up as 2 seperate sites and located on the Xraid
    Current DNS setup:
    Primary Zone name: myurl.com with nameservers ns1myurl.no-ip.info and ns2myurl.no-ip.info and allow zone transfers in checked
    Then
    Name
    Type
    Value
    myurl.com
    Primary Zone
            ns1myurl.no-ip.info
            Machine
    12.34.56.78 (external IP)
            ns2myurl.no-ip.info
            Machine
    12.34.56.78 (external IP)
            myurl.com.
            Machine
    12.34.56.78 (external IP)
            www.myurl.com.
            Alias
    myurl.com.
    With the reverse zone looking thus with allow zone transfers being checked
    Name
    Type
    Value
    56.34.12.in-addr.arpa.
    Reverse Zone
            12.34.56.78
            Reverse mapping
            myurl.com.

    Thanks for the reply Camelot, that part though I had already figured out. I now have this working, all I did was change the external IP to the internal one of the server with resolves with the .local machine name and all is working just fine (for now!). As long as I have primary zones set for each site and any alias or services set up on them then everything works well.. The real test will be when my ISP changes the IP, whilst my tests have proved successful the proof will be when they update the address.
    Thanks anyway. David.

Maybe you are looking for

  • Import Video To Layers gone?

    I have Photoshop CS4 Extended and I recently transfered to a new PC and redownloaded it, I installed all updates. I recently went to go transfer a .mov file into layers via Import Vide to Layers in File -> Import to see that it is gone. How do I fix/

  • SQL FORMATING ERROR in E-Business suite

    Hi, I've been notificing following issue in one server. OS=RHEL 5.3 DB=10.2.3 Application=Oracle E-bis 12.0.6 One instance result: select Substr(first_name, 1, 1) AA , Substr(last_name, 1, 30) LastN from per_all_people_f where employee_number = '111'

  • Are there SAP transactions for FACTORING?

    I wonder if in SAP i can find transaction type for Factoring. Thanks Gandalf

  • E-commerce 4.0 extensions

    Hi gurus! I have implemented the note 671711, but now I have problems to get those extensions back. The code, which puts extension back to item, seems to be alright. for (int i = 0; i < posd.getItemListData().size(); i++) {      ItemData item = posd.

  • I can get to a court site that I used to but then it freezes and won't go any further

    I have always used a Court site to check on court records using both Mozilla Fire Fox 3.6 and Internet Explorer. Now with Fire Fox 4.0 upgrade I can go to site ("contextecourt connect") and it goes thru just fine to the site and I get thru to "Agree"