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

Enabling Push Buttons

Former Member
0 Likes
1,235

Hi Gurus,

I have a column of push buttons in my table control, each push button for each line item.

According to my requirement, I disabled the push button column initially, it will only get enable depending

upon each line item's condition.

Like, 1st row, if rad2 = 'x' , then the push button for that line should get enabled.

2nd row, if rad2 = 'X', then the push button for that line should get enabled.

3rd row, if rad2 NE 'X', then the push button for that line should be disabled.

I tried a lot , but its not happening. May be because I disabled the column based on the screen group.

Can anyone please help me on this ?

Thanks

Chandan

9 REPLIES 9
Read only

Former Member
0 Likes
1,066

Hi,

You need to write the code in PBO (loop at screen and End loop) and also write based on the field names not on the screen group, if you use the screen group then it will applicable all the fields which are under that group, so it is better to user based on the screen field name.

Thanks

Sudheer

Read only

0 Likes
1,066

I have written the code in PBO, but after radio button click the related push button has to get enabled, so this should be in PAI , right ?

can u be more elaborative please

Thanks

Chandan

Read only

0 Likes
1,066

Hi Chandan,

that should be in PBO only..

because when ever you click radio button the action is triggered it means the function key is triggered..

so all the Screen logic related to Function keys is written in PBO..

Regards,

Prabhduas

Read only

0 Likes
1,066

Hi prabhu,

Its not working, I tried putting it under PBO, but its not working.

Please suggest

Thanks

Chandan

Read only

0 Likes
1,066

check do you assigned any function code for Radio buttons..

double click on the radio button and check the Fucntion code..

and go to attributes in the screen and assign user-command for first radio button with some value..

Regards,

Prabhudas

Read only

0 Likes
1,066

Hi Prabhu,

I assigned fcode to one of the radio buttons, now whats next ??

Please suggest

Thanks

Chandan

Read only

Former Member
0 Likes
1,066

Hi,

First assign some function keys for Radio buttons..

and assign the Logic for enabling and disabling screen logic in the PBO..

Refer:

Take the group1 for the screen fields that you have taken on screen as ABC and then follow code to disable fields, in PBO:-


IF <condition>. "as per your condition
  IF screen-group1 = 'ABC'.
    LOOP AT SCREEN.
      screen-invisible = 0. "to disable screen fields
    ENDLOOP.
    MODIFY SCREEN.
  ENDIF.
ENDIF.

Now say if you want to enable fields on some condition then you may use:-


IF <condition>. "as per your condition
  IF screen-group1 = 'ABC'.
    LOOP AT SCREEN.
      screen-invisible = 1.  "to enable Push Button
    ENDLOOP.
    MODIFY SCREEN.
  ENDIF.
ENDIF.

Regards,

Prabhudas

Edited by: Prabhu Das on May 11, 2009 7:51 PM

Read only

Former Member
0 Likes
1,066

I didn't write this with pusbuttons in mind, but it should help you:

[Dynamic Setting of Field Attributes in Table Controls|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/11651] [original link is broken] [original link is broken] [original link is broken];

Rob

Read only

Former Member
0 Likes
1,066

solved