Problem in understanding the code

this particular code is given as stadard example in sap unicode conversion
this particular code is replcement for 'translate code page syntax'
this code describes  how to use particular cl_abap_conv_in_ce classs
i cannot understand the   'buffer'  field in this code
can any one tell me what is the meaning of buffer = '41424320' from where did he get this value?
  DATA:
    text(100) TYPE c,
    int TYPE i,
    buffer(4) TYPE x,
    conv TYPE REF TO cl_abap_conv_in_ce.
  conv = cl_abap_conv_in_ce=>create(
          encoding = 'UTF-8'
          endian = 'L' ).
  buffer = '41424320'.
  conv->convert(
    EXPORTING input = buffer
    IMPORTING data = text ).
  buffer = '02010000'.
  conv->convert(
    EXPORTING input = buffer
    IMPORTING data = int ).

thank you mahmet i also want to check weather  i am doing the  code correct or not
i have old syntax in my program like    'TRANSLATE header-id FROM CODE PAGE file_tab-codepage'.
i am replacing the above syntax with the follwing code and can u correct me if  i am wrong
data:
buffer1 type xstring,
conv type ref to cl_abap_conv_in_ce,
int type i.
conv = cl_abap_conv_in_ce=>create(
          encoding = 'file_tab-codepage'
          endian = 'L' ).
  buffer1 = '41424320'.
  conv->convert(
    exporting input = buffer1
    importing data = header-id ).

