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

Pushbutton's text, can i change it dynamically?

Former Member
0 Likes
505

Hi, I'm using a module pool to create a dynpro as web interface. According to sy-tcode calling the dynpro I should be able to change the text of 3 pushbuttons. Is there a way to achieve that?

Alternatively, from screen painter I saw you can make an I/O field "sensible to double click", how is it possible to "catch" the click so that I can take an action as I'm doing with the pushbutton's function code?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
460

Hi Carlos,

By Web interface do you mean you are creating a WebDynpro Component ?

However, if your query is related to a GUI transaction/module pool application then you can do the following:

Problem 1: Changing the texts on the pushbuttons

Well, say you have a button which shows "Display", "Create" and "Change" based on the Tcode you are accessing the transaction with. Then you create three buttons in your dialog screen. One with each text , however having the same OKCODE. Have separate modif IDs for them e.g. DIS, INS, CHG respectively and then based on sy-tcode you hide the not required buttons in PBO using LOOP AT SCREEN WHERE GROUP1 EQ ..... SCREEN-INVISIBLE = 1. SCREEN-ACTIVE = 0. MODIFY SCREEN. ENDLOOP.

In PAI, now you would get the same OKCODE for all the buttons, but you can further segragate by SY_TCODE as so

Case OKCODE.

WHEN 'BUTN'

CASE SY-TCODE.

WHEN '......

Problem 2: Double Click

When you set the flag for double click, you also need to assign an OKCODE viz. PICK to function key F2 in the PF status of the screen. Hence when the user double clicks on the I/O field, the function code PICK is auto triggered by SAP and can be captured in PAI module.

Now to know which field was double clicked on you can use GET CURSOR command to get the screen name of the field double clicked and subsequently the value.

Hope this information helps.

Cheers,

Aditya

Hi, I'm using a module pool to create a dynpro as web interface. According to sy-tcode calling the dynpro I should be able to change the text of 3 pushbuttons. Is there a way to achieve that?

Alternatively, from screen painter I saw you can make an I/O field "sensible to double click", how is it possible to "catch" the click so that I can take an action as I'm doing with the pushbutton's function code?

2 REPLIES 2
Read only

Former Member
0 Likes
461

Hi Carlos,

By Web interface do you mean you are creating a WebDynpro Component ?

However, if your query is related to a GUI transaction/module pool application then you can do the following:

Problem 1: Changing the texts on the pushbuttons

Well, say you have a button which shows "Display", "Create" and "Change" based on the Tcode you are accessing the transaction with. Then you create three buttons in your dialog screen. One with each text , however having the same OKCODE. Have separate modif IDs for them e.g. DIS, INS, CHG respectively and then based on sy-tcode you hide the not required buttons in PBO using LOOP AT SCREEN WHERE GROUP1 EQ ..... SCREEN-INVISIBLE = 1. SCREEN-ACTIVE = 0. MODIFY SCREEN. ENDLOOP.

In PAI, now you would get the same OKCODE for all the buttons, but you can further segragate by SY_TCODE as so

Case OKCODE.

WHEN 'BUTN'

CASE SY-TCODE.

WHEN '......

Problem 2: Double Click

When you set the flag for double click, you also need to assign an OKCODE viz. PICK to function key F2 in the PF status of the screen. Hence when the user double clicks on the I/O field, the function code PICK is auto triggered by SAP and can be captured in PAI module.

Now to know which field was double clicked on you can use GET CURSOR command to get the screen name of the field double clicked and subsequently the value.

Hope this information helps.

Cheers,

Aditya

Read only

0 Likes
460

Thanks! Everything works pefectly now.

Regards.