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

A question about value help

Former Member
0 Likes
619

Hello Expert,

I wrote one program as below:

Report  ZJWU_TEST3

parameters: p_A   radiobutton group gp1 default 'X',
                  p_B   radiobutton group gp1.

parameters: p_var type disvariant-variant.

at selection-screen on value-request for p_var.
  if p_A = 'X'.
    p_var = 'A'.
  else.
    p_var = 'B'.
  endif.

Now my question is, when I run the program and click the F4 help for p_var, the value of p_var is alway 'A' no matter what I select, p_A or p_B.  That is, the program will never go to "else" statement.

Can any one help to give some idea and let me know how to fix the issue?

Thanks in advance,

Regards,

Johnny.

1 ACCEPTED SOLUTION
Read only

pushkar_dhale
Participant
0 Likes
589

Hi Yongbo,

Kindly modify your code as follows and you will get your expected result.

Report  ZJWU_TEST3


parameters: p_A   radiobutton group gp1 default 'X' USER-COMMAND fcode1 ,

                    p_B   radiobutton group gp1 .

parameters: p_var type disvariant-variant.

 

at selection-screen on value-request for p_var.

   if p_A = 'X'.

     p_var = 'A'.

   else.

     p_var = 'B'.

   endif.

Regards,

Pushkar Dhale

3 REPLIES 3
Read only

pushkar_dhale
Participant
0 Likes
590

Hi Yongbo,

Kindly modify your code as follows and you will get your expected result.

Report  ZJWU_TEST3


parameters: p_A   radiobutton group gp1 default 'X' USER-COMMAND fcode1 ,

                    p_B   radiobutton group gp1 .

parameters: p_var type disvariant-variant.

 

at selection-screen on value-request for p_var.

   if p_A = 'X'.

     p_var = 'A'.

   else.

     p_var = 'B'.

   endif.

Regards,

Pushkar Dhale

Read only

Aashish28
Contributor
0 Likes
589

Hiii,

         now check with F4.

parameters: p_A   radiobutton group gp1 default 'X' USER-COMMAND cmd,
                   p_B   radiobutton group gp1.

parameters: p_var type disvariant-variant.

at selection-screen on value-request for p_var.
   if p_A = 'X'.
     p_var = 'A'.
   else.
     p_var = 'B'.
   endif.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
589

Even if you change it to Y or Z in the selection screen, the value will not be implicitly assigned to p_a in PAI. The default value X gets assigned to the screen field in PBO.

You have to look into the documentation of function DYNP_VALUES_UPDATE if you need a solution.