Similar Messages

  • Problem in fetching the code for the line item

    Hi,
    I am working on a report in which to display the values corresponding to the line item of a PO.
    For, ex, if there are 3 line items 10,140,150 and their condition values such zing,zgrd,zbrd are the condition types consist of different values depending on the line item i.e. 10,140,150.
    My problem is when i execute the code the data of 1st line item is correctly fetched but the rest 2 line item data is pasted as it is. only the main pricre changes and the code for zing,zbrd,zgrd remains same as it is in the first line item 10.
    plzz proivde me guide lines how to solve this problem.
    Here's d code:-
    DATA : vspl LIKE konv-kbetr.
    DATA : vspl1 LIKE konv-kbetr.
    DATA : vkwert LIKE konv-kwert.
    DATA: VSPL2 LIKE KONV-kbetr.    "ZING COST
    DATA: VSPL3 LIKE KONV-kbetr.    "ZGRD COST
    DATA: VSPL4 LIKE KONV-kbetr.    "ZBDL COST
    LOOP AT item.
        SELECT kbetr FROM konv INTO item-rate  WHERE knumv = header-knumv AND kposn = item-ebelp
         AND ( kschl = 'ZP00' OR kschl = 'P001' OR kschl = 'PBXX' OR kschl = 'P000' OR kschl = 'PB00' OR kschl = 'ZING' OR kschl = 'ZBRD' OR kschl = 'ZGRD').
          MODIFY item.
       ENDSELECT.
      ENDLOOP.
      LOOP AT item.
        SELECT kwert FROM konv INTO vkwert  WHERE knumv = header-knumv AND kposn = item-ebelp
        AND ( kschl = 'ZP00' OR kschl = 'P001' OR kschl = 'PBXX' OR kschl = 'P000' OR kschl = 'PB00' OR kschl = 'ZING' OR kschl = 'ZBRD' OR kschl = 'ZGRD').
        ENDSELECT.
      ENDLOOP.
    CLEAR : vspl , vspl1 , vspl2 , vspl3 , vspl4.
      LOOP AT item.
        SELECT kbetr FROM konv INTO vspl  WHERE knumv = header-knumv AND kposn = item-ebelp  
       AND  kschl = 'ZCOM'.
        ENDSELECT.
        SELECT kbetr FROM konv INTO vspl1 WHERE knumv = header-knumv AND kposn = item-ebelp
        AND  kschl = 'ZBR1'.
        ENDSELECT.
    *******************Begin - new code added on 14.01.2009******************
        SELECT kbetr FROM konv INTO vspl2 WHERE knumv = header-knumv AND kposn = item-ebelp
        AND  kschl = 'ZING'.
        ENDSELECT.
       SELECT kbetr FROM konv INTO vspl3 WHERE knumv = header-knumv AND kposn = item-ebelp
       AND  kschl = 'ZGRD'.
        ENDSELECT.
       SELECT kbetr FROM konv INTO vspl4 WHERE knumv = header-knumv AND kposn = item-ebelp
       AND  kschl = 'ZBRL'.
       ENDSELECT.
    *******************End - new code added on 14.01.2009******************
      ENDLOOP.
      LOOP AT item.
        item-rate  = item-rate + vspl + vspl1.
    *******************Begin - new code added on 14.01.2009******************
        item-rate1 = item-rate1 + vspl2.
        item-rate2 = item-rate2 + vspl3.
        item-rate3 = item-rate3 + vspl4.
    ********************End - new code added on 14.01.2009*******************
        MODIFY item INDEX sy-tabix TRANSPORTING rate.
    *******************Begin -11`` new code added on 14.01.2009******************
        MODIFY item INDEX sy-tabix TRANSPORTING rate1.
        MODIFY item INDEX sy-tabix TRANSPORTING rate2.
        MODIFY item INDEX sy-tabix TRANSPORTING rate3.
    *********************End - new code added on 14.01.2009******************
      ENDLOOP.
    PLZ PROIVDE ME GUIDLINES HOW TO SOLVE THIS PROBLEM .
    Edited by: ricx .s on Jan 19, 2009 10:16 AM
    Edited by: Vijay Babu Dudla on Jan 19, 2009 5:22 AM

    Hello,
    Why are you looping at the same internal table so many times, you could probably perform everything within one loop instead.
    DATA : vspl LIKE konv-kbetr.
    DATA : vspl1 LIKE konv-kbetr.
    DATA : vkwert LIKE konv-kwert.
    DATA: VSPL2 LIKE KONV-kbetr. "ZING COST
    DATA: VSPL3 LIKE KONV-kbetr. "ZGRD COST
    DATA: VSPL4 LIKE KONV-kbetr. "ZBDL COST
    field-symbols <fs>.
    LOOP AT item assigning <fs>.
    SELECT kbetr FROM konv INTO <fs>-rate WHERE knumv = header-knumv AND kposn = item-ebelp
    AND ( kschl = 'ZP00' OR kschl = 'P001' OR kschl = 'PBXX' OR kschl = 'P000' OR kschl = 'PB00' OR kschl = 'ZING' OR kschl = 'ZBRD' OR kschl = 'ZGRD').
    MODIFY item.
    ENDSELECT.
    SELECT kwert FROM konv INTO vkwert WHERE knumv = header-knumv AND kposn = item-ebelp
    AND ( kschl = 'ZP00' OR kschl = 'P001' OR kschl = 'PBXX' OR kschl = 'P000' OR kschl = 'PB00' OR kschl = 'ZING' OR kschl = 'ZBRD' OR kschl = 'ZGRD').
    ENDSELECT.
    ENDLOOP.
    CLEAR : vspl , vspl1 , vspl2 , vspl3 , vspl4.
    SELECT kbetr FROM konv INTO vspl WHERE knumv = header-knumv AND kposn = item-ebelp
    AND kschl = 'ZCOM'.
    ENDSELECT.
    SELECT kbetr FROM konv INTO vspl1 WHERE knumv = header-knumv AND kposn = item-ebelp
    AND kschl = 'ZBR1'.
    ENDSELECT.
    *******************Begin - new code added on 14.01.2009******************
    SELECT kbetr FROM konv INTO vspl2 WHERE knumv = header-knumv AND kposn = item-ebelp
    AND kschl = 'ZING'.
    ENDSELECT.
    SELECT kbetr FROM konv INTO vspl3 WHERE knumv = header-knumv AND kposn = item-ebelp
    AND kschl = 'ZGRD'.
    ENDSELECT.
    SELECT kbetr FROM konv INTO vspl4 WHERE knumv = header-knumv AND kposn = item-ebelp
    AND kschl = 'ZBRL'.
    ENDSELECT.
    *******************End - new code added on 14.01.2009******************
    <fs>-rate = <fs>-rate + vspl + vspl1.
    *******************Begin - new code added on 14.01.2009******************
    <fs>-rate1 = item-rate1 + vspl2.
    <fs>-rate2 = item-rate2 + vspl3.
    <fs>-rate3 = item-rate3 + vspl4.
    ENDLOOP.
    Also, use field-symbols and use loop at itab assigning addition so that you can directly change the contents of the table without using modify statment.
    regards,
    Advait

  • Help needed in understanding the code.

    Hi All,
    I am just trying to understand the Java code in one Self Serice page. However, I am having tough in understanding the CO code. In the prosessRequest class, I have the below code.
    oapagecontext.putTransactionValue("AddAssignmentInsertRowFlag", "N");
    oaapplicationmodule.getTransaction().commit();
    As soon as, oaapplicationmodule.getTransaction().commit();
    gets executed, its calling some other class. Not sure what is being called, but i can see the log messages that its executing some other class which actually does the calls to DB APIs and inserting data into main tables.
    Can you please explain me what is being called to make DB API calls. I would greatly appreciate your help.
    Thanks in Advance!
    - Rani
    ****************************Here is the full code of class for your reference****************************
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    if("SelectedResourceLink".equals(oapagecontext.getParameter("event")))
    Debug.log(oapagecontext, this, "SelectedResourceLink has been pressed", 3);
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_SELECTED_RESOURCES_LAYOUT&akRegionApplicationId=275", true, "RP");
    String s = (String)oapagecontext.getTransactionValue("AssignmentType");
    super.processFormRequest(oapagecontext, oawebbean);
    Debug.log(oapagecontext, this, "in processFormRequest()", 3);
    OAApplicationModule oaapplicationmodule = oapagecontext.getRootApplicationModule();
    if(!"Y".equals(oapagecontext.getParameter("paMass")))
    String s1 = oapagecontext.getParameter("event");
    if("lovUpdate".equals(s1))
    Debug.log(oapagecontext, this, "*** User Selected a value from LOV ***", 3);
    String s3 = oapagecontext.getParameter("source");
    Debug.log(oapagecontext, this, "*** lovInputSourceId = " + s3 + " ***", 3);
    if("ProjectNumber".equals(s3) && "Project".equals(s))
    Hashtable hashtable = oapagecontext.getLovResultsFromSession(s3);
    String s10 = (String)hashtable.get("ProjectId");
    Debug.log(oapagecontext, this, "*** ProjectId ***" + s10, 3);
    oapagecontext.putTransactionValue("paProjectId", s10);
    if("Project".equals(s))
    Debug.log(oapagecontext, this, "*** Setting default value for Delivery assignment ***", 3);
    oaapplicationmodule.invokeMethod("defaultProjectAttrs");
    if("RoleName".equals(s3))
    Hashtable hashtable1 = oapagecontext.getLovResultsFromSession(s3);
    Debug.log(oapagecontext, this, "*** RoleName Hashtable Contents ***" + hashtable1.toString(), 3);
    String s11 = (String)hashtable1.get("RoleId");
    Debug.log(oapagecontext, this, "*** RoleId ***" + s11, 3);
    Debug.log(oapagecontext, this, "*** AssignmentType = " + s + "***", 3);
    if("Open".equals(s))
    Debug.log(oapagecontext, this, "*** Calling defaultJobAttrs for Open Assignment***", 3);
    Serializable aserializable[] = {
    s11
    oaapplicationmodule.invokeMethod("defaultJobAttrs", aserializable);
    if("Template".equals(s) || "Open".equals(s))
    Debug.log(oapagecontext, this, "*** Defaulting Competencies ***" + s11, 3);
    OAViewObject oaviewobject = (OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("RoleCompetenciesVO");
    oaviewobject.setMaxFetchSize(-1);
    oaviewobject.setWhereClauseParam(0, s11);
    oaviewobject.executeQuery();
    Debug.log(oapagecontext, this, "*** End LOV event ***", 3);
    String s4 = "";
    String s8 = "";
    OASubTabLayoutBean oasubtablayoutbean1 = (OASubTabLayoutBean)oawebbean.findIndexedChildRecursive("AddAssignmentSubTabLayout");
    if("Project".equals(s) && !oasubtablayoutbean1.isSubTabClicked(oapagecontext))
    OAViewObject oaviewobject1 = (OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("AddNewAssignmentVO");
    s4 = (String)oaviewobject1.first().getAttribute("ProjectId");
    s8 = (String)oaviewobject1.first().getAttribute("ProjectNumber");
    Debug.log(oapagecontext, this, "*** lProjectId = " + s4, 3);
    Debug.log(oapagecontext, this, "*** lProjectNumber = " + s8, 3);
    if("Project".equals(s) && !oasubtablayoutbean1.isSubTabClicked(oapagecontext) && !StringUtils.isNullOrEmpty(s8))
    Debug.log(oapagecontext, this, "Delivery Assignment, Project Number is there but no Project Id", 3);
    if(s4 == null || s4.equals(""))
    ViewObject viewobject = oapagecontext.getApplicationModule(oawebbean).findViewObject("ObtainProjectId");
    if(viewobject == null)
    String s14 = "SELECT project_id FROM PA_PROJECTS_ALL WHERE segment1 =:1";
    viewobject = oaapplicationmodule.createViewObjectFromQueryStmt("ObtainProjectId", s14);
    viewobject.setWhereClauseParam(0, s8);
    viewobject.executeQuery();
    int j = viewobject.getRowCount();
    if(j != 1)
    Debug.log(oapagecontext, this, "Error : Project Number is Invalid or not unique", 3);
    OAException oaexception4 = null;
    oaexception4 = new OAException("PA", "PA_PROJECT_NUMBER_INVALID");
    oaexception4.setApplicationModule(oaapplicationmodule);
    throw oaexception4;
    oracle.jbo.Row row = viewobject.last();
    if(row != null)
    Object obj2 = row.getAttribute(0);
    if(obj2 != null)
    s4 = obj2.toString();
    if(s4 != null)
    oapagecontext.putTransactionValue("paProjectId", s4);
    if(oaapplicationmodule.findViewObject("AddNewAssignmentsVO") != null)
    oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().setAttribute("ProjectId", s4);
    } else
    Debug.log(oapagecontext, this, "Error : No rows returned in Project Number query", 3);
    OAException oaexception5 = null;
    oaexception5 = new OAException("PA", "PA_PROJECT_NUMBER_INVALID");
    oaexception5.setApplicationModule(oaapplicationmodule);
    throw oaexception5;
    String s12 = "F";
    if(s4 != null && !s4.equals(""))
    String s13 = Security.checkUserPrivilege("PA_ASN_CR_AND_DL", "PA_PROJECTS", s4, oapagecontext, false);
    if("F".equals(s13))
    OAException oaexception3 = null;
    oaexception3 = new OAException("PA", "PA_ADD_DELIVERY_ASMT_SECURITY");
    oaexception3.setApplicationModule(oaapplicationmodule);
    Debug.log(oapagecontext, this, "ERROR:" + oaexception3.getMessage(), 3);
    throw oaexception3;
    OAViewObject oaviewobject2 = (OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("AddNewAssignmentVO");
    Object obj = oaviewobject2.first().getAttribute("BillRateOverride");
    Object obj1 = oaviewobject2.first().getAttribute("BillRateCurrOverride");
    Object obj3 = oaviewobject2.first().getAttribute("MarkupPercentOverride");
    Object obj4 = oaviewobject2.first().getAttribute("DiscountPercentOverride");
    Object obj5 = oaviewobject2.first().getAttribute("TpRateOverride");
    Object obj6 = oaviewobject2.first().getAttribute("TpCurrencyOverride");
    Object obj7 = oaviewobject2.first().getAttribute("TpCalcBaseCodeOverride");
    Object obj8 = oaviewobject2.first().getAttribute("TpPercentAppliedOverride");
    Object obj9 = null;
    Object obj10 = null;
    Debug.log(oapagecontext, this, "in AddAssignmentsTopCO processFcstInfoRg(): getting the implementation options", 3);
    Object obj11 = oaviewobject2.first().getAttribute("BrRateDiscReasonCode");
    Object obj12 = oapagecontext.getTransactionValue("rateDiscReasonFlag");
    Object obj13 = oapagecontext.getTransactionValue("brOverrideFlag");
    Object obj14 = oapagecontext.getTransactionValue("brDiscountOverrideFlag");
    String s22 = oapagecontext.getParameter("BillRateRadioGroup");
    if("BRCurrencyRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "BRCurrencyRadioButton chosen", 3);
    if(obj == null || obj1 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception6 = new OAException("PA", "PA_CURR_BILL_RATE_REQUIRED");
    oaexception6.setApplicationModule(oaapplicationmodule);
    throw oaexception6;
    } else
    if("BRMarkupRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "BRMarkup%RadioButton chosen", 3);
    if(obj3 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception7 = new OAException("PA", "PA_MARKUP_PERCENT_REQUIRED");
    oaexception7.setApplicationModule(oaapplicationmodule);
    throw oaexception7;
    } else
    if("BRDiscountRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "BRDiscount%RadioButton chosen", 3);
    if(obj4 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception8 = new OAException(oapagecontext.getMessage("PA", "PA_DISCOUNT_PERCENT_REQUIRED", null));
    oaexception8.setApplicationModule(oaapplicationmodule);
    throw oaexception8;
    if("Y".equals(oapagecontext.getTransactionValue("paMass")) || "Admin".equals(s) || "Template".equals(s))
    Debug.log(oapagecontext, this, "Need not have this check for team templates ", 3);
    } else
    if(obj13 != null && obj13.equals("Y") && obj12 != null && obj12.equals("Y") && "BRCurrencyRadioButton".equals(s22) && StringUtils.isNullOrEmpty((String)obj11))
    Debug.log(oapagecontext, this, "error 1", 3);
    OAException oaexception9 = new OAException("PA", "PA_RATE_DISC_REASON_REQUIRED");
    oaexception9.setApplicationModule(oaapplicationmodule);
    throw oaexception9;
    if(obj14 != null && obj14.equals("Y") && obj12 != null && obj12.equals("Y") && "BRDiscountRadioButton".equals(s22) && StringUtils.isNullOrEmpty((String)obj11))
    Debug.log(oapagecontext, this, "error 2", 3);
    OAException oaexception10 = new OAException("PA", "PA_RATE_DISC_REASON_REQUIRED");
    oaexception10.setApplicationModule(oaapplicationmodule);
    throw oaexception10;
    Debug.log(oapagecontext, this, "*** Selected transfer price radio shr = " + s22, 3);
    oapagecontext.putTransactionValue("BROGroupSelected", s22);
    Debug.log(oapagecontext, this, "*** 1 :Selected bill rate radio = " + s22, 3);
    if(s22 != null)
    oapagecontext.putSessionValue("BROGroupSelected", s22);
    s22 = oapagecontext.getParameter("TransferPriceRadioGroup");
    Debug.log(oapagecontext, this, "*** Selected transfer price radio = " + s22, 3);
    if("TPCurrencyRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "***TPCurrencyRadioButton chosen", 3);
    if(obj5 == null || obj6 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception11 = new OAException("PA", "PA_CURR_RATE_REQUIRED");
    oaexception11.setApplicationModule(oaapplicationmodule);
    throw oaexception11;
    } else
    if("TPBasisRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "***TPBasisRadioButton chosen", 3);
    if(obj7 == null || obj8 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception12 = new OAException("PA", "PA_BASIS_APPLY_PERCENT_REQD");
    oaexception12.setApplicationModule(oaapplicationmodule);
    throw oaexception12;
    oapagecontext.putTransactionValue("TPORadioGroupSelected", s22);
    if(oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().getAttribute("RoleId") != null)
    Debug.log(oapagecontext, this, "*** Role Id is + " + oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().getAttribute("RoleId"), 3);
    if(oapagecontext.getParameter("SearchCompetencies") != null)
    String s2 = "OA.jsp?akRegionCode=PA_COMP_SEARCH_LAYOUT&akRegionApplicationId=275&paCallingPage=AddAssignment";
    oapagecontext.redirectImmediately(s2, true, "RP");
    OASubTabLayoutBean oasubtablayoutbean = (OASubTabLayoutBean)oawebbean.findIndexedChildRecursive("AddAssignmentSubTabLayout");
    if(s.equals("Project") && oasubtablayoutbean.isSubTabClicked(oapagecontext) && !StringUtils.isNullOrEmpty((String)oapagecontext.getTransactionValue("paProjectId")))
    String s5 = "PA_ASN_FCST_INFO_ED";
    String s9 = "F";
    s9 = Security.checkUserPrivilege(s5, "PA_PROJECTS", (String)oapagecontext.getTransactionValue("paProjectId"), oapagecontext, false);
    if(s9.equals("F"))
    Debug.log(oapagecontext, this, "Error : PA_ASN_FCST_INFO_ED previelge not found", 3);
    OAException oaexception2 = null;
    oaexception2 = new OAException("PA", "PA_NO_SEC_FIN_INFO");
    oaexception2.setApplicationModule(oaapplicationmodule);
    throw oaexception2;
    if(oapagecontext.getParameter("GoBtn") != null)
    if("Y".equals(oapagecontext.getTransactionValue("paMass")) && "0".equals(oapagecontext.getTransactionValue("paNumSelectedResources")))
    OAException oaexception = new OAException("PA", "PA_NO_RESOURCE_SELECTED");
    oaexception.setApplicationModule(oapagecontext.getRootApplicationModule());
    Debug.log(oapagecontext, this, "ERROR:" + oaexception.getMessage(), 3);
    throw oaexception;
    String s6 = "T";
    if(s.equals("Admin") && "Y".equals(oapagecontext.getTransactionValue("paMass")) && "1".equals(oapagecontext.getTransactionValue("paNumSelectedResources")))
    Debug.log(oapagecontext, this, "resource id[19] is " + (String)oapagecontext.getTransactionValue("paResourceId"), 3);
    if(oapagecontext.getTransactionValue("AdminSecurityChecked") == null)
    String s7 = Security.checkPrivilegeOnResource("-999", (String)oapagecontext.getTransactionValue("paResourceId"), SessionUtils.getResourceName((String)oapagecontext.getTransactionValue("paResourceId"), oapagecontext), "PA_ADM_ASN_CR_AND_DL", null, oapagecontext, false);
    if("F".equals(s7))
    OAException oaexception1 = new OAException("PA", "PA_ADD_ADMIN_ASMT_SECURITY");
    oaexception1.setApplicationModule(oapagecontext.getRootApplicationModule());
    Debug.log(oapagecontext, this, "ERROR:" + oaexception1.getMessage(), 3);
    throw oaexception1;
    if("SUBMIT_APPRVL".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    oapagecontext.putTransactionValue("Save", "N");
    else
    oapagecontext.putTransactionValue("Save", "Y");
    String as[] = oaapplicationmodule.getApplicationModuleNames();
    String as1[] = oaapplicationmodule.getViewObjectNames();
    Debug.log(oapagecontext, this, "no of app module: " + as.length, 3);
    Debug.log(oapagecontext, this, "no of view: " + as1.length, 3);
    for(int i = 0; i < as.length; i++)
    Debug.log(oapagecontext, this, "app module: " + as, 3);
    for(int k = 0; k < as1.length; k++)
    Debug.log(oapagecontext, this, "app module: " + as1[k], 3);
    Debug.log(oapagecontext, this, "*** assignmentType = " + s, 3);
    Debug.log(oapagecontext, this, "*** projectId = " + oapagecontext.getTransactionValue("paProjectId"), 3);
    if("Project".equals(s) && !StringUtils.isNullOrEmpty((String)oapagecontext.getTransactionValue("paProjectId")) && !"Y".equals(oapagecontext.getParameter("paMass")))
    Debug.log(oapagecontext, this, "*** Setting default staffing owner for add delivery assignment -- projectId = " + oapagecontext.getTransactionValue("paProjectId"), 3);
    oaapplicationmodule.invokeMethod("setDefaultStaffingOwner");
    OAViewObject oaviewobject3 = (OAViewObject)oaapplicationmodule.findViewObject("RoleCompetenciesVO");
    oaviewobject3.setMaxFetchSize(0);
    oaviewobject3.setRangeSize(-1);
    oracle.jbo.Row arow[] = oaviewobject3.getAllRowsInRange();
    for(int l = 0; l < arow.length; l++)
    RoleCompetenciesVORowImpl rolecompetenciesvorowimpl = (RoleCompetenciesVORowImpl)oaviewobject3.getRowAtRangeIndex(l);
    Debug.log(oapagecontext, this, "roleCompetenciesVORowImpl" + rolecompetenciesvorowimpl, 3);
    rolecompetenciesvorowimpl.setPlsqlState((byte)0);
    oapagecontext.putTransactionValue("AddAssignmentInsertRowFlag", "N");
    oaapplicationmodule.getTransaction().commit();
    if("Y".equals(oapagecontext.getTransactionValue("paMass")) && !"1".equals(oapagecontext.getTransactionValue("paNumSelectedResources")))
    if(!"SUBMIT_APPRVL".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Save, Mass, NumSelectedResources>1", 3);
    Debug.log(oapagecontext, this, "work flow has been launched", 3);
    OADialogPage oadialogpage = new OADialogPage((byte)3, new OAException("PA", "PA_MASS_ASSIGNMENT_CONFIRM"), null, "OA.jsp?akRegionCode=PA_RESOURCE_LIST_LAYOUT&akRegionApplicationId=275&addBreadCrumb=N", null);
    oadialogpage.setRetainAMValue(false);
    oapagecontext.redirectToDialogPage(oadialogpage);
    return;
    Debug.log(oapagecontext, this, "SaveAndSubmit, Mass, NumSelectedResources>1", 3);
    putParametersOnSession(oapagecontext);
    int i1 = 0;
    int j1 = 0;
    String s21 = "SelectedResourceId";
    int l1 = Integer.parseInt(oapagecontext.getTransactionValue("paNumSelectedResources").toString());
    Debug.log(oapagecontext, this, "size of resourceArray = " + l1, 3);
    String as2[] = new String[l1];
    for(; !"END".equals(oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1)))); i1++)
    if(oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1))) != null)
    Debug.log(oapagecontext, this, "resource id = " + oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1))).toString(), 3);
    as2[j1] = oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1))).toString();
    j1++;
    SessionUtils.putMultipleParameters("paResourceId", as2, oapagecontext);
    Debug.log(oapagecontext, this, "redirect to Mass Submit for Approval page", 3);
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_MASS_SUBMIT_LAYOUT&akRegionApplicationId=275&paCallingPage=MassAdd&paProjectId=" + oapagecontext.getTransactionValue("p_project_id"), false, "RP");
    return;
    if("RETURN_TO".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Return to Option Selected ", 3);
    String s15 = (String)oapagecontext.getTransactionValue("PrevPageUrl");
    int k1 = s15.indexOf("OA.jsp?");
    s15 = s15.substring(k1);
    Debug.write(oapagecontext, this, "*** RETURN_TO URL: " + s15, 3);
    oapagecontext.redirectImmediately(s15);
    } else
    if("ADD_ANOTHER".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Add Another Option Selected", 3);
    oaapplicationmodule.invokeMethod("resetAddNewAssignment");
    if(oaapplicationmodule.findViewObject("RoleCompetenciesVO") != null)
    oaapplicationmodule.findViewObject("RoleCompetenciesVO").clearCache();
    String s16;
    if(!s.equals("Project") && !s.equals("Admin"))
    s16 = "OA.jsp?akRegionCode=PA_ADD_ASSIGNMENTS_PAGE_LAYOUT&akRegionApplicationId=275&paProjectId=" + oapagecontext.getTransactionValue("paProjectId") + "&paAssignmentType=" + s + "&OA_SubTabIdx=0";
    else
    s16 = "OA.jsp?akRegionCode=PA_ADD_ASSIGNMENTS_PAGE_LAYOUT&akRegionApplicationId=275&paResourceId=" + oapagecontext.getTransactionValue("paResourceId") + "&paAssignmentType=" + s + "&OA_SubTabIdx=0";
    Debug.log(oapagecontext, this, "nextUrl " + s16, 3);
    if("Template".equals(s))
    oapagecontext.redirectImmediately(s16, true, "S");
    else
    oapagecontext.redirectImmediately(s16, false, "S");
    } else
    if("UPDATE_DETAILS".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Update Details Selected ", 3);
    String s17 = "";
    if("Staffed".equals(s))
    s17 = "ProjStaffedAsmt";
    else
    if("Admin".equals(s))
    s17 = "AdminAsmt";
    else
    if("Project".equals(s))
    s17 = "PersonStaffedAsmt";
    else
    if("Open".equals(s))
    s17 = "OpenAsmt";
    else
    if("Template".equals(s))
    s17 = "TemplateAsmt";
    String s19 = "OA.jsp?akRegionCode=PA_ASMT_LAYOUT&akRegionApplicationId=275&paProjectId=" + oapagecontext.getTransactionValue("paProjectId") + "&paAssignmentId=" + oapagecontext.getTransactionValue("wfOutAssignmentId") + "&paCalledPage=" + s17 + "&addBreadCrumb=RP";
    Debug.log(oapagecontext, this, "UPDATE_DETAILS: URL: " + s19, 3);
    oapagecontext.redirectImmediately(s19, false, "RP");
    if(s.equals("Staffed") || s.equals("Admin") || s.equals("Project"))
    String s18 = (String)oapagecontext.getTransactionValue("wfOutResourceId");
    String s20 = (String)oapagecontext.getTransactionValue("wfOutAssignmentId");
    Debug.log(oapagecontext, this, "outResourceId " + s18, 3);
    Debug.log(oapagecontext, this, "outAssignmentId " + s20, 3);
    if("SUBMIT_APPRVL".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    if(s.equals("Staffed"))
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_SUBMIT_ASMT_APR_LAYOUT&akRegionApplicationId=275&paAsgmtId=" + s20 + "&paResourceId=" + s18 + "&paProjectId=" + oapagecontext.getTransactionValue("paProjectId") + "&paAsgmtAprStatus=ASGMT_APPRVL_WORKING&paAssignmentType=" + s + "&paCallingPage=AddAssignment", false, "RP");
    return;
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_SUBMIT_ASMT_APR_LAYOUT&akRegionApplicationId=275&paAsgmtId=" + s20 + "&paResourceId=" + s18 + "&paAsgmtAprStatus=ASGMT_APPRVL_WORKING&paAssignmentType=" + s + "&paCallingPage=AddAssignment", false, "RP");

    Hi Rani,
    As soon as the transaction is commited the methods in the VORowImpl Class are called.
    You can check in the VORowImpl class and search for the log messages.
    Thanks,
    Gaurav

  • Trying to understand the code???

    Hi,
    I am trying to understand the following bit of code, currently the code puts each catalogue into a different row of the table but i want each catalogue to be put in the next column
    (so the catalogues appear across the page on the actual web page). The following code is for the page in question but im not sure how much is relevant so i will paste it all and highlight the section i think is relevant:
    <html>
    <%-- DECLARATIONS --%>
    <%@ page import="se.ibs.ns.cf.*,  se.ibs.ccf.*, se.ibs.bap.*, se.ibs.bap.util.*, se.ibs.bap.web.*,  java.util.*, se.ibs.ns.icat.*, se.ibs.bap.asw.cf.*, java.lang.*" %>
    <% ItemCatalogueBean bean = (ItemCatalogueBean)SessionHelper.getSessionObject("ItemCatalogueBean",session);
       String resourcePath = bean.getResourcePath(null);
       String title = "Product catalogue";
       String languageCode = bean.getLanguageCode();
    %>
    <%@ include file="FuncHead.jsp" %>
    <BODY class="IBSBody" onLoad="loaded = true;">
    <form method="POST" action=<%= bean.getEncodedServlet("se.ibs.ns.icat.ItemCatalogueSearchServlet", response) %> name="basicForm">
    <%@ include file="FuncSubmitScript.jsp" %>
    <%@ include file="FuncPageBegin.jsp" %>
    <div align="center">
      <table border="0" width="895">
        <tr>
          <td align="left" width="502">
    <div align="left">
      <table border="0" width="500">
        <tr>
          <td class="IBSPageTitleText" align="left" valign="top" width="238">
              <%@ include file="FuncPageTitle.jsp" %>
              <%@ include file="FuncPageTitleImage.jsp" %>
                    <br>
           On this page you can see the product catalogues. Click on one of the
           links to go to the next level. Alternatively you can click the <b>Search
           catalogue</b> button to find the products of interest.</td>
               <td width="248" valign="bottom">
                <div align="left"><%@ include file="FuncShoppingCart.jsp" %></div>
               </td>
        </tr>
      </table>
    </div></td></tr></table></div>
    <input type="submit" value="Search catalogue" name="ACTION_NONE" onClick="submitButtonOnce(this); return false">
    <hr>
    <%-- REPEAT CATALOGUES --%>
    <div align="left">
    <table border="0" width="100%">
    <% Vector catalogues = bean.getItemCatalogues();
            int cataloguesSize = catalogues.size();
               for (int i = 0; i < cataloguesSize; i++){
                      BAPItemCatalogue cat =  (BAPItemCatalogue) catalogues.elementAt(i); %>
              <%-- LINK AND MARK AS NEW --%>
                  <tr>
                         <td width="23%"><a class="IBSMenuLink" href="link" onClick="javascript:invokeLink('<%= bean.getEncodedServlet("se.ibs.ns.icat.ItemCatalogueCategoryServlet", response) %>?CODE=<%= ToolBox.encodeURLParameter(cat.getCode())%>'); return false">
                              <%= cat.getDescription(languageCode) %></a>
                         </td>
                         <td width="40%" align="right">
                              <% if (cat.isNew()) {%>
                                     <img border=0 src="<%= resourcePath %>new.gif">
                              <% } %>
                        </td>
                  </tr>
              <%--  CATALOGUES IMAGE AND INTERNET INFORMATION (text, multimedia objects,downloads, links...) --%>
                  <tr>
                         <td width="23%" valign="top" align="left">
                              <% if (bean.isAdvanced(cat) && bean.hasMultimediaImage(cat)) { %>
                                   <a href="link" onClick="javascript:invokeLink('<%= bean.getEncodedServlet("se.ibs.ns.icat.ItemCatalogueCategoryServlet", response) %>?CODE=<%= ToolBox.encodeURLParameter(cat.getCode())%>'); return false">
                                   <img border="0" src="<%= bean.getMultimediaImage(cat) %>"></a>
                        <% } else {%>     
                                   <img border="0" src="<%= resourcePath %>Catalog.gif">
                              <% } %>
                         </td>
                         <td class="IBSTextNormal" width="40%" valign="top">
                              <%= bean.getWebText(cat) %>
                         </td>
                  </tr>
                  <tr>
                         <td width="23%">
                         </td>
                         <td width="40%">
                         <% Vector mmLinks = bean.getMultimediaLinks(cat);
                      int mmLinksSize = mmLinks.size();     
                              for (int ml=0; ml<mmLinksSize; ml++){
                                   BAPCodeAndDescription mmLink = (BAPCodeAndDescription)mmLinks.elementAt(ml); %>
                                   <a class="IBSLink" href="<%= mmLink.getCode() %>" target="_blank"><%= mmLink.getDescription() %></a><br>
                         <% } %>
                   <% Vector webLinks = bean.getWebLinks(cat);
                        int webLinksSize = webLinks.size();
                        for (int wl=0; wl<webLinksSize; wl++){
                                   BAPCodeAndDescription webLink = (BAPCodeAndDescription)webLinks.elementAt(wl); %>
                                   <a class="IBSLink" href="<%= webLink.getCode() %>" target="_blank"><%= webLink.getDescription() %></a><br>
                        <% } %>
                         </td>
                  </tr>
                <%}%>
    </table>
    </div>
    <%@ include file="FuncPageLinks.jsp" %>
    <%@ include file="FuncPageEnd.jsp" %>
    </form>
    </body>
    </html>i hope someone could help me to understand this,
    thank you for your help

    You've probably already seen these, but here are a couple of links that may help.
    http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/operators.html#array_a ccess
    http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/Array.html
    What's basically happening is that the "for" loop goes through each item in the array.  Don't be confused by the fact that two of the items in the array are Strings and one is an Integer - variable i being a String has nothing to do with the data type of the elements in the array.
    The following code:
    private function createLabels():void
         var myArray:Array = ['one', 'two', 3];
         for(var i:String in myArray)
              trace("i = " + i);
              trace(myArray[i]);
    gives the following results:
    i = 0
    one
    i = 1
    two
    i = 2
    3
    From that we can see that the "for" loop is assigning the index number of each array element, not the actual array element ('one', 'two', or 3) to the variable i.  So calling myArray[i] is the same as calling myArray[0] the first time through the loop.  This type of "for" loop is just a shorter way of doing the following, which produces exactly the same results:
    private function createLabels():void
         var myArray:Array = ['one', 'two', 3];
         for(var i:int = 0; n < myArray.length; i++)
              trace("i = " + i);
              trace(myArray[i]);
    Hope that helps.
    Cheers!

  • Problem in moving the code from one system to other system

    Hi,
    I am working on building a webservice. I started building the EJB teir compnents like (Entity beans, Sessions beans, data base schemas) using the SUN ONE STUDIO 5 and SUN ONE App Server 7.0.
    The problem, if I want to move the same entity beans code from one computer to other computer.
    I am using same platform except the operating system (XP, and Windows 2000), apart from this every thing is same (Sun one studio 5, sun one app server 7.0). The Entity beans are working on the source computer and tested the beans. But When I moved the code to other computer, I compiled the entity beans code and it compiled perfectly. Then I tested the entity bean, I generated the test client, and deployed it. Till now no problem. When I tried to excute it and invoke the functions then it giving the following error:
    Is there any solution, so that I can avoid coding from scrath again when I want to use same on other computer.
    [b][22/Sep/2003:10:29:39] SEVERE ( 1616):
    javax.ejb.EJBException: nested exception is: com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:615)
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper.getObjectById(PersistenceManagerWrapper.java:247)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.jdoGetInstance(AppNumInfoBean_535499553_ConcreteImpl.java:905)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.ejbLoad(AppNumInfoBean_535499553_ConcreteImpl.java:693)
    at com.sun.ejb.containers.EntityContainer.callEJBLoad(EntityContainer.java:2372)
    at com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.java:1362)
    at com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:1405)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:1313)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:462)
    at Data.AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.getDatelastapp(AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.java:113)
    at Data._AppNumInfo_Stub.getDatelastapp(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
    at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
    at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
    at jasper.dispatch_jsp._jspService(_dispatch_jsp.java:136)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
    at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
    at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    javax.ejb.EJBException: nested exception is: com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    at com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.java:1378)
    at com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:1405)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:1313)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:462)
    at Data.AppNumInfoBean_53
    [22/Sep/2003:10:32:00] INFO ( 1616): Bean AppNumInfo method ejbLoad:
    com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:615)
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper.getObjectById(PersistenceManagerWrapper.java:247)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.jdoGetInstance(AppNumInfoBean_535499553_ConcreteImpl.java:905)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.ejbLoad(AppNumInfoBean_535499553_ConcreteImpl.java:693)
    at com.sun.ejb.containers.EntityContainer.callEJBLoad(EntityContainer.java:2372)
    at com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.java:1362)
    at com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:1405)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:1313)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:462)
    at Data.AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.setDatelastapp(AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.java:138)
    at Data._AppNumInfo_Stub.setDatelastapp(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
    at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
    at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
    at jasper.dispatch_jsp._jspService(_dispatch_jsp.java:136)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
    at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
    at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    [22/Sep/2003:10:32:00] SEVERE ( 1616): EJB5017: Exception while running preinvoke : ejbName = [AppNumInfo]
    [22/Sep/2003:10:32:00] SEVERE ( 1616):
    javax.ejb.EJBException: nested exception is: com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:615)
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper.getObjectById(PersistenceManagerWrapper.java:247)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.jdoGetInstance(AppNumInfoBean_535499553_ConcreteImpl.java:905)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.ejbLoad(AppNumInfoBean_535499553_ConcreteImpl.java:693)
    at com.sun.ejb.containers.EntityContainer.callEJBLoad(EntityContainer.java:2372)
    at com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.java:1362)
    at com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:1405)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:1313)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:462)
    at Data.AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.setDatelastapp(AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.java:138)
    at Data._AppNumInfo_Stub.setDatelastapp(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
    at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
    at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
    at jasper.dispatch_jsp._jspService(_dispatch_jsp.java:136)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
    at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
    at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    javax.ejb.EJBException: nested exception is: com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    at com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.java:1378)
    at com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:1405)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:1313)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:462)
    at Data.AppNumInfoBean_53

    The response on Enterprise Java Beans is on the right track:
    From http://forum.java.sun.com/thread.jsp?forum=13&thread=447232
    There appears to be either a portion that didn't get recompiled, or perhaps a hard-coded GUID-type number within the application. Carefully go over the elements in the application that were hard-coded to run on the other machine -- were they have all been migrated?
    And
    Here's a possible culprit, from the error message: 535499553
    He is talking about this part of the stack trace, I belive:
    at Data.AppNumInfoBean_535499553_ConcreteImpl.jdoGetInstance(AppNumInfoBean_535499553_ConcreteImpl.java:905)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.ejbLoad(AppNumInfoBean_535499553_ConcreteImpl.java:693)
    at com.sun.ejb.containers.EntityContainer.callEJBLoad(EntityContainer.java:2372)
    It's not finding AppNumInfoBean_535499553.

  • Problem in moving the code from one computer to other

    Hi,
    I am working on building a webservice. I started building the EJB teir compnents like (Entity beans, Sessions beans, data base schemas) using the SUN ONE STUDIO 5 and SUN ONE App Server 7.0.
    The problem, if I want to move the same entity beans code from one computer to other computer.
    I am using same platform except the operating system (XP, and Windows 2000), apart from this every thing is same (Sun one studio 5, sun one app server 7.0). The Entity beans are working on the source computer and tested the beans. But When I moved the code to other computer, I compiled the entity beans code and it compiled perfectly. Then I tested the entity bean, I generated the test client, and deployed it. Till now no problem. When I tried to excute it and invoke the functions then it giving the following error:
    Is there any solution, so that I can avoid coding from scrath again when I want to use same on other computer.
    [22/Sep/2003:10:29:39] SEVERE ( 1616):
    javax.ejb.EJBException: nested exception is: com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:615)
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper.getObjectById(PersistenceManagerWrapper.java:247)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.jdoGetInstance(AppNumInfoBean_535499553_ConcreteImpl.java:905)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.ejbLoad(AppNumInfoBean_535499553_ConcreteImpl.java:693)
    at com.sun.ejb.containers.EntityContainer.callEJBLoad(EntityContainer.java:2372)
    at com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.java:1362)
    at com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:1405)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:1313)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:462)
    at Data.AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.getDatelastapp(AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.java:113)
    at Data._AppNumInfo_Stub.getDatelastapp(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
    at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
    at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
    at jasper.dispatch_jsp._jspService(_dispatch_jsp.java:136)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
    at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
    at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    javax.ejb.EJBException: nested exception is: com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    at com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.java:1378)
    at com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:1405)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:1313)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:462)
    at Data.AppNumInfoBean_53
    [22/Sep/2003:10:32:00] INFO ( 1616): Bean AppNumInfo method ejbLoad:
    com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:615)
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper.getObjectById(PersistenceManagerWrapper.java:247)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.jdoGetInstance(AppNumInfoBean_535499553_ConcreteImpl.java:905)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.ejbLoad(AppNumInfoBean_535499553_ConcreteImpl.java:693)
    at com.sun.ejb.containers.EntityContainer.callEJBLoad(EntityContainer.java:2372)
    at com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.java:1362)
    at com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:1405)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:1313)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:462)
    at Data.AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.setDatelastapp(AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.java:138)
    at Data._AppNumInfo_Stub.setDatelastapp(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
    at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
    at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
    at jasper.dispatch_jsp._jspService(_dispatch_jsp.java:136)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
    at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
    at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    [22/Sep/2003:10:32:00] SEVERE ( 1616): EJB5017: Exception while running preinvoke : ejbName = [AppNumInfo]
    [22/Sep/2003:10:32:00] SEVERE ( 1616):
    javax.ejb.EJBException: nested exception is: com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:615)
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper.getObjectById(PersistenceManagerWrapper.java:247)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.jdoGetInstance(AppNumInfoBean_535499553_ConcreteImpl.java:905)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.ejbLoad(AppNumInfoBean_535499553_ConcreteImpl.java:693)
    at com.sun.ejb.containers.EntityContainer.callEJBLoad(EntityContainer.java:2372)
    at com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.java:1362)
    at com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:1405)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:1313)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:462)
    at Data.AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.setDatelastapp(AppNumInfoBean_535499553_ConcreteImpl_EJBObjectImpl.java:138)
    at Data._AppNumInfo_Stub.setDatelastapp(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
    at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
    at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
    at jasper.dispatch_jsp._jspService(_dispatch_jsp.java:136)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
    at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
    at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    javax.ejb.EJBException: nested exception is: com.sun.jdo.api.persistence.support.JDOUserException: Object not found for this ObjectId.
    NestedException: java.lang.ClassCastException: java.lang.String
    at com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.java:1378)
    at com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:1405)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:1313)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:462)
    at Data.AppNumInfoBean_53

    The response on Enterprise Java Beans is on the right track:
    From http://forum.java.sun.com/thread.jsp?forum=13&thread=447232
    There appears to be either a portion that didn't get recompiled, or perhaps a hard-coded GUID-type number within the application. Carefully go over the elements in the application that were hard-coded to run on the other machine -- were they have all been migrated?
    And
    Here's a possible culprit, from the error message: 535499553
    He is talking about this part of the stack trace, I belive:
    at Data.AppNumInfoBean_535499553_ConcreteImpl.jdoGetInstance(AppNumInfoBean_535499553_ConcreteImpl.java:905)
    at Data.AppNumInfoBean_535499553_ConcreteImpl.ejbLoad(AppNumInfoBean_535499553_ConcreteImpl.java:693)
    at com.sun.ejb.containers.EntityContainer.callEJBLoad(EntityContainer.java:2372)
    It's not finding AppNumInfoBean_535499553.

  • Problem in modifying the code using work area concept

    Hi,
    I am working on a code in which i am on the code in which i am using the modify statement but it is not giving the right output.
    here's d code:-
    LOOP AT T_ITPO5 INTO W_ITPO5.
            LOOP AT T_ITPO4 INTO W_ITPO4 WHERE AUFNR = W_ITPO5-AUFNR.
           LOOP AT T_ITPO4 INTO W_ITPO4 FROM WV_INDEX.
             IF W_ITPO4-AUFNR EQ W_ITPO5-AUFNR.
             IF ITPO4-NTGEW <> 0 .
                CALL FUNCTION 'ZGET_ITEM_WEIGHT'
                  EXPORTING
                    P_BUID   = W_ITPO4-WERKS
                    P_ITEMID = W_ITPO4-MATNR
                    P_QTY    = 1
                    P_UOM    = W_ITPO4-MEINS
                    P_UOM1   = 'KG'
                  IMPORTING
                    P_RETVAL = W_ITPO4-WTKG.
                TOTWT1 = W_ITPO4-WTKG * W_ITPO4-MENGE.
             IF W_ITPO4-BWART = '261'.
              W_ITPO5-I_QTY = W_ITPO5-I_QTY + TOTWT1.
             ELSEIF W_ITPO4-BWART = '101' OR W_ITPO4-BWART = '531'.
              W_ITPO5-I_QTY = W_ITPO5-I_QTY - TOTWT1.
             ENDIF.
           ENDLOOP.
             MODIFY T_ITPO5 INDEX SY-TABIX FROM W_ITPO5.
           MODIFY T_ITPO5 FROM W_ITPO5 TRANSPORTING AUFNR.
       ENDLOOP.
         WRITE: / 'PRD.NO       ITEM DESCRIPTION                               WIP(KGS)'.
        ULINE.
        LOOP AT T_ITPO5 INTO W_ITPO5.
          READ TABLE T_ITPO1 INTO W_ITPO1 WITH KEY AUFNR = W_ITPO5-AUFNR.
          SELECT SINGLE MAKTG FROM MAKT INTO W_ITPO5-ITEMDESC WHERE MATNR = W_ITPO1-MATNR.
          if sy-subrc = 0 .
          WRITE: / W_ITPO5-AUFNR,W_ITPO5-ITEMDESC,W_ITPO5-I_QTY.
          TOT_QTY = TOT_QTY + W_ITPO5-I_QTY.
          else.
          write 'Unsuccessful'.
          endif.
        ENDLOOP.
        ULINE.
        FORMAT COLOR 3.
        WRITE: / 'GTOTAL',55 TOT_QTY.
        FORMAT COLOR OFF.
    plzz provide me guidelines to solve this problem.

    here's d code;-
    TYPES: BEGIN OF ITPO1,
           AUFNR TYPE AFPO-AUFNR,      "Order Number
           PSMNG TYPE AFPO-PSMNG,      "Order item quantity
           WEMNG TYPE AFPO-WEMNG,      "Quantity of goods received for the order item
           DWERK TYPE AFPO-DWERK,      "Plant
           MATNR LIKE AFPO-MATNR,      "Item Id
           END OF ITPO1.
    DECLARATION FOR AUFM TABLE
    TYPES: BEGIN OF ITPO4,
           AUFNR TYPE AUFM-AUFNR,      "Order Number
           BWART TYPE AUFM-BWART,      "Movement Type (Inventory Management)
           MENGE TYPE AUFM-MENGE,      "Quantity
           MEINS TYPE AUFM-MEINS,      "Base Unit of Measure
           BLDAT TYPE AUFM-BLDAT,      "Document Date in Document
           WERKS TYPE AUFM-WERKS,      "Plant
           MATNR TYPE AUFM-MATNR,      "Material Number
           NTGEW TYPE MARA-NTGEW,      "Net Weight
           WTKG  TYPE MARA-NTGEW,
           END OF ITPO4,
           BEGIN OF ITPO5 ,
           AUFNR TYPE AUFM-AUFNR,
           MENGE TYPE AUFM-MENGE,
           I_QTY TYPE AUFM-MENGE,
           ITEMDESC LIKE MAKT-MAKTG,
           END OF ITPO5.
        WORK AREA AND INTERNAL TABLE DECLARATION
    DATA : W_ITPO1 TYPE ITPO1,
           W_ITPO4 TYPE ITPO4,
           W_ITPO5 TYPE ITPO5,
           T_ITPO1 TYPE ITPO1 OCCURS 0,
           T_ITPO4 TYPE ITPO4 OCCURS 0,
           T_ITPO5 TYPE ITPO5 OCCURS 0.
    VARIABLES
    DATA: TOTWT1 LIKE AUFM-MENGE,
          TOT_QTY LIKE AUFM-MENGE.
    PARAMETERS N SELECT-OPTIONS
    PARAMETERS: PLANT LIKE AFPO-DWERK.
    SELECT-OPTIONS: PO_DATE FOR AFKO-GSTRP.
        LOOP AT T_ITPO5 INTO W_ITPO5.
            LOOP AT T_ITPO4 INTO W_ITPO4 WHERE AUFNR = W_ITPO5-AUFNR.
                CALL FUNCTION 'ZGET_ITEM_WEIGHT'
                  EXPORTING
                    P_BUID   = W_ITPO4-WERKS
                    P_ITEMID = W_ITPO4-MATNR
                    P_QTY    = 1
                    P_UOM    = W_ITPO4-MEINS
                    P_UOM1   = 'KG'
                  IMPORTING
                    P_RETVAL = W_ITPO4-WTKG.
                TOTWT1 = W_ITPO4-WTKG * W_ITPO4-MENGE.
             IF W_ITPO4-BWART = '261'.
              W_ITPO5-I_QTY = W_ITPO5-I_QTY + TOTWT1.
             ELSEIF W_ITPO4-BWART = '101' OR W_ITPO4-BWART = '531'.
              W_ITPO5-I_QTY = W_ITPO5-I_QTY - TOTWT1.
             ENDIF.
           ENDLOOP.
             MODIFY T_ITPO5 INDEX SY-TABIX FROM W_ITPO5.
           MODIFY T_ITPO5 FROM W_ITPO5 TRANSPORTING AUFNR.
       ENDLOOP.
         WRITE: / 'PRD.NO       ITEM DESCRIPTION                               WIP(KGS)'.
        ULINE.
        LOOP AT T_ITPO5 INTO W_ITPO5.
          READ TABLE T_ITPO1 INTO W_ITPO1 WITH KEY AUFNR = W_ITPO5-AUFNR.
          SELECT SINGLE MAKTG FROM MAKT INTO W_ITPO5-ITEMDESC WHERE MATNR = W_ITPO1-MATNR.
          if sy-subrc = 0 .
          WRITE: / W_ITPO5-AUFNR,W_ITPO5-ITEMDESC,W_ITPO5-I_QTY.
          TOT_QTY = TOT_QTY + W_ITPO5-I_QTY.
          else.
          write 'Unsuccessful'.
          endif.
        ENDLOOP.
        ULINE.
        FORMAT COLOR 3.
        WRITE: / 'GTOTAL',55 TOT_QTY.
        FORMAT COLOR OFF.
    I want to have output that the production order is displayed along with the deficit quantity. but using this concept it shows only production order no. and qty 0.

  • Problem in triggering the code for CO02 User Exit

    Hi,
    I am using the code for the Tcode CO02 (User Exit) and i am facing a problem that when i am using the code as a normal program it is executing fine and displaying the pop up window and showing the data in it.
    But when i am using that code in the USER EXIT code it is not trigerring that pop up window.
    I am using the enhancement:-
    *PPCO0007 * - Exit when saving production order
    And the include in which i am writing the code is :-
    INCLUDE ZXCO1U06
    plzz provide me guidelines for solving this problem.

    hi ,
    i am using the following: -
    Enhancement No.  ->  PPCO0007 (Exit when saving production order)
    When i click on the enhancement the following is displayed:-
    Function exit  ->   *EXIT_SAPLCOZV_001 *
    When i double click the function exit  the code i had written in the following include:-
    INCLUDE ZXCO1U06
    plzz tell me whether i am doing it right or worng?

  • Problem while executing the code( that covert jpeg images to movie)

    http://java.sun.com/products/java-media/jmf/2.1.1/solutions/JpegImagesToMovie.html
    here is the code:
    * @(#)JpegImagesToMovie.java     1.3 01/03/13
    * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
    * Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
    * modify and redistribute this software in source and binary code form,
    * provided that i) this copyright notice and license appear on all copies of
    * the software; and ii) Licensee does not utilize the software in a manner
    * which is disparaging to Sun.
    * This software is provided "AS IS," without a warranty of any kind. ALL
    * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
    * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
    * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
    * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
    * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
    * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
    * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
    * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
    * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
    * POSSIBILITY OF SUCH DAMAGES.
    * This software is not designed or intended for use in on-line control of
    * aircraft, air traffic, aircraft navigation or aircraft communications; or in
    * the design, construction, operation or maintenance of any nuclear
    * facility. Licensee represents and warrants that it will not use or
    * redistribute the Software for such purposes.
    import java.io.*;
    import java.util.*;
    import java.awt.Dimension;
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.media.datasink.*;
    import javax.media.format.VideoFormat;
    * This program takes a list of JPEG image files and convert them into
    * a QuickTime movie.
    public class JpegImagesToMovie3 implements ControllerListener, DataSinkListener {
    public boolean doIt(int width, int height, int frameRate, Vector inFiles, MediaLocator outML) {
         ImageDataSource ids = new ImageDataSource(width, height, frameRate, inFiles);
         Processor p;
         try {
         System.err.println("- create processor for the image datasource ...");
         p = Manager.createProcessor(ids);
         } catch (Exception e) {
         System.err.println("Yikes! Cannot create a processor from the data source.");
         return false;
         p.addControllerListener(this);
         // Put the Processor into configured state so we can set
         // some processing options on the processor.
         p.configure();
         if (!waitForState(p, p.Configured)) {
         System.err.println("Failed to configure the processor.");
         return false;
         // Set the output content descriptor to QuickTime.
         p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.QUICKTIME));
         // Query for the processor for supported formats.
         // Then set it on the processor.
         TrackControl tcs[] = p.getTrackControls();
         Format f[] = tcs[0].getSupportedFormats();
         if (f == null || f.length <= 0) {
         System.err.println("The mux does not support the input format: " + tcs[0].getFormat());
         return false;
         tcs[0].setFormat(f[0]);
         System.err.println("Setting the track format to: " + f[0]);
         // We are done with programming the processor. Let's just
         // realize it.
         p.realize();
         if (!waitForState(p, p.Realized)) {
         System.err.println("Failed to realize the processor.");
         return false;
         // Now, we'll need to create a DataSink.
         DataSink dsink;
         if ((dsink = createDataSink(p, outML)) == null) {
         System.err.println("Failed to create a DataSink for the given output MediaLocator: " + outML);
         return false;
         dsink.addDataSinkListener(this);
         fileDone = false;
         System.err.println("start processing...");
         // OK, we can now start the actual transcoding.
         try {
         p.start();
         dsink.start();
         } catch (IOException e) {
         System.err.println("IO error during processing");
         return false;
         // Wait for EndOfStream event.
         waitForFileDone();
         // Cleanup.
         try {
         dsink.close();
         } catch (Exception e) {}
         p.removeControllerListener(this);
         System.err.println("...done processing.");
         return true;
    * Create the DataSink.
    DataSink createDataSink(Processor p, MediaLocator outML) {
         DataSource ds;
         if ((ds = p.getDataOutput()) == null) {
         System.err.println("Something is really wrong: the processor does not have an output DataSource");
         return null;
         DataSink dsink;
         try {
         System.err.println("- create DataSink for: " + outML);
         dsink = Manager.createDataSink(ds, outML);
         dsink.open();
         } catch (Exception e) {
         System.err.println("Cannot create the DataSink: " + e);
         return null;
         return dsink;
    Object waitSync = new Object();
    boolean stateTransitionOK = true;
    * Block until the processor has transitioned to the given state.
    * Return false if the transition failed.
    boolean waitForState(Processor p, int state) {
         synchronized (waitSync) {
         try {
              while (p.getState() < state && stateTransitionOK)
              waitSync.wait();
         } catch (Exception e) {}
         return stateTransitionOK;
    * Controller Listener.
    public void controllerUpdate(ControllerEvent evt) {
         if (evt instanceof ConfigureCompleteEvent ||
         evt instanceof RealizeCompleteEvent ||
         evt instanceof PrefetchCompleteEvent) {
         synchronized (waitSync) {
              stateTransitionOK = true;
              waitSync.notifyAll();
         } else if (evt instanceof ResourceUnavailableEvent) {
         synchronized (waitSync) {
              stateTransitionOK = false;
              waitSync.notifyAll();
         } else if (evt instanceof EndOfMediaEvent) {
         evt.getSourceController().stop();
         evt.getSourceController().close();
    Object waitFileSync = new Object();
    boolean fileDone = false;
    boolean fileSuccess = true;
    * Block until file writing is done.
    boolean waitForFileDone() {
         synchronized (waitFileSync) {
         try {
              while (!fileDone)
              waitFileSync.wait();
         } catch (Exception e) {}
         return fileSuccess;
    * Event handler for the file writer.
    public void dataSinkUpdate(DataSinkEvent evt) {
         if (evt instanceof EndOfStreamEvent) {
         synchronized (waitFileSync) {
              fileDone = true;
              waitFileSync.notifyAll();
         } else if (evt instanceof DataSinkErrorEvent) {
         synchronized (waitFileSync) {
              fileDone = true;
              fileSuccess = false;
              waitFileSync.notifyAll();
    public static void main(String args[]) {
         if (args.length == 0)
         prUsage();
         // Parse the arguments.
         int i = 0;
         int width = -1, height = -1, frameRate = 1;
         Vector inputFiles = new Vector();
         String outputURL = null;
         while (i < args.length) {
         if (args.equals("-w")) {
              i++;
              if (i >= args.length)
              prUsage();
              width = new Integer(args[i]).intValue();
         } else if (args[i].equals("-h")) {
              i++;
              if (i >= args.length)
              prUsage();
              height = new Integer(args[i]).intValue();
         } else if (args[i].equals("-f")) {
              i++;
              if (i >= args.length)
              prUsage();
              frameRate = new Integer(args[i]).intValue();
         } else if (args[i].equals("-o")) {
              i++;
              if (i >= args.length)
              prUsage();
              outputURL = args[i];
         } else {
              inputFiles.addElement(args[i]);
         i++;
         if (outputURL == null || inputFiles.size() == 0)
         prUsage();
         // Check for output file extension.
         if (!outputURL.endsWith(".mov") && !outputURL.endsWith(".MOV")) {
         System.err.println("The output file extension should end with a .mov extension");
         prUsage();
         if (width < 0 || height < 0) {
         System.err.println("Please specify the correct image size.");
         prUsage();
         // Check the frame rate.
         if (frameRate < 1)
         frameRate = 1;
         // Generate the output media locators.
         MediaLocator oml;
         if ((oml = createMediaLocator(outputURL)) == null) {
         System.err.println("Cannot build media locator from: " + outputURL);
         System.exit(0);
         JpegImagesToMovie3 imageToMovie3 = new JpegImagesToMovie3();
         imageToMovie3.doIt(width, height, frameRate, inputFiles, oml);
         System.exit(0);
    static void prUsage() {
         System.err.println("Usage: java JpegImagesToMovie -w <width> -h <height> -f <frame rate> -o <output URL> <input JPEG file 1> <input JPEG file 2> ...");
         System.exit(-1);
    * Create a media locator from the given string.
    static MediaLocator createMediaLocator(String url) {
         MediaLocator ml;
         if (url.indexOf(":") > 0 && (ml = new MediaLocator(url)) != null)
         return ml;
         if (url.startsWith(File.separator)) {
         if ((ml = new MediaLocator("file:" + url)) != null)
              return ml;
         } else {
         String file = "file:" + System.getProperty("user.dir") + File.separator + url;
         if ((ml = new MediaLocator(file)) != null)
              return ml;
         return null;
    // Inner classes.
    * A DataSource to read from a list of JPEG image files and
    * turn that into a stream of JMF buffers.
    * The DataSource is not seekable or positionable.
    class ImageDataSource extends PullBufferDataSource {
         ImageSourceStream streams[];
         ImageDataSource(int width, int height, int frameRate, Vector images) {
         streams = new ImageSourceStream[1];
         streams[0] = new ImageSourceStream(width, height, frameRate, images);
         public void setLocator(MediaLocator source) {
         public MediaLocator getLocator() {
         return null;
         * Content type is of RAW since we are sending buffers of video
         * frames without a container format.
         public String getContentType() {
         return ContentDescriptor.RAW;
         public void connect() {
         public void disconnect() {
         public void start() {
         public void stop() {
         * Return the ImageSourceStreams.
         public PullBufferStream[] getStreams() {
         return streams;
         * We could have derived the duration from the number of
         * frames and frame rate. But for the purpose of this program,
         * it's not necessary.
         public Time getDuration() {
         return DURATION_UNKNOWN;
         public Object[] getControls() {
         return new Object[0];
         public Object getControl(String type) {
         return null;
    * The source stream to go along with ImageDataSource.
    class ImageSourceStream implements PullBufferStream {
         Vector images;
         int width, height;
         VideoFormat format;
         int nextImage = 0;     // index of the next image to be read.
         boolean ended = false;
         public ImageSourceStream(int width, int height, int frameRate, Vector images) {
         this.width = width;
         this.height = height;
         this.images = images;
         format = new VideoFormat(VideoFormat.JPEG,
                        new Dimension(width, height),
                        Format.NOT_SPECIFIED,
                        Format.byteArray,
                        (float)frameRate);
         * We should never need to block assuming data are read from files.
         public boolean willReadBlock() {
         return false;
         * This is called from the Processor to read a frame worth
         * of video data.
         public void read(Buffer buf) throws IOException {
         // Check if we've finished all the frames.
         if (nextImage >= images.size()) {
              // We are done. Set EndOfMedia.
              System.err.println("Done reading all images.");
              buf.setEOM(true);
              buf.setOffset(0);
              buf.setLength(0);
              ended = true;
              return;
         String imageFile = (String)images.elementAt(nextImage);
         nextImage++;
         System.err.println(" - reading image file: " + imageFile);
         // Open a random access file for the next image.
         RandomAccessFile raFile;
         raFile = new RandomAccessFile(imageFile, "r");
         byte data[] = null;
         // Check the input buffer type & size.
         if (buf.getData() instanceof byte[])
              data = (byte[])buf.getData();
         // Check to see the given buffer is big enough for the frame.
         if (data == null || data.length < raFile.length()) {
              data = new byte[(int)raFile.length()];
              buf.setData(data);
         // Read the entire JPEG image from the file.
         raFile.readFully(data, 0, (int)raFile.length());
         System.err.println(" read " + raFile.length() + " bytes.");
         buf.setOffset(0);
         buf.setLength((int)raFile.length());
         buf.setFormat(format);
         buf.setFlags(buf.getFlags() | buf.FLAG_KEY_FRAME);
         // Close the random access file.
         raFile.close();
         * Return the format of each video frame. That will be JPEG.
         public Format getFormat() {
         return format;
         public ContentDescriptor getContentDescriptor() {
         return new ContentDescriptor(ContentDescriptor.RAW);
         public long getContentLength() {
         return 0;
         public boolean endOfStream() {
         return ended;
         public Object[] getControls() {
         return new Object[0];
         public Object getControl(String type) {
         return null;
    on executing with the command:
    java JpegImagesToMovie -w <width> -h <height> -f <frame rate per sec.> -o <output URL> <input JPEG file 1> <input JPEG file 2> ...
    comes this......
    Exception in thread"JMF thread:SendEventQueue:com.sun.media.processor.unknown Handler" java.lang.NullPointerException"
    plz help

    Don't forget to use the "Code Formatting Tags",
    see http://forum.java.sun.com/help.jspa?sec=formatting,
    so the posted code retains its original formatting.

  • SAX problem(plz see the code given)

    hi all,
    i am using SAX parser for validating my xml file against the dtd,i am getting some errors that i am not able to make out.cud u plz help me.i am sending u my files.
    ------------------------java file------------------------------------
    import java.io.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.SAXParserFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    public class Echo extends DefaultHandler
    public static void main(String argv[]){
    if (argv.length != 1) {
    System.err.println("Usage: cmd filename");
    System.exit(1);
    // Use an instance of ourselves as the SAX event handler
    //DefaultHandler handler=new DefaultHandler();
    Echo handler=new Echo();
    // Use the default (non-validating) parser
    SAXParserFactory factory = SAXParserFactory.newInstance();
    factory.setValidating(true);
    try {
    // Set up output stream
    out = new OutputStreamWriter(System.out, "UTF8");
    // Parse the input
    SAXParser saxParser = factory.newSAXParser();
    saxParser.parse( new File(argv[0]), handler );
    catch (SAXParseException spe) {
    // Error generated by the parser
    System.out.println("\n** Parsing error"
    + ", line " + spe.getLineNumber()
    + ", uri " + spe.getSystemId());
    System.out.println(" " + spe.getMessage() );
    }catch (Throwable t){
    t.printStackTrace();
    System.exit(0);
    static private Writer out;
    public void startDocument()
    throws SAXException{
    emit("<?xml version='1.0' encoding='UTF-8'?>");
    nl();
    public void endDocument()
    throws SAXException{
    try {
    nl();
    out.flush();
    }catch (IOException e) {
    throw new SAXException("I/O error", e);
    public void startElement(String namespaceURI,
    String sName, // simple name (localName)
    String qName, // qualified name
    Attributes attrs)
    throws SAXException
    String eName = sName; // element name
    if ("".equals(eName)) eName = qName; // namespaceAware = false
    emit("<"+eName);
    if (attrs != null) {
    for (int i = 0; i < attrs.getLength(); i++) {
    String aName = attrs.getLocalName(i); // Attr name
    if ("".equals(aName)) aName = attrs.getQName(i);
    emit(" ");
    emit(aName+"=\""+attrs.getValue(i)+"\"");
    emit(">");
    public void endElement(String namespaceURI,
    String sName, // simple name
    String qName // qualified name
    throws SAXException
    emit("</"+qName+">");
    public void characters(char buf[], int offset, int len)
    throws SAXException
    String s = new String(buf, offset, len);
    emit(s);
    public void ignorableWhitespace(char buf[], int offset, int Len)
    throws SAXException
    nl();
    //emit("IGNORABLE");
    private void emit(String s)
    throws SAXException
    try {
    out.write(s);
    out.flush();
    } catch (IOException e) {
    throw new SAXException("I/O error", e);
    private void nl()
    throws SAXException
    String lineEnd = System.getProperty("line.separator");
    try {
    out.write(lineEnd);
    } catch (IOException e) {
    throw new SAXException("I/O error", e);
    public void error(SAXParseException e)
    throws SAXParseException
    throw e;
    public void warning(SAXParseException e)throws SAXParseException{
    System.out.println("WARNING : Line Number:- "+e.getLineNumber());
    System.out.println("WARNING : Column Number:- "+e.getColumnNumber());
    System.out.println("WARNING : System ID:- "+e.getSystemId());
    System.out.println("WARNING : Public Number:- "+e.getPublicId());
    --------------------------xml file------------------------------------
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE slideshow SYSTEM "echo.dtd">
    <!-- A SAMPLE set of slides -->
    <slideshow
    title="Sample Slide Show"
    date="Date of publication"
    author="Yours Truly"
    >
    <![CDATA[Digram : frobmorten <------------ fuznaten
    | <3> ^
    | <1> | <1> = fozzle
    V | <2> = framboze
    Staten+ <3> = frenzle
    <2>
    ]]>
    <!-- TITLE SLIDE -->
    <slide type="all">
    <image src="my.gif" alt="this is my pic" type="image/gif"/>
    <title>Wake up to WonderWidgets!</title>
    </slide>
    <!-- OVERVIEW -->
    <slide type="all">
    <title>Overview</title>
    <item>WonderWidgets are great</item>
    <item/>
    <item>Who buys WonderWidgets</item>
    </slide>
    <slide type="all">
    <title>Overview</title>
    <item>Who buys WonderWidgets</item>
    </slide>
    </slideshow>
    -----------------------------dtd file---------------------------------
    <!ELEMENT slideshow (slide+)>
    <!ATTLIST slideshow
    title CDATA #IMPLIED
    date CDATA #IMPLIED
    author CDATA #IMPLIED
    >
    <!ELEMENT slide (image?,title, item*)>
    <!ATTLIST slide type CDATA #IMPLIED>
    <!ELEMENT title (#PCDATA)>
    <!ELEMENT item (#PCDATA | item)* >
    <!ELEMENT image EMPTY>
    <!ATTLIST image
    alt CDATA #IMPLIED
    src CDATA #REQUIRED
    type CDATA "image/gif"
    >
    -----------------------ERROR I AM GETTING IS--------------------------
    <?xml version='1.0' encoding='UTF-8'?>
    <slideshow title="Sample Slide Show" date="Date of publication" author="Yours Tr
    uly">
    Digram : frobmorten <------------ fuznaten
    | <3> ^
    | <1> | <1> = fozzle
    V | <2> = framboze
    Staten+ <3> = frenzle
    <2>
    <slide type="all">
    <image src="my.gif" alt="this is my pic" type="image/gif"></image>
    <title>Wake up to WonderWidgets!</title>
    </slide>
    <slide type="all">
    <title>Overview</title>
    <item>WonderWidgets are great</item>
    <item></item>
    <item>Who buys WonderWidgets</item>
    </slide>
    <slide type="all">
    <title>Overview</title>
    <item>Who buys WonderWidgets</item>
    </slide>
    org.xml.sax.SAXException: The content of element type "slideshow" must m
    atch "(slide)+".
    at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.j
    ava:979)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at Echo.main(Echo.java:28)
    with my lot efforts i am not able to make out where i am wrong,plz do have a look on the codes.
    thanx in advance
    best regards
    anshul

    Hi i have consulted the XML spec and it is not possible to have a CDATA section as element content. A element declaration can have only content that is empty, ANY (i.e. can include any other declared elements in DTD), mixed (i.e. can contain PCDATA or child elements, or child elements. An element cannot include any character data which CDATA represents. i.e it is not valid to do <!ELEMENT slideshow CDATA>
    The CDATA can only be used with an attribute declaration. Regard CDATA as a type definition for any attribute variables.
    So what do i suggest. You could declare a separate element which has an attribute for the CDATA section
    <!ELEMENT input (Name)>
    <!ATTLIST input instructions CDATA #REQUIRED>
    hope this helps.

  • Don't understand the code, about boucing ball

    this is a program intends to create a ball and let the ball bouncing until it reaches the right side of the console. It's in the stanford cs106a course.
    I don't the part:
    // assume bounce will move ball an amount above the
    // floor equal to the amount it would have dropped
    // below the floor.
    double diff = ball.getY() - (getHeight() - DIAM_BALL);
    ball.move(0, -2 * diff);does the ball actually reaches the bottom of the console, and them let the ball moves back upwards with the distance 2diff?
    thanks a lot!
    beside, I'm new in this forum, how to let the code show in the code mode? Cause it seems hard to read right now.
    Here is the whole program:
    * File: BouncingBall.java
    * This program graphically simulates a bouncing ball.
    import acm.program.*;
    import acm.graphics.*;
    public class BouncingBall extends GraphicsProgram {
    /** Size (diameter) of the ball */
    private static final int DIAM_BALL = 30;
    /** Amount Y velocity is increased each cycle as a
    * result of gravity */
    private static final double GRAVITY = 3;
    /** Animation delay or pause time between ball moves */
    private static final int DELAY = 50;
    /** Initial X and Y location of ball */
    private static final double X_START = DIAM_BALL / 2;
    private static final double Y_START = 100;
    /** X Velocity */
    private static final double X_VEL = 5;
    /** Amount Y Velocity is reduced when it bounces */
    private static final double BOUNCE_REDUCE = 0.9;
    /** Starting X and Y Velocties */
    private double xVel = X_VEL;
    private double yVel = 0.0;
    /* private instance variable */
    private GOval ball;
    public void run() {
    setup();
    // Simulation ends when ball goes off right hand
    // end of screen
    while (ball.getX() < getWidth()) {
    moveBall();
    checkForCollision();
    pause(DELAY);
    /** Create and place ball. */
    private void setup() {
    ball = new GOval(X_START, Y_START, DIAM_BALL, DIAM_BALL);
    ball.setFilled(true);
    add(ball);
    /** Update and move ball */
    private void moveBall() {
    // increase yVelocity due to gravity on each cycle
    yVel += GRAVITY;
    ball.move(xVel,yVel);
    /** Determine if collision with floor, update velocities
    * and location as appropriate. */
    private void checkForCollision() {
    // determine if ball has dropped below the floor
    if (ball.getY() > getHeight() - DIAM_BALL) {
    // change ball's Y velocity to now bounce upwards
    yVel = -yVel * BOUNCE_REDUCE;
    // assume bounce will move ball an amount above the
    // floor equal to the amount it would have dropped
    // below the floor.
    double diff = ball.getY() - (getHeight() - DIAM_BALL);
    ball.move(0, -2 * diff);
    }Edited by: 967521 on 2012-10-24 下午7:11
    Edited by: 967521 on 2012-10-25 上午7:43
    Edited by: Melissa13 on 2012-10-26 上午7:21

    Put your code between tags and it'll show correctly (you should edit the post now).                                                                                                                                                                                   

  • Problem in decrypting the code

    I have written the following code for decryption
    String inputString = "5B5E0A35FBD295AB923D872BC1CBCF45307FACDA881978ACBE65C21FDF63658F61B48EE3C99BBDB0E51B9F1498289305526D82EA2D52D681993E3AD499F2887E82D35CC9CD9EF436B8A9E587CC3E2A50CABFAB39824632F7ECDCDFAE7AC0A7BEAD0767D83D3E3E0BFAAA3F053E5678901ABCDE1B8581310F6513D0547290F6C9E";
    String inputKey = "243fbde01df0684ed5b49f1035137225fcca9ba960e5e979e9cb8bee345f2f258678901acbd05c4f084c0373d3300432b186e03c56bd93bacb4ba634ad2b407b18f2985497eaa1e635152d7e9814ee469a94115109841758f67e61885d412dcc47efd670e156700e6df84dcadd41bc0588a8b4babcde54387d742e96308d66a1";
    String labelString = "0000000819";
    byte [] input = hexstringToByteArray(inputString);
    byte[] keyBytes = hexstringToByteArray(inputKey);
    byte[] label = padWithZeros(hexstringToByteArray(labelString));
    Security.addProvider(new BouncyCastleProvider());
    BigInteger privateKeyInt = new BigInteger(keyBytes);
    Cipher bcCipher = Cipher.getInstance("RSA/NONE/OAEPWithSHA1AndMGF1Padding", "BC");
    OAEPParameterSpec defaultOaepSpec = OAEPParameterSpec.DEFAULT;
    OAEPParameterSpec oaepSpec = new OAEPParameterSpec(defaultOaepSpec.getDigestAlgorithm(),
    defaultOaepSpec.getMGFAlgorithm(),
    defaultOaepSpec.getMGFParameters(),
    new PSource.PSpecified(label));
    java.security.KeyFactory keyFactory = java.security.KeyFactory.getInstance("RSA", "BC");
    java.security.Key bcPrivateKey = keyFactory.generatePrivate((new RSAPrivateKeySpec(privateKeyInt,new BigInteger("3"))));
    // SecureRandom = new SecureRandom()
    bcCipher.init(Cipher.DECRYPT_MODE, bcPrivateKey,oaepSpec);
    byte[] em = bcCipher.doFinal(input);
    System.out.println(byteArrayToHexString(em));
    Output :-
    Exception in thread "main" java.lang.IllegalArgumentException: unknown parameter type.
         at org.bouncycastle.jce.provider.JCERSACipher.engineInit(JCERSACipher.java:247)
         at javax.crypto.Cipher.init(DashoA13*..)
         at javax.crypto.Cipher.init(DashoA13*..)
         at PublicMain.main(PublicMain.java:44)
    I have to use OEAP padding
    pls help me solve this problem thanks in advance

    I have written this code for decryption and tried the earlier problem by resolving proper jar file
    String inputString = "5B5E0A35FBD295AB923D872BC1CBCF45307FACDA88598153052DC21FDF6365345678AEBCC99BBDB0E51B9F1498289305526D82EA2D52D681993E3AD499F2887E82D35CC9CD9EF436B8A9E587CC3E2A50CABFAB39824632F7ECDCDFAE7AC0A7BEAD0767D83D3E3E0BFAAA3F";
    /* private key*/String inputKey = "243fbde01df0684ed5b49f1035137225fcca9ba960e5e979e9cb8bee345f2f258344795904605c4f084c037456cabefc4186e03c56bd93bacb4ba634ad2b407b18f2985497eaa1e635152d7e9814ee469a94115109841758f67e61885d412dcc47efd670e156700e6df84dcadd41bc0588a8b4b19bb509409d742e96308d66a1";
    String labelString = "40156ca44f22db70b7f852eec9d57ce10000000913"; //Unencrypted header may change
    String publicKey = "9e4004e8ab15bad1ec47059b86a50f5f46334da008fded08b7fe300d1a14a8f926d8abcde13456786282335c03eee04559861043b8a1f7db4ee79f2a17a8aff278dee0ebc997a48668fb99ec6d901b3e5723318bbdc0586f05196b4603b36b2d8eb62b52395684b26d50bb6df19bc8b72bb7eec359a68651842e739e52cbc05027";
    byte [] input = hexstringToByteArray(inputString);
    byte[] keyBytes = hexstringToByteArray(inputKey);
    byte[] publicKeyBytes = hexstringToByteArray(publicKey);
    byte[] label = hexstringToByteArray(labelString);
    System.out.println(input.length);
    Security.addProvider(new BouncyCastleProvider());
    BigInteger privateKeyInt = new BigInteger(keyBytes);
    BigInteger publicKeyInt = new BigInteger(publicKeyBytes);
    Cipher bcCipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA1AndMGF1Padding", "BC");
    OAEPParameterSpec defaultOaepSpec = OAEPParameterSpec.DEFAULT;
    OAEPParameterSpec oaepSpec = new OAEPParameterSpec(defaultOaepSpec.getDigestAlgorithm(),
    defaultOaepSpec.getMGFAlgorithm(),
    defaultOaepSpec.getMGFParameters(),
    new PSource.PSpecified(label));
    java.security.KeyFactory keyFactory = java.security.KeyFactory.getInstance("RSA", "BC");
    java.security.Key bcPrivateKey = keyFactory.generatePrivate((new RSAPrivateKeySpec(publicKeyInt,privateKeyInt)));
    // SecureRandom = new SecureRandom()
    /* PrivateKey p = keyFactory.generatePrivate((new RSAPrivateKeySpec(publicKeyInt,privateKeyInt)));
    System.out.println(p.toString());*/
    bcCipher.init(Cipher.DECRYPT_MODE, bcPrivateKey,oaepSpec);
    /*RSAEngine rsa = new RSAEngine();
    OAEPEncoding a = new OAEPEncoding(rsa,new SHA1Digest(),label);
    rsa.init(false, (CipherParameters) p);
    byte[] output = a.decodeBlock(input, 0, input.length); */
    byte[] em = bcCipher.doFinal(input);
    System.out.println(byteArrayToHexString(em));
    But now it is giving the following exception :
    Exception in thread "main" org.bouncycastle.crypto.DataLengthException: input too large for RSA cipher.
         at org.bouncycastle.crypto.engines.RSACoreEngine.convertInput(Unknown Source)
         at org.bouncycastle.crypto.engines.RSABlindedEngine.processBlock(Unknown Source)
         at org.bouncycastle.crypto.encodings.OAEPEncoding.decodeBlock(Unknown Source)
         at org.bouncycastle.crypto.encodings.OAEPEncoding.processBlock(Unknown Source)
         at org.bouncycastle.jce.provider.JCERSACipher.engineDoFinal(Unknown Source)
         at javax.crypto.Cipher.doFinal(DashoA13*..)
         at PublicMain.main(PublicMain.java:55)
    Please help me correcting the input length
    Thanks in advance

  • Problem with printing the code

    Hi ,
    I m having problems in printing my source code . I use emacs as a text editor. Is there any settings that need to be made before printing . Because when i try to print it didn't print my whole code. And when i try to print it from some where else it gives me error saying printer not found on LPT1. Is it something about the port or what. Plz tell me about it ASAP , because i need to submit my project.
    Bye
    Waiting for reply

    Hello gotchya11,
    If you are using a Unix environment, you can use the "lp" print command to send a document to printer. The "-d <device name>" flag is where you specify which printer to sent the document to. You can do a
    "man lp"
    from the command line to get more info on how to print. Perhaps you need to specify the destination where the file is to be printed. What you can do if you need to print the doc is to just copy and paste your code into a text editor and print from some other program if you are running Solaris CDE or Windows.
    Hope this helps,
    Ming
    Developer Technical Support
    http://www.sun.com/developers/support

  • Help needed in understanding the Java code.

    Hi All,
    I have recently started learning the Java language. I came across this example and had a problem in understanding the output of the program. I could follow that if the continue statement is present in the below program the output is "Found 9 p's in the string" . But if the continue statement is removed I could not understand why the output would be "Found 35 p's in the string" .Is it because of the spaces and characters other than p... (eter ier icked a eck of ickled eers)
    Example-----------------------
    The continue statement skips the current iteration of a for, while , or do-while loop. The unlabeled form skips to the end of the innermost loop's body and evaluates the boolean expression that controls the loop. The following program, ContinueDemo , steps through a String, counting the occurences of the letter "p". If the current character is not a p, the continue statement skips the rest of the loop and proceeds to the next character. If it is a "p", the program increments the letter count.
    class ContinueDemo {
    public static void main(String[] args) {
    String searchMe
    = "peter piper picked a " +
    "peck of pickled peppers";
    int max = searchMe.length();
    int numPs = 0;
    for (int i = 0; i < max; i++) {
    // interested only in p's
    if (searchMe.charAt(i) != 'p')
    continue;
    // process p's
    numPs++;
    System.out.println("Found " +
    numPs + " p's in the string.");
    Here is the output of this program:
    Found 9 p's in the string.
    To see this effect more clearly, try removing the continue statement and recompiling. When you run the program again, the count will be wrong, saying that it found 35 p's instead of 9.

    The answer is already in your example - "The unlabeled form skips to the end of the innermost loop's body and evaluates the boolean expression that controls the loop."
    It unloads the current loop iteration when condition is matching. Loop is again starting from boolean expression inside loop declaration.
    Java Programming - java forum

  • Help in understanding the MouseRotate Source code.(Source code attached)

    Hi
    I am trying to understand the code here in the class below. The description says MouseTranslate is a Java3D behavior object that lets users control the
    translation (X, Y) of an object via a mouse drag motion with the third mouse button (alt-click on PC). See MouseRotate for similar usage info I was able to locate the isAltDown() and isMetaDown conditions. But could not figure out where is the condition (evt.getButton() == MouseEvent.Button1) is being checked.
    I have spent too much time on this, any help is greatly appreciated.
    Thanking you
    Venkat
    package com.sun.j3d.utils.behaviors.mouse;
    * MouseTranslate is a Java3D behavior object that lets users control the
    * translation (X, Y) of an object via a mouse drag motion with the third
    * mouse button (alt-click on PC). See MouseRotate for similar usage info.
    public class MouseTranslate extends MouseBehavior {
        double x_factor = .02;
        double y_factor = .02;
        Vector3d translation = new Vector3d();
        private MouseBehaviorCallback callback = null;
         * Creates a mouse translate behavior given the transform group.
         * @param transformGroup The transformGroup to operate on.
        public MouseTranslate(TransformGroup transformGroup) {
         super(transformGroup);
         * Creates a default translate behavior.
        public MouseTranslate(){
         super(0);
         * Creates a translate behavior.
         * Note that this behavior still needs a transform
         * group to work on (use setTransformGroup(tg)) and
         * the transform group must add this behavior.
         * @param flags
        public MouseTranslate(int flags) {
         super(flags);
         * Creates a translate behavior that uses AWT listeners and behavior
         * posts rather than WakeupOnAWTEvent.  The behavior is added to the
         * specified Component. A null component can be passed to specify
         * the behavior should use listeners.  Components can then be added
         * to the behavior with the addListener(Component c) method.
         * @param c The Component to add the MouseListener
         * and MouseMotionListener to.
         * @since Java 3D 1.2.1
        public MouseTranslate(Component c) {
         super(c, 0);
         * Creates a translate behavior that uses AWT listeners and behavior
         * posts rather than WakeupOnAWTEvent.  The behaviors is added to
         * the specified Component and works on the given TransformGroup.
         * A null component can be passed to specify the behavior should use
         * listeners.  Components can then be added to the behavior with the
         * addListener(Component c) method.
         * @param c The Component to add the MouseListener and
         * MouseMotionListener to.
         * @param transformGroup The TransformGroup to operate on.
         * @since Java 3D 1.2.1
        public MouseTranslate(Component c, TransformGroup transformGroup) {
         super(c, transformGroup);
         * Creates a translate behavior that uses AWT listeners and behavior
         * posts rather than WakeupOnAWTEvent.  The behavior is added to the
         * specified Component.  A null component can be passed to specify
         * the behavior should use listeners.  Components can then be added to
         * the behavior with the addListener(Component c) method.
         * Note that this behavior still needs a transform
         * group to work on (use setTransformGroup(tg)) and the transform
         * group must add this behavior.
         * @param flags interesting flags (wakeup conditions).
         * @since Java 3D 1.2.1
        public MouseTranslate(Component c, int flags) {
         super(c, flags);
        }Rest of the code follows in the next post

        public void initialize() {
         super.initialize();
         if ((flags & INVERT_INPUT) == INVERT_INPUT) {
             invert = true;
             x_factor *= -1;
             y_factor *= -1;
         * Return the x-axis movement multipler.
        public double getXFactor() {
         return x_factor;
         * Return the y-axis movement multipler.
        public double getYFactor() {
         return y_factor;
         * Set the x-axis amd y-axis movement multipler with factor.
        public void setFactor( double factor) {
         x_factor = y_factor = factor;
         * Set the x-axis amd y-axis movement multipler with xFactor and yFactor
         * respectively.
        public void setFactor( double xFactor, double yFactor) {
         x_factor = xFactor;
         y_factor = yFactor;   
        public void processStimulus (Enumeration criteria) {
         WakeupCriterion wakeup;
         AWTEvent[] events;
         MouseEvent evt;
    //      int id;
    //      int dx, dy;
         while (criteria.hasMoreElements()) {
             wakeup = (WakeupCriterion) criteria.nextElement();
             if (wakeup instanceof WakeupOnAWTEvent) {
              events = ((WakeupOnAWTEvent)wakeup).getAWTEvent();
              if (events.length > 0) {
                  evt = (MouseEvent) events[events.length-1];
                  doProcess(evt);
             else if (wakeup instanceof WakeupOnBehaviorPost) {
              while (true) {
                  // access to the queue must be synchronized
                  synchronized (mouseq) {
                   if (mouseq.isEmpty()) break;
                   evt = (MouseEvent)mouseq.remove(0);
                   // consolodate MOUSE_DRAG events
                   while ((evt.getID() == MouseEvent.MOUSE_DRAGGED) &&
                          !mouseq.isEmpty() &&
                          (((MouseEvent)mouseq.get(0)).getID() ==
                        MouseEvent.MOUSE_DRAGGED)) {
                       evt = (MouseEvent)mouseq.remove(0);
                  doProcess(evt);
         wakeupOn(mouseCriterion);
        void doProcess(MouseEvent evt) {
         int id;
         int dx, dy;
         processMouseEvent(evt);
         if (((buttonPress)&&((flags & MANUAL_WAKEUP) == 0)) ||
             ((wakeUp)&&((flags & MANUAL_WAKEUP) != 0))){
             id = evt.getID();
    *         if ((id == MouseEvent.MOUSE_DRAGGED) && !evt.isAltDown() && evt.isMetaDown()) { *
              x = evt.getX();
              y = evt.getY();
              dx = x - x_last;
              dy = y - y_last;
              if ((!reset) && ((Math.abs(dy) < 50) && (Math.abs(dx) < 50))) {
                  //System.out.println("dx " + dx + " dy " + dy);
                  transformGroup.getTransform(currXform);
                  translation.x = dx*x_factor;
                  translation.y = -dy*y_factor;
                  transformX.set(translation);
                  if (invert) {
                   currXform.mul(currXform, transformX);
                  } else {
                   currXform.mul(transformX, currXform);
                  transformGroup.setTransform(currXform);
                  transformChanged( currXform );
                  if (callback!=null)
                   callback.transformChanged( MouseBehaviorCallback.TRANSLATE,
                                     currXform );
              else {
                  reset = false;
              x_last = x;
              y_last = y;
             else if (id == MouseEvent.MOUSE_PRESSED) {
              x_last = evt.getX();
              y_last = evt.getY();
         * Users can overload this method  which is called every time
         * the Behavior updates the transform
         * Default implementation does nothing
        public void transformChanged( Transform3D transform ) {
         * The transformChanged method in the callback class will
         * be called every time the transform is updated
        public void setupCallback( MouseBehaviorCallback callback ) {
         this.callback = callback;
    }

Maybe you are looking for

  • How to display swf in full screen mode and how to redirect to a url

    Hi, I have 2 questions : Question 1 - I have a flash swf file and I want to display it in the browser in full mode meaning it should fit the browser, I have tried adding fscommand("fullscreen", "true"); in the first frame of a lyaer but it does not w

  • How Do I Open a .BDB2 file?

    Hello All I have downloaded file (50547BC - SharePoint 2010 Site Collection and Site Administration) from the Microsoft Courseware Marketplace. The option stated that it was a .PDF file. However, when it was eventually downloaded it turned out to be

  • Regular expression in exact match

    Hi, Please let me know how do i find an exact match within a string using Regular expression, var str1:String = "s1 + s2 + sf_s1 + s1 - s2"; var replceableStr:String = "s1"; var reggular:RegExp = /\s+(s1)\s+/gi; var str2:String; str2 = str1.replace(r

  • File Adapter. How to set file creation mode (ex. 666)?

    Hi All I'm using Outbound File Adapter to write files. Adapter creates the files whit access mode 622 (rw-r--r--). My requirement is to have files in 666 access mode. How can i achieve that? Thanks, Oleg.

  • Doubt regarding RFC

    Hi All , I know RFC is used for communications between two independent SAP systems, or for communications between an SAP system and a non-SAP system, such as an external application. But It can also be used for communications between modules on the s