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

Selection screen issue

Former Member
0 Likes
2,178

Hi techies,

I have  selection screen in which 3parameters are there.

If I provide values for the first two parameters then third parameter should be invisible. .

But I can make this achive through at selection screen output but I need to disable that third parameter right after user provides values to above two fields.

He won't press execute button or enter....

22 REPLIES 22
Read only

adrian_mejido
Contributor
0 Likes
2,146

Hi Praveen,

You should do that, but you need to press enter.

AT SELECTION-SCREEN OUTPUT. 

LOOP AT SCREEN.

* Here you should put your code

MODIFY SCREEN

ENDLOOP.

Best regards

Read only

0 Likes
2,146

i already mentioned i will not press execute or enter .

if that is to be done , then i can do it .

anyways issue seems simple but its not possible i think .

please techies try .

Read only

0 Likes
2,146

Of course, but I am telling you that I think you can't do that if you don't press enter buttom. If you used another type like RADIOBUTTOM, you would achieve it.

Best regards

Read only

0 Likes
2,146

Not possible with the limited event framework of the classic SAPGUI, I'd say. Try Webdynpro, HTML5 or such fancy stuff.

Thomas

Read only

VijayaKrishnaG
Active Contributor
0 Likes
2,146

Hi Praveen,

I think this is not possible as the control will not takes the values until unless we press Enter or Execute.

-Vijay

Read only

0 Likes
2,146

ok thanks adrian and vijay

, even am confirming that this may be possible ,

still we will see any other techies can solve it .

Read only

0 Likes
2,146

Hi Praveen,

If the values of 2nd field is getting filled with F4 Help, try to cll function module DYNP_VALUES_READ  in AT SELECTION ON VALUE REQUEST FIELD <filed_2>. This will capture the entered value. So if this FM returns value, try to modify screen.

-Vijay

Read only

0 Likes
2,146

But values are to be given manually , there is no F4 search help for that field .

Read only

Former Member
0 Likes
2,146

Hi Praveen,

you can only solve your issue, if both first parameters are of type checkbox, radiobutton or listbox.

Then you can add a user-command option which raises an event to process the selectioon-screen.

Please have a look at the keyword documentation for PARAMETERS - screen options for more help.

Regards,

Klaus

Read only

0 Likes
2,146

Hi klaus ,

the first two parameters have values which need to be entered .

how can we do it when they are declared as check box or radio buttons?

Read only

0 Likes
2,146

Despite I think that it might solve his issue, using radiobuttom or checkbox you will be able to active o choose your option but you won't be able to write values as if they were char parameters.

Best regards

Read only

0 Likes
2,146

Hi,

please check this code:

REPORT  ztest_param.

                                                                                                                                                                                                                                                             

PARAMETERS: xp_par1 TYPE c AS CHECKBOX USER-COMMAND chk1.

PARAMETERS: xp_par2 TYPE c AS CHECKBOX USER-COMMAND chk2.

PARAMETERS: xp_par3 TYPE matnr  MODIF ID xyz.

                                                                                                                                                                                                                                                             

AT SELECTION-SCREEN OUTPUT.

                                                                                                                                                                                                                                                             

   LOOP                               AT  SCREEN.

     CHECK screen-group1              EQ  'XYZ'.

     IF  xp_par1                      EQ  'X'

     AND xp_par2                      EQ  'X'.

       screen-active                   =  '0'.

     ELSE.

       screen-active                   =  '1'.

     ENDIF.

                                                                                                                                                                                                                                                             

     MODIFY                             SCREEN.

   ENDLOOP.

                                                                                                                                                                                                                                                             

START-OF-SELECTION.

Regards,

Klaus

Read only

0 Likes
2,146

Actually i need to enter some values to the first and second parameters .

if we give check box then how can i provide values?

Read only

former_member823006
Participant
0 Likes
2,146

Hi Praveen,

We can't capture the TAB value therefore we have to press 'ENTER'

Check the below code for your reference:-

selection-screen: begin of block b1 .

parameters: pdate like mkpf-budat  modif id b1.

parameters: rsnum like resb-rsnum modif id b2 .

parameters: lifnr like mseg-lifnr modif id b3.

selection-screen: end of block b1.

at selection-screen output.

   if rsnum <> ' '.

     loop at screen .

       if screen-group1 = 'B1'.

         screen-active = 1.

         modify screen.

       elseif screen-group1 = 'B2'.

         screen-active = 1.

         modify screen.

       elseif screen-group1 = 'B3'.

         screen-active = 0.

         modify screen.

       endif.

     endloop.

   endif.


Regards,

Deepanshu

Read only

0 Likes
2,146

I think that this solution has been already published.

In addition, SAP Screen processing won't trigger SELECTION SCREEN OUTPUT event unless there is an user action like pushing a button, radiobutton , checkbox, selecting a value from a dropdown list, press enter, etc.

Best regards

Read only

Former Member
0 Likes
2,146

Hi Praveen,

Since there is no user command option for parameter fields you cannot do it without pressing enter.

Thanks,

Vineesh.

Read only

Former Member
0 Likes
2,146

Hi techies ,

can i close this discussion as 'not possible '  ?

Read only

0 Likes
2,146

Hi Praveen,

You can close the discussion.

For Changing the screen you need to have some event triggered.

You can try this, you can place a check box with the third field and allow user to check it if he wants to enter value in the field and in this event you can validate and enable the field or throw message that values is not required(as per your requirement).

Read only

Former Member
0 Likes
2,146

closing the discussion .....

Thanks all.

Read only

0 Likes
2,146

"Not possible" is also an answer, so you should at least set your question to "answered".

Thomas

Read only

ThangaPrakash
Active Contributor
0 Likes
2,146

Hello Praveen,

Try with the below code.


PARAMETERS: xp_par1 TYPE vbeln.

PARAMETERS: xp_par2 TYPE werks.

PARAMETERS: xp_par3 TYPE matnr  MODIF ID xyz.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT  SCREEN.

    CHECK screen-group1 EQ  'XYZ'.

    IF  xp_par1 IS NOT INITIAL

    AND xp_par2 IS NOT INITIAL.

      screen-active                  = '0'.

    ELSE.

      screen-active                  = '1'.

    ENDIF.

    MODIFY SCREEN.

  ENDLOOP.


Until you enter the first two parameters, third parameter won't be disabled.


Read only

0 Likes
2,146

This is not what he required. In this case also we need press enter to take action on 3rd Field.