Checkbox in Web Dynpro

Hi,
I have created a checkbox in a table of webdynpro view. On toggle, i have created an action in which i'm disabling a button when the user check the checkbox. That is working fine. But when i check on checkbox in the table, all of checkboxes in that column got checked. How to solve this problem, please suggest.
Thanks,

Hi,
Within your On ClickAction Method, please write like that
DATA lo_nd_nd_mom_det TYPE REF TO if_wd_context_node.
  DATA lo_el_nd_mom_det TYPE REF TO if_wd_context_element.
  DATA ls_nd_mom_det TYPE wd_this->element_nd_mom_det.
  DATA lt_nd_mom_det TYPE wd_this->elements_nd_mom_det.
navigate from <CONTEXT> to <ND_MOM_DET> via lead selection
  lo_nd_nd_mom_det = wd_context->get_child_node( name = wd_this->wdctx_nd_mom_det ).
@TODO handle not set lead selection
  IF lo_nd_nd_mom_det IS INITIAL.
  ENDIF.
get element via lead selection
  lo_el_nd_mom_det = lo_nd_nd_mom_det->get_element(  ).
***Getting the Table Records
  CALL METHOD lo_nd_nd_mom_det->GET_STATIC_ATTRIBUTES_TABLE
    IMPORTING
      TABLE = lt_nd_mom_det.
  data : l_count type i,l_index type sy-tabix.
  clear l_count.
***Set count based upon the Cilck
  loop at lt_nd_mom_det into ls_nd_mom_det where check = 'X'.
    l_count = l_count + 1.
  endloop.
  clear ls_nd_mom_det.
***Check Count value is Greater the One
  if l_count > 1.
    read table  lt_nd_mom_det into ls_nd_mom_det with key ZZ_SERIAL_NO = wd_comp_controller->g_serial_no.   
    ls_nd_mom_det-check = ' '.
    l_index = sy-tabix.
    MODIFY  lt_nd_mom_det INDEX l_index  FROM ls_nd_mom_det transporting check.
endif.
    read table  lt_nd_mom_det into ls_nd_mom_det with key check = 'X'.
    wd_comp_controller->g_serial_no = ls_nd_mom_det-ZZ_SERIAL_NO.
   CALL METHOD lo_nd_nd_mom_det->bind_table( lt_nd_mom_det ).
Here ZZ_SERIAL_NO is Key field in my Table.
Regards,
Vijay

