Custom button control at SC Level

Hello friends,
I have enhanced a WD component on SC(/SAPSRM/WDC_DODC_SC_I_BD) to add some custom fields on the click of a button.
I have added the custom fields in SPRO >,...> extension and field control-->.. configure custom fields at item level.  and updated the same attributes in WD thru a Z enh.
Now I have to control the button to make it invisible or visible based on the SC , EDIT or DISPLAY mode.
I have two approaches.
1) In spro-> Define actions and assign actions and control actions.(thru dynamic class)
2) Webdynpro : Not able to capture the item details at init method to control the actions.
I tried option 1 thru trial and error method. But i guess i am missing something here to trigger correctly.
If anynone tried and succeeded thru either of the options or any other method, kindly post the same.
Regards,
Vinay

hello,
Please use below code in MODIFYVIEW of /SAPSRM/WDC_DODC_SC_I_BD
Bind the button visible to attibute FILL_COLUMN_VISI
DATA: lo_wd_view_controller       TYPE REF TO if_wd_view_controller,
      lo_wd_comp_controller       TYPE REF TO /sapsrm/iwci_wdi_l_fpc_general,
      lo_task_container           TYPE REF TO /sapsrm/if_cll_task_container,
      lv_pdo_fill                 TYPE /sapsrm/pdo_inst_mode,
  Instantiate the component controller and task container
    lo_wd_view_controller      = wd_this->wd_get_api( ).
    lo_wd_comp_controller      = wd_comp_controller.
    lo_task_container          = wd_comp_controller->mo_task_container.
CALL METHOD lo_task_container->get_transaction_mode
      IMPORTING
        ev_pdo_trans_mode = lv_pdo_fill.
    IF lv_pdo_fill  = gc_display.
*   Set Visibility of button Fill Column to "Invisible"
      lv_fill_column_visi = '01'.
      lo_el_visibility->set_attribute(
        name =  `FILL_COLUMN_VISI`
        value = lv_fill_column_visi ).
    ELSEIF lv_pdo_fill  = gc_edit.
  Set Visibility of button Fill Column to "Visible"
        lv_fill_column_visi = '02'.
        lo_el_visibility->set_attribute(
          name =  `FILL_COLUMN_VISI`
          value = lv_fill_column_visi ).
     ENDIF.
Regards,
Neelima

