RSR_OLAP_BADI -  initialization method

We have created an  implementation using the RSR_OLAP_BADI. In the INITIALIZATION METHOD we are using the code shown below from one of the white papers. The code goes through the characteristics and key figures and finds there position in the table. That position is used in an ASSIGN statement in the COMPUTE METHOD so we can put a value in our virtual key figures. The code for characteristics works fine but the code for key figures does not.
What we found in debug is that field VALUE_RETURNNM in  table I_TH_SFK does not contain a value for any of our key figures.
Does anyone know how or where the table I_T_SFK is filled?
Regards,
Mike...
**CODE:
class cl_exm_im_rsr_olap_badi definition load.
get field postions for characteristics in structure
  loop at i_th_sfc assigning <l_s_sfc>
  where user_exit ne rrke_c_mode-none.
field name in structure is keyreturnnm
name of the global variable
    concatenate 'P_CHA' <l_s_sfc>-chanm
        into l_global_name separated by '_'.
fill the global variable
    unassign <l_global>.
    assign (l_global_name) to <l_global>.
    check <l_global> is assigned.
    <l_global> = cl_exm_im_rsr_olap_badi=>get_field_position_d(
    i_fieldnm = <l_s_sfc>-keyreturnnm
    i_s_data = i_s_data ).
  endloop.
get field positions for key figures in structure
loop at i_th_sfk assigning <l_s_sfk>
       where value_returnnm is not initial.
name of the global variable
    concatenate 'P_KYF' <l_s_sfk>-kyfnm
        into l_global_name
        separated by '_'.
fill the global variable
    unassign <l_global>.
    assign (l_global_name) to <l_global>.
    check <l_global> is assigned.
    <l_global> = cl_exm_im_rsr_olap_badi=>get_field_position_d(
                                       i_fieldnm = <l_s_sfk>-value_returnnm
                                       i_s_data  = i_s_data ).
  endloop.

Fred,
The reference to VALUE_RETURNNM is in the LOOP for Key Figures
in methond INITIALIZE.
get field positions for key figures in structure
loop at i_th_sfk assigning <l_s_sfk>
where value_returnnm is not initial.
name of the global variable
concatenate 'P_KYF' <l_s_sfk>-kyfnm
into l_global_name
separated by '_'.
fill the global variable
unassign <l_global>.
assign (l_global_name) to <l_global>.
check <l_global> is assigned.
<l_global> = cl_exm_im_rsr_olap_badi=>get_field_position_d(
i_fieldnm = <l_s_sfk>-value_returnnmi_s_data = i_s_data ).
endloop.

