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

capturing checkbox value at at selection-screen on value request event

Former Member
0 Likes
4,126

Hi,

I have a checkbox and parameter field and by default checkbox is unchecked.when I check the checkbox and press f4 on the field within the at selection-screen on value request event i want to capture the checkbox value .Is it possible because even though the checkbox is checked it is coming as initial and I am not adding any user-command to checkbox

Thanks

Bala Duvvuri

10 REPLIES 10
Read only

former_member191735
Active Contributor
0 Likes
1,963

nevermind.

I think you have to use user command .

Edited by: Sampath Kumar on Apr 28, 2011 9:02 AM

Edited by: Sampath Kumar on Apr 28, 2011 9:04 AM

Read only

Former Member
0 Likes
1,963

define your checkbox as follow:

parameters: p_check as CHECKBOX USER-COMMAND abcd.

and you're ok

Read only

Former Member
0 Likes
1,963

Hi Bala,

If you don't want to use user-command syntax and still want to capture whether check box value, make use of screen-request

value to determine whether check box is checked or not. Try this code and see for yourself as how screen-request is being set to '1' when checked and to '0' when unchecked.

REPORT y_vm_test.

PARAMETERS: p_check AS CHECKBOX,

p_user TYPE char10.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_user.

PERFORM get_user_data.

&----


*& Form get_user_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_user_data .

LOOP AT SCREEN.

BREAK-POINT.

  • Check SCREEN-REQUEST value here when screen-name = 'p_check'

ENDLOOP.

ENDFORM. " get_user_data

Read only

0 Likes
1,963

Vivek,

screen-request is always showing 1 if checkbox is checked or unchecked.

Thanks

Bala Duvvuri

Read only

former_member463524
Contributor
0 Likes
1,963

Hi,

Please share the code used for declaration and for checking.

This would be helpful for us to understand.

Regards,

Meera

Read only

0 Likes
1,963

Meera,

this is my code

PARAMETERS: p_check1 AS CHECKBOX.

AT SELECTION-SCREEN ON VALUE REQUEST FOR p_file.

if p_local eq 'X'.

else.

endif.

Thanks

Bala Duvvuri

Read only

0 Likes
1,963

Hi Bala,

PARAMETERS: p_check1 AS CHECKBOX.

AT SELECTION-SCREEN ON VALUE REQUEST FOR p_file.

if p_local eq 'X' needs to be changed to p_check1.

else.

endif.

You have declared p_check1 as the parameter but you are checking p_local variable.

Please change the check against p_check1.

Regards,

Meera

Read only

0 Likes
1,963

No more a requirement and I dont think we can capture checkbox value at selection-screen on value request without using user command

Thanks

Bala Duvvuri

Read only

0 Likes
1,963

Hi Bala,

Please check whether p_file value request getting triggered before the check box selection through debugging.

If it is getting triggered before check box selection, you cant able to capture in on value request.

Regards,

Meera

Read only

Former Member
0 Likes
1,963

Hi Bala ,

You can do this in the following ways:

PARAMETERS: p_check1 AS CHECKBOX.( By default the check box is not checked).

Now if you from the program you call the selection screen , you can collect the value of p_check1 in any other variable say check1 and then check whether

if check1 = 'X'

/*Write your code here

endif.

For the value request you have to use AT SELECTION-SCREEN ON VALUE REQUEST FOR...

Regards

Kavindra