Application Development 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: 

Need help to disable input selection-screen - very urgent

Former Member
0 Kudos

Hi SAP experts,

I have a requirement where in I need to disable ( Grey out ) the input fileds on the selection screen .

My problem is as I am using ABAP query I am not able to use any events ( AT SELECTION-SCREEN OUTPUT ).

My selection screen looks like this

MATERIAL NUMBER ( SELECT-OPTIONS)

MATERIAL TYPE ( PARAMETERS )

Now I want to add one more check box below the above fields on the selection-screen.When I click on the check-box,the MATERIAL NUMBER must be greyed out and MATERIAL TYPE should remain the same.

Please let me know the coding for the same. All answers would be rewarded.

Thanks in Advance,

Suresh.

9 REPLIES 9

Former Member
0 Kudos

Hi,

Sorry. That was sent by mistake.

Former Member
0 Kudos

Hi,

Your requirement can only be fullfilled at AT selection screen output.

If checkbox = 'x'.

loop at screen where name = material screen name.

screen-active = '0'.

modify screen.

ENDLOOP.

Regards,

Prakash

Former Member
0 Kudos

Hi,

Create one checkbox in the selection screen as shown below :

parameters: p_check as checkbox.

Then check for that checkbox was checked as below :

if p_check is not initial.

<code>.

endif.

Under <code> write that corresponding field with addition "NO-DISPLAY".

Regards,

Raghu

0 Kudos

Hi ,

I am not sure that we can change the Program which is generated using SAP Query.

you can copy this program to Z program and do the necessary changes in AT SELECT SCREEN OUTPUT event.

Kind Regards,

Ravi Sankar.Z

0 Kudos

Hi,

Even we know that we can copy the query into a program.Please give some useful answer

Suresh

Former Member
0 Kudos

Hi,

Check out these codes.

1.


TABLES : mara, makt.
parameter: p_matnr type mara-matnr,
           p_maktx type makt-maktx.

at selection-screen output.

select single maktx
from makt
into p_maktx
where matnr = p_matnr
and spras = 'EN'.

loop at screen.
  if screen-name = 'P_MAKTX'.
    screen-input = 0.
    modify screen.
  endif.
endloop.

2.


TABLES : mara, makt.
TYPES:BEGIN OF tp_maktx,
      maktx TYPE makt-maktx,
      END OF tp_maktx.

DATA:t_maktx TYPE STANDARD TABLE OF tp_maktx,
     wa_maktx TYPE tp_maktx.


SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECT-OPTIONS: s_maktx FOR makt-maktx.

INITIALIZATION.
  REFRESH s_maktx[].

AT SELECTION-SCREEN OUTPUT.


  LOOP AT SCREEN.
    IF screen-name = 'S_MAKTX-LOW' or screen-name = 'S_MAKTX-HIGH'.
      screen-input = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.


  REFRESH s_maktx[].
  if s_matnr[] is not initial.
  SELECT maktx FROM makt
  INTO TABLE t_maktx
  WHERE matnr IN s_matnr
  AND spras = 'EN'.
  endif.

  LOOP AT t_maktx INTO wa_maktx.
    s_maktx-low = wa_maktx-maktx.
    APPEND s_maktx.
    CLEAR:wa_maktx.
  ENDLOOP.

3.


TABLES : mara, makt.
parameter p_cb1 type c as checkbox.

parameter p_cb2 type c as checkbox.

parameter p_cb3 type c as checkbox.

initialization.
loop at screen.
if screen-name = 'P_CB3'.
screen-invisible = 1.
modify screen.
endif.
endloop.

at selection-screen output.

*loop at screen.
*if screen-name = 'P_CB3'.
*screen-invisible = 1.
*modify screen.
*endif.
*endloop.

loop at screen.

if p_cb1 = 'X'.
  if screen-name = 'P_CB2'.
  screen-invisible = 1.
  modify screen.
  endif.
  if screen-name = 'P_CB3'.
  screen-invisible = 0.
  modify screen.
  endif.
endif.

if p_cb2 = 'X'.
  if screen-name = 'P_CB3'.
  screen-invisible = 1.
  modify screen.
  endif.
  if screen-name = 'P_CB1'.
  screen-invisible = 0.
  modify screen.
  endif.
endif.

if p_cb3 = 'X'.
  if screen-name = 'P_CB1'.
  screen-invisible = 1.
  modify screen.
  endif.
  if screen-name = 'P_CB2'.
  screen-invisible = 0.
  modify screen.
  endif.
endif.
endloop.

Reward if helpful..

Regards.

Former Member
0 Kudos

Hi,

I cant get your requirement exactly, but i still feel the codes which i have given should be helpful enough for you to understand, how to make a field invisible and to grey out a field.

what is the exact problem are you facing.

Regards.

0 Kudos

see Venkat,

you said you are using SAP Query then I think you might know that the program will be generated itself.

now if you want to customize this code then you need to modify the standard / need to go for copy program.

If you know the answers then it will be great.

Kind Regards,

Ravi Sankar

0 Kudos

Example of My selection screen:

1. customer no. (selection option)

2. customer name(selection option)

3.customer zipcode(parameter)

4.p_automate (check box)

My requirement is that when I check the p_automate the input fields (customer no,customer name) should be gred out whereas customer zipcode should not be grey out.

NOTE:One thing I am using ABAP query(In query AT-SELECTION SCREEN OUTPUT will not work) not report.Please give me alternate solution.

Thanks in advance.