ICON_CREATE on button on a screen

Dear expers,
I have a requirement to expand and collaspe a subscreen on click of a button. But i stuck in changing the icon of a button on every click. I have a example to change the icon of a button on selection screen but its not working on a screen with ICON_CREATE function.
Kindly suggest,
Praveen Lobo

Hi,
The example Report Program explains you how to use the code for changing the ICON for a text. But in the function module documentation of the ICON_CREATE, it is clearly mentioned that the same can be used to change the ICON of the Push Button also.
Code Snippet:
     CALL FUNCTION 'ICON_CREATE'
       EXPORTING
            name                  = icon_name
            text                  = icon_text
            info                  = 'Status'
            add_stdinf            = 'X'
       IMPORTING
            result                = push_btn
       EXCEPTIONS
            icon_not_found        = 1
            outputfield_too_short = 2
            OTHERS                = 3.
push_btn should be the name of the Push button on the Screen. And change the property of it to Output enabled. And then execute the code. it will change the Icon of the Push button dynamically.
have a look at the following link:
http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba9a635c111d1829f0000e829fbfe/content.htm
"Pushbuttons have a label - the text that you specify statically in the attributes - and can also have icons. If you set the Output field attribute for a pushbutton, you can also set its text dynamically in the ABAP program. To do this, you must create a field in the ABAP program with the same name as the pushbutton. You must then assign the required text to the field before the screen is displayed. You can also assign icons to dynamic texts on pushbuttons by including the icon code in the text. The icon codes are all contained in the include program <ICON>. For example, the ICON_CANCEL () icon has the code @0W@." - This explains that you can change the icon of the Push button.
Hope this helps.
Thanks,
Samantak.

