Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Change Button Icon name in Module Pool

Former Member
0 Likes
3,676

Hi all,

I am working on a module pool program. In some condition it needs to display button Icon ICON_ENTER_MORE, and in some condition it needs to display Icon ICON_DISPLAY_MORE.

I am wondering whether this can be done in module pool. If yes, please guide me how/what should I do.

Your help are greatly appreciated.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,575

Hi,

It is possible to display dynamic button in a TABLE CONTROL. I am not sure we can do it in other area of the screen.

If it has to be done in the table control,change that particular field to be displayed as PUSHBUTTON display.

In the PBO for the table control for ICON_ENTER_MORE move @1F@ to that particular field of length 4,for ICON_DISPLAY_MORE move @1E@ .

Regards,

Smart

Hi,

It is possible to display dynamic button in a TABLE CONTROL. I am not sure we can do it in other area of the screen.

If it has to be done in the table control,change that particular field to be displayed as PUSHBUTTON display.

In the PBO for the table control for ICON_ENTER_MORE move @1F@ to that particular field of length 4,for ICON_DISPLAY_MORE move @1E@ .

Regards,

Smart

9 REPLIES 9
Read only

Former Member
0 Likes
2,575

Hy myahsam,

one approach could be:

- create a status bar with both buttons: ICON_ENTER_MORE and ICON_DISPLAY_MORE, just one next to each other. Assign an okcode for each button

- as a default, in your ABAP code, exclude the okcode for ...DISPLAY...

- if the conditions meet, include the okcode for ...DISPLAY... and exclude the okcode for ...ENTER...

I hope this helps. Kind regards,

Alvaro

Read only

Former Member
0 Likes
2,576

Hi,

It is possible to display dynamic button in a TABLE CONTROL. I am not sure we can do it in other area of the screen.

If it has to be done in the table control,change that particular field to be displayed as PUSHBUTTON display.

In the PBO for the table control for ICON_ENTER_MORE move @1F@ to that particular field of length 4,for ICON_DISPLAY_MORE move @1E@ .

Regards,

Smart

Read only

0 Likes
2,575

Hi,

Thanks for all the replies.

However I cannot understand this statement, "In the PBO for the table control for ICON_ENTER_MORE move @1F@ to that particular field of length 4,for ICON_DISPLAY_MORE move @1E@". What is @1F@ and @1E@" ?

I am now using the show and hide method to display the button with icon. When condition 1, then it will display button 1, then condition 2 then it will display button 2.

The problem now is, the button cannot display in the fixed position. Does anyone have any idea on this?

Read only

I066686
Product and Topic Expert
Product and Topic Expert
0 Likes
2,575

Hi Wong,

No Need to use 2 buttons, if you follow the method what i said , just one button is enough

@1F@ and @1E@" were the Icon Codes for the ICON.

Follow simple steps:

1)Give the name and function code for Pushbutton and in property make it as output only.

eg: PSH_BTN.

2) Check the checkbox with icon in pushbutton property.

3) In PBOMODULE of the screen , according to your Logic assign the Icon code to the button name.

eg:

   if cond1 .
      PSH_BTN = '@1F@'.---> ICON_ENTER_MORE 
    elseif cond2.
      PSH_BTN = '@1E@ '.--->ICON_DISPLAY_MORE 
    endif.

Now you can get my point i think.It worked for me.

Regards,

Kiruba

Read only

0 Likes
2,575

Hi Kiruba,

Thanks for your tips. It works for me now.

By the way, how do you know the icon code from?

Where can I get the icon code list?

Read only

0 Likes
2,575

Hi myahsam.

please have a look at the type-pool ICON. To do so, enter into transaction SE12, select "type group", enter ICON and display. This will yield an ABAP-like editor, with the name of the icon (i.e.ICON_ENTER_MORE) and the ID (i.e. '@1F@').

I hope it helps. Best regards,

Alvaro

Read only

Former Member
0 Likes
2,575

Hi,

One method is as specified above by Alvaro. The other approach u can try is invisble the button based on the condition using below logic-

LOOP AT SCREEN.

IF screen-group1 = c_display.

screen-invisible = c_0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Hope this helps.

Read only

I066686
Product and Topic Expert
Product and Topic Expert
0 Likes
2,575

Hi myahsam,

Your query is very much possible.

I have done it. Use the Icon code @1F@ and @1E@.

Its a simple logic:

Give the name and function code for Pushbutton and in property make it as output only.

Check the checkbox with icon in pushbutton property.

In PBO according to Logic assign the Icon code to the button name.

Just follow the below link

Link:http://wiki.sdn.sap.com/wiki/display/Snippets/SamplecodeforiconchangelikeNseriestransactions.

I hope this solves your problem.

Regards,

Kiruba

Edited by: kirubakaran.t38 on May 14, 2010 12:39 PM

Read only

Former Member
0 Likes
2,575

Hi Wong,

Check the below link,

Cheerz

Ram