Implementation class memeber variables are null
I have faced this before and I never could figure it out and now I really need to know why this happens. Please see the following pseudo code:
// Parent
public class MyAbstractPanel extends JPanel{
public MyAbstractPanel{
try{
jbInit();
}catch(Exception e){
// Take measure
public abstract jbInit() throws Exception;
// Implementor
public class MyImplementor extends MyAbstractPanel{
public JTextArea textArea = new JTextArea();
public jbInit() throws Exception {
// do stuff
textArea .setText("Test Message"); <<------- THROWS NULL POINTER EXCEPTION HERE
// Factory
public class FrameFactory{
private static myImplementor;
public static MyAbstractFrame getMyplementor(){
if (myImplementor == null){
myImplementor = new MyImplementor();
return myImplementor;
// Client implementation
public static void main(String[] args) throws Exception {
JFrame frame = ....
frame.add(FrameFactory.getMyplementor());
}If I initialize the textArea inside the jbInit() method in MyImplementor class then it fixes the issue but if I put initialize on accessor level, it never get initialized. Is it JDK bug or there something I have missed on inheritance rule.
I am currently trying to fix and existing application it's will be a real big job for me to move all the initialize expression from the header to jbInit() or in any initialize method.Any idea why?
This is the wrong forum, but I'll answer your question anyway.
There is a default constructor for MyImplementor that is compiler generated. It looks like this:
public MyImplementor() {
super();
textArea = new JTextArea();
}MyAbstractPanel() calls jbInit(), which you've overriden in MyImplementor.
See the problem?
As a trivia note, C++ handles this by not dispatching method calls virtually during object construction. Less flexible, but safer.
God bless,
-Toby Reyelts
Similar Messages
-
Values from a jsp page are null in Action Class
hi, i am working on an application...i have a jsp page with several inputs (type=text) and when a submit the form to to my action class all values received are null.
Here is a part of code:
the jsp file: letter.jsp
<form target="_self" action="/Test/editLetter.do" name="letterTF">
<table>
<tbody>
<tr>
<th>
No of objects
</th>
<th>
Weight
</th>
<th>
Description
</th>
</tr>
<tr>
<td>
Package
<input name="package" id="package" type="checkbox">
</td>
<td>
<input name="package_No" type="text" value="<%=currentBean.getPackageNo() %>"> <%-- from session...have to edit some date from a data base--%>
</td>
<td>
<input name="package_weight" type="text" value="<%=currentBean.geWeight()%>">
</td>
<td>
<input name="description" type="text" value="<%=currentBean.Description()%>"
</td>
</tr>
<tr>
..................................................... <%-- It's a big form --%>
</tr>
<tr>
<input type="submit" name="send" value="Send">
</tr>
</tbody>
</table>
</form>
struts-config.xml:
<form-bean
name="letterTF"
type="Test.LetterForm">
</form-bean>
<action path="/editLetter"
type="Test.LetterAction"
name="scrisoareTF"
input="/letter.jsp"
scope="request"
validate="false">
<forward name="success" path="/index_orders.jsp"/>
</action>
The ActionForm class:
public class LetterForm extends ActionForm{
private String package;
private String package_No;
private String package_weight;
public void setPackage(String package){
this.package = package
public String getPackage(){
return package;
The action class:
public class LetterAction extends Action{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception{
String package;
String package_No;
String package_weight;
LetterForm letterTF = (LetterForm) form;
package = letterTF.getPackage();
package_No = letterTF.getPackageNo()
package_weight = letterTF.getPackageWeight();
System.out.println("Package: "+package);//it will print Package: null
System.out.println("Weight: "+weight);//it will print Weight: null
System.out.println("Description "+description) //it will print Description: null
As I observed its not making the set methods from LetterForm.java
I am dealing with this bug for a couple of days an i didn't managed to break it. If anyone has an idea would he be so kind to share it with me.
Thanks in advanced,
DavidBasically your form beans are the place holders or containers for your jsp attributes. It has to be mapped in such a way that when the form is submitted the user entered values get populated on to your form bean.
For Eg:
JSP
<html:form action="accountSearchResults.do">
<html:text property="myName" size="15"/>
//USE ONLY STRUTS TAGS IN JSP's. U CAN REFER TO
//http://struts.apache.org/1.x/struts-taglib/tlddoc/index.html
//THE PROPERTY NAME "myName" SHOULD BE DEFINED IN
//YOUR FORMBEAN WITH getMyName AND setMyName
//METHODS DEFINED
</html:form>
struts-config.xml
<form-beans>
<form-bean name="addEditAccount" type="org.apache.struts.validator.LazyValidatorForm">
<form-property name="myName" type="java.lang.String">
</form-property>
</form-bean>
</form-beans>
<action-mappings>
<action path="/accountSearchResults" type="com.zzz.AccountSearchResultAction" name="addEditAccount" scope="request">
<forward name="success" path="NextPage.jsp">
</forward>
</action>
</action-mappings>
Action Class
Since we have defined the form bean as a lazyvalidator instance you can use:
PropertyUtils.copyProperties(targetBean, form);to fetch the values entered by the user. Try to use struts tags in your jsp's and map the properties to your form bean variables. Hope that helps.
SirG -
Values from a jsp page are null in an Action class
hi, i am working on an application...i have a jsp page with several inputs (type=text) and when a submit the form to to my action class all values received are null.
Here is a part of code:
the jsp file: letter.jsp
<form target="_self" action="/Test/editLetter.do" name="letterTF">
<table>
<tbody>
<tr>
<th>
No of objects
</th>
<th>
Weight
</th>
<th>
Description
</th>
</tr>
<tr>
<td>
Package
<input name="package" id="package" type="checkbox">
</td>
<td>
<input name="package_No" type="text" value="<%=currentBean.getPackageNo() %>"> <%-- from session...have to edit some date from a data base--%>
</td>
<td>
<input name="package_weight" type="text" value="<%=currentBean.geWeight()%>">
</td>
<td>
<input name="description" type="text" value="<%=currentBean.Description()%>"
</td></tr>
<tr>
..................................................... <%-- It's a big form --%>
</tr>
<tr>
<input type="submit" name="send" value="Send">
</tr>
</tbody>
</table>
</form>
struts-config.xml:
<form-bean
name="letterTF"
type="Test.LetterForm">
</form-bean>
<action path="/editLetter"
type="Test.LetterAction"
name="scrisoareTF"
input="/letter.jsp"
scope="request"
validate="false">
<forward name="success" path="/index_orders.jsp"/>
</action>
The ActionForm class:
public class LetterForm extends ActionForm{
private String package;
private String package_No;
private String package_weight;
public void setPackage(String package){
this.package = package
public String getPackage(){
return package;
The action class:
public class LetterAction extends Action{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception{
String package;
String package_No;
String package_weight;
LetterForm letterTF = (LetterForm) form;
package = letterTF.getPackage();
package_No = letterTF.getPackageNo()
package_weight = letterTF.getPackageWeight();
System.out.println("Package: "+package);//it will print Package: null
System.out.println("Weight: "+weight);//it will print Weight: null
System.out.println("Description "+description) //it will print Description: null
As I observed its not making the set methods from LetterForm.java
I am dealing with this bug for a couple of days an i didn't managed to break it. If anyone has an idea or a solution would he be so kind to share it with me
Thanks in advance,
DavidBasically your form beans are the place holders or containers for your jsp attributes. It has to be mapped in such a way that when the form is submitted the user entered values get populated on to your form bean.
For Eg:
JSP
<html:form action="accountSearchResults.do">
<html:text property="myName" size="15"/>
//USE ONLY STRUTS TAGS IN JSP's. U CAN REFER TO
//http://struts.apache.org/1.x/struts-taglib/tlddoc/index.html
//THE PROPERTY NAME "myName" SHOULD BE DEFINED IN
//YOUR FORMBEAN WITH getMyName AND setMyName
//METHODS DEFINED
</html:form>
struts-config.xml
<form-beans>
<form-bean name="addEditAccount" type="org.apache.struts.validator.LazyValidatorForm">
<form-property name="myName" type="java.lang.String">
</form-property>
</form-bean>
</form-beans>
<action-mappings>
<action path="/accountSearchResults" type="com.zzz.AccountSearchResultAction" name="addEditAccount" scope="request">
<forward name="success" path="NextPage.jsp">
</forward>
</action>
</action-mappings>
Action Class
Since we have defined the form bean as a lazyvalidator instance you can use:
PropertyUtils.copyProperties(targetBean, form);to fetch the values entered by the user. Try to use struts tags in your jsp's and map the properties to your form bean variables. Hope that helps.
SirG -
FB4 Beta 2: Variables accessed across swf-files are null.
I’ve been working on an ActionScript project and just recently switched from FB4 Beta1 to Beta2. The project is made up of multiple swf-files that are loaded into shell.swf. When compiled with FB4 Beta1 variables are accessible across the loaded swfs and shell.swf but they just turn up as being null when compiled with FB4 Beta2. What causes this behavior and how do I go about it?
If you are using Marshall Plan functionality, it is no longer available by default. You have to add the MXMLC option
-includes=mx.managers.systemClasses.MarshallingSupport
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui -
How to implement classes with alv's
hi
how to implement classes with alv'sHi Jyotsna,
check this example codes.
*"Table declarations...................................................
TABLES:
EKKO, " Purchasing Document Header
CDHDR, " Change document header
SSCRFIELDS. " Fields on selection screens
*"Selection screen elements............................................
SELECT-OPTIONS:
S_EBELN FOR EKKO-EBELN, " Purchasing Document Number
S_LIFNR FOR EKKO-LIFNR, " Vendor's account number
S_EKGRP FOR EKKO-EKGRP, " Purchasing group
S_BEDAT FOR EKKO-BEDAT, " Purchasing Document Date
S_UDATE FOR CDHDR-UDATE. " Creation date of the change
" document
*" Data declarations...................................................
Field String to hold Purchase Document Number *
DATA:
BEGIN OF FS_EBELN,
EBELN(90) TYPE C, " Purchase Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created
" the Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
END OF FS_EBELN,
Field String to hold Purchase Document Header *
BEGIN OF FS_EKKO,
EBELN TYPE EKKO-EBELN, " Purchasing Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
" Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
END OF FS_EKKO,
Field String to hold Account Number and name of the Vendor *
BEGIN OF FS_LFA1,
LIFNR TYPE LFA1-LIFNR, " Account Number of Vendor
NAME1 TYPE LFA1-NAME1, " Name1
END OF FS_LFA1,
Field String to hold Change date and the name of the user *
BEGIN OF FS_CDHDR,
OBJECTCLAS TYPE CDHDR-OBJECTCLAS, " Object Class
OBJECTID TYPE CDHDR-OBJECTID, " Object value
CHANGENR TYPE CDHDR-CHANGENR, " Document change number
USERNAME TYPE CDHDR-USERNAME, " User name
UDATE TYPE CDHDR-UDATE, " Creation date of the change
" document
END OF FS_CDHDR,
Field String to hold Change document items *
BEGIN OF FS_CDPOS,
OBJECTCLAS TYPE CDPOS-OBJECTCLAS," Object class
OBJECTID(10) TYPE C, " Object Value
CHANGENR TYPE CDPOS-CHANGENR, " Document change number
TABNAME TYPE CDPOS-TABNAME, " Table Name
FNAME TYPE CDPOS-FNAME, " Field Name
VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
END OF FS_CDPOS,
Field String to hold Date Element Name *
BEGIN OF FS_DATAELE,
TABNAME TYPE DD03L-TABNAME, " Table Name
FIELDNAME TYPE DD03L-FIELDNAME, " Field Name
ROLLNAME TYPE DD03L-ROLLNAME, " Data element (semantic domain)
END OF FS_DATAELE,
Field String to hold Short Text of the Date Element *
BEGIN OF FS_TEXT,
ROLLNAME TYPE DD04T-ROLLNAME, " Data element (semantic domain)
DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
" Repository Objects
END OF FS_TEXT,
Field String to hold data to be displayed on the ALV grid *
BEGIN OF FS_OUTTAB,
EBELN TYPE EKKO-EBELN, " Purchasing Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
" Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
WERKS TYPE LFA1-WERKS, " Plant
NAME1 TYPE LFA1-NAME1, " Name1
USERNAME TYPE CDHDR-USERNAME, " User name
UDATE TYPE CDHDR-UDATE, " Creation date of the change
" document
DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
" Repository Objects
VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
END OF FS_OUTTAB,
Internal table to hold Purchase Document Number *
T_EBELN LIKE STANDARD TABLE
OF FS_EBELN,
Internal table to hold Purchase Document Header *
T_EKKO LIKE STANDARD TABLE
OF FS_EKKO,
Temp Internal table to hold Purchase Document Header *
T_EKKO_TEMP LIKE STANDARD TABLE
OF FS_EKKO,
Internal table to hold Account number and Name of the Vendor *
T_LFA1 LIKE STANDARD TABLE
OF FS_LFA1,
Internal Table to hold Change date and the name of the user *
T_CDHDR LIKE STANDARD TABLE
OF FS_CDHDR,
Internal Table to hold Change document items *
T_CDPOS LIKE STANDARD TABLE
OF FS_CDPOS,
Temp. Internal Table to hold Change document items *
T_CDPOS_TEMP LIKE STANDARD TABLE
OF FS_CDPOS,
Internal Table to hold Data Element Name *
T_DATAELE LIKE STANDARD TABLE
OF FS_DATAELE,
Temp. Internal Table to hold Data Element Name *
T_DATAELE_TEMP LIKE STANDARD TABLE
OF FS_DATAELE,
Internal Table to hold Short Text of the Date Element *
T_TEXT LIKE STANDARD TABLE
OF FS_TEXT,
Internal Table to hold data to be displayed on the ALV grid *
T_OUTTAB LIKE STANDARD TABLE
OF FS_OUTTAB.
C L A S S D E F I N I T I O N *
CLASS LCL_EVENT_HANDLER DEFINITION DEFERRED.
*" Data declarations...................................................
Work variables *
DATA:
W_EBELN TYPE EKKO-EBELN, " Purchasing Document Number
W_LIFNR TYPE EKKO-LIFNR, " Vendor's account number
W_EKGRP TYPE EKKO-EKGRP, " Purchasing group
W_VALUE TYPE EKKO-EBELN, " Reflected Value
W_SPACE VALUE ' ', " Space
W_FLAG TYPE I, " Flag Variable
W_VARIANT TYPE DISVARIANT, " Variant
ALV Grid
W_GRID TYPE REF TO CL_GUI_ALV_GRID,
Event Handler
W_EVENT_CLICK TYPE REF TO LCL_EVENT_HANDLER,
Field catalog table
T_FIELDCAT TYPE LVC_T_FCAT.
AT SELECTION-SCREEN EVENT *
AT SELECTION-SCREEN ON S_EBELN.
Subroutine to validate Purchase Document Number.
PERFORM VALIDATE_PD_NUM.
AT SELECTION-SCREEN ON S_LIFNR.
Subroutine to validate Vendor Number.
PERFORM VALIDATE_VEN_NUM.
AT SELECTION-SCREEN ON S_EKGRP.
Subroutine to validate Purchase Group.
PERFORM VALIDATE_PUR_GRP.
START-OF-SELECTION EVENT *
START-OF-SELECTION.
Subroutine to select all Purchase orders.
PERFORM SELECT_PO.
CHECK W_FLAG EQ 0.
Subroutine to select Object values.
PERFORM SELECT_OBJ_ID.
CHECK W_FLAG EQ 0.
Subroutine to select Changed values.
PERFORM SELECT_CHANGED_VALUE.
CHECK W_FLAG EQ 0.
Subroutine to Select Purchase Orders.
PERFORM SELECT_PUR_DOC.
Subroutine to select Vendor Details.
PERFORM SELECT_VENDOR.
Subroutine to select Text for the Changed values.
PERFORM DESCRIPTION.
END-OF-SELECTION EVENT *
END-OF-SELECTION.
IF NOT T_EKKO IS INITIAL.
Subroutine to populate the Output Table.
PERFORM FILL_OUTTAB.
Subroutine to build Field Catalog.
PERFORM PREPARE_FIELD_CATALOG CHANGING T_FIELDCAT.
CALL SCREEN 100.
ENDIF. " IF NOT T_EKKO...
CLASS LCL_EVENT_HANDLER DEFINITION
Defining Class which handles events
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
HANDLE_HOTSPOT_CLICK
FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID.
ENDCLASS. " LCL_EVENT_HANDLER DEFINITION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION
Implementing the Class which can handle events
CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
*---Handle Double Click
METHOD HANDLE_HOTSPOT_CLICK .
Subroutine to get the HotSpot Cell information.
PERFORM GET_CELL_INFO.
SET PARAMETER ID 'BES' FIELD W_VALUE.
CALL TRANSACTION 'ME23N'.
ENDMETHOD. " HANDLE_HOTSPOT_CLICK
ENDCLASS. " LCL_EVENT_HANDLER
*& Module STATUS_0100 OUTPUT
PBO Event
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'OOPS'.
SET TITLEBAR 'TIT'.
Subroutine to fill the Variant Structure
PERFORM FILL_VARIANT.
IF W_GRID IS INITIAL.
CREATE OBJECT W_GRID
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = CL_GUI_CONTAINER=>SCREEN0
I_APPL_EVENTS =
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
I_FCAT_COMPLETE = SPACE
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. " IF SY-SUBRC 0
CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT = W_VARIANT
I_SAVE = 'A'
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = T_OUTTAB
IT_FIELDCATALOG = T_FIELDCAT
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. " IF SY-SUBRC 0.
ENDIF. " IF W_GRID IS INITIAL
CREATE OBJECT W_EVENT_CLICK.
SET HANDLER W_EVENT_CLICK->HANDLE_HOTSPOT_CLICK FOR W_GRID.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
PAI Event
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form PREPARE_FIELD_CATALOG
Subroutine to build the Field catalog
<--P_T_FIELDCAT Field Catalog Table
FORM PREPARE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
DATA LS_FCAT TYPE LVC_S_FCAT.
Purchasing group...
LS_FCAT-FIELDNAME = 'EKGRP'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Purchasing Document Number...
LS_FCAT-FIELDNAME = 'EBELN'.
LS_FCAT-REF_TABLE = 'EKKO' .
LS_FCAT-EMPHASIZE = 'C411'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-HOTSPOT = 'X'.
APPEND LS_FCAT TO PT_FIELDCAT .
CLEAR LS_FCAT .
Name of Person who Created the Object...
LS_FCAT-FIELDNAME = 'ERNAM'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-OUTPUTLEN = '15' .
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Purchasing Document Date...
LS_FCAT-FIELDNAME = 'BEDAT'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Vendor's account number...
LS_FCAT-FIELDNAME = 'LIFNR'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Account Number of Vendor or Creditor...
LS_FCAT-FIELDNAME = 'NAME1'.
LS_FCAT-REF_TABLE = 'LFA1'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Vendor Name'(001).
LS_FCAT-SELTEXT = 'Vendor Name'(001).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Creation date of the change document...
LS_FCAT-FIELDNAME = 'UDATE'.
LS_FCAT-REF_TABLE = 'CDHDR'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Change Date'(002).
LS_FCAT-SELTEXT = 'Change Date'(002).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
User name of the person responsible in change document...
LS_FCAT-FIELDNAME = 'USERNAME'.
LS_FCAT-REF_TABLE = 'CDHDR'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Modified by'(003).
LS_FCAT-SELTEXT = 'Modified by'(003).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Short Text Describing R/3 Repository Objects...
LS_FCAT-FIELDNAME = 'DDTEXT'.
LS_FCAT-REF_TABLE = 'DD04T'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '15'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Old contents of changed field...
LS_FCAT-FIELDNAME = 'VALUE_OLD'.
LS_FCAT-REF_TABLE = 'CDPOS'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '12'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
New contents of changed field...
LS_FCAT-FIELDNAME = 'VALUE_NEW'.
LS_FCAT-REF_TABLE = 'CDPOS'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '12'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
ENDFORM. " PREPARE_FIELD_CATALOG
*& Form SELECT_PO
Subroutine to select all the Purchase Orders
There are no interface parameters to be passed to this subroutine.
FORM SELECT_PO .
SELECT EBELN " Purchasing Document Number
ERNAM " Name of Person who Created
" the Object
LIFNR " Vendor's account number
EKGRP " Purchasing group
BEDAT " Purchasing Document Date
FROM EKKO
PACKAGE SIZE 10000
APPENDING TABLE T_EBELN
WHERE EBELN IN S_EBELN
AND BEDAT IN S_BEDAT.
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S401(M8).
ENDIF. " IF SY-SUBRC NE 0
ENDFORM. " SELECT_PO
*& Form SELECT_OBJ_ID
Subroutine to select Object ID
There are no interface parameters to be passed to this subroutine.
FORM SELECT_OBJ_ID .
IF NOT T_EBELN IS INITIAL.
SELECT OBJECTCLAS " Object Class
OBJECTID " Object value
CHANGENR " Document change number
USERNAME " User name
UDATE " Creation date
FROM CDHDR
INTO TABLE T_CDHDR
FOR ALL ENTRIES IN T_EBELN
WHERE OBJECTID EQ T_EBELN-EBELN
AND UDATE IN S_UDATE
AND TCODE IN ('ME21N','ME22N','ME23N').
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S833(M8) WITH 'Header Not Found'(031).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_EBELN IS INITIAL
ENDFORM. " SELECT_OBJ_ID
*& Form SELECT_CHANGED_VALUE
Subroutine to select Changed Values
There are no interface parameters to be passed to this subroutine.
FORM SELECT_CHANGED_VALUE .
IF NOT T_CDHDR IS INITIAL.
SELECT OBJECTCLAS " Object class
OBJECTID " Object value
CHANGENR " Document change number
TABNAME " Table Name
FNAME " Field Name
VALUE_NEW " New contents of changed field
VALUE_OLD " Old contents of changed field
FROM CDPOS
PACKAGE SIZE 10000
APPENDING TABLE T_CDPOS
FOR ALL ENTRIES IN T_CDHDR
WHERE OBJECTCLAS EQ T_CDHDR-OBJECTCLAS
AND OBJECTID EQ T_CDHDR-OBJECTID
AND CHANGENR EQ T_CDHDR-CHANGENR.
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S833(M8) WITH 'Item Not Found'(032).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_CDHDR IS INITIAL
T_CDPOS_TEMP] = T_CDPOS[.
ENDFORM. " SELECT_CHANGED_VALUE
*& Form SELECT_PUR_DOC
Subroutine to select Purchase Order Details
There are no interface parameters to be passed to this subroutine.
FORM SELECT_PUR_DOC .
IF NOT T_CDPOS IS INITIAL.
SORT T_EBELN BY EBELN.
LOOP AT T_CDPOS INTO FS_CDPOS.
READ TABLE T_EBELN INTO FS_EBELN WITH KEY EBELN =
FS_CDPOS-OBJECTID BINARY SEARCH.
IF SY-SUBRC NE 0.
DELETE TABLE T_EBELN FROM FS_EBELN.
ENDIF. " IF SY-SUBRC NE 0.
ENDLOOP. " LOOP AT T_CDPOS...
LOOP AT T_EBELN INTO FS_EBELN.
MOVE FS_EBELN-EBELN TO FS_EKKO-EBELN.
MOVE FS_EBELN-ERNAM TO FS_EKKO-ERNAM.
MOVE FS_EBELN-LIFNR TO FS_EKKO-LIFNR.
MOVE FS_EBELN-EKGRP TO FS_EKKO-EKGRP.
MOVE FS_EBELN-BEDAT TO FS_EKKO-BEDAT.
APPEND FS_EKKO TO T_EKKO.
ENDLOOP. " LOOP AT T_EBELN...
T_EKKO_TEMP] = T_EKKO[.
ENDIF. " IF NOT T_CDPOS IS INITIAL
ENDFORM. " SELECT_PUR_DOC
*& Form SELECT_VENDOR
Subroutine to select Vendor details
There are no interface parameters to be passed to this subroutine.
FORM SELECT_VENDOR .
IF NOT T_EKKO IS INITIAL.
SORT T_EKKO_TEMP BY LIFNR.
DELETE ADJACENT DUPLICATES FROM T_EKKO_TEMP COMPARING LIFNR.
SELECT LIFNR " Account Number of Vendor or
" Creditor
NAME1 " Name 1
FROM LFA1
INTO TABLE T_LFA1
FOR ALL ENTRIES IN T_EKKO_TEMP
WHERE LIFNR EQ T_EKKO_TEMP-LIFNR.
IF SY-SUBRC NE 0.
MESSAGE S002(M8) WITH 'Master Details'(033).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_EKKO IS INITIAL
ENDFORM. " SELECT_VENDOR
*& Form DESCRIPTION
Subroutine to get the description
There are no interface parameters to be passed to this subroutine.
FORM DESCRIPTION .
IF NOT T_CDPOS IS INITIAL.
SORT T_CDPOS_TEMP BY TABNAME FNAME.
DELETE ADJACENT DUPLICATES FROM T_CDPOS_TEMP COMPARING TABNAME FNAME
SELECT TABNAME " Table Name
FIELDNAME " Field Name
ROLLNAME " Data element
FROM DD03L
INTO TABLE T_DATAELE
FOR ALL ENTRIES IN T_CDPOS_TEMP
WHERE TABNAME EQ T_CDPOS_TEMP-TABNAME
AND FIELDNAME EQ T_CDPOS_TEMP-FNAME.
IF NOT T_DATAELE IS INITIAL.
T_DATAELE_TEMP] = T_DATAELE[.
SORT T_DATAELE_TEMP BY ROLLNAME.
DELETE ADJACENT DUPLICATES FROM T_DATAELE_TEMP COMPARING ROLLNAME.
SELECT ROLLNAME " Data element
DDTEXT " Short Text Describing R/3
" Repository Objects
FROM DD04T
INTO TABLE T_TEXT
FOR ALL ENTRIES IN T_DATAELE_TEMP
WHERE ROLLNAME EQ T_DATAELE_TEMP-ROLLNAME
AND DDLANGUAGE EQ SY-LANGU.
IF SY-SUBRC NE 0.
EXIT.
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_DATAELE IS INITIAL.
ENDIF. " IF NOT T_CDPOS IS INITIAL.
ENDFORM. " DESCRIPTION
*& Form FILL_OUTTAB
Subroutine to populate the Outtab
There are no interface parameters to be passed to this subroutine.
FORM FILL_OUTTAB .
SORT T_CDHDR BY OBJECTCLAS OBJECTID CHANGENR.
SORT T_EKKO BY EBELN.
SORT T_LFA1 BY LIFNR.
SORT T_DATAELE BY TABNAME FIELDNAME.
SORT T_TEXT BY ROLLNAME.
LOOP AT T_CDPOS INTO FS_CDPOS.
READ TABLE T_CDHDR INTO FS_CDHDR WITH KEY
OBJECTCLAS = FS_CDPOS-OBJECTCLAS
OBJECTID = FS_CDPOS-OBJECTID
CHANGENR = FS_CDPOS-CHANGENR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_CDHDR-USERNAME TO FS_OUTTAB-USERNAME.
MOVE FS_CDHDR-UDATE TO FS_OUTTAB-UDATE.
READ TABLE T_EKKO INTO FS_EKKO WITH KEY
EBELN = FS_CDHDR-OBJECTID
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_EKKO-EBELN TO FS_OUTTAB-EBELN.
MOVE FS_EKKO-ERNAM TO FS_OUTTAB-ERNAM.
MOVE FS_EKKO-LIFNR TO FS_OUTTAB-LIFNR.
MOVE FS_EKKO-EKGRP TO FS_OUTTAB-EKGRP.
MOVE FS_EKKO-BEDAT TO FS_OUTTAB-BEDAT.
READ TABLE T_LFA1 INTO FS_LFA1 WITH KEY
LIFNR = FS_EKKO-LIFNR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_LFA1-NAME1 TO FS_OUTTAB-NAME1.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
MOVE FS_CDPOS-VALUE_NEW TO FS_OUTTAB-VALUE_NEW.
MOVE FS_CDPOS-VALUE_OLD TO FS_OUTTAB-VALUE_OLD.
READ TABLE T_DATAELE INTO FS_DATAELE WITH KEY
TABNAME = FS_CDPOS-TABNAME
FIELDNAME = FS_CDPOS-FNAME
BINARY SEARCH.
IF SY-SUBRC EQ 0.
READ TABLE T_TEXT INTO FS_TEXT WITH KEY
ROLLNAME = FS_DATAELE-ROLLNAME
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_TEXT-DDTEXT TO FS_OUTTAB-DDTEXT.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
APPEND FS_OUTTAB TO T_OUTTAB.
CLEAR FS_OUTTAB.
ENDLOOP.
ENDFORM. " FILL_OUTTAB
*& Form GET_CELL_INFO
Subroutine to get the Cell Information
--> W_VALUE Holds the value of Hotspot clicked
FORM GET_CELL_INFO .
CALL METHOD W_GRID->GET_CURRENT_CELL
IMPORTING
E_ROW =
E_VALUE = W_VALUE
E_COL =
ES_ROW_ID =
ES_COL_ID =
ES_ROW_NO =
ENDFORM. " GET_CELL_INFO
*& Form VALIDATE_PD_NUM
Subroutine to validate Purchase Document Number
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_PD_NUM .
IF NOT S_EBELN[] IS INITIAL.
SELECT EBELN " Purchase Document Number
FROM EKKO
INTO W_EBELN
UP TO 1 ROWS
WHERE EBELN IN S_EBELN.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E717(M8).
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_EBELN[]...
ENDFORM. " VALIDATE_PD_NUM
*& Form VALIDATE_VEN_NUM
Subroutine to validate Vendor Number
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_VEN_NUM .
IF NOT S_LIFNR[] IS INITIAL.
SELECT LIFNR " Vendor Number
FROM LFA1
INTO W_LIFNR
UP TO 1 ROWS
WHERE LIFNR IN S_LIFNR.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E002(M8) WITH W_SPACE.
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_LIFNR[]...
ENDFORM. " VALIDATE_VEN_NUM
*& Form VALIDATE_PUR_GRP
Subroutine to validate the Purchase Group
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_PUR_GRP .
IF NOT S_EKGRP[] IS INITIAL.
SELECT EKGRP " Purchase Group
FROM T024
INTO W_EKGRP
UP TO 1 ROWS
WHERE EKGRP IN S_EKGRP.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E622(M8) WITH W_SPACE.
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_EKFRP[]...
ENDFORM. " VALIDATE_PUR_GRP
*& Form FILL_VARIANT
Subroutine to fill the Variant Structure
There are no interface parameters to be passed to this subroutine
FORM FILL_VARIANT .
Filling the Variant structure
W_VARIANT-REPORT = SY-REPID.
W_VARIANT-USERNAME = SY-UNAME.
ENDFORM. " FILL_VARIANT
REPORT YMS_HIERSEQLISTDISPLAY .
Program with FM REUSE_ALV_HIERSEQ_LIST_DISPLAY *
Author : Michel PIOUD *
Email : mpioudyahoo.fr HomePage : http://www.geocities.com/mpioud *
TYPE-POOLS: slis. " ALV Global types
CONSTANTS :
c_x VALUE 'X',
c_gt_vbap TYPE SLIS_TABNAME VALUE 'GT_VBAP',
c_gt_vbak TYPE SLIS_TABNAME VALUE 'GT_VBAK'.
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max. "#EC NEEDED
PARAMETERS p_max(02) TYPE n DEFAULT '10' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_2 FOR FIELD p_expand. "#EC NEEDED
PARAMETERS p_expand AS CHECKBOX DEFAULT c_x.
SELECTION-SCREEN END OF LINE.
TYPES :
1st Table
BEGIN OF ty_vbak,
vbeln TYPE vbak-vbeln, " Sales document
kunnr TYPE vbak-kunnr, " Sold-to party
netwr TYPE vbak-netwr, " Net Value of the Sales Order
erdat TYPE vbak-erdat, " Creation date
waerk TYPE vbak-waerk, " SD document currency
expand TYPE xfeld,
END OF ty_vbak,
2nd Table
BEGIN OF ty_vbap,
vbeln TYPE vbap-vbeln, " Sales document
posnr TYPE vbap-posnr, " Sales document
matnr TYPE vbap-matnr, " Material number
netwr TYPE vbap-netwr, " Net Value of the Sales Order
waerk TYPE vbap-waerk, " SD document currency
END OF ty_vbap.
DATA :
1st Table
gt_vbak TYPE TABLE OF ty_vbak,
2nd Table
gt_vbap TYPE TABLE OF ty_vbap.
INITIALIZATION.
v_1 = 'Maximum of records to read'.
v_2 = 'With ''EXPAND'' field'.
START-OF-SELECTION.
Read Sales Document: Header Data
SELECT vbeln kunnr netwr waerk erdat
FROM vbak
UP TO p_max ROWS
INTO CORRESPONDING FIELDS OF TABLE gt_vbak.
IF NOT gt_vbak[] IS INITIAL.
Read Sales Document: Item Data
SELECT vbeln posnr matnr netwr waerk
FROM vbap
INTO CORRESPONDING FIELDS OF TABLE gt_vbap
FOR ALL ENTRIES IN gt_vbak
WHERE vbeln = gt_vbak-vbeln.
ENDIF.
PERFORM f_display.
Form F_DISPLAY
FORM f_display.
Macro definition
DEFINE m_fieldcat.
ls_fieldcat-tabname = &1.
ls_fieldcat-fieldname = &2.
ls_fieldcat-ref_tabname = &3.
ls_fieldcat-cfieldname = &4. " Field with currency unit
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
ls_sort-tabname = &1.
ls_sort-fieldname = &2.
ls_sort-up = c_x.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA:
ls_layout TYPE slis_layout_alv,
ls_keyinfo TYPE slis_keyinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
lt_sort TYPE slis_t_sortinfo_alv," Sort table
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv." Field catalog
ls_layout-group_change_edit = c_x.
ls_layout-colwidth_optimize = c_x.
ls_layout-zebra = c_x.
ls_layout-detail_popup = c_x.
ls_layout-get_selinfos = c_x.
IF p_expand = c_x.
ls_layout-expand_fieldname = 'EXPAND'.
ENDIF.
Build field catalog and sort table
m_fieldcat c_gt_vbak 'VBELN' 'VBAK' ''.
m_fieldcat c_gt_vbak 'KUNNR' 'VBAK' ''.
m_fieldcat c_gt_vbak 'NETWR' 'VBAK' 'WAERK'.
m_fieldcat c_gt_vbak 'WAERK' 'VBAK' ''.
m_fieldcat c_gt_vbak 'ERDAT' 'VBAK' ''.
m_fieldcat c_gt_vbap 'POSNR' 'VBAP' ''.
m_fieldcat c_gt_vbap 'MATNR' 'VBAP' ''.
m_fieldcat c_gt_vbap 'NETWR' 'VBAP' 'WAERK'.
m_fieldcat c_gt_vbap 'WAERK' 'VBAP' ''.
m_sort c_gt_vbak 'KUNNR'.
m_sort c_gt_vbap 'NETWR'.
ls_keyinfo-header01 = 'VBELN'.
ls_keyinfo-item01 = 'VBELN'.
ls_keyinfo-item02 = 'POSNR'.
Dipslay Hierarchical list
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'
is_layout = ls_layout
it_fieldcat = lt_fieldcat
it_sort = lt_sort
i_tabname_header = c_gt_vbak
i_tabname_item = c_gt_vbap
is_keyinfo = ls_keyinfo
TABLES
t_outtab_header = gt_vbak
t_outtab_item = gt_vbap
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " F_LIST_DISPLAY
Form USER_COMMAND *
FORM user_command USING i_ucomm TYPE sy-ucomm
is_selfield TYPE slis_selfield. "#EC CALLED
DATA ls_vbak TYPE ty_vbak.
CASE i_ucomm.
WHEN '&IC1'. " Pick
CASE is_selfield-tabname.
WHEN c_gt_vbap.
WHEN c_gt_vbak.
READ TABLE gt_vbak INDEX is_selfield-tabindex INTO ls_vbak.
IF sy-subrc EQ 0.
Sales order number
SET PARAMETER ID 'AUN' FIELD ls_vbak-vbeln.
Display Sales Order
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDCASE.
ENDFORM. " USER_COMMAND
Kindly Reward Points If You Found The Reply Helpful,
Cheers,
Chaitanya. -
What is the Java default ORB implementation class?
I have a web application deployed on the Sun Java System Application Server 8. This application will also act as a CORBA client by invoking remote methods on another CORBA server.
Our first approach was to use the ORB provided by the Sun App Server. But whenever the code reaches the point to initialize the ORB:
orb = ORB.init(as, null); we encountered such exceptions:
[#|2005-02-03T00:38:43.912-0600|WARNING|sun-appserver-pe8.0.0_01|javax.enterpris
e.resource.corba._DEFAULT_.rpc.transport|_ThreadID=14;|"IOP00710209: (INTERNAL)
Unable to create listener thread on the specific port"
org.omg.CORBA.INTERNAL: vmcid: SUN minor code: 209 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFa
iled(ORBUtilSystemException.java:3142)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFa
iled(ORBUtilSystemException.java:3160) When we deployed the same app on Tomcat, it worked fine. We later reasoned the exception was happening on the Sun App Server because perhaps it was trying to initialize another ORB with the same properties as the one initialized by the Sun App Server, and thus was trying to create another listener on a port already in use.
On tomcat, the ORB used was the default ORB provided by Java. Thus, we thought we would try 'overriding' the ORB properties for the Sun App Server by specifiying this in the ORB.init() method:
String as[] = null;
Properties orbProperties = new Properties();
orbProperties.put("org.omg.CORBA.ORBClass","com.sun.corba.se.internal.iiop.ORB");
orbProperties.put("org.omg.CORBA.ORBSingletonClass","com.sun.corba.se.internal.iiop.ORB");
orb = ORB.init(as, orbProperties);But when executing this, we get the exception as follows:
Caused by: org.omg.CORBA.INITIALIZE: can't instantiate custom socket factory: co
m.sun.enterprise.iiop.IIOPSSLSocketFactory vmcid: 0x0 minor code: 0 completed
: No
at com.sun.corba.se.internal.corba.ORB.parseProperties(ORB.java:1250)
at com.sun.corba.se.internal.POA.POAORB.parseProperties(POAORB.java:267)
at com.sun.corba.se.internal.Interceptors.PIORB.parseProperties(PIORB.ja
va:341)
at com.sun.corba.se.internal.corba.ORB.set_parameters(ORB.java:460)
at com.sun.corba.se.internal.POA.POAORB.set_parameters(POAORB.java:153)
at com.sun.corba.se.internal.Interceptors.PIORB.set_parameters(PIORB.jav
a:333)
at org.omg.CORBA.ORB.init(ORB.java:337)
at com.covansys.ipceuc.corbalogic.SessionManager.<clinit>(SessionManager
.java:159) Some Sun sites mentioned that com.sun.CORBA.iiop.ORB is the Java ORB implementation. When trying to use this, we got a ClassNotFoundException.
Also tried the following classes:
com.sun.corba.se.internal.corba.ORB
com.sun.corba.se.internal.core.ORB
com.sun.corba.se.internal.org.omg.ORBAll of them reported exceptions as follows:
Caused by: org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementati
n org.omg.CORBA.ORB vmcid: 0x0 minor code: 0 completed: No
at org.omg.CORBA.ORB.create_impl(ORB.java:297)
at org.omg.CORBA.ORB.init(ORB.java:336)
at com.covansys.ipceuc.corbalogic.SessionManager.<clinit>(SessionManage
.java:158)
... 55 more
Caused by: java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstanc
(InstantiationExceptionConstructorAccessorImpl.java:30)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at org.omg.CORBA.ORB.create_impl(ORB.java:295)
... 57 more
|#] Anyone know what the Java ORB implementation class is, or whether this is possible at all?
Thanks in advance.Hello
The defaults for JDK 1.4.2 (at least) are shown it the code below:
Properties p = new Properties ();
p.put ("org.omg.CORBA.ORBSingletonClass",
"com.sun.corba.se.internal.corba.ORBSingleton");
p.put ("org.omg.CORBA.ORBClass",
"com.sun.corba.se.internal.Interceptors.PIORB");
p.put ("javax.rmi.CORBA.UtilClass",
"com.sun.corba.se.internal.POA.ShutdownUtilDelegate");
p.put ("javax.rmi.CORBA.PortableRemoteObjectClass",
"com.sun.corba.se.internal.javax.rmi.PortableRemoteObject");
System.setProperties (p);Of course you can use this code to set these defaults back. Be careful, if you do this inside Weblogic, for instance, it will likely abend.
[]'s
Marcond -
Hello!
How can i change implementation class of text field programmatically in run time?
ThanksHello Francois,
I wounder if you could help me.
I am trying to use FBean.Set_Indexed_Property and
NewLabel := FBean.Get_Indexed_Property
i need to retrieve some values and it will be nice to use those functions
this is my java class
package sumanumeros;
* @author madq80
* Para cambiar la plantilla para este comentario de tipo generado vaya a
* Ventana>Preferencias>Java>Generación de código>Código y comentarios
import java.io.*;
import java.text.MessageFormat;
import java.util.*;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;
import org.jdom.xpath.XPath;
import oracle.forms.ui.VBean;
public class SumaNumeros extends VBean {
public static void init(){
public static void main(String[] args) {
SumaNumeros s = new SumaNumeros();
//s.suma(12,8);
s.leerfichero("c:\\resulbusqueda.xml");
public String letras (String letra1, String letra2){
String resutado = letra1+"-->"+letra2;
System.out.print("retur"+resutado );
return resutado;
}//letras
public int suma (int numero1, int numero2){
int resutado = numero1+ numero2;
System.out.print("retur"+resutado );
return resutado;
}//suma
public String leerfichero(String nombrefichero ){
List list=null;
String lostitulos = null;
System.out.print("nombrefichero 1"+nombrefichero +"\n");
try {
System.out.print("nombrefichero 2"+nombrefichero +"\n");
List DocumentTitle = new ArrayList();
RandomAccessFile raf = new RandomAccessFile (nombrefichero, "r" );
byte[] buffer = new byte [ (int) raf.length () ];
raf.readFully ( buffer );
raf.close ();
String srcfile = new String ( buffer );
String pattern = "{0}<response>{1}</response>{2}";
MessageFormat mf = new MessageFormat ( pattern );
Object[] obj = mf.parse ( srcfile );
String response = (String) obj[1];
ByteArrayInputStream bais = new ByteArrayInputStream ( response.getBytes () );
SAXBuilder saxb = new SAXBuilder ( false );
Document doc = saxb.build ( bais );
Element root = doc.getRootElement ();
System.err.println ( root );
XPath xpath = XPath.newInstance ( "/xml/rs:data/z:row" );
list = xpath.selectNodes ( doc );
for ( int i = 0, len = list.size () ; i < len ; i++ )
Element item = (Element) list.get ( i );
System.err.println ( "--> " + item.getAttributeValue ( "DocumentTitle" ) );
DocumentTitle.add(item.getAttributeValue ( "DocumentTitle" ));
System.out.print("-->"+item.getAttributeValue ( "DocumentTitle" ) +"\n");
Iterator iter = DocumentTitle.iterator();
while (iter.hasNext()){
String titulo = (String)iter.next();
if(lostitulos == null) {
lostitulos = titulo;
}else{
lostitulos = lostitulos+","+titulo;
//System.out.println("******************************************");
System.out.println (lostitulos);
}catch (Exception e){
e.printStackTrace();
System.out.print("nombre 1"+lostitulos +"\n");
return lostitulos;
and this is my code on the form
declare
num integer;
hBean ITEM := Find_Item('BLOCK3.CIM');
argList FBEAN.ARGLIST;
v_result varchar2(2000);
NewLabel varchar2(2000);
begin
FBEAN.SET_LOGGING_MODE(hBean,1,FBEAN.LOG_ALL);
-- Get the file name --
If :GLOBAL.IS_BEAN_REGISTER = 'false' Then
FBean.Register_Bean(hBean,1,'sumanumeros.SumaNumeros');
:GLOBAL.IS_BEAN_REGISTER := 'true' ;
End if ;
argList := FBean.Create_ArgList;
FBEAN.ADD_ARG(argList,'c:\\resulbusqueda.xml');
v_result := FBean.Invoke_char('BLOCK3.CIM',1,'leerfichero',argList);
info('v_result'||v_result);
FBean.Set_Indexed_Property('BLOCK3.TITULOS',
1,
'titulos',
FBEAN.ALL_ROWS,
'Grommets, Widgets, Bolts, and Screws');
FBean.Get_Indexed_Property
NewLabel := FBean.Get_Indexed_Char_Property('BLOCK3.TITULOS',
1,
'titulos',
1);
info('NewLabel'||NewLabel); */
FBean.Set_Indexed_Property('BLOCK3.CIM',1,'leerfichero', FBEAN.ALL_ROWS,v_result);
NewLabel := FBean.Get_Indexed_Property('BLOCK3.CIM', 1, 'leerfichero', 1);
info('NewLabel'||NewLabel);
exception
when others then
info(sqlcode||' '||sqlerrm);
end;
the values that i get here
v_result := FBean.Invoke_char('BLOCK3.CIM',1,'leerfichero',argList);
are
ppp,asdasss,prueba,Anticipo a cuenta/Pet. pago a cuenta,Revista,Esto es una prueba,Comunicacion Siniestro,Comunicación .............
but when i use
FBean.Set_Indexed_Property('BLOCK3.CIM',1,'leerfichero', FBEAN.ALL_ROWS,v_result);
NewLabel := FBean.Get_Indexed_Property('BLOCK3.CIM', 1, 'leerfichero', 1);
it does not work i do not know what to do
do i have to treat the string with substr ???
many thanks and sorry to ask you againg -
Delete the records which have the Data values are NULL before load data to BPC model
Hi Everyone,
I am loading the data from flat file to BPC Model (10.0 Version).
Source data (Flat file) looks like below:
RP_Employee RPT_Currency Data
Test USD 8
Test1 USD
Test2 USD 6
My user requirement is that to delete the records which have the Data values are NULL before load data to BPC model.
So,Please let me know how can i meet to this requirement.
I am thinking that,it is possible by using start routine BADi. If i am correct please let me know process like creation of class and BADi implementation.
Thanks in advance!!Hi Nilanjan,
Please see my source data below:
Account Client Employee Time Data
123 XYZ Vishu 2014.01 300
456 2014.01
789 ABC Alexander 2014.02 200
If you see the second record,
If data value is ZULL, then the Employee or another dimension is also NULL.
So I want to delete second records.
If it is Start routine please share the code and steps to do.
Thanks in advance!!
Regards,
Viswanath -
WebUtil (Implementation class)
Hi , my english is very bad , ....
Inside of Bean Area de forms in her properties Implementation Class , default it exists a path calling oracle.forms.webutil.clientInfo.GetClientInfo , How setting really the path oracle.forms in the system? , because not finding..
Donde se encuentra la equivalencia entre oracle.forms y algún directorio del sistema..
Thanks...Hi Duncan...
But , my configuration is..
CLASSPATH=D:\oracle\ora9ias\jlib\debugger.jar;D:\oracle\ora9ias\jlib\ewt3.jar;D:\oracle\ora9ias\jlib\share.jar;D:\oracle\ora9ias\jlib\utj90.jar;D:\oracle\ora9ias\Webutil\lib\webutil.jar
In the WebUtil Manual says....
#A sample .ENV file for use with WebUtil note the following important Points:
And Setting the variable CLASSPATH , not the FORMS90_BUILDER_CLASSPATH....
CLASSPATH=c:\webutil\lib\webutil.jar
And the FORMS90_BUILDER_CLASSPATH do not exists in the server , only exists REPORTS_CLASSPATH , but not FORMS90_BUILDER_CLASSPATH..
Someone help me?? -
Garbage Collection facilitation by assigning variables to null
Hello,
I understand Garbage Collection (GC) can be facilitated by assigning variables to null. Is this true for all variables?
I have a class and there are some member variables which are strings. Also i have some methods with some string variables declared and defined inside the method. I am assigning null to class member variables and also the string variables of the method.
is it correct to assign null and faciliate GC for the string variables declared and defined inside the method?
Class A {
String t1;
public void test() {
String t2 = "test";
// processing
t2 = null; // Will this facilitate GC?
public static void main (String[] args) {
test();
A obj = new A();
A.t1 = "testclass";
A.t1 = null; // Will this faciliate GC?
Thanks, AravinthIn fact, the java heap is divided into a space for new allocations, and two survivor spaces. The algorithm for when collection occurs in each space is complex, and tuning GC is an interesting topic all its own. Follow the best advice you have been given ... chillax. The JVM has GC under control.
<think/> Of course, having said this, you can have memory leaks if you create references that never go out of scope, even if they are no longer used. Avoid this.
� {� -
How does a class set itself to null?
if error happened, can an instance sets itself to null?
i mean, inside the class,
i.e. this=null?Nope. 'this' is only a referencer to the current class instance as passed by argument or its data members and methods in which it is used. You cannot treat it as a stand-alone variable. Valid: this.something. Valid: method(this). Invalid: this=something.
And, nope. An instance cannot set itself to null. You can set it to null from another class with a reference arrived at by 'new' or by extraction.
Or, you can use the finalize() method, which is, in essence, a means for an instance to null itself.
One word of warning: an object (class instance) will not be garbage collected until ALL references to it have been lost. This goes for myclass = null and finalize(). You'll have to check that no other classes or threads are holding references to the object before it goes away completely.
Robert Templeton -
Error while activating the Implementation class of a BADI ?
Hello,
I am trying to activate a BADIi but its implementation class(ZCL_IM_DSD_ADD_CUST_IN_DNL) is not getting activated and giving the following object error on activation.
CPUB ZCL_IM_DSD_ADD_CUST_IN_DNL
and it says that "INCLUDE report "ZCL_IM_DSD_ADD_CUST_IN_DNL====CL" not found , where "DSD_ADD_CUST_IN_DNL" is the Impl. name of the definition "/DSD/ME_BAPI" implementing the interface "/DSD/IF_EX_ME_BAPI".
what am i missing here. Big time help will be extremely appreciated ..
Thanks a ton.Hi,
I had a quick qn,
Normally, the implementation name should start with Z. Can you create using the name 'DSD_ADD_CUST_IN_DNL' ? or are you using any access key (SSCR)?
For the infm, I have just tried to create one Z implementation in my system and it works fine. Could you please delete the current implementation and try it once again ?
Regards,
Selva K. -
BRF Expression - Implementation class OCA001 - No Context Component Exist
Dear All,
I am trying to create an expression in BRF.
Application class is ISHERCM_PP and Implementation class OCA001 (Access to simple context). As expected after selecting this implementation class Result Type field is not editable. I selected Context 0MODBOOK_CONTEXT, after pressing enter it gives an error message that "First Enter a Result Type". After this I tried to select Context Component, but in F4 there is no values found.
First time I am creating an expression for implementation class OCA001, please suggest, what I am missing.
Thanks in Advance
Sudhir GuptaSudhir,
Can you explain what you want to do in terms of the business process?
When the event is triggered there is no information yet available about the where-used lists
that are created asynchronously after the module bookings are saved. If the module context contained in this structure does not suffice to program a BRF action or expression, the where-used lists can be read from the database additionally*
*Table Type for Program Type (in this and the last field of the structure the where-used lists are
contained in their state before the activity that triggered the event was executed. The current state
must be read from the database if necessary.
br,
Rob -
ORA-01008 All variables are not bound
Hi I am running this query and getting this exception ORA-01008 All variables are not bound .
Could anyone please insight ?
SELECT EQMT_INGT_LOG_ID, EQMT_ID,
XMLSerialize(DOCUMENT XMLType(ingLog.BUCK_SLIP_XML) AS CLOB) BUCK_SLIP_XML
FROM TOS_EQMT_INGT_LOG ingLog
where BUCK_SLIP_XML is not null and ingt_date between to_date(:fromDate, 'MM/DD/YYYY HH24:MI')
and to_date(:toDate,'MM/DD/YYYY HH24:MI' )
and eqmt_id in (select eqmt_id from tos_eqmt
where eqmt_init = :eqmtInit and eqmt_nbr = :eqmtNbr
and orig_loca_id in (select loca_id from tos_loca where altn_src_sys_stn_id = :circ7 ))
and SCAC = :scac
and STCC = :stcc
and SHPR_NAME = :shprName
and CNSE_NAME = :cnseName
and driv_id in (select driv_id from tos_driv where lcns = :lcns )
and driv_id in (select driv_id from tos_driv where sabv = :sabv )
and ingt_stat_ind = :ingtStatInd
and BUCK_SLIP_XML like :inspectedBy
ORDER BY INGT_DATESlightly off-topic but what do you think this does :
XMLSerialize(DOCUMENT XMLType(ingLog.BUCK_SLIP_XML) AS CLOB) BUCK_SLIP_XML? -
How can I display char if a variable is null
Hi All,
How can I display char if a variable is null in sap business object
item name
Office Visits
Non-Emergency ED Utilization
Non-Preferred Pharmacy
above items are value and they are populating for this month but form next month "Inpatient Stays" a new item will add at database level
i want to display this item with current month
final result should be
item name
Office Visits
Non-Emergency ED Utilization
Non-Preferred Pharmacy
Inpatient Stays
i have tried with ISNULL function but it is not working
please help i am using SAP BO 3.1
Thanks in Advance
RanjeetYou should be able to findout NULL using isnull([object]) function.. at report layer..
Try with the below formula which should work for you
=If Isnull(trim([object])) then "Inpatient Stays" else [Object]
Maybe you are looking for
-
I cannot get Photoshop CS4 Extended to open raw CR2 files from my Canon 5D MkIII. Adobe Bridge will not open a thumbnail, either. The same files open fine in Lightroom 5.6. I am working with Windows 7 Pro and Intel Core i7 on a Dell Vostro.
-
Hi In our existing SAP system, we have five tax groups and we have assigned four tax groups to PA , PSA. But the last tax group Eg. 5 its not assigned for any PA and PSA. So customer want to delete the unused tax group. So here, if we delete that, wh
-
Re: BPC; Legal and Management Consolidation
Hello, Would it be possible to have both legal and management consolidation with one Appset and two different Applications? One Application for legal consolidation and another for Management consolidation? Please share your inputs. Kind regards, RJ
-
Hi all, FD-32 transaction is used for the credit management and once we save the data the data gets updated in KNKK table. I want to know whether we can crreate an entry in KNKK table without having credit control area as if we try to do it through F
-
The apple ID on my iphone 5 is different from the ID on my computer, my iTunes and Apple account. I am unable to change the Apple ID on my pone even with syncing to the computer and itunes. Thanks.