Wat is  Assistance class in WD for Abap

hi,
Can any one gives perfect picture about  Asisstance class in Webdynpro abap.
Thanks in advance.
Best Regards,
Kranthi.

Assistance Class in WD is used for storing common reusable logic apart from component controller.
It can also be used to store Text Symbols for displaying messages or lables for the WD application.
Per WD session there will be one instance of assistance class ( if mentioned ) will be automatically instantiated and you can access it by wd_assist.
It can also be used to store a reusable set of constants, public attributes, types etc.
Assistance class has some standard methods like get_text to fetch text from text symbols.
To craete an assistance class you have to create a normal class and then mention CL_WD_COMPONENT_ASSISTANCE as superclass. Then you can metion you class name in WD Component Header Details.
To have a look of assistance class you can look at CL_WD_COMPONENT_ASSISTANCE class then navigate to all its Subclasses ( Assistance Class ). The methods will give you an idea of the usage.
Hope this helps
Regards
manas Dua

Similar Messages

  • Assistance class in Web dynpro ABAP

    step 1: Create WEB DYNPRO component. Example: Zwd_assist_class_test.
                 -save.
                -Active.  
    step 2: Assistance class on component(Zwd_assist_class_test)  screenwriter assist class name Example:Asistance_class.
    step3: Select the Assistance class name click on pop up new window .
    step4:Assistance class window methods  give method name
    step5: Select parameters of the methods  giving importing exporting table ,objects.
    step6:Select Attributes button given the attribute name Example:ET_MAR.
    For example methods READ_ONLY.
    coding for method: select * from <db_table> into table <ET_tab> where matnr between im_matnr1 and im_matnr2.
    I want using MARA,VBAK,VBAP tables data display in single table,creating two search fields .these are VBELN, MATNR
    how to write READ_ONLY method ?

    Hi Rajasekhar,
    The exporting parameters which you have declared can take only one record as its declared as work area. Instead you need to identify the table type and use like
    for MARA... MARA_TT
    for VBAK... VBAK_T
    for VBAP... VBAP_T
    but, for your requirement, you need not required to pass mara, vbak, vbap table data, instead you need to put into final internal table ET_result.
    I suggest you to create a table type ZTT_RESULT in SE11 which contains all your fields in the output.
    Now, inside READ_DATA( ) method you can do as below ( just an example)
    loop at lt_mara into ls_mara.
         move-corresponding ls_mara to ls_result.
         loop at lt_vbap into ls_vbap where matnr = ls_mara-vbeln.   
               move-corresponding ls_vbap to ls_result.
              read table lt_vbak into ls_vbak with key vbeln = ls_vbap-vbeln.
              if sy-subrc is initial.
                        move-corresponding ls_vbak to ls_result.
              endif.
         endloop.
    append ls_result to ET_RESULT.
    endloop.
    Hope this helps you.
    Regards,
    Rama

  • Creating ABAP class in XI for ABAP mapping

    Hi All,
    While creating ABAP class in SE80 XI I am getting following message.
    “You are not registered as a
    developer.
    Please register in the Online
    Service System (OSS).
    In the OSS you will receive
    an access key.”
    Plz guide which role I required to do ABAP mapping/class creation.
    Regards

    Hi Rohan,
    for developing abap you need a developer key. You can get it with the corresponding authorisation at <a href="https://websmp209.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000103676&_SCENARIO=01100035870000000202&">SAP OSS</a>.
    Regards,
    Udo

  • Assistance Class and Constructor

    Hi,
    I've created an assistance class + a constructor for it. This constructor needs a parameter to initialize the Assistance Class.
    However I'm unable to pass it on since the instantiation of WD_ASSIST is done by the framework.
    How can I achieve this?
    Thanks

    Yes Thomas. I totally agree with you. ideally an assistance class is always instantiated by the WD framework. But I just talked about the technical possibility of having a constructor for an assistance class.
    Apart from the embedded component usage one more possibility which comes to my mind is coverting a normal class ( being used elese where in normal report programs where constructor is necessary for instantiating parameters) into an assistance class. Although the class may be copied into a new class and then by deleting the constructor and creating a method for the purpose which constructor used to do.
    I welcome your thoughts on this scenario.

  • Assistance class not instantiated in the component controller of an ABAP WD

    I have a very weird problem when trying to launch an ABAP webdynpro I get a short dump, looking into it the assitance class does not get instantiated properly so it falls over.  It used to work, but I don't think I have substantially changed anything with the assitance class just on the layout, although something must have changed.
    In the constructor of the component controller it trys to cast (I think that is the correct term)  the assistance class from the compoent controller as below, Me->f_Alter_Ego->assistance_class is initial so that fails, it then tries to create the assistance class and falls over on create object Me->f_Assist.
      try.
        Me->f_Assist ?= Me->f_Alter_Ego->assistance_class.
      catch cx_sy_move_cast_error.    "#EC NO_HANDLER
      endtry.
      if not Me->f_Assist is bound.
        create object Me->f_Assist.
      endif.
    Extract from the short dump below.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "/1BCWDY/4LYS0NWZ8L8ENKKA93YQ==CP" had to be
         terminated because it has
        come across a statement that unfortunately cannot be executed.
        The following syntax error occurred in program
         "ZCL_WD_USER_MAINT=============CP " in include
         "ZCL_WD_USER_MAINT=============CM004 " in
        line 7:
        "You can only use "class=>method" with static methods."
    Other ABAP web dynpros in our system are fine.
    I have tried the obvious stuff like removing the assitance class from the WD component and putting it back in again.
    There is obviously somehting I am missing can anyone point me in the right direction or has experienced this before?
    Thanks,
    Tim

    Thanks Thomas,
    I could not see the wood for the trees on that one, I had syntax checked the assitance class ZCL_WD_USER_MAINT, however, that error would have been raised at runtime.
    Anyway all sorted now.
    Cheers,
    Tim

  • Relavance of assistant class in Webdynpro ABAP.

    When we can create a object for a class in the attributes tab of the component controller and acess the methods of the class directly, why do we need a assistant class.??
    Moderator message : Search for available information, post the question in Web Dynpro forum, thread locked
    Edited by: Vinod Kumar on Dec 22, 2011 3:09 PM

    Hai,
           In webdynpro ABAP,we use to write all the coding part within the component itself but there is a provision with which we can write the necessary business logic outside the component that is in a class and we can use that class as the assistance class in the current component. It is same as model class.

  • Abap error when using Web Dynpro assistance class

    Hello All,
    I created Web Dynpro component with assistance class.
    On the component controller I can see the attribute "WD_ASSIST".
    I also can use Goto  -> text symbols and create net text key.
    But when I tried to read the text:
    wd_assist->get_text( '001' ).
    There is abap error:
    Method get_text is unknown protected or private.
    I can see the method get_text inside my assistance class like this:
    IF_WD_COMPONENT_ASSISTANCE~GET_TEXT visibility - public.
    I think I missed something while creating the assistance class?
    Thanks in advanced for the help.
    Nir

    Your method call should be:
    wd_assist->IF_WD_COMPONENT_ASSISTANCE~get_text( '001' ).
    You have to supply the interface name or go into the class definition and create a public alias for that method.

  • Data fetch for range of value inside an assistance class

    I want to create an assistance class where I can fetch data for the range of values selected ( basically when I select a range of sales order ).
    I was only only successfully in creating parameters, passing single values.
    Regards,
    Krishna.

    Hi Krishna,
    Logic to fetch the data of range ( implement in the method  )
       data : lv_matnr TYPE string VALUE 'MATNR',
                lr_matnr TYPE REF TO data.
    FIELD-SYMBOLS : <lr_matnr> TYPE ANY TABLE.
    ************ Method to call range of data ************************
    CALL METHOD wd_this->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD
      EXPORTING
        I_ID               = lv_matnr
      RECEIVING
        RT_RANGE_TABLE     = lr_matnr.
    ASSIGN lr_matnr->* to <lr_matnr>.
    *************** call the method of the assistance class
    wd_assist->GET_DATA( EXPORTING IR_MATNR = <lr_matnr> ).
    ****************** parameters of the method in the assistance class ********************
    Hope this helps you
    Thanks & Regards,
    Sankar Gelivi

  • Detailed example for ABAP mapping in XI7.0 with code in  class builder

    hi experts,
                  will any one one send me the detailed example(including navigation steps) for ABAP mapping in XI7.0 with code in class builder.
                                                         Thankin u,

    Hi,
    Just go through the below link.It will guide you how to do abap mapping:
    The guide is on XI 3.0 but the same can be used in 7.0 also.
    The How-to-guide
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    This link will provide more information regarding program point of view.
    http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/content.htm
    Thanks,
    Kishore.
    Edited by: Kishore on Mar 14, 2008 4:35 AM

  • Webservice for ABAP classes

    Hi ,
        This is regarding creating about web service for ABAP classes. On searching SDN forum this is not possible.
        But we should not call methods from a class within the function module used in webservice?
        Please advice.
        Exposing WebService directly from ABAP Class not from BAPI
    Thanks
    Harsh

    [Amazon Associates Webservice|http://ecs.amazonaws.com/AWSECommerceService/2008-08-19/DE/AWSECommerceService.wsdl] is literal.
    More Details to be found [here|http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html]
    Have fun!
    anton

  • U3010Discussionu3011Code Assistant / Completion for ABAP editor

    Does any one get tired about ABAP edtor's code wizard?
    Does any one want to improve function for Abap editor?
    I want to do some research on this, starting from code completion, like Visual Assistant for MS.Visual Studio.
    Can anyone share with me about the entry point for this function? Or any limitation due to NetWeaver AS, etc?
    Thank you.

    Hi,
    When don't have any problem with that. We're currently at SAP BASIS 7 level 10 on the server side and I'm using SAP gui 710 Sp2.
    Are the code hints stil activated in your settings?
    Eddy
    PS. Which type of SDN Ubergeek/BPX suit are <a href="https://weblogs.sdn.sap.com/pub/wlg/6555">you</a>?
    Deadline: June 15th

  • Urgent Help need for ABAP Custom Process Types

    Hi Gurus,
    I have created a Custom Process Type for ABAP program which returns status (Success or Failure).
    I followed the below procedure to create a custom ABAP process type.
    In RSPC, I went to Settings -> Maintain process types
    I selected the ABAP process type and then selected the EDIT -> COPY AS and then in the process chain configuration screen, I gave a new name to the process type, changed the POSSIBLE EVENTS settings to "2 process ends "successful" or "failure" and saved the settings to confirm changes.
    Now I can see the new process type for ABAP program which returns the success or failure for the successors.
    Now, my question is, where do i write the logic for ABAP program ? how does the ABAP program returns the success or failure. Do I have to change the code in the method IF_RSPC_EXECUTE~EXECUTE to return success or failure.  Please make me clear where I can write the code? For example in my ABAP program, I am searching a table to find a specific value. If the value is not found, then the ABAP process type should return failure, if found should return success. How can I do this?
    Thanks in advance,
    Regards,
    aarthi
    [email protected]

    Hi,
       We have a similar problem. We have an ABAP program in a process chain that
    uses a custom process type with on success and on failure.
        If  the program is successful there is no problem. it will run the next process step.
        The problem is when the ABAP Program fails and even though the message class is E in our ABAP program it has a confirm popup message with a status change and asks "Save Status and Trigger Events if Appropriate".
         Once you enter Yes to continue it then continues to the next step in the program and is fine.I traced in debug where this status message is appearing. It is in CL_RSPC_LOG. There is a popup_to_confirm_step where it checks the e_status that is value J ( Framework Error upon completion). Then it submits the rspc_process_finish program to complete and call the on error process step.
         Has anyone else experienced this and is there any other documents out there to help me?
    Apologies if this is not very clear.
    Any assistance would be appreciated.
    Thanks
    Monica Mandia

  • Model in Web Dynpro for ABAP

    Hi,
    Web dynpro ( ABAP ) comes under MVC pattern. In that "MVC" V & C is clear. For business logic we are using this model.My question is while creating a web dynpro component..
    1)how model comes into the picture.
    2) Actually where we are defining this "MODEL"
    Thanks in advance
    vinoth

    Hi,
    I'm afraid you've put the MVC model in place, violating the MVC rules.
    - you use a webdynpro component as model, sharing the data via the context, this means you create the model using the controller of that component
    - Model: this is not available up to now in WDA, but that place is taken by the assistance class: [documentation|http://help.sap.com/saphelp_nw2004s/helpdata/en/43/1f6442a3d9e72ce10000000a1550b0/frameset.htm]
    - View: this in fact is only the layout tab in the views
    - Controller: all the rest: methods, attributes, context, events, actions,..
    an overview can be found in [documentation|http://help.sap.com/saphelp_nw2004s/helpdata/en/a5/1a1e3e7181b60ae10000000a114084/frameset.htm]
    grtz,
    Koen

  • Custom controller v Assistance Class

    Hi
    I have always used the assistance class to place all business logic.  I understand that this replaces the custom controller that is generally used for theis purpose in WDJ. Therefore, is the custom controller used much in WDA or is it largely redundant?
    Cheers
    Ian

    >
    Abhimanyu Lagishetti wrote:
    > Hi Ian,
    >
    >  It is not largely redundant as such, i can see two main reasons
    >
    >  1.  Configuration Controller, entire FPM is based on this. you can control the configuration of the WDA using custom controller
    >
    >  2. Business Logic, which belong to only current WDA can be put in Custom Controller so that it is more readable, where as in Assistance class we can use it in other applications when working in a team
    >
    > in both the cases you are following MVC
    >
    > Abhi
    1.  You are correct that configuration controllers are a useful feature of custom controllers; however FPM is not really based on this.  Custom Controllers/Configuration Controllers in your components are not a requirement of FPM.  In FPM your component implements a special Web Dynpro Component Interface.  The configuration of the FPM is done using component configuration of a standard SAP component.  Once again you can use Configuration Controllers in your FPM components like you would in any other component; but it is in no way a requirement to do so in order to use FPM.
    2.  Technically it is possible to place business logic in the custom controller, but my personal suggestion would be to not do so.  The context and context bindings carry a performance penalty and should only be used data that is needed by the layouts.  You end up creating custom controllers with logic that is locked into the component and only uses the attributes/methods.  What you end up with is a less useful class.  That is why I feel that using a normal ABAP class (possibly an Assistance Class) is the perfered way to go.
    I would add a third use: the service call wizards.  If you are going to use the wizards to generate calls to RFCs or other classes, it is often advisable to place this generated code into a custom controller (one of the wizard options). This is particularly useful if you are going to have more than one wizard call generated.  I guess you could make a case that this is the "business logic" that was being refered to in Item 2 above.  However I want would make the distinction that this is only the call to the business logic.

  • How to create a node with attributes at runtime in webdynpro for ABAP?

    Hi Experts,
             How to create a node with attributes at runtime in webdynpro for ABAP? What classes or interfaces I should use? Please provide some sample code.
    I have checked IF_WD_CONTEXT_NODE_INFO and there is ADD_NEW_CHILD_NODE method. But this is not creating any node. I this this creates only a "node info" object.
    I even check IF_WD_CONTEXT_NODE but i could not find any method that creates a node with attribute.
    Please help!
    Thanks
    Gopal

    Hi
       I am getting the following error while creating a dynamic context node with 2 attributes. Please help me resolve this problem.
    Note
    The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
    The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
    Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
    Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
    Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
    My code is like the following:
    TYPES: BEGIN OF t_type,
                CARRID TYPE sflight-carrid,
                CONNID TYPE sflight-connid,
             END OF t_type.
      Data:  i_struc type table of t_type,
      dyn_node   type ref to if_wd_context_node,
      rootnode_info   type ref to if_wd_context_node_info,
      i_node_att type wdr_context_attr_info_map,
      wa_node_att type line of wdr_context_attr_info_map.
          wa_node_att-name = 'CARRID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
          insert wa_node_att into table i_node_att.
          wa_node_att-name = 'CONNID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
          insert wa_node_att into table i_node_att.
    clear i_struc. refresh i_struc.
      select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
    rootnode_info = wd_context->get_node_info( ).
    rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
                                       attributes = i_node_att
                                       is_multiple = abap_true ).
    dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
    dyn_node->bind_table( i_struc ).
    l_ref_interfacecontroller->set_data( dyn_node ).
    I am trying to create a new node. That is
    CONTEXT
    - DYNFLIGHT
    CARRID
    CONNID
    As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
    Also I cannot define the structure in the ABAP dictionary because it changes based on condition
    Message was edited by: gopalkrishna baliga

Maybe you are looking for

  • Cannot Connect Imac 24" via mini dvi to HDMi adapter cable to Sony Bravia 3

    Hello Everyone, I'm having the worst time in trying to connect the following: 1. Imac 24" 3.06 dual with dvi connection 2. Mini dvi to HDMI adapter (this mac with this connection was produced only for a short while!). 3. 10' (foor) HDMI wire 3. Sony

  • Process memory leak issue  solaris 10

    I have a process which has a memory leak issue. I ran this process on solaris 9 as well as solaris 10. When i run prstat command i get a different output for two. Funny thing is that memory leak noted in solaris 10 is much more than that in solaris 9

  • FCP Not Starting Up on Macbook Pro

    So I bought the new Intel Macbook Pro and installed FCP 5.01. But FCP wouldn't start, so I checked the forums and found that it might have been because I didn't upgrade to FCP 5.1 Universal crossgrade. So, I did that, but I'm still not able to get FC

  • Sale order - mtrl - prod ord ; table link

    hi, pl tell me a link through table and field - how to get a link between sale ord - item no. - mtrl - prodn ord no. - prodn posted qty. regards

  • Dynamic create class

    hi, I want to create a class dynamic and using it in a program. How this can be done ? Thanks Wilson