Similar Messages

  • Add a button on normal screen ?

    hi,
    what's the screen for showing the content of ' write' statement,  and i want to add a button on this screen, how ?
    thanks

    Hi Zhang,
    Please refer this code from help.sap.com
    TABLES sscrfields.
    TYPE-POOLS icon.
    SELECTION-SCREEN:
      BEGIN OF SCREEN 500 AS WINDOW TITLE title,
        PUSHBUTTON 2(10)  but1 USER-COMMAND cli1,
        PUSHBUTTON 12(30) but2 USER-COMMAND cli2
                               VISIBLE LENGTH 10,
      END OF SCREEN 500.
    AT SELECTION-SCREEN.
      CASE sscrfields.
        WHEN 'CLI1'.
        WHEN 'CLI2'.
      ENDCASE.
    START-OF-SELECTION.
      title  = 'Push button'.
      but1 = 'Button 1'.
      CALL FUNCTION 'ICON_CREATE'
        EXPORTING
          name   = icon_information
          text   = 'Button 2'
          info   = 'My Quickinfo'
        IMPORTING
          RESULT = but2
        EXCEPTIONS
          OTHERS = 0.
      CALL SELECTION-SCREEN '0500' STARTING AT 10 10.
    Reward points if useful.
    Regards,
    Atish

  • Problem with buttons in my screens

    hi
    i have two buttons in my screen say button1 and button2
    by default when i display this screen as per my requirement only button1 should be visible and button2 should be invisible
    button2 should only be visible when i click on my first button i.e. button1.
    where and how to code this
    vamsi

    Hello Sir,
    This is Ravi and Saras this side.
    Remember?
    TCS.....SAP Training.....Lemon Tree...
    Ok.
    As far as ur question is concerned.....
    1. At selection-screen output
         loop at screen.....then make the 2nd button invisible by modifying the screen.
    2. At selection-screen
         Between an if endif condition check whether the 1st button has been clicked.
         If yes then again loop at screen and make the 2nd button visible.
    That will solve ur problem.
    Regards,
    Ravi and Saras

  • I tried to soft reset my ipod touch with the top button and the screen button.  it turned off and went to the blue screen with the apple.  now it won't do anything-it has stayed on that scren for 4 hours now.  does anyone know how i can fix this?

    i tried to soft reset my ipod touch with the top button and the screen button.  it turned off and then went to the blue screen with the apple like it should.  however, it now just stays on that screen.  it has a sort of clock looking thing at the bottom of the apple that does not move either.  it has stayed on this screen for over 4 hours.  i also can not hard reset it in itunes.  i am not really goood at this sort of thing.  does anyone have this problem or a possible solution?  thanks

    See Here for
    Frozen or unresponsive iPod touch
    The Basic Troubleshooting Steps are:
    Restart..  Reset..  Restore...
    Try this First... You will Not Lose Any Data...
    Turn the iPod Off... ( if it isn’t already )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear and then Disappear...
    Usually takes about 15 - 20 Seconds... (But can take Longer...)
    Release the Buttons...
    Turn the iPod On...
    If that does not help... See Here:
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414

  • Want to restrict buttons in PV8i screen in Training & Event Management

    Dear All,
    My requirement is to restrict available buttons in PV8I screen except the 'Appraisal' function. The standard buttons given in PV8I screen are like Rebbok event, cancel etc. My client requires that an user can only use this screen to maintain the business event appraisal data. User should not have the authorization for rebook event, cancel or request for booking. So how these buttons can be removed / hide or deactivated, so that the user will not be able to use thesr buttons. Please help.
    Regards,
    Daniel

    Using configuration you can only remove SAP launchpad buttons and toolbars.
    refer
    Transaction iView not to display R/3 header
    http://wiki.sdn.sap.com/wiki/display/HOME/Article%2b-%2bEmploy%2bSAP%2bGUI%2bfor%2bHTML%2binstead%2bof%2ban%2bInternet%2bservice?bc=true
    If you wish to remove or hide some Tcode level buttons that this will be done only using some application/Tcode specific configuration/modification.
    Edited by: Saurabh Agarwal on Mar 1, 2012 9:38 AM

  • Is it possible to add buttons on a screen without drawing in screen painter

    Hi experts and others,
    I want to design a flexible screen structure so I want my buttons which are on a screen appears according to my wish at runtime.
    Is it possible to design a screen like this.
    In addition, I would get my button's name and fcode from table.
    I am open the hear any idea.
    Regards.

    Simple Way to Do this:
    1) Create the relevant Button on the screen.Assign Group name in the screen Properties.
    2) In PBO you can write codes to hide the button according to your requirements.
    Ex:
    PBO.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'AA'.        " Group assigned at Property level
    Screen-Active = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    Regards,
    Gurpreet

  • Error during creation of push button on selection screen

    Hi,
    I wanted to create push buttons on selection screen,
    Code:
    DATA DB1 TYPE VBAP-WERKS.
    DATA DB2 TYPE MARA-MATNR.
    SELECT-OPTIONS : SPLANT FOR DB1,
                                    SCLASS FOR DB2.
    SELECTION-SCREEN:  FUNCTION KEY 1,
                                        FUNCTION KEY 2,
                                        FUNCTION KEY 3.
    INITIALIZATION.
    DATA FUNCTXT TYPE SMP_DYNTXT.
    CLEAR FUNCTXT.
    DATA: FUNCTXT_01 TYPE SSCRFIELDS-FUNCTXT_01.
    FUNCTXT-TEXT = 'DEL'.
    SSCRFIELDS-FUNCTXT_01 = FUNCTXT.
    CLEAR FUNCTXT.
    FUNCTXT-TEXT = 'EDIT'.
    SSCRFIELDS-FUNCTXT_02 = FUNCTXT.
    CLEAR FUNCTXT.
    FUNCTXT-TEXT = 'CRE'.
    SSCRFIELDS-FUNCTXT_03 = FUNCTXT.
    But during activating, I'm getting the error as : Field "SSCRFIELDS-FUNCTXT_01" is unknown. It is neither in one of the specified tables nor defined by "DATA" statement.
    Please suggest solutions to overcome this error.
    Regards
    Darshan MS

    Hi,
    trans. for examples of selection screen : BIBS
    regards
    Fred

  • Error in search help button at selection-screen

    hi all,
    i have a small issue.
    i have created a seach help button in selection screen .
    my code is as bellow.
    TYPES: BEGIN OF ty_ZSD_SNID,
           KUNNR TYPE KUNNR,
           BAREA TYPE WERKS_D,
          END OF ty_ZSD_SNID.
    DATA : it_z TYPE STANDARD TABLE OF ty_ZSD_SNID.
    selection-screen : begin of block b with frame title text-000.
    select-options : skunnr for zsd_snid-kunnr.
    parameters :     pbarea like zsd_snid-barea obligatory.
    selection-screen : end of block b.
    INITIALIZATION.
      SELECT KUNNR BAREA FROM ZSD_SNID INTO TABLE it_z.
      SORT it_z BY BAREA KUNNR.
      DELETE ADJACENT DUPLICATES FROM it_z COMPARING BAREA KUNNR.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SKUNNR-low.
      IF it_z[] IS NOT INITIAL.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
                 EXPORTING
              DDIC_STRUCTURE         = ' '
                   retfield               = 'KUNNR'  " data base table field name
              PVALKEY                = ' '
                  dynpprog               = sy-repid " program name
                  dynpnr                 = sy-dynnr          "screen name
                  dynprofield            = 'SKUNNR-LOW'  " layot field name
              STEPL                  = 0
              WINDOW_TITLE           =
              VALUE                  = ' '
                  value_org              = 'S'
              MULTIPLE_CHOICE        = ' '
              DISPLAY                = ' '
              CALLBACK_PROGRAM       = ' '
              CALLBACK_FORM          = ' '
              MARK_TAB               =
            IMPORTING
              USER_RESET             =
                 TABLES
                   value_tab              = it_z[]   " internal talble name
              FIELD_TAB              =
              RETURN_TAB             =
              DYNPFLD_MAPPING        =
            EXCEPTIONS
              PARAMETER_ERROR        = 1
              NO_VALUES_FOUND        = 2
              OTHERS                 = 3
        IF sy-subrc  <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ELSE.
        MESSAGE E000(zsdsn).
      ENDIF.
    my issue is , its working properly if records are there in my z table.
    if no records are there in the table then if i do comment the last message statement then its working.
    if i do uncomment like the above code, then its dumming.
    what i should i do ??
    kind regards

    closed because of no answer.

  • Creating push button on Selection screen application toolbar

    Hi Friends,
    this is a HR-ABAP report. I have to create a push button on Selection screen. when user clicks on that push button 'MODAL DIALOG BOX' has to be displayed containing some data.
    plz kindly give some sample code to do this.
    Regards,
    Radhika Dasharatha.

    Hi,
    1)Use SELECTION-SCREEN  PUSHBUTTON /10(20) PUSH USER-
      COMMAND 'ABC'. in selection screen.
    2) Give the static name to button in INITIALIZATION event like PUSH = 'PRESS'.
    3) At selection screen.
      if sy-ucomm eq 'ABC'.
    call FM HR_BE_GE_MODAL_DIALOG
    endif.
    Thanks
    Sandeep
    Reward if useful

  • My daughter help down the home button and the screen is now glowing, how do i tuen it back to normal?

    help me,daughter held down home button aqnd my screen is glowing, kida, where the back ground was black it is now white.  its kinda like a backlight or something. how do i put it back to normal?

    If the screen colours look like they've turned negative then try triple-clicking the home button - or go into Settings > General > Accessibility and turn White on Black 'off' (and check/change what Triple-Click Home on the same Restrictions screen is set to).

  • Selection screen modification based on various buttons in selection screen

    Hi,
    I have 1 query related with Selection screen modification.
    In my Report Program,I have created GUI Status for my selection screen
    Now 2 buttons in application toolbar are coming on selection sceen.
    For this i used,'At selection screen output' event.
    And there are 2 blocks on selection screen.
    If user press button1 then block2 should not display.
    and if user press button2 then block1 should not display.
    but the problem is i m not getting reqd result and also while doing debugging its not showing me sy-ucomm value.
    Any pointers on this.
    Thanks,
    Mamta

    Hi Mamta,
       have it in a group then you can write code accordingly see sample example,
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS       : p_r1 RADIOBUTTON GROUP rad
                            USER-COMMAND clk DEFAULT 'X'.            " upload Radio Button
    SELECTION-SCREEN COMMENT 5(35) text-003.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN : BEGIN OF BLOCK 001 WITH FRAME TITLE text-001.
    PARAMETERS: p_upl       LIKE rlgrap-filename MODIF ID a           "Upload File
                             DEFAULT 'c:\temp\parbmat.xls',
                p_werks     like t001w-werks MODIF ID a,              "Plant
    PARAMETERS: p_rest      LIKE rlgrap-filename MODIF ID a           "Dwonload File Path
                             DEFAULT 'c:\temp\Success.xls'.
    SELECTION-SCREEN : END OF BLOCK 001.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : p_r2 RADIOBUTTON GROUP rad.
    SELECTION-SCREEN COMMENT 5(35) text-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN : BEGIN OF BLOCK 002 WITH FRAME TITLE text-002.
    PARAMETERS     : p_plant  LIKE marc-werks MODIF ID b.                "Plant
    PARAMETERS     : p_lgort  LIKE mard-lgort MODIF ID b.                "Storage Location
    PARAMETERS     : p_vkorg  LIKE mvke-vkorg MODIF ID b.                "Sales Organization
    PARAMETERS     : p_vtweg  LIKE mvke-vtweg MODIF ID b.                "Distribution Channel
    SELECT-OPTIONS : s_mat FOR  mara-matnr MODIF ID b.                  "Material No No
    SELECT-OPTIONS : s_dat FOR  mara-ersda MODIF ID b.                  "Date on Record Created
    PARAMETERS     : p_down LIKE rlgrap-filename MODIF ID b
                      DEFAULT 'c:\temp\Material Master.xls'.           "Download File Path
    SELECTION-SCREEN : END OF BLOCK 002.
    AT SELECTION-SCREEN OUTPUT.
    *Inactive Fields depending on the radio button
      LOOP AT SCREEN.
        IF p_r1 = 'X'.
          IF screen-group1 = 'B'.
            screen-active = 0.
          ENDIF.
        ELSEIF p_r2 = 'X'.
          IF screen-group1 = 'A'.
            screen-active = 0.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    Edited by: suresh suresh on Jul 28, 2009 12:42 PM
    Edited by: suresh suresh on Jul 28, 2009 12:42 PM

  • How do I put a home button on my screen?

    How do you put a home button on iPad screen?

    Settings - General - Accessibility - Assistive Touch = On

  • It's not showing the play or next song buttons on locks screen when the musics are played

    it's not showing the play or next song buttons on locks screen when the musics are played

    kaeandcolesmon,
    If you open the recovery drive (partition) it should only have a single folder (Recovery).
    To make sure that your not saving restore points to that drive.
    See:
    Start, Control Panel, System, System Protection tab. Make sure the D drive partition is set to OFF so that it does not save there.
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • After resetting my phone to factory settings, it will not turn on. When i press the power button a white screen and black apple pop up. it stays on that screen and will not go to the home screen, it will just die. please help!

    after resetting my phone to factory settings, it will not turn on. When i press the power button a white screen and black apple pop up. it stays on that screen and will not go to the home screen, it will just die. please help!

    Make sure it is charged for about 10min using the adapter, then connect in recovery mode, explained in this article:
    If you can't update or restore your iOS device

  • Reader XI has the print button off the screen when on 800x600 resolution

    Reader XI has the print button off the screen when on 800x600 resolution as well, how to fix without changing resolution?  A user needs the resolution set to that for her eyes.
    I see that this was an issue in Reader X and update 10.1.3 resolved it.  What was the fix?

    The scrollbar appears and works but unfortunately the dialog size is still too big therefore the print button ends up being hidden by the windows taskbar. Could you please make sure that the print dialog size is calculated against the work area (desktop size minus the taskbar, there's a win32 API to get that) rather than the whole desktop to fix the issue?
    That would also fix another issue: when the taskbar is sized higher than usual whatever the resolution you have it could still end up covering the print buttons but if you calculate against the work area rather than the desktop area that issue would be fixed as well.
    Please don't leave it unfixed because even if the requirements say 1024x768 if you have higher DPI settings or have a taskbar with a non-default size the print button could easily become unreacheable.

Maybe you are looking for

  • Local variable problem

    I am making an application that takes an apartment number and number of occupants in that apartment and then displays a number of statistics. So far I haven't had much problem except on a what is probably a very simple problem. I have two buttons, an

  • Help! 2nd gen. ipod nano audio output not balanced

    anyone knows what the problem of my ipod nano? while i was listening suddenly there was no audio output on the right earphone. i restarted it at least 5 times, even changed to another earphone. then after a few hours i tried to test it again and the

  • Transaction KSB1 - KSV5

    Good Morning. We have problems with the transaction KSB1.We have the cost center 10382002 and the cost element 560190992. If we trie a Total, we have 0 USD but 16,16 ARS. The two value will be 0. In this case we have a differenz. We have this problem

  • Serious problems with the canceling for my plan, it´s just frustrating =(

    In the Cancel Plan confirmation pop-up, for me and probably others, it dosen´t appears the option of "cancel plan" in the bottom, so that´s either a dum issue from the system or Adobe just dosen´t wants us to cancel our plan. PLEASE IF ANYONE COULD J

  • Fn:SUM in Xquery getting error

    Hi All Gm, I am using fn:sum in xquery.I am getting multiple data as request. Using fn;Sum if I add more 7 digits ,it is  converting to hexadecimal.but I don't want to convert hexadecimal value. ex: fn:sum(9999999,0,100)= 9896E3.(sum of 8 digits conv