Similar Messages

  • Raising custom error message in generic service initialize method of Pr&for

    Dear all,
    I am developing the HCM process form.
    Is it possible to raise an error if any condition is not met in initialize method in generic service of HCM process & forms?
    If possible could you please provide me the steps/process.
    Thanks & Regards,
    Krishna K

    Change for a BADI more suited (not in the update of after-save process) like ME_PROCESS_PO_CUST (Method PROCESS_ITEM, CHECK).
    ME_PURCHDOC_POSTED  is too late.
    Regards

  • Initialize method in JAAS login module

    Hi All,
    In my JAAS login module (extended AbstractLoginModule) deployed on WAS 6.40 (sneak preview) my initialize method is being called for every browser session. I have added some logging in the login module contructor, even that is being called for every new browser session. Is this the expected behaviour?
    I guess the initialize method should be called on once.
    regards,
    Vishal

    Hi,
    We had the same problem.
    What we found was that Sap has a new Login Module called HeaderVariableLoginModule which you have to create using the class com.sap.security.core.server.jaas.HeaderVariableLoginModule. You can do this in NWA -> Configuration -> Authentication and Single Sign-On -> Login Module, then click on the create button and fill out the fields with the information i just gave you.
    The list of Login Modules should now include HeaderVariableLoginModule, which you can configure by selecting the row of this module, and adding two options-  ume.configuration.active=true and Header=REMOTE_USER.
    It appears that this Login Module is covertly delivered as a class in every Netweaver version >= 7.0.
    Good luck,
    Steven McElwee, Duke University
    PS- I tried to attach a word document that shows the procedure for this, but this system rejected it. I can email it you if you let me know where to send it. In our case we used "Header=uid" rather than "Header="REMOTE_USER".

  • Java collaboration initialization method- exists on javacaps 5.1.1?

    Hi everyone
    I have javacaps version 5.1.1
    I want cache properties on a Map in a Java collaboration definition.
    Has a Java collaboration definition an initialization method? or how can implement it?
    Any help will we appreciated

    I do not think in such method exists. If you need to implement the cache at begining of the collaboration- Have a static method in side that method limplement your load properties code. This will gurantee the cache available as long as your JVM life i.e until restart the Integration Server instance.
    Cheers
    Raghu

  • External drive not showing up - which disk initialization method will NOT erase the data on that external hard drive?

    Hi,
    as thousands of other users, my WD Passport drive worked like a charm until yesterday and now it wont show on any computer, but does show in the Disk management and when plugged in , the Disk Management offers two ways of initialization : MBR and GPT
    i dont understand any of that and want to know if any of those two methods will make the disk initialize wITHOUT loosing the data on the drive?
    i looked on so many forums and some people say that it will and others that it will not erase the data. 
    can you please tell me what is correct?? also a suggestion is to add some more wording to that initializaiton dialog box so that we can know what initialization does and doesnt
    thank you so much

    Try connecting it to a different computer to see if you can access the data, under no circumstances should you Initialize the drive as all existing data will be lost.
    If you still can't access your files, then remove the drive from the case and connect it via an extra SATA cable and power connector (you usually need a desktop PC in order to do this if the drive is a 3.5 inch model, a 2.5in drive will fit into a laptop
    if you have a spare slot).
    J W Stuart: http://www.pagestart.com
    Never be afraid to ask. This forum has some of the best people in the world available to help.

  • RSR_OLAP_BADI Compute method is not trigerred

    Hi there,
    I have a problem with RSR_OLAP_BADI used for Virtual characteristics. I have defined the BADI based on the defention RSR_OLAP_BADI. I followed the following steps.
    1-Created my implementation based on RSR_OLAP_BADI.
    2-Created my virtual characteristics and added it to the rows of the query which is based on an infoset.
    3- Added my Infoset to the fillters of the BADI and then added the attributes to the class generated. in the form P_CHA_Z0PA_IS02___F210, etc.
    4-In the define method, I used a standard code which I copied and adjusted to fit my needs .
    5- In the Compute method, I hardcoded the virtual chara value for testing in a statement such as
    method IF_EX_RSR_OLAP_BADI~COMPUTE.
    FIELD-SYMBOLS <FS_F210> TYPE ANY .
    BREAK-POINT.
    P_CHA_Z0PA_IS02___F210 = SY-DATUM.
    <FS_F210> =  P_CHA_Z0PA_IS02___F210 .
    endmethod.
    Now, the problem is that when I execute the query and try to debug the BADI the system never breaks at the compute method as if it is not getting trigerred  but when i generate that query it does break at the define method. is there some step missing, is it possible that I should use an exit variable on the virtual chara so that it gets the compute method trigerred.
    Please advise....and points are the least i can do to say thanks.
    Cheers,
    Jad

    Issue resolved, the code in the define method was not correct and therefore the compute was not getting executed,
    Regards,
    Jad

  • Virtual Key Figures in RSR_OLAP_BADI COMPUTE Method not recalculated

    Hi,
    Please clarify why is the COMPUTE METHOD of RSR_OLAP_BADI not always 
    triggered or executed.
    For instance, my query is drilled down by customer and
    material by default. Upon opening the query and after entering
    the appropriate selections, the virtual key figures that I have
    used in the query are correct .
    However, if i make any change to the query and run it in RSRT, the BADi method COMPUTE is not executed.
    Is this really the normal behavior of the said BADI? Why is
    it unstable?

    Hi Rohit,
    I have a similar problem the compute method is not trigerring and i am trying to debug it but it is not breaking at all, although when i generate from rsrt it breaks at a breakpoint of define method however i have defined another break at compute method but not breaking.
    I am using the infoobject inside the query but and tried to hard code it  for testing in the compute method but doesnt seem to be getting executed.
    Please help.
    Cheers,
    Jad

  • Question on initialize method (p. 255 of  WDJ Tutorial #3 )

    At the top of p. 25 of Tutorial #3, the code block says to add the line:
    (a)
    wdContext.currentContextElement().setBirthday(new Date(0)));   
    When I do this, an error message results saying that setBirthday takes a string argument.
    So I change the above line to:
    b)
    wdContext.currentContextElement().setBirthday(new Date(0)));   
    and the error message goes away. 
    What's going on here?  Is (a) a mistake in the tutorial, or have I overlooked something somewhere ?
    Thanks
    Dave

    Yep it seems there is an error on page 12. If you import the attached source and if you check the simple type BirthDay in the dictionary (in your studio), you can see that the build-in type is set to date and not to string. It is also expected to use a date type for a birthday.
    Regards,
    Christophe

  • Initializer block not called when static method called

    public class Initializer {
         Initializer(){
              System.out.println("Constructor called");
                   System.out.println("CLASS INITIALIZED");
         static void method(){
              System.out.println("Static method called");
         public static void main(String[] args) {
              Initializer.method();
    From the JLS
    A class or interface type T will be initialized immediately before the first occurrence of any one of the following:
    T is a class and an instance of T is created.
    T is a class and a static method declared by T is invoked.
    [b]
    But when i call the static method , if the class is initialized shouldnt the initializer block be called, it is not called, why.

    Perhaps running something like this will add a little more colour?:
    public class Initializer {
        static {
            System.out.println("First static initializer");
            System.out.println("First instance initializer");
        Initializer() {
            System.out.println("Constructor");
        static {
            System.out.println("Second static initializer");
            System.out.println("Second instance initializer");
        static void staticMethod() {
            System.out.println("staticMethod");
        void instanceMethod() {
            System.out.println("instanceMethod");
        public static void main(String[] args) {
            System.out.println("main");
            staticMethod();
            new Initializer().instanceMethod();
    }

  • RSR_OLAP_BADI  or RSR00002 --not getting triggered from RSRT --Please Help

    Hi All
    Quick reposnse is highly Appreciated and rewarded.
    I wanted to implement a Virtual Key Figure .I have implemented RSR_OLAP_BADI .But when i execute query through RSRT .This BADI is not getting triggered infact its not reaching the Break Point which i have set in DEFINE and COMPUTE methods. I tried setting break point in user exit RSR00002 too but not working.
    Is there any attribute or properties or any technical setting that have to be done for Query to trigger this BADI.Or any settings in BADI required ?
    I am using infocube 0SD_C03 as the filter in BADI attributes.

    Hi!
    Check attributes for you implementation class.
    In DEFINE method set rrke_c_mode-no_selection for your virtual char.
    after that generate query in rsrt (if you set break in INITIALIZE method - you can debug)
    then run the query (if you set break in COMPUTE method - you can debug if query return some data).

  • How to reference Key figure in (BAdI) IF_EX_RSR_OLAP_BADI~COMPUTE method?

    Hi,
    I am a new bee to the ABAP world.
    I am writing a BAdI implementation (Definition name: RSR_OLAP_BADI) for a 'Virtual KeyFigure' named D_TAX1.
    I dont know how to set the value for key figure D_TAX1 in BADI implementation COMPUTE method (IF_EX_RSR_OLAP_BADI~COMPUTE).
    D_TAX1 is a virttual key figure I had added in DSO.
    I want to populate the value in BADI compute method (IF_EX_RSR_OLAP_BADI~COMPUTE).
    I haven't written any method implementation for IF_EX_RSR_OLAP_BADI~DEFINE.
    Is it mandatory that I need to write some thing there? I haven't declared any attributes either.
    I want to set tax amount to the D_TAX1 virtual key figure based on the amount (another key figure in DSO).
    I don't know if I need to write this, but the class name in BAdI is: : ZCL_IM_VAL_IMPL.
    I really appreciate your help in this matter.
    Thank you.
    Sekhar

    Thank you for your answers.
    I have added the following code to the methods DEFINE, INITIALIZE & COMPUTE methods.
    method IF_EX_RSR_OLAP_BADI~DEFINE.
      DATA: l_s_chanm TYPE rrke_s_chanm,
          l_kyfnm TYPE rsd_kyfnm.
      FIELD-SYMBOLS:
          <l_s_chanm> TYPE rrke_s_chanm.
    Insert Code
    CASE i_s_rkb1d-infocube.
      WHEN 'D_DSOIC1'.                                "DSO name
        l_s_chanm-chanm = 'D_CST1'.              "Characteristic
        l_s_chanm-mode = rrke_c_mode-read.
        APPEND l_s_chanm TO c_t_chanm.
        APPEND 'D_TAX1' TO c_t_kyfnm.          "D_TAX1 is a newly added Virtual KeyFigure
    ENDCASE.
    ENDMETHOD. "if_ex_rsr_olap_badi~define
    [In the following INITIALIZE method, I didn't change any thing. I used the INITIALIZE method from the CL_EXM_IM_RSR_OLAP_BADI as is]
    method IF_EX_RSR_OLAP_BADI~INITIALIZE.
      DATA: l_global_name TYPE string.
      FIELD-SYMBOLS:
            <l_global>    TYPE i,
            <l_s_sfc>     TYPE rrkg_s_sfc,
            <l_s_sfk>     TYPE rrkg_s_sfk.
    there's no need to change this method
    Just create attributes for each charactersitic
    with name P_CHA_<characteristic> TYPE i.
    and constants for each key figure with name
    P_KYF_<key figure> TYPE i.
      CLASS cl_exm_im_rsr_olap_badi DEFINITION LOAD.
    get field postions for characteristics in structure
      LOOP AT i_th_sfc ASSIGNING <l_s_sfc>
           WHERE user_exit NE rrke_c_mode-none.
    field name in structure is keyreturnnm
    name of the global variable
        CONCATENATE 'P_CHA' <l_s_sfc>-chanm
            INTO l_global_name
            SEPARATED BY '_'.
    fill the global variable
        UNASSIGN <l_global>.
        ASSIGN (l_global_name) TO <l_global>.
        CHECK <l_global> IS ASSIGNED.
        <l_global> = cl_exm_im_rsr_olap_badi=>get_field_position_d(
                                           i_fieldnm = <l_s_sfc>-keyreturnnm
                                           i_s_data  = i_s_data ).
      ENDLOOP.
    get field positions for key figures in structure
      LOOP AT i_th_sfk ASSIGNING <l_s_sfk>
           WHERE value_returnnm IS NOT INITIAL.
    name of the global variable
        CONCATENATE 'P_KYF' <l_s_sfk>-kyfnm
            INTO l_global_name
            SEPARATED BY '_'.
    fill the global variable
        UNASSIGN <l_global>.
        ASSIGN (l_global_name) TO <l_global>.
        CHECK <l_global> IS ASSIGNED.
        <l_global> = cl_exm_im_rsr_olap_badi=>get_field_position_d(
                                           i_fieldnm = <l_s_sfk>-value_returnnm
                                           i_s_data  = i_s_data ).
      ENDLOOP.
    endmethod.
    METHOD if_ex_rsr_olap_badi~compute.
      FIELD-SYMBOLS <fs_d_tax1> TYPE ANY.
      FIELD-SYMBOLS <fs_d_cst1> TYPE ANY.
      ASSIGN COMPONENT p_kyf_d_tax1 OF STRUCTURE c_s_data TO <fs_d_tax1>.
      ASSIGN COMPONENT p_cha_d_cst1 OF STRUCTURE c_s_data TO <fs_d_cst1>.
      <fs_d_tax1> = 10.
    ENDMETHOD.
    When I display the virtual key figure D_TAX1 in the query, it is not populated with value 10.
    Can you guys please tell me what I need to change?
    I haven't written any code in GET_FIELD_POSITION_D (in the example class CL_EXM_IM_RSR_OLAP_BADI, this method is implemented).
    I appreciate your suggestions and help.
    Thank you,
    Sekhar

  • Using a non-static vector in a generic class with static methods

    I have a little problem with a class (the code is shown underneath). The problem is the Assign method. This method should return a clone (an exact copy) of the set given as an argument. When making a new instance of a GenericSet (with the Initialize method) within the Assign method, the variables of the original set and the clone have both a reference to the same vector, while there exists two instances of GenericSet. My question is how to refer the clone GenericSet's argument to a new vector instead of the existing vector of the original GenericSet. I hope you can help me. Thanks
    package genericset;
    import java.util.*;
    public class GenericSet<E>{
    private Vector v;
    public GenericSet(Vector vec) {
    v = vec;
    private <T extends Comparable> Item<T> get(int index) {
    return (Item<T>) v.get(index);
    public static <T extends Comparable> GenericSet<T> initialize() {
    return new GenericSet<T>(new Vector());
    public Vector getVector() {
    return v;
    public static <T extends Comparable> GenericSet<T> insert (GenericSet<T> z, Item<T> i){
    GenericSet<T> g = assign(z);
    Vector v = g.getVector();
    if (!member(g,i))
    v.addElement(i);
    return g;
    public static <T extends Comparable> GenericSet<T> delete(GenericSet<T> z, Item<T> i){
    GenericSet<T> g = assign(z);
    Vector v = g.getVector();
    if (member(g,i))
    v.remove(i);
    return g;
    public static <T extends Comparable> boolean member(GenericSet<T> z, Item<T> i) {
    Vector v = z.getVector();
    return v.contains(i);
    public static <T extends Comparable> boolean equal(GenericSet<T> z1, GenericSet<T> z2) {
    Vector v1 = z1.getVector();
    Vector v2 = z2.getVector();
    if((v1 == null) && (v2 != null))
    return false;
    return v1.equals(v2);
    public static <T extends Comparable> boolean empty(GenericSet<T> z) {
    return (cardinality(z) == 0);
    public static <T extends Comparable> GenericSet<T> union(GenericSet<T> z1, GenericSet<T> z2) {
    GenericSet<T> g = assign(z1);
    for(int i=0; i<cardinality(z2); i++) {
    Item<T> elem = z2.get(i);
    insert(g, elem);
    return g;
    public static <T extends Comparable> GenericSet<T> intersection(GenericSet<T> z1, GenericSet<T> z2) {
    GenericSet<T> g = initialize();
    for(int i=0; i<cardinality(z2); i++) {
    Item<T> elem = z2.get(i);
    if(member(z1, elem))
    insert(g, elem);
    return g;
    public static <T extends Comparable> GenericSet<T> difference(GenericSet<T> z1, GenericSet<T> z2) {
    GenericSet<T> g = initialize();
    for(int i=0; i<cardinality(z1); i++) {
    Item<T> elem = z1.get(i);
    if(!member(z2, elem))
    insert(g, elem);
    for(int i=0; i<cardinality(z2); i++) {
    Item<T> elem = z2.get(i);
    if(!member(z1, elem))
    insert(g, elem);
    return g;
    public static <T extends Comparable> GenericSet<T> assign(GenericSet<T> z) {
    GenericSet<T> g = initialize();
    for(int i=0; i<cardinality(z); i++) {
    Item<T> elem = z.get(i);
    insert(g, elem);
    return g;
    public static <T extends Comparable> boolean subset(GenericSet<T> z1, GenericSet<T> z2) {
    for(int i=0; i<cardinality(z1); i++) {
    Item<T> elem = z1.get(i);
    if(!member(z2, elem))
    return false;
    return true;
    public static <T extends Comparable> int cardinality(GenericSet<T> z){
    Vector v = z.getVector();
    return v.size();
    }

    The issue is not "reference a non-static interface", but simply that you cannot reference a non-static field in a static method - what value of the field ed would the static method use? Seems to me your findEditorData should look something like this:   public static EditorBean findEditorData( String username, EditorBean editorData )
          return editorData.ed.findEditor( username );
       }

  • Facing problem in creating socket in a method from an already deployed application exe while same method is working from another exe from same environment from same location.

    Dll Created In: - MFC VC
    6.0
    Application Exe Developed In:
    - VC 6.0, C# and VB.net (Applications which are using dll)
    OS: - Windows XP sp2 32bit
    / Windows Server 2008 64 bit
    Problem: - Facing problem in creating socket
    in a method from an already deployed application exe while same method is working from another exe from same environment from same location.
    Description: - We have product component which
    has an exe component and from exe we invoke a method, which is defining in dll, and that dll is developed in MFC VC6.0. In the dll we have a method which downloads images from another system after making socket connection. But every time we are getting Error
    code 7, it is not giving desire result while same method is working from another exe from same environment from same location. And also me dll is deployed on many systems and giving proper output from same application.
    Already Attempt: - Because error is coming on
    client side so what we did, we created a driver in C# which invokes same method from same environment(on client machine) using same dll and we are astonished because it worked fine there.
    Kindly Suggest: -
    We are not able to figure out root cause because nothing is coming in windows event logs but what I did, for finding the problem line, I wrote logs on each line and found the exact line in application exe which is not working,
    actually  it is not executing Create () method,
    I will give snippet of the code for understanding the problem because we are not finding any kind solution for it.
    Kindly assist us in understanding and fixing this problem.
    Code Snippet: -
    Int Initialize (LPTSTR SiteAddress, short PortId)
    try
    CClientTSSocket *m_pJtsSockto;
    m_pJtsSockto = new CClientTSSocket;
    LONG lErr = m_pJtsSockto->ConnectTS(csIPAddress,PortId);
    ErrorLog (0, 0, "--------ConnectTS has been called ------------","" );
    catch(...)
    DWORD errorCode = GetLastError();
    CString errorMessage ;
    errorMessage.Format("%lu",errorCode);
    ErrorLog (0, 0, "Image System", (LPTSTR)(LPCTSTR)errorMessage);
    return  IS_ERR_WINDOWS;
    Note: -
    CClientTSSocket extends CAsyncSocket
     IS_ERR_WINDOWS is a macro error code which value I found 7.
    LONG ConnectTS(CString strIP, UINT n_Port)
    ErrorLog(0,0,"ConnectTS is calling Create [is going to call]","");
    if(!Create())
    ErrorLog(0,0,"ConnectTS is calling [Create not called successfully] ","");
     n_Err = GetLastError();
     ErrorLog(n_Err,0,"ConnectTS is calling1111111111111111Erorrrrrrrrrrrrr","");
    return NET_INIT;
    ErrorLog(0,0,"ConnectTS is calling2222222222222222222","");
    if(!AsyncSelect(0))
    n_Err = GetLastError();
    return NET_INIT;
    if(!Connect(strIP,n_Port))
    n_Err = GetLastError();
    ErrorLog(n_Err,0,"ConnectTS","");
    return SERVER_NOT_CONNECTED;
    Code description: -
    From
    int GETImage_MT() method we call Initialize() method and pass client machine IP and Port and there we call
    ConnectTS() method, In this method we Create() method and finally it returns the error code as mention in macro 7.
    Logs after running the program: -
    --------ConnectTS has been called ------------
    ConnectTS is calling Create [is going to call]
    Image System 
    0
    Note: - According to logs, problem is coming in Create method().
    Here 0 is errorMessage received in catch block. And from catch block it returns macro value 7. And when we run same method individually from same machine, same environment through same dll
    from different exe, it is working fine and we are facing any kind of problem. While same problem application was working properly earlier but now continuously it showing problem.
     Kindly assist us to resolve the issue.

    Pointer variable was already initialized; I have mention in code; kindly assist us.
    Dll Created In: - MFC VC 6.0
    Application Exe Developed In: - VC 6.0, C# and VB.net (Applications which are using dll)
    OS: - Windows XP sp2 32bit / Windows Server 2008 64 bit
    Problem: - Facing problem in creating socket
    in a method from an already deployed application exe while same method is working from another exe from same environment from same location.
    Description: - We have product component
    which has an exe component and from exe we invoke a method, which is defining in dll, and that dll is developed in MFC VC6.0. In the dll we have a method which downloads images from another system after making socket connection. But every time we are getting
    Error code 7, it is not giving desire result while same method is working from another exe from same environment from same location. And also me dll is deployed on many systems and giving proper output from same application.
    Already Attempt: - Because error is coming
    on client side so what we did, we created a driver in C# which invokes same method from same environment (on client machine) using same dll and we are astonished because it worked fine there.
    Kindly Suggest:
    - We are not able to figure out root cause because nothing is coming in windows event logs but what I did, for finding the problem line, I wrote logs on each line and found the exact line in application exe which is not
    working, actually it is not executing Create () method, I will give snippet of the code for understanding
    the problem because we are not finding any kind solution for it. Kindly assist us in understanding and fixing this problem.
    Code Snippet: -
    Int Initialize (LPTSTR SiteAddress, short PortId)
    try
    CClientTSSocket *m_pJtsSockto;
    m_pJtsSockto = new CClientTSSocket;
    LONG lErr = m_pJtsSockto->ConnectTS(csIPAddress,PortId);
    ErrorLog (0, 0, "--------ConnectTS has been called ------------","" );
    catch(...)
                       DWORD errorCode = GetLastError();
                       CString errorMessage ;
                       errorMessage.Format("%lu",errorCode);
                       ErrorLog (0, 0, "Image System", (LPTSTR)(LPCTSTR)errorMessage);
                       return  IS_ERR_WINDOWS;
    Note: - CClientTSSocket extends CAsyncSocket
     IS_ERR_WINDOWS is a macro error code which value I found 7.
    LONG ConnectTS(CString strIP, UINT n_Port)
              ErrorLog(0,0,"ConnectTS is calling Create [is going to call]","");
              if(!Create())
                       ErrorLog(0,0,"ConnectTS is calling [Create not called successfully] ","");
              n_Err = GetLastError();
              ErrorLog(n_Err,0,"ConnectTS is calling1111111111111111Erorrrrrrrrrrrrr","");
                      return NET_INIT;
              ErrorLog(0,0,"ConnectTS is calling2222222222222222222","");
              if(!AsyncSelect(0))
                       n_Err = GetLastError();
                       return NET_INIT;
              if(!Connect(strIP,n_Port))
                       n_Err = GetLastError();
                       ErrorLog(n_Err,0,"ConnectTS","");
                       return SERVER_NOT_CONNECTED;
    Code description: - From int GETImage_MT() method
    we call Initialize() method and pass client machine IP and Port and there we call ConnectTS() method, In
    this method we Create() method and finally it returns the error code as mention in macro 7.
    Logs after running the program: -
    --------ConnectTS has been called ------------
    ConnectTS is calling Create [is going to call]
    Image System  0
    Note: - According to logs, problem is coming in Create method(). Here
    0 is errorMessage received in catch block. And from catch block it returns macro value 7. And when we run same method individually from same machine, same environment through same dll from different exe, it is working fine and we are facing any kind of problem.
    While same problem application was working properly earlier but now continuously it showing problem.
     Kindly assist us to resolve the issue.

  • Stateful Session Bean Initialization (EJB 3.0)

    Hi all!
    In EJB 2.1 the initialization was with create (args) methods. NOw, how is it exploited? Create methods are no more there and there must be a way to send parameters to the stateful session bean when it is newly created...isn't it?
    Thank you!

    There is no pre-defined equivalent of a create method in EJB 3.0. If you want to initialize a
    stateful session bean, just define a business method that the client should use as an initialization
    method.

  • Abstract method called in an abstract class

    Hello,
    I am writing some code that I'd like to be as generic as possible.
    I created an abstract class called Chromozome. This abstract class has a protected abstract method called initialize().
    I also created an abstract class called Algorithm which contains a protected ArrayList<Chromozome>.
    I would like to create a non abstract method (called initializePopulation()) which would create instances of Chromozome, call their method initialize() and full the ArrayList with them.
    In a practical matter, only subclass of Algorithm will be used, using an ArrayList of a subclass of Chromozome implementing their own version of initialize.
    I have been thinking of that and concluded it was impossible to do. But I'd like to ask more talented peaple before forgetting it !
    Thanks,
    Vincent

    Ok, let's it is not impossible, juste that I had no idea of how doing it :-)
    The difficulty is that Algorithm will never have to deal with Chromozome itself, but always with subclass of Chromozome. This is usually not an issue, but in that case, Algorithm is required to create instances of the desired subclass of Chromozome, but without knowing in advance wich subclass will be used (I hope what I say makes any sense).
    Actually I may have found a way in the meantime, but maybe not the best one.
    I created in Algorithm an abstract method :
    protected abstract Chromozome createChromozome()The method initializePopulation will call createChromozome instead of calling directly the constructor and the initialize() method of Chromozome.
    Then subclass of Algorithm will implement the method createChromozome using the desired subclass of Chromozome.

Maybe you are looking for