Similar Messages

  • Web Dynpro ABAP: How to do checkboxes in table column?

    Hi,
    In Web Dynpro for ABAP, I have a table, where one column consists of check boxes, and the user should be able to check some boxes in some lines. In the context of my view, I created a node tied to a DDIC structure, with some attributes. The attribute where I want to see the checkboxes is of type boolean. In the layout I create an element of type table. Then I create the binding to the context node and for the columns I use cell editor of the appropriate type, that is, checkbox. However, when I test my application, there are no checkboxes at all. What am I doing wrong?
    Thanks,
    Ira

    >
    Jenny Karunakaran wrote:
    > Hi Jung,
    >
    > Thanks for the reply. But I dont know how to assign value set to this attribute(i.e. Context atribute to which filter value property is bound). Can I use a supply function for this ?
    >
    >
    > Regards,
    > Jenny
    No. A value set and a supply function are two completely different things. You use this Context API to populate the value set for an attribute:
    IF_WD_CONTEXT_NODE_INFO=>SET_ATTRIBUTE_VALUE_SET
    Value Sets are also how ByKey UI elements (like the DropDownByKey) are built.  Here is a help document that discusses value sets - but in the context of the ByKey UI elements.  The process is the same for creating the value set however:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/bb/69b441b0133531e10000000a155106/frameset.htm

  • How to find a BADI to change the default value of a Web Dynpro Screen?

    Hello Experts!!
    My requirement is as follows-
    The SAP cProjects Distribution Functions screens default the Calculation Base to “Per Day”(This is represented via the initially-selected value in a listbox). The requirement is to make it deafult to the current standard “Per Month” (This also appears in the list box).
    Is there any BADI to achieve this?
    I tried putting a debug point in the Get_Instance method of the class cl_exithandler to find all the BADIs associated with the screen. I got a bunch of BADIs with no luck. And now I am not even able to debug anymore as the debuger is not opening. Can anybody tell me why this is happening? It was working two days before. And yes I have read all the posts about debugging a web dynpro application and I am doing everything that is mentioned there- I have set an external debug point and I have checked the "IP Matching" checkbox against my name in the workbench, but, with no luck
    Any help on this will be greatly appreciated.
    Thanks and Regards,
    Smitha

    You can't do this on a running VI. If you have an idle VI, you can open a reference to that VI and use an invoke node with the Make Current Values Default method, but that will only work in LV (i.e. not in an EXE) and will affect all the controls. What you can do is save the values to a file and load them when the program starts. OpenG's File I/O package includes some VIs which will help you with that.
    Try to take over the world!

  • Access KM predefined property values from a Web Dynpro application

    Hi,
    I am trying to build a custom search interface in Web Dynpro which leverages the KMC Indexing and Search services.
    In this interface I would like to display value lists of predefined properties in KM (created using the Property Metadata Service) and bind each predefined property's value list to a checkbox group UI element.
    Which KM API should I use to retrieve the values of a specific predefined property ?
    When using the standard flexible user interface in the portal this can easily be achieved through configuration, but now I would like to know how to achieve this in Java code.
    Thanks in advance for your input.
    I have some idea on how to get the propertymap from a resource, but how can I access the metadata of a predefined property in KM directly ?

    Hi Theo, i'm working on something like this, i have a WD application that is accessing Km through a Webservice, on the webservice ejb i have this problem:
    IResourceFactory resFactory = ResourceFactory.getInstance();
    IRepositoryServiceFactory serFactory = resFactory.getServiceFactory();
    IPropertyConfigurationService propConfigService = (IPropertyConfigurationService) serFactory.getService("PropertyConfigurationService");
    IMetaNameListIterator i = propConfigService.getMetaModel().nameIterator();
         while (i.hasNext()) {
         IMetaName metaname = i.next();
         if ( metaname.getDocumentPatterns()!= null){
         propertyData.setId(metaname.getName());
         propertyData.setName(metaname.getLabel(locale));
         propertyData.setNamespace(metaname.getNamespace());
         propertyData.setDescription(metaname.getDescription(locale));
                    propertyList.add(propertyData);
    On this line serFactory.getService("PropertyConfigurationService") i get the following error on the trace:
    #System.err#sap.com/KmmsListEAR#System.err#Guest#2####30a27fa0cbfa11dbace30018de0545f1#SAPEngine_Application_Thread[impl:3]#Error##Plain###Configuration Framework error: unable to create an IConfigClientContext instance from an EP5 userInitialConfigException: The configuration service locator could not be initialized for any of the environments. The configuration framework is not available.#
    #System.err#sap.com/KmmsListEAR#System.err#Guest#2####30a27fa0cbfa11dbace30018de0545f1#SAPEngine_Application_Thread[impl:3]#Error##Plain###InitialConfigException: The configuration service locator could not be initialized for any of the environments. The configuration framework is not available.
    Do you have any idea of how to solve this? or if you accomplished in a different way, can you guide me a little bit.
    Thanks in advance Theo

  • How to add a javabean Model to a web dynpro Project

    Hi all,
    I have been following the tutorial "Using EJBs in Web Dynpro Applications" for creating a customized LOCAL webdynpro application, based in javabean Model. It was made by just exporting the JAR file from a java project, as it is explained in the tutorial. OK.
    The problem comes when I want to duplicate the development but using a DC Web Dynpro Project. I have re-develop every step of the tutorial but using DC projects:
    DC diccionary project, DC ejb project, DC enterprise application project & DC java project.
    But now I DO NOT KNOW the steps for importing the development into a model for DC Web Dynpro.
    Anyhelp will be very appreciated, thanks in advance-

    Thanks Jhansi,
    Yes, you are right. I had already followed those steps. The error comes when I have to select between the JavaBean Source:
    1. project (source folder) (checkbox)
    2. public parts of used DC's (combobox)
    I have been trying both, the second one by copying first the JAR called CommandBean.jar of my DC Java Project with dependencies to EJB project into the web dynpro "lib" folder, and then selecting the new entry CommandBean.jar from that combobox.
    then i get de following error: "Invalid JAR - No JavaBeans available for import"
    So I do not know how to use any of these two options for java source.
    Thanks.

  • How to get User Id in Web dynpro application

    Hi Experts,
    I am running web dynpro application with authentication checkbox set. I want to display user id of the user in my application. I am using following code in Init method of component controller.
    IWDClientUser wdUser = WDClientUser.getCurrentUser();
    WdContext.currentContextElement().setUserName           (wdUser.getClientUserID());
    Here I am getting some integer value as userId.
    I am not using Portals, so solutions suggested for portal are not useful for me .
    Is there any way to get this uset id.
    Thanks in advance

    hi
    try this piece of code
              IWDClientUser wdUser = WDClientUser.getCurrentUser();
              IUser user = wdUser.getSAPUser();
              if (user != null)
                        IUserAccount[] acct = user.getUserAccounts();
                        if(acct[0] != null)
                                  String strUserid = acct[0].getLogonUid();
    wdContext.currentZtms_Fm_Regupdate_InputElement().setAssoid(new String(strUserid));
    Note: Defining the IUser will show an error. To resolve this, within the properties of
    the project, choose Java build path -> Libraries -> Add external jars ->
    com.sap.securities -> lib -> com.sap.security.api. Open this file and retype the code.

  • Web Dynpro Application throws NoClassDefFoundError for IAspect

    Hi All
    I decided to teach myself a little bit more about Web Dynpros and the Composite Application Framework and as such started working through SAP's tutorials. Currently I'm busy with 'Using a Composite Application via a Web Dynpro UI' - at the section where I need to programmatically populate a DropDownByKey with the location names. I followed the tutorial's instructions step for step, but after deploying and running my application I receive the following error message:
    java.lang.NoClassDefFoundError: com/sap/tc/col/client/generic/api/IAspect
    Sometimes IAspect is replaced by IStructure.
    The detailed error provides this message:
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to create delegate for component com.sap.carpool.travel.Travel. (Hint: Is the corresponding DC deployed correctly? Does the DC contain the component?)
    It seems as if it is struggling to find the DC containing IAspect and IStructure, but I have included
    tc/col/runtime (default)
    in the 'Used DCs' of my Web Dynpro DC.
    Any ideas what might be causing this or how to fix it?
    Thanks in advance,
    JP

    Hi Valery,
    Thanks for the reply.
    It seems like that to me as well. I can use the code as I've imported
    com.sap.tc.col.client.generic.api.IAspect;
    , but when it actually tries and load the implementation it can't find it?
    Unfortunately, checking the run-time (or build or deploy time) checkboxes on tc/col/runtime did not help.

  • A problem when start web dynpro application....

    each time I start  web dynpro application, I always be asked to provide username and password,
    but one of  my colleague was only ased that for the first time.......
    it puzzled me very much, anybody helps me out?

    the box is checked by default , isn't it.......
    but it seems that the checkbox is not work.....i still have to asked to provide username/password
    thanks for your answer..

  • What kind of data types in Web Dynpro can be bound to Interactive Form?

    Hello
    Apparently it is not possible to bind a Web Dynpro Context variable of type boolean to a checkbox in an interactive form. We get the PDF Document Render Exception until the data type is changed to string, then the generation seems to work. Does anyone know what data types in Web Dynpro other than String can be bound to an Interactive Form Document? Is there any information about this in help.sap.com/adobeforums.com/elsewhere? I have researched a bit, but couldn't get a general statement on this topic.
    Thank you for your help!
    Kind regards
    Bettina Hepp

    Hi,
    You can Bind the Boolean type of webdynpro to the CheckBox in Adobe Interactive Form.
    Just define the value Attribute in the Context of type Boolean and bind the Checkbox in Aif with this attribute.
    Sample Code:
    if (wdContext.currentContextelement.reason == true)
    ur validations.....
    Regards
    Mustafa

  • How to change parameter ALLOW_BROWSER in web-dynpro ?

    hi,
    i have a request where i have to change the property ALLOW_BROWSER in a web-dynpro from NO to YES.
    when i get in portal content administration this property is NOT changeable. the value NO is 'undergreyed' as well
    as the property CachingLevel

    Hi
    have a look on this thread
    1. Problem with getting table element's table row
    2.How to select the entire row by selecting the checkbox in a table
    BR
    Satish

  • Web Dynpro Error Messages

    Hi Guys,
    I have the ff scenario:
    1. I have a web dynpro with a tabstrip.
    2. I have a save button.
    My problems are:
    1. When I raise error message via lo_message_manager->report_attribute_error_message, the error message is raised and the field in error is highlighted but when I navigate to another tab, the error message disappears.
    I want the error to show even when I navigate to another tab.
    2. When I click the 'save' button, i tried to read the error message via lo_message_manager->get_messages( ), but there's no data returned. There's an error and yet it executes the save button.
    I want the error to show until all the issues were solved before it can actually proceed with the saving.
    How can I achieve this?

    Hi Deepankar,
    I guess putting all the validations in WDDOBEFOREACTION is okay if I have few views and fields.
    But I have a lot.
    I cannot do all my validations in WDDOBEFOREACTION.
    It is important that I do my validation in ONACTION events on each fields.
    So that when the user hits enter or click a dropdown list or click a checkbox, the error would then be raised right away if there's any.
    Because I have so many tabs and dropdowns and checkbox and validations on enter, WDDOBEFOREACTION will get triggered so many times.
    I can't activate is_permanent also because it sometimes prevents the user in doing any action. I have non-editable fields that are dependent on other fields for entry. When I tried correcting the field that it's depending to, it won't trigger the onaction event, thus the screen seems not responding which in fact it just want the context attribute to be corrected.
    Is there no other way to catch the errors when the user clicks the button?
    I noticed that I can only read the messages in WDDOBEFORENAVIGATION and not in any other places, but this WDDOBEFORENAVIGATION is executed after ONACTION event of the button. My processing is already executed before I had the chance to read the error.
    Please advice.

  • Coding standards for Web dynpro ABAP

    Hello all,
    Can anybody please help me by providing the code review checklist for Web dynpro ABAP?
    Thanks and Regards,
    Rohini Shankar

    Hello friend,
    WebDynpro     *
    1     Do not implement Data intensive operations in UI layer     
    2     Avoid database selects in the WebDynpro code.Use the corresponding BAPIs ,Methods     
    3     Are ABAP OO Classes like Assistance class are being used for application coding ?     
    4     Are Windows/Views only used for the sole purpose of hosting views and context?     
    5     Are a reasonable number of views put in a single WD Component instead of creating multiple WD Components ?     
    6     Unneccessary usage of dynamic programming and dynamic component avoided      
    7     Are singleton nodes used in case of nesting in the context ?     
    8     Is deep nesting of containers, Groups and Tabstrips avoided ?     
    9     Is the UI element TreeByKey or TreeByTableNestingColumn used instead of the Tree UI element ?     
    10     Is the checkbox "Accessibility Checks Active" ticked in the WD Component properties     
    11     Are the WD Component Instances deleted when no longer needed (IF_WD_COMPONENT_USAGE=>DELETE_COMPONENT)     
    12     Are the OTR texts defined  for all the labels, texts(where ever appropriate) in properties of all the UI elements      
    13     Has the Generation limit been checked for all the components developed     
    14     Sufficients commets are written at the beginning of every major block to explain the processing logic.     
    *Error Handling     *
    1     Is SY-SUBRC checked after CALL function modules      
    2     Use Assertions if you face unexpected errors which usually never ever occur!     
    Extended Check and Clean Up
    1     Have following been removed :     
         ·      Unused variables                       
         ·      Unused text elements                   
         ·      Unused tables from TABLES statement     
         ·      Commented out parts of the code     
         ·      Code segments which do nothing     
    2     Is extended program check completed  and all errors/warnings removed      
    These are the things which i used for my project.
    Thanks,
    Sri Hari

  • Closing web browser from a Web Dynpro (ABAP) component in it

    Hi,
    I am opening a Web Dynpro component in IE.
    I have a requirement to close the Internet Explorer window on click of a "Close" Button in Web Dynpro (ABAP) component. I am using EXIT Outbound plug of the Main Window to perform the same.
    In the EXIT plug I am setting "CLOSE_WINDOW" parameter to ABAP_TRUE.
    On click of the "Close" button a pop-up dialog box (with "Yes" and "No" buttons) appears asking me whether I really want to close the IE window.
    If I click on "Yes" button of the dialog box, the IE window gets closed without any issues.
    But when I click on "No" button, the IE window shows up a blank screen. I want the control to come back to the calling Web Dynpro component's screen.
    Appreciate any help/guidance in the above issue.
    Thanks,
    Prasanna

    create an action 'YES','NO', 'CANCEL' in required view.
    copy and paste below code in YES action
    method ONACTIONYES .
      data : l_view_cntr type ref to if_wd_view_controller,
    l_win_cntr type ref to if_wd_window_controller,
    l_window type ref to if_wd_window,
    l_parameter_list type wdr_event_parameter_list,
    l_parameter type wdr_event_parameter,
    l_val type ref to data.
    field-symbols <fs> type any.
    l_view_cntr = wd_this->wd_get_api( ).
    l_win_cntr = l_view_cntr->get_embedding_window_ctlr( ).
    l_parameter-name = 'CLOSE_WINDOW'."'CLOSE_WINDOW'.
    create data l_val type c.
    assign l_val->* to <fs>.
    <fs> = 'X'.
    l_parameter-value = l_val.
    insert l_parameter into table l_parameter_list.
    l_win_cntr->if_wd_view_controller~fire_plug(
    exporting plug_name = 'EXIT_PLUG'
    parameters = l_parameter_list ).
    endmethod.
    goto your window
    create plug EXIT in Window of type EXIT and chect interface checkbox
    create a button - for example - "PUSH BUTTON"
    in pushbutton action
    copy and paste this code
    method ONACTIONEXIT_PLG .
    DATA: API TYPE REF TO IF_WD_COMPONENT,
          WINMAN TYPE REF TO IF_WD_WINDOW_MANAGER,
          WIN TYPE REF TO IF_WD_WINDOW,
          TEXT1 TYPE STRING_TABLE,
          ls_text type string,
          V_API TYPE REF TO IF_WD_VIEW_CONTROLLER.
    API = WD_COMP_CONTROLLER->WD_GET_API( ).
    WINMAN = API->GET_WINDOW_MANAGER( ).
    LS_TEXT = 'Do You Want To Close the Window'.
    INSERT LS_tEXT into table text1.
    win = winman->create_popup_to_confirm(
                                           window_title = 'CONFIRM'
                                           text = text1
                                           button_kind = if_wd_window=>co_buttons_yesnocancel
                                           message_type = if_wd_window=>co_msg_type_question
                                           window_position = if_wd_window=>co_center ).
    V_API = WD_THIS->WD_GET_API( ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_YES
            ACTION_NAME = 'YES'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_TRUE ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_NO
            ACTION_NAME = 'NO'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_FALSE ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_CANCEL
            ACTION_NAME = 'CANCEL'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_FALSE ).
    WIN->OPEN( ).
    endmethod.

  • Web dynpro break point

    hallow
    i declare in COMPONENTCONTROLLER a new metod and i dont now how to set
    a break point to now if metod get value
    how i do that?
    regards

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/849170e3-0601-0010-d59e-ddfce735fac5
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0e9a9d90-0201-0010-478e-991dbea73a30
    Debugging ABAP Code from Within the Developer Studio
    Let us assume you have a Web Dynpro application that calls function modules using Adaptive RFC, and you want to debug the corresponding ABAP code from within the Developer Studio.
    You can do this quite simply, provided that the SAP GUI is installed on your local machine and the ABAP system is connected to via a dedicated server (no load balancing). You then only have to activate the relevant setting for external debugging in the ABAP Workbench and set the breakpoint in the ABAP code before starting the Web Dynpro application on the J2EE Engine. 
    Prerequisites
    You have debugging authorization in the ABAP Workbench in the relevant system.
    Since debugging in the ABAP system via load balancing is not supported, you must reconfigure your JCO destinations so that the calls take place on a dedicated ABAP application server. For Web Dynpro, this is done in the Web Dynpro Content Administrator. In the destination maintenance, specify Single Server Connection as the Destination Type.
    Step-by-Step Procedure
    Use the SAP GUI to log on to the system or server to which the RFC call is to take place.
    You should log on with the same user with which the call will take place.
    Due to the large amount of parallel calls, using a collective user is not recommended.
    You should try to execute the application with a dedicated user throughout the duration of the debugging session.
    Activate external debugging in the ABAP Workbench.
    To do this, call the ABAP Workbench using one of the transactions SE37, SE38, or SE80.
    Choose Utilities à Settings and then the ABAP Editor tab followed by Debugging.
    Enter the user for which the debugging session is to take place. Select the Active checkbox and deactivate IP-Matching.
    Save your settings.
    Set an HTTP (external) breakpoint in the ABAP code.
    Display the source code of the relevant function module.
    Position the cursor at the place in the source code where execution is to be stopped.
    Choose the external breakpoint icon  from the toolbar. 
    The relevant line is highlighted.
    Note that the validity period for the external breakpoint is limited to 2 hours. If you require more time to debug, you must set the breakpoint again.
    Start the J2EE Engine and – if you have not already done so – deploy your application.
    Start your test application on the J2EE Engine.
    The following example of a Web Dynpro application is used to display flight data from the SAP system in a table.
    The J2EE Engine establishes a connection to the SAP GUI and starts the ABAP Debugger in a new GUI session. The Debugger is stopped at the line in the ABAP code at which the breakpoint is set.

  • Create Logical Link to ABAP Web Dynpro

    Hello,
    Within my Direct Link Group, I would like to create a Logical Link to a custom ABAP Web Dynpro.
    Is this possible?  If so, does anyone know how I can accomplish this?
    Thanks,
    Matt

    Hi Matt,
          Please follow the following steps.
    1. find out the URL for the launching BSP Webdynpro application
    2. create a URL in the spro.
    SPRO->CRM->UI framework->Technical Role Definition->Transaction launcher->Define URLs and parameters
    create a new entry and give the following entries.
    a) give the url id
    b)request method -> GET ( select from Drop down )
    c)  click on the 'Non-BSP' URL
    click the checkbox 'Determine Host/Port'  ( it will determine automatically clent and system when launch )
    Mapped LogSys - 'OWNLOGSYS'
    URL = 'sap/bc/webdynpro/sap/XXXXXX'    XXXXXX = ur webdynpro application name
    save the URL.
    3. Create a Transaction launcher and give the above created URL id in step 'Further Technical Details'
    select Transaction Type as 'URL Transaction' and enter the ID.
    4. Create a logical link and assign the transaction launcher id to it.
    5. assign the logical link to direct logical link.
    6. assign direct link to nav bar profile
    7. assign nav bar profile to Business role
    Hope this helps.
    Regards,
    Sandeep

Maybe you are looking for