Similar Messages

  • SAPUI5 custom button control based on SAPUI5 button

    I would like to build a custom button with. The reason for this is because I reuse this button a lot of time.
    - It has two style classes.
    - The button should extend the SAPUI5 button.
    - Uses the jQuery append() function.
    How I built my button up to now:
    this.btnMyTeam = new sap.ui.commons.Button({
      text : "My Team" + "\n\n" + LanguageEntityAdapter.getInstance().getTextForLabelname("APP_NAME_MYTEAM")+"\n\n\n\n\n",
      press : function() {
      oController.onMyTeamButton();
      this.btnMyTeam.addStyleClass("StartScreenButton MyTeamImage");
    //in the onAfterRendering function of the controller
    this.btnMyTeam.$().append(
      "<span style=\"color: #8DA3D3 !important; font-size: 25px;\">" + this.getNumberOfDays() + "</span><span>\n\n"  + LanguageEntityAdapter.getInstance().getTextForLabelname("MY_TIME_CORRECTION_ISSUES") + "</span>");
    This is not a nice way !!!
    So I would like to extend the sap-ui.commons.button. And tried like this. but no success at all.
    sap.ui.commons.Button.extend("StartScreenButton", {
      metadata : {
      properties : {
      upperText : {type : "string"},
      htmlAppend1 : {type : "string"},
      htmlAppend2 : {type : "string"},
      upperText : {type : "string"},
      backgroundImgStyleClass : {type : "string"},
      events : {
      onPress : {
      init : function() {
      this.innerButton = new sap.ui.commons.Button({
      text:this.upperText,
      this.innerButton.addStyleClass(this.backgroundImgStyleClass);
      this.innerButton.addStyleClass("StartScreenButton");
      onAfterRendering : function() {
      this.append("");
      renderer : {
      render : function(oRm, oControl){
      oRm.renderControl(oControl);
      oRm.renderControl(this.innerButton);

    Hi Dominik,
    maybe you can use the following example as an orientation.
    Regards
    Michael

  • Add customer button on header level for BUS2201(PO) - SRM 7.0

    Hi,
    I want to define a customer button (with action) within PO on header level.
    Web Dynpro           FPM_OIF_COMPONENT
    Configuration          /SAPSRM/WDCC_FPM_OIF_PO_PURCH
    Task:
    Add a customer button besides standard Export button.
    I assume-afterwards I have to enhance the method onactionbutton_pressed to create my event when customer button is pressed, right?
    Could anyone please guide me how to solve this issue?
    Thanks and best reagrds
    Andreas

    Hi,
    Here are the steps to add the button, I wrote it in other thread. In my case for PO is not displayed, try to follow the steps and if you are able to show the button tell me how please.
    Add custom button in PO
    And yes ,you need to create an enhancement point in the view CNR_VIEW of the component FPM_OIF_COMPONENT, you need to create a post-exit in the method BUTTON_PRESSED, here you have a sample code:
    DATA: lv_id TYPE string,
            lv_event_id TYPE fpm_event_id.
      DATA: lo_nd_oif_application TYPE REF TO if_wd_context_node,
            lo_nd_variant TYPE REF TO if_wd_context_node,
            lo_nd_toolbar TYPE REF TO if_wd_context_node,
            lo_nd_button TYPE REF TO if_wd_context_node,
            lo_el_button TYPE REF TO if_wd_context_element,
            lo_nd_other_functions TYPE REF TO if_wd_context_node.
      DATA: lv_substring TYPE string,
            lv_substring_i TYPE i,
            lv_node_name TYPE string,
            lv_position TYPE string,
            lv_length TYPE i,
            lv_seq TYPE i.
      DATA:lt_keys TYPE STANDARD TABLE OF string,
           lv_key LIKE LINE OF lt_keys.
      TYPES:BEGIN OF y_parameters,
        name TYPE string,
        value TYPE string,
      END OF y_parameters.
      DATA: lt_parameters TYPE STANDARD TABLE OF y_parameters,
            ls_parameter LIKE LINE OF lt_parameters.
      DATA: lv_boid      TYPE bbp_guid,
            lv_botype    TYPE string,
            lv_objkey TYPE  swo_typeid,
            lv_objtype  TYPE  swo_objtyp,
            lv_object_id TYPE crmt_object_id_db,
            lv_process_type TYPE crmt_process_type_db,
            lv_object_type TYPE crmt_subobject_category_db,
            lv_rfc TYPE zgrs_co_logsys-rfc,
      DATA: lo_fpm TYPE REF TO if_fpm.
      lo_fpm = cl_fpm_factory=>get_instance( ).
      lo_fpm->raise_event_by_id( lv_event_id ).
      lt_keys = lo_fpm->mo_app_parameter->get_keys( ).
      LOOP AT lt_keys INTO lv_key.
        ls_parameter-name = lv_key.
        lo_fpm->mo_app_parameter->get_value(
          EXPORTING  iv_key = lv_key
          IMPORTING  ev_value = ls_parameter-value  ).
        INSERT ls_parameter INTO TABLE lt_parameters.
      ENDLOOP.
      lv_id = wdevent->get_string( 'ID' ).
      lo_nd_oif_application = wd_context->get_child_node( name = wd_this->wdctx_oif_application ).
      lo_nd_variant = lo_nd_oif_application->get_child_node( name = wd_this->wdctx_variant ).
      lo_nd_toolbar = lo_nd_variant->get_child_node( name = wd_this->wdctx_toolbar ).
      lo_nd_other_functions = lo_nd_toolbar->get_child_node( name = wd_this->wdctx_other_functions ).
      lv_substring = lv_id.
      lv_length = STRLEN( lv_id ).
      lv_seq = lv_length - 3.
      IF lv_id+lv_seq = '_CP'.
        lv_substring = lv_substring(lv_seq).
        lv_id = lv_substring.
      ENDIF.
      WHILE lv_substring CS '_'.
        lv_position = sy-fdpos + 1.
        lv_substring = lv_substring+lv_position.
      ENDWHILE.
      IF lv_substring CO '1234567890'.
        lv_substring_i = lv_substring.
      ENDIF.
    * Item level action;
      IF lv_id CS '_item'.
    * Or header level action;
      ELSE.
        IF lv_id CA '0123456789'.
          lv_position = sy-fdpos - 1.
          lv_node_name = lv_id(lv_position).
          IF lv_id CS 'OTHER_FUNCTIONS'.
            lo_nd_button = lo_nd_other_functions->get_child_node( name = wd_this->wdctx_button ).
            lo_nd_button->set_lead_selection_index( index = lv_substring_i ).
            lo_el_button = lo_nd_button->get_element(  ).
            TRY.
                lo_el_button->get_attribute(
                EXPORTING
                  name =  `EVENT_ID`
                IMPORTING
                  value = lv_event_id ).
              CATCH cx_wd_context.
            ENDTRY.
            READ TABLE lt_parameters INTO ls_parameter WITH KEY name = 'SAPSRM_BOTYPE'.
            lv_botype = ls_parameter-value.
            READ TABLE lt_parameters INTO ls_parameter WITH KEY name = 'SAPSRM_BOID'.
            lv_boid = ls_parameter-value.
    *         Obtain the object_id;
            SELECT SINGLE object_id INTO lv_object_id
             FROM crmd_orderadm_h
             WHERE guid EQ lv_boid.
    *         If not Z button, exits;
            IF lv_event_id(1) NE 'Z'. EXIT. ENDIF.
    *      Actions;
            CASE lv_event_id.
              WHEN 'ZBUTTON'.
              WHEN 'ZBUTTON2'.
            ENDCASE.
          ENDIF.
        ENDIF.
      ENDIF.

  • How to control custom button display or hide in toolbar

    I had been added four buttons in Acrobat Tool bar.
    Now I find a function AVToolButtonSetComputeEnabledProc in SDK that this function only control the button enable or disenable.
    Now I want to control the custom button display or hide, how can I to do?
    Does this SDK have a API to achieve my  need?

    As of Acrobat X, we no longer support dynamic hiding/showing – only enable/disable.

  • Add customer button to check status screen

    hi everyone
    i'm quite new in developing srm and need your help.
    my customer wants me to put a new customer button on the check status web screen at item level which is supposed to work like the print button.
    so if i want to integrate this customer button do i have to modify the screen and html template? as far as i know there is no customer exit for this?!
    thanks in advance!

    Hi
    <u>Which SRM version are you using ?</u>
    <b>The addition of a new button for a new process means modification to standard screens, HTML templates used in the relevant Internet (Web) Services and the releavnt source code.
    Addition of button can only be done through ITS Template change.Please look in the Internet services say - BBP_BID_INV (for Bid Invitations) Or for service - BBPSC01 (shopping cart) for the exact template in whcih you want to add the button</b>
    <b>You have to define a new button in the screen and in the template. Then assign to it an OK_CODE and manage it in the PBO of the screen.</b>
    There is no BADI which can do this as this is not a SAP funtionality. You need to do a little bit of research on this to get the job done.
    <b>As a start step, You can use the BADIs - BBP_CUF_BADI and  BBP_CUF_BADI_2 to change the display from customer-defined fields to the SAP standard screen. This BAdI enables you to control whether the fields can be edited, and how they are displayed.</b>
    MODIFY_SCREEN method will Show/hide field display and restrict edit options.
    <u>For more information on BADI please go to SPRO -> BADI.
    OR View the information on BADI's.</u>
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
    <u>Implement -  BADI - BBP_CUF_BADI (in SRM 4.0) to display a customized screen.</u>
    <b>Related link -></b>
    a new button required on shoppingcart screen
    <u>Hope above proves helpful to you.</u>
    Regards
    - Atul

  • Custom button in FPM component

    Hello experts,
    In a requirement i want to add custom button in FPM_OIF_COMPONENT. For this i followed following steps -
    1. In SE80 transaction open FPM_OIF_COMPONENT
    2. Select the requisite component configuration.
    3. Start Configurator.
    4. In configuration, enter component name & configuration ID then select option 'Continue in Display mode'.
    5. In display mode, in 'Additional Functions', select 'Create customization' or if configuration already exists, then select 'Edit Configuration'.
    6. In toolbar schema, I added one toolbar element as 'Other Function' and set the properties as enabled checked and visibility as 'Is Visible'.
    7. Save.
    8. After this to control the action of the new button, i added the action 'ZACT' in 'CNR_VIEW' by enhancing the view.
    9. In SPRO->SRM->Cross application basic settings->Extensions & fieldcontrol->Assign actions, i assigned the action to set type and business object.
    10. Then in SPRO->SRM->Cross application basic settings->Extensions & fieldcontrol->Control Actions->Configure control on header level, I added PDO action type, BO type, PDO action enabled, dynamic class & method to control the button visibility.
    After doing all the steps above, when i open the required window in SRM portal, I am unable to view the custom button added.
    Please let me know where i am going wrong.

    Hi Yayayi,
    You need to refer FPM event id of the corresponding button but not action id. As you said you have given FPM_EVENT_ID as ZACT, write the code in process event of component controller of  your WDP component in which IF_FPM_UI_BUILDING_BLOCK interface has been re-implemented.
    But dont forget to follow the below steps shown in snapshot.
    Hope this helps you.
    Thanks
    KH

  • SharePoint Ribbon custom button "enablescript"

    Hi,
    I want to set  permission for  all selected items in library.
    I 've added custom button   to ribbon.
    My custom button{  find all selected items and redirect to "mypage.aspx?ids=12,25,45" } .
    In them there is no problem....
    But..
    if curentuser  does not have  full control  permissions  then  mybutton must be disable..
    EnableScript not working:((
    I 'have tried this and like this  examples.
    I inserted alert('') between rows..
     and this row not working.
    context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), Function.createDelegate(this, this.onFailureMethod))
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/f21ad6b1-445a-497d-a286-d3ba8c2928a6/how-to-get-the-current-user-permission-level-on-a-list-item-with-ecmascript

    Hi,
    This enablescript  not working.
    function ItemhasPermissions() 
     {    var buttonState= true;
          var selectedItems = SP.ListOperation.Selection.getSelectedItems();
          var count = CountDictionary(selectedItems);
          if (count > 0)
               var i;
               for (i in selectedItems)
    if( !selectedItems[i].get_effectiveBasePermissions().has(SP.PermissionKind.editListItems))
      buttonState=false;
    return buttonState;

  • How to create a custom Button in a SNP planning book

    Hi Experts,
    I created my own Planning Book and Dataview in SNP with 3 Key Figures: KF1, KF2, KF3. Now I want to create one my own button with Macro so that when I press that button, the Macro will run to calculate: KF3 = KF1 + KF2.
    I know that I can drag this Macro to one of default events like: Default, Level Change, Start. But actually, I want to create my own button so that I can handle the event as I want.
    My question are:
    1. How to create a custom button on the toolbar of SNP Planning book and writing macro for the button?
    2. Please give me any document, material teaching about writing macro and relating to my above scenario.
    Thanks very much!
    Duyennx
    Edited by: xuanduyen on Sep 6, 2011 9:20 AM

    Hi,
    Access the transaction "/n/sapapo/advm". In the list select your planning book/ data view and click 'Start Macro Builder' button.
    In the Macro builder screen, drag and drop your macro from Macro depot to the work area.
    Right click on your macro name and select 'properties'. In the pop up, next to the Assigned Push button field, there is a button 'Choose'. Click that. It will display all the available icons. In standard system, it displays more than 1000 icon. Choose any one icon which is suitable for your macro function. Close the pop up and save the macro. This will assign a push button to your macro.
    In the Planning book tool bar, you can see the selected icon in the header tool bar. Just by clicking that icon, you can execute the macro interactively.
    And I don't know whether we can include/design our own icon. But there are already 1000+ standard icons to choose.
    Regards,
    Manimaran M.

  • Hi, i created and bought a 74 pages book on iPhoto that costs me around 96 euros. It was delivered with a all 2 pages badly printed. It is not acceptable that there is no quality control at this level of price.I am very disappointed and wo't buy again!!!

    hi, i created and bought a 74 pages book on iPhoto that costs me around 96 euros. It was delivered with a all 2 pages badly printed. It is not acceptable that there is no quality control at this level of price.I am very disappointed and won't buy again!!!
    except this major point i must admit the quality is quite good , but a bick lack of quality control and a customer disapointed at the end.
    On the internet site it is not possible to send it back. So apple doesn't want to take in account that they mail sometimes fail, and want to satisfy their customer, because you have no other choice that accepting it.
    best regards

    Yes it is returnable.
    http://store.apple.com/us/help/returns_refund
    That's for the US, there's a similar one for your country.

  • Adding custom button to Ribbon for custom list definition

    I'm trying to add a custom button to the ribbon, specifically for a custom list definition.  I have two custom list definitions, one for a document library (Type="11008") and one for a list (Type="10002").  
    I can use the following CustomAction to successfully add a button to the document library ribbon:
    <CustomAction Id="MyCustomAction.DocLib"
    RegistrationId="11008"
    RegistrationType="List"
    Location="CommandUI.Ribbon">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.Library.Share.Controls._children">
    <Button
    Id="MyCustomAction.DocLib.Button"
    Alt="Help"
    Sequence="5"
    Command="SayHi"
    Image32by32Left="-64" Image32by32Top="-320" Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png"
    Image16by16Left="-64" Image16by16Top="-176" Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png"
    LabelText="Say Hi!"
    TemplateAlias="o1"/>
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <CommandUIHandler Command="SayHi" CommandAction="javascript:alert('Hi!');"/>
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    If I try to do the same thing for my list, the button does not show up:
    <CustomAction Id="MyCustomAction.List"
    RegistrationId="10002"
    RegistrationType="List"
    Location="CommandUI.Ribbon">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.List.Share.Controls._children">
    <Button
    Id="MyCustomAction.List.Button"
    Alt="Help"
    Sequence="5"
    Command="SayHi"
    Image32by32Left="-64" Image32by32Top="-320" Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png"
    Image16by16Left="-64" Image16by16Top="-176" Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png"
    LabelText="Say Hi!"
    TemplateAlias="o1"/>
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <CommandUIHandler Command="SayHi" CommandAction="javascript:alert('Hi!');"/>
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    What am I missing that is keeping me from getting this button to show up in my List ribbon?

    Well, I debated just deleting my question, but I'll leave it up in case someone else runs into this.  My custom list definition for my list had <Toolbar Type="Freeform" />.  I don't remember why I changed that, but once I changed
    that back to <Toolbar Type="Standard"/> my custom buttons started showing up as expected.
    The answer
    here pointed me in the right direction.

  • Opening a popup from custom button in a Form

    I have a requirement to open a popup from a custom button of a portal form and once the value is selected from the popup the control should return to the main form with the value selected and set it to some display only field in that same form. It can be done thru' popup of a field directly but how can I do this thru'a button ?.
    Help would be appreciated.
    Thanks
    -Krishnamurthy

    Works for me if I middle-click a bookmark on the Bookmarks Toolbar and browser.tabs.loadBookmarksInBackground is set to true.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • WCEM:clicking on custom button(Excel Downlaod) giving message "An error occurred; please try again. If the error persists, please contact technical support."

    Hi Expert,
    I need help.
    I created a custom button to download data to an excel sheet. after clicking the button I am getting message
    "An error occurred; please try again. If the error persists, please contact technical support.".
    I tried debugging WCEM, but it is not even reaching that point.
    Your help will be highly appreciated.
    here is the code.
    BitContentview.XHTML
    <wec:commandButton  id="bdtexcel" immediate="true" actionListener="#{cc.vch.DownloadBITData}" type="submit" value="#{i18n['invoices.ui.openitems.printSelected']}"/>
    UI-repository.xml
      <ViewComponent name="BITContentView"  componentHandlerClassName="com.cpr.cprwec.app.comm.module.ebpp.ui.handler.impl.BITDetailViewVCHandler"/>
    BITDetailViewVCHnadler.java
    package com.cpr.cprwec.app.comm.module.ebpp.ui.handler.impl;
    import com.cpr.cprwec.app.comm.module.ebpp.backendobject.interf.EbppBackend;
    import java.io.IOException;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.List;
    import javax.faces.context.FacesContext;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ActionEvent;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServletResponse;
    import com.cpr.cprwec.app.comm.module.ebpp.modulemgmt.impl.EbppModuleAccessImpl;
    import com.cpr.cprwec.app.comm.module.ebpp.modulemgmt.interf.EbppModuleAccess;
    import com.cpr.cprwec.app.comm.module.ebpp.ui.dto.impl.DisputeDataDTOImpl;
    import com.cpr.cprwec.app.comm.module.ebpp.ui.dto.impl.OpenItemDTOImpl;
    import com.cpr.cprwec.app.comm.module.ebpp.ui.dto.interf.DisputeDataDTO;
    import com.cpr.cprwec.app.comm.module.ebpp.ui.dto.interf.OpenItemDTO;
    import com.cpr.cprwec.app.comm.module.ebpp.ui.dto.impl.BITDataDTOImpl;
    import com.cpr.cprwec.app.comm.module.ebpp.ui.dto.interf.BITDataDTO;
    import com.cpr.cprwec.app.comm.module.ebpp.ui.dto.impl.BITDetailDTOImpl;
    import com.cpr.cprwec.app.comm.module.ebpp.ui.dto.interf.BITDetailDTO;
    import com.sap.wec.app.common.module.common.attachment.businessobject.interf.Attachment;
    import com.sap.wec.tc.core.backend.sp.jco.JCoConnection;
    import com.sap.wec.tc.core.businessobject.BusinessObjectException;
    import com.sap.wec.tc.core.common.exceptions.ApplicationBaseRuntimeException;
    import com.sap.wec.tc.core.common.logging.WCFLocation;
    import com.sap.wec.tc.core.common.searching.businessobject.impl.GenericSearch;
    import com.sap.wec.tc.core.common.searching.businessobject.interf.GenericSearchReturnResultData;
    import com.sap.wec.tc.core.common.util.GenericFactory;
    import com.sap.wec.tc.core.common.util.Message;
    import com.sap.wec.tc.core.common.util.MessageList;
    import com.sap.wec.tc.core.common.util.table.Table;
    import com.sap.wec.tc.core.common.util.table.TableRow;
    import com.sap.wec.tc.core.modulemgmt.ForeignModuleAccess;
    import com.sap.wec.tc.core.modulemgmt.ModuleAccess;
    import com.sap.wec.tc.core.modulemgmt.exceptions.ModuleInactiveException;
    import com.sap.wec.tc.core.modulemgmt.exceptions.ModuleLifecycleException;
    import com.sap.wec.tc.core.runtime.WecFrameworkRuntime;
    import com.sap.wec.tc.core.runtime.WecSession;
    import com.sap.wec.tc.core.runtime.jsf.WecFrameworkRuntimeJSF;
    import com.sap.wec.tc.core.runtime.jsf.composition.PageManagerBean;
    import com.sap.wec.tc.core.runtime.navigation.NavigationCondition;
    import com.sap.wec.tc.core.ui.composition.menu.MenuManager;
    import com.sap.wec.tc.core.ui.composition.menu.MenuMetadataException;
    import com.sap.wec.tc.core.ui.vc.BuildTime;
    import com.sap.wec.tc.core.ui.vc.NavigationParameterBinding;
    import com.sap.wec.tc.core.ui.vc.RequestParameterBinding;
    import com.sap.wec.tc.core.ui.vc.impl.ViewComponentHandlerBaseImpl;
    import com.cpr.cprwec.app.comm.module.ebpp.businessobject.interf.BIT;
    import com.cpr.cprwec.app.comm.module.ebpp.businessobject.impl.BITImpl;
    public class BITDetailViewVCHandler extends
            ViewComponentHandlerBaseImpl<EbppModuleAccess> {
        protected static final WCFLocation LOCATION = WCFLocation
                .getInstance(BITDetailViewVCHandler.class.getName());
        public BITDataDTO bitDataDTO;
        public BITDetailDTO bitDetailDTO;
        public List<BITDataDTO> BITDataDTOList;
        public List<BITDetailDTO> BITDetailDTOList;
        public boolean noBITData;
        public boolean noBITDetail;
        public boolean renderPanel = true;
        public boolean isDownloadBITData;
        public boolean isDownloadBITDetail;
        public boolean downloadStarted=false;
        public boolean BITFound =false;
        public boolean isBITFound() {
            return BITFound;
        public void setDownloadStarted( boolean downloadStarted ){
            this.downloadStarted = downloadStarted;
        public boolean getDownloadStarted(){
            return this.downloadStarted;
        public void setBITFound(boolean BITFound) {
            this.BITFound = BITFound;
        public String getObjectID() {
            return objectID;
        public void setObjectID(String objectID) {
            this.objectID = objectID;
        public List<BITDataDTO> getBITDataDTOList() {
            return BITDataDTOList;
        public List<BITDetailDTO> getBITDetailDTOList() {
            return BITDetailDTOList;
        public Boolean getNoBITData() {
            return noBITData;
        public Boolean getNoBITDetail() {
            return noBITDetail;
        public Boolean getRenderPanel() {
            return renderPanel;
        private static final int DEFAULT_BUFFER_SIZE = 1024000;
        public Attachment attachmentData;
        public Attachment getAttachmentData() {
            return attachmentData;
        @RequestParameterBinding(maxLength = 1024)
        protected String objectID;
        @BuildTime
        public String processBuildTime() throws BusinessObjectException {
            BIT BIT = null;
            noBITData = noBITDetail = false;
            renderPanel = true;
            if (isLoggedIn()) {
                if ( isDownloadBITData == true ){
                    this.downloadBITDataExcel();
                else {
                this.getModuleAccess().getBITBO().clearMessages();
                BIT = this.moduleAccess.getBITBO().getBITFromBackend(objectID);
                BITDataDTOList = BIT.getBITDataDTOList();
                BITDetailDTOList = BIT.getBITDetailDTOList();
                MessageList objectData = this.getModuleAccess().getBITBO()
                        .getMessageList();
                if (objectData.size() > 0) {
                    noBITData = noBITDetail = true;
                    renderPanel = false;
                    this.addMessageList(objectData);
            return checkLoginCondition();
        private boolean isLoggedIn() {
            return checkLoginCondition() == null;
        private String checkLoginCondition() {
            NavigationCondition navCondition = getNavigationCondition("login");
            if (!navCondition.isFullfiled()) {
                navCondition.addToNavigationStack();
                return navCondition.getOutcome();
            return null;
        public String downloadBITData(){
            downloadStarted = true;
            isDownloadBITData = true;
            downloadBITDataExcel();
            return checkLoginCondition();
        public void downloadBITDataExcel() {
        //    dummyDebug("downloadBITDataExcel", BITDataDTOList.size(), "", "" );
            if (BITDataDTOList.size() > 0) {
                try {
                    attachmentData = this.getModuleAccess().getDownloadBO()
                            .getBITDataExcel(BITDataDTOList);
                    if (attachmentData != null) {
                        FacesContext faces = FacesContext.getCurrentInstance();
                        HttpServletResponse response = (HttpServletResponse) faces
                                .getExternalContext().getResponse();
                        response.reset();
                        response.setContentType(attachmentData
                                .getAttachmentMimeType());
                        response.setContentLength(attachmentData
                                .getAttachmentContent().length);
                        response.setHeader("Content-disposition",
                                "attachment;filename="
                                        + attachmentData.getAttachmentName());
                        response.setBufferSize(DEFAULT_BUFFER_SIZE);
                        ServletOutputStream out;
                        try {
                            out = response.getOutputStream();
                            out.write(attachmentData.getAttachmentContent());
                            out.flush();
                            faces.responseComplete();
                        } catch (IOException e) {
                            throw new ApplicationBaseRuntimeException(
                                    "Problem opening file", e);
                        } finally {
                            attachmentData = null;
                } catch (BusinessObjectException e) {
                    e.printStackTrace();
            isDownloadBITData = false;

    Thanks Hamendra for checking the issue.
    I am setting up breakpoints in WCEM, tab JAVA EE then from menu RUN->Toggle brekpoints and then debug configuration.
    the breakpoints are in several places in  handler class BITDetailviewVCHandler class including method  downloadBITData.
    this method I am calling from BitContentview.XHTML
    <wec:commandButton  id="bdtexcel" immediate="true" actionListener="#{cc.vch.DownloadBITData}" type="submit" value="#{i18n['invoices.ui.openitems.printSelected']}"/>
    When the BIT page is loading the control stops at the breakpoint.
    but it is not stopping there  when i click the 'Excel Download' button.
    How do I get the log file. I am very new to WCEM, please guide me.
    I tried to debug the UI using Google chrome. it is giving me the following error.
    POST https://<>/<>/<>/<>HomePage.jsf?wec-appid=<>MAINAPP6&wec-locale=en_US 500 (Internal Server Error)
    when I expand the node
    c.event.trigger:<>/<>/javax.faces.resource/sap/comp.theme/templates/jquery/lib/jquery-1.4.2.min.js.jsf:54
    c.event.trigger:<>/<>/javax.faces.resource/sap/comp.theme/templates/jquery/lib/jquery-1.4.2.min.js.jsf:54
    c.event.trigger:<>/<>/javax.faces.resource/sap/comp.theme/templates/jquery/lib/jquery-1.4.2.min.js.jsf:66
    (anonymous function):<>/<>/javax.faces.resource/sap/comp.theme/templates/jquery/lib/jquery-1.4.2.min.js.jsf:30
    c.extend.each:<>/<>/javax.faces.resource/sap/comp.theme/templates/jquery/lib/jquery-1.4.2.min.js.jsf:24 c.fn.c.each:<>/<>/javax.faces.resource/sap/comp.theme/templates/jquery/lib/jquery-1.4.2.min.js.jsf:66 c.fn.extend.trigger:<>/<>/javax.faces.resource/<>dev/comp.theme/templates/jquery/js/commandButton.js.jsf:31
    com.sap.wec.commandButton.submitForm:<>/<>/main/<>HomePage.jsf?wec-appid=<>MAINAPP6&objectID=500000233&page=D61CFFF8E75D48A1B348F315D209EFF9&wec-locale=en_US:48 onclick
    Navigated to https://wsapdjd803.<>.ca:<>/<>/main/<>HomePage.jsf?wec-appid=<>MAINAPP6&wec-locale=en_US
    Seems to be it is failing somewhere commandButton-related JavaScript functions
    Thanks
    Subassish

  • Custom button and Custom fields in item data tab of SRM shopping cart

    Hello All,
    I am new to SRM 7.
    There is a requirement to add a custom button and on the click of a button I need to pop up some custom fields , and
    store it in SRM system.
    The webdynpro component is /SAPSRM/WDC_UI_SC_DOFC_D1.
    Can you pls tell me the process of adding, popup and transfer of the fields to SRM tables.
    Should we adding some fileds in SPRO->Extensions and field control.
    Kindly help.
    Regards
    Vinay

    Hi,
    I dont have access to SRM system but you can use enhancment concepts to enhance the standard component.
    Refer http://wiki.sdn.sap.com/wiki/display/SRM/HidingtabofShoppingcartinSAPSRM7.0 which is having something simmilar requirment.
    also refer http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/700317da-bd79-2c10-368e-8f18bf5d8b81?QuickLink=index&overridelayout=true
    I hope this will helpful for you to achive your requirments.
    Thanks,
    Chandra

  • Query : Custom field at line item level in SRM 7.0 .

    I was going through a document which instructs on how to add a custom field at line item level in SRM 7.0.
    I found this code :
    CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
    EXPORTING
    I_GUID = IV_DOC_GUID
    I_WITH_ITEMDATA = 'X'
    TABLES
    E_ITEM = LT_ITEM
    E_MESSAGES = LT_MESSAGES
    E_STATUS = LT_STATUS. . 
    LOOP AT LT_STATUS INTO WA_STATUS.
    IF WA_STATUS-STAT EQ 'I1015' AND WA_STATUS-INACT IS INITIAL.
    LV_STATUS_APPROVE = 'X'.
    ENDIF.
    ENDLOOP.
    I wanted to know what is 'I1015'  and what is its significance .
    please advise .
    Ambar

    HI
    This speaks about the status of the Cart. This means that the Status of the Cart is AWAITING APPROVAL...I dont know which document you have gone through but procedure for adding a Custom Field in SRM 7.0 is:
    1. Create a Custom field in the Database in SRM. Preferrably add the field in an include and extend thta include to the table in SE11.
    2. Go to Portal Login of SRM and right click the part of the screen where you want to add the custom field. Click on More Field Help. The popup will give you the name of WebDynpro Applicaiton which controls that area.
    3. Login to SRM via GUI and display the webdynpro application using SE80. Enhance the Webdynpro application.
    4. Add the custom field to the Context of the WebDynpro Application View. You will be selecting the field from the database table while adding the custom field to the context
    5. Add the field at the specified place in Layout Tab of the WebDynpro View,
    6. Create a binding between the Layout Field and the Context
    7. Activate the changes.... you will see the field in Portal login of SRM....
    For more details , refer to the Webdynpro help of the application...
    Regards
    Virender Singh

  • Custom button to print

    Hello all,
    I created a custom button that I want to use to print the slide instead of the generic widget from Captivate. I thougt I would create a button that wouold have an advanced action that would execute a window.print() japavscript, but it wont print. I basically want what the Print widget does execpt on the cusomt button I made. Can someone please help. Thanks.
    UPDATE:
    I decided to use the Print widget that is already there, however, it prints really large. Is there a way to control the size of the print out or make it landscape?
    Thanks, again.

    Hello,
    Welcome to Adobe Forums.
    When you click on the button, does it bring up the Print Window ?
    Thanks,
    Vikram

Maybe you are looking for

  • After Update of iPad and MacBookPro no communication between AppleTV and Devices

    After Update of my iPad 2 with iOS 6.0 and OS to 10.8.2 there is no communication between AppleTV and these devices.

  • Why is firefox sliding to the right and I can not open the window?

    I have a status bar at the bottom...no problem. The problem is that when I open Firefox I see the icon for several windows opened over lapping and I can not get one of them to maximize for me. They, very quickly, slide to the right and off the screen

  • Digital Camera and udev woes. Why?

    So I was fooling around with trying to get my digital camera to work correctly with libgphoto2/gtkam. It took a long while, but I eventually got it to work with a custom udev rule. However, the wiki points out a sure fire way to get this to work with

  • Jar files exporting

    Hi all, I have a jar file that works along with some C plus plus dll s. I need to package the jar in such a way that it should have the necessary files for the jar to open and there is no need for the client to again install java. I mean my jar shoul

  • Restore: Tunes cannot connect my phone because it is locked with a passcode

    My iPhone is telling me that a restore is needed and to connect it to iTunes. When I connect it to iTunes I get a message that iTunes cannot connect my phone because it is locked with a passcode.  I know the passcode but my phone does notgive me the