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

size for parameters with user-command

Former Member
0 Likes
2,370

Hi,

I have declared the parameters as

parameters: p_insty like qmat-art user-command chg.

but gives me an error qmat-art does not have length 1. How to specify size along with user-command

Regards,

bindazme

7 REPLIES 7
Read only

Former Member
0 Likes
1,518

hi,

you cannot mention " user-command" along with parameters(can use Modif id).

But u can use the "user-command " along with radio-button.

Revert back if any issues,

Reward if helpful.

Regards,

Naveen

Read only

Former Member
0 Likes
1,518

Hi ,

Why you are using user-command with a parameter.

Whats your exact requirement.

Using usere command with a parameter makes no sence.

It is used mainly with radiobuttons, checkbokes ets

Regards,

Vivek

Read only

0 Likes
1,518

Hi,

I have 2 parameter options and 2 buttons - activate and deactivate. I was told to use user-command to to make it both activate and deactivate without clicking the execute button on top left. The buttons work. But every time i have to click on the execute button.

Regards,

bindazme

Read only

0 Likes
1,518

Do you mean something like this?



report zrich_0001.


parameters: p_fld1 radiobutton group grp1 user-command chg default 'X',
            p_fld2 radiobutton group grp1.
selection-screen pushbutton /1(20) pb1 user-command act.
selection-screen pushbutton /1(20) pb2 user-command dea.

at selection-screen output.

  pb1 = 'Activate'.
  pb2 = 'Deactivate'.

  loop at screen.
    if screen-name = 'PB1'
       and p_fld2 = 'X'.
      screen-active = '0'.
    endif.
    if screen-name = 'PB2'
      and p_fld1 = 'X'.
      screen-active = '0'.
    endif.
    modify screen.
  endloop.

Regards,

Rich Heilman

Read only

0 Likes
1,518

Or making inactive?



report zrich_0001.


parameters: p_fld1 radiobutton group grp1 user-command chg default 'X',
            p_fld2 radiobutton group grp1.
selection-screen pushbutton /1(20) pb1 user-command act.
selection-screen pushbutton /1(20) pb2 user-command dea.

at selection-screen output.

  pb1 = 'Activate'.
  pb2 = 'Deactivate'.

  loop at screen.
    if screen-name = 'PB1'
       and p_fld2 = 'X'.
      screen-input = '0'.      "<-- Not read for input
    endif.
    if screen-name = 'PB2'
      and p_fld1 = 'X'.
      screen-input = '0'.     "<-- Not read for input
    endif.
    modify screen.
  endloop.

Regards,

Rich Heilman

Read only

0 Likes
1,518

I think I have misunderstood your question. Try this sample coding. Here I am forcing the "Execute" of the selection-screen based on the user clicking the buttons on the screen.



report zrich_0001.

tables: sscrfields.

selection-screen pushbutton /1(20) pb1 user-command act.
selection-screen pushbutton /1(20) pb2 user-command dea.

at selection-screen output.

pb1 = 'Activate'.
pb2 = 'Deactivate'.

at selection-screen.

  case sy-ucomm.

    when 'ACT' or 'DEA'.
      sscrfields-ucomm = 'ONLI'.

  endcase.


start-of-selection.


  write:/ 'START-of-SELECTION has been fired'.

Regards,

Rich Heilman

Read only

former_member194669
Active Contributor
0 Likes
1,518

Hi,

User command will only work with parameter as checkbox


parameters: p_insty type c as checkbox user-command CHG.

aRs