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.

Similar Messages

  • Download of pdf to our local system by using classes in webdynpro abap

    hi,
    I createa an application ,in that i converted Smartform to Pdf.I want to download the generated pdf to our local system by using "cl_wd_runtime_services" because we cant directly use FM GUI_DOWNLOAD directly.So can any one please tell me the process.

    Hi ,
    see the below code..
    call function 'CONVERT_OTF'
          exporting
            format                = 'PDF'
          importing
            bin_filesize          = pdf_size
            bin_file              = LV_PDF
          tables
            otf                   = lt_otfdata[]
            lines                 = l_dummy
          exceptions
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 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.
    lv_string = filename
    cl_wd_runtime_services=>attach_file_to_response(
          i_filename  =  LV_STRING
          i_content   = lv_pdf
          i_mime_type = 'pdf/application'
          i_in_new_window = abap_false
          i_inplace       = abap_false ).
    this will open a popup same as when u download some file...
    Regards
    Yash

  • 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

  • Calling a method in Class from webdynpro

    Hi All,
    I have to perform some action when i click the button created in my webdynpro screen.
    However I must not write the code for the button action inside the button event. But I have to create a class and inside the class i have to create the method for this button event.
    Can anyone tell me how to call a method in a class created in SE24 from webdynpro on clicking the button.
    Thanks in advance.

    hi..
    When you want to perform some action after clicking a Button, then you have to write the code only in 'Events' - 'On Action' event. From your question, i assume that, you wanna use Assistance class in your webdynpro so as to increase better performance. Here is the link which will guide yuo with screen shot for using assistance class in WD-ABAP.
    http://wiki.sdn.sap.com/wiki/display/WDABAP/AssistanceclassfunctionalityinWDA
    thanks,
    Padma

  • 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

  • To call standard tcode in webdynpro( thru webgui) : Assistance class

    Hi Gurus,
    I have an alv display in which the vbeln entries have link to action control.
    i.e when i click vbeln( sales order no), it should open a new window through its/webgui.
    1.I am getting following error when i activate , get_execute_location is private/protected.
    2. How do i go about the following code:
    wd_comp_controller->execute_get_location(
    IMPORTING
    e_host = lv_host
    e_out_protocol = lv_out_protocol
    e_port = lv_port ).
    Within my method of my assistance class I call an interface in class cl_http_server to procure my host,
    protocol and port number.
    CALL METHOD cl_http_server=>if_http_server~get_location
    IMPORTING
    host = e_host
    port = e_port
    out_protocol = e_out_protocol.
    Can some one explain in detail.
    Best Regards,
    Navin Fernandes.

    Hi Navin,
    To display a standard tcode in your webdynpro application using  ITS  you can use the following code
    DATA: url TYPE string,
            host type string,
            port type string.
    *Call below method to get host and port
      cl_http_server=>if_http_server~get_location(
         IMPORTING host = host
                port = port ).
    *create URL
      CONCATENATE 'http'
      '://' host ':' port
      '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=' 'SE11'
       INTO url.
    *get the window manager as we are opening t code in external window.
      DATA lo_window_manager TYPE REF TO if_wd_window_manager.
      DATA lo_api_component TYPE REF TO if_wd_component.
      DATA lo_window TYPE REF TO if_wd_window.
      lo_api_component = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
    *  call the url which we created above
      lo_window_manager->create_external_window(
      exporting
      url = url
      receiving
      window = lo_window ).
      lo_window->open( ).
    Hope this helps!
    Best Regards,
    Radhika Vadher.

  • 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.

  • 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

  • How to use messages in WebDynpro-ABAP

    Hi,
        How to use messages in WebDynpro-ABAP.
    Does it has any class to manage messages like IWDMessageManager or we can just use standard SAP Message types.. like E,W,X,I,S..
    I hope it have a message container to display messages.
    Thank U for Ur time.
    Cheers,
    Sam

    Hi Sam,
    U can hard code the message or u can use the Assistance class's text elements to store the messages.
    1) Code to display hard coded message:
    report message
    CALL METHOD l_message_manager->report_attribute_error_message
    EXPORTING
    message_text = "Enter the correct Connection ID"
    element = elem_flightinfo
    attribute_name = 'CONNID'.
    2) Code to display message from text element of assistance class:
    lv_text = wd_assist->if_wd_component_assistance~get_text( key = '002' ).
    report message
    CALL METHOD l_message_manager->report_attribute_error_message
    EXPORTING
    message_text = lv_text
    element = elem_flightinfo
    attribute_name = 'CONNID'.
    Where Message "Enter the Correct Connection ID" is stored in Text Element with key '002'
    Hope this helps,

  • Restarting or Reloading Webdynpro ABAP(FPM) application in Portal

    Hi All,
    I have created a ABAP webdynpro application in FPM framework which is run in the portal. The application has got a roadmap that contains 7 steps. In the last step there is a button 'save and exit'. When the user reaches the last step and presses the 'save and exit' button, one popup will appear with a 'close' button. When the user pressed that 'close' button, the application should restart i.e., the user should be taken to the first step. I tried using the method 'NAVIAGATE_ABSOLUTE' where I hardcoded the PCD path which takes the user to the first step but it is not helpful ( All Relative navigation links and Detailed navigation links were missing in portal ) in my case as it is not actually restarting the application. Could anyone help me out in getting the application restarted in the portal on click of a button.
    Note: We tried with Exit-Plug as well, which is not applicable ( helpful) for portal integration.
    Please suggest.
    Thanks
    Deepak

    Hi Deepak,
    Well we have few webdynpro applications with multiple views, by design, on the last step after save, we disable all other button and display a new button called 'RESTART' with only available choice. On click of this button
    1. We initialize all the data of component.
    2. Clear stored variable parameters & internal table used by assistance class
    3. if everything was fine fire navigation to the FirstDefaultView of the webdynpro application.
    Thus its almost restart of the application.
    So design wise have a method  INIT_COMP  in the component controller of webdynpro component. and then at the last step when call to RESTART is made reinitialize all the data of your webdynpro component.
    method onactionrestart.
    wd_assist->reinit_my_obj_tables( ).
    wd_this->fire_to_v_Start_plg(  ).
    endmethod
    Greetings
    Prashant

  • Calling custom Infotype method from Webdynpro Abap

    Hi Experts,
    I am working on an application where i need to call a method of a custom defined infotype.
    I have done this -->
    1. Create a custom infotype 9111
    2. SAP creates a class of that infotype ZCL_HRPA_INFOTYPE_9111
    3. Inside this method there are few inherited method which provide me functionality of insert , update , delete
    i want to call methods IF_HRPA_INFTY_BL~MODIFY,
    IF_HRPA_INFTY_BL~INSERT
    However when i call these method from webdynpro abap this method does not work.
    where as when i try to insert an entry using PA30 transaction it works.
    Does anyone know why does this happen and what is the solution?
    Regards,
    Ashish Shah

    Hi Ashish,
    You need to create method inside your assistance class, the class your webdynpro component talks to.
    Within the methods of Assistance class you will have to create instance of ZCL_HRPA_INFOTYPE_9111 and call its  method IF_HRPA_INFTY_BL~INSERT  passing the data.
    Cheers
    Prashant

  • WEBDYNPRO ABAP APPLICATION

    Hi
    I want to know how to post data in ztable in SAP through webdynpro using ABAP application.
    Please provide general documents for it if any.
    Regards,
    Chaitali

    Hi,
    First, to post the data into your Ztable design the necessary UI will all the selections and ncesssaery fields and the custom button to save the data to the table.
    Correct procedure for storing the data to table is done using the zclasses & Objects(OOPS) where you internally create the methods which inturn have either the ZBAPI (for Ztable) or Zfunctionmodules or using the assisatnce class.
    Use this custom class in UI and create a object for it.
    On the button handlers, you can use the object and call thee respective method to store the data.
    For ABAP Objects you can refer to any documentation in ABAP Objects forum for designing classes and usage of objects.
    Assistance Class -
    http://help.sap.com/saphelp_nw04s/helpdata/EN/43/1f6442a3d9e72ce10000000a1550b0/content.htm
    Standard WD component - DEMO_COMMON_ASSISTANCE1 for reference.
    Regards,
    Lekha.

  • Why do we go for Webdynpro ABAP?

    Hi All,
             Why do we go for Webdynpro ABAP and How is it beneficial comparing with other technologies in SAP?
    Thanks
    Gopi.

    hi ,
    u may wish to like to go thru this WIKI
    http://wiki.sdn.sap.com/wiki/display/WDABAP/General+Issues#GeneralIssues-1.95
    in whch WD ABAP is compared with WD JAVA , BSP , JSP and HTMLB and mobile infrastrucutre .
    u may wish to go thru these WD ABAP tutorials :
    http://help.sap.com/saphelp_nw2004s/helpdata/en/03/0048413e466e24e10000000a155106/content.htm
    Main Topic Page:
    http://sdn.sap.com/irj/sdn/nw-wdabap#section2
    Tutorials for Beginners:
    Web Dynpro for ABAP: Tutorials for Beginners [original link is broken]
    eLearning Videos:
    /people/thomas.jung/blog/2006/06/20/web-dynpro-abap-demonstration-videos
    go thru this quote by thomas
    The designers of WDA didn't want to lock developers into having to create an extra model layer. One of the values of WDA is that it sits closely with the underlying business logic and data. Therefore it can easily reuse existing function modules or classes (or even contain SQL directly - although this isn't recommended).
    There are different options for playing the role of model. You could create a faceless web dynpro component. This is sometimes used in large complex Floorplan Manager applications. However the cross-component context binding can represent a performance problem.
    More often a class is used as a simple model. These are called feeder classes in POWL. But really any ABAP class can be used to separate out the logic for the model. Data from this class can be accessed and then bound to the local context. Sometimes people use the Assistance Class as a model. It is possible to share a single instance of an assistance class between a hierarchy of components - making it an efficient way to share data.
    Of course there are the service call wizards. These aren't really models like in WDJ. Instead they are just shortcuts to generate context structures and code generators. However everything they generate can also be created by hand or altered after generation.
    rgds,
    amit

  • Is there any way to create a folder in presentation server - webdynpro abap

    Hello,
    My requirement is to create a folder in presentation server using webdynpro abap..
    I tried on this CL_GUI_FRONTEND_SERVICRES classes ..but its getting an short dump.
    Is there any way to create folder using classes / FM..
    Regards,
    Praveen kumar reddy s.

    Hi PRaveen,
    Check this.. WD_TEST_APPL_ACFEXECUTE
    Check Thamos article..
    http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/109b9b52-bc00-2c10-8786-e4c5e96d7e04
    go for help..
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b91539878a2d67e10000000a42189c/content.htm
    Cheers,
    Kris.
    Edited by: kissnas on May 10, 2011 2:24 PM

  • Calling a webservice from webdynpro ABAP.

    Hi,
    Anybody have doc/material with screenshots on calling a webservice from webdynpro ABAP (In WAS 7.0 version using service calls )  with clear steps ?
    Thanks in advance. Ponts will not be a constraint for right answers
    Praveen
    Edited by: Praveen kumar Kadi on Feb 23, 2009 11:19 AM

    Hi Praveen,
    1st Step : configure Logical Port
    http://help.sap.com/saphelp_nw70/helpdata/EN/16/285d32996b25428dc2eedf2b0eadd8/frameset.htm
    2nd Step : Generate Proxy Object
    http://help.sap.com/saphelp_nw70/helpdata/EN/16/285d32996b25428dc2eedf2b0eadd8/frameset.htm
    3rd Step : Instantiating the proxy object & calling the methods exposed by webservice
    data: sys_exception type ref to cx_ai_system_fault,
          sys_exception2 type ref to cx_ai_application_fault,
          client_proxy type ref to zco_myesa, "MY PROXY CLASS
          lv_ret_code type int4,
          lv_input type zsend_email_input,
          lv_response type zsend_email_response.
    data: lv_from type string,
          lv_from_address type string,
          lv_to type string,
          lv_to_address type string,
          lv_subject type string,
          lv_msg type string.
    lv_input-from = 'MYSAPTEST'.
    lv_input-from_address = '<someAddress>'.
    lv_input-to = 'Prashant'.
    lv_input-to_address = '<someAddress>'.
    lv_input-subject = ' TEST'.
    lv_input-msg_body = ' Hi this is wonderfull to see it work'.
    try.
    create object client_proxy
    exporting
    logical_port_name = 'BASIC'. " Basic is a TYPE G RFC Destination
    call method client_proxy->send_email
       exporting
         input  = lv_input
       importing
         output = lv_response    .
      catch cx_ai_system_fault  into sys_exception .
        data lv_err type string.
         lv_err = sys_exception->if_message~get_text( ).
         write: / lv_err.
      catch cx_ai_application_fault into sys_exception2  .
         lv_err = sys_exception->if_message~get_text( ).
         write: / lv_err.
    endtry.
    if lv_response is initial.
       write: /'Not Executed'.
    else.
       write: /'Did Execute'.
    endif.
    Greetings
    Prashant

Maybe you are looking for

  • How do I create multiple TEBs with one submit button on one page in Captivate 7

    I've read other posts on this topic (which refer primarily to earlier versions of Captivate) and am still at a loss as to how to put multiple text entry boxes on a page with one submit button. Here's my scenario: I am creating test questions. Each te

  • Dual Screen Problem

    I'm trying to connect my iMac to a monitor using a DVI lead. I can get my Macbook conencted, though it only seems to show 16 colors right now, however, when trying with the iMac, I don't get any mention of the second screen. I had the same problem wi

  • HT2486 is address book and contact the same program

    I need to build and print a mailing list, is Address Book and Contact the same program on my Macbook Pro?  I was considering getting Bento4 - not sure what to do

  • System dependet default SAP GUI Design

    Hi to all! In the SAP GUI, there is the possibility to set  system design dependent. So it is different from R3 system to R3 system. Is there a way to change the design on the R3 system or what criteria will be the default design chosen? Thanks Herma

  • Mac's Safari will not hide the top bar when in full screen please help

    So in my Safari when I enter full screen to watch a video the top bar won´t disappear no matter how long I wait and this is one of the little details that just **** me off. Here's a picture of it: http://i.imgur.com/0rGaE.jpg Please tell me how to fi