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

Former Member
0 Likes
735

Hi a ll ,

This is my code if i give some input value in matnr P_date should be in disable mode and vice versa. But this code is not working . Can any one suggest me where modificatons requires/

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: MATNR FOR MARA-MATNR .

SELECT-OPTIONS: : P_date for mara-ersda MODIF ID sc1.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF matnr is not initial .

IF screen-group1 = 'SC1' .

screen-input = 0.

MODIFY SCREEN.

CONTINUE.

ENDIF .

ENDIF.

endloop.

9 REPLIES 9
Read only

Former Member
0 Likes
708

Hi,

please have a look at following link:

http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/content.htm

It describes the hierarchy rules between the components ACTIVE, INPUT, OUTPUT, and INVISIBLE. They also have different effects depending on their respective static settings.

Hope this helps.

Regards

Bernd

Read only

ferry_lianto
Active Contributor
0 Likes
708

Hi Priya,

Please try this.


TABLES: MARA.
                                                                        
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: MATNR  FOR MARA-MATNR MODIF ID SC2.
SELECT-OPTIONS: P_DATE FOR MARA-ERSDA MODIF ID SC1.
SELECTION-SCREEN END OF BLOCK B1.
                                                                                AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF NOT MATNR IS INITIAL .
      IF SCREEN-GROUP1 = 'SC1' .
        SCREEN-INPUT = '0'.
        MODIFY SCREEN.
      ENDIF.
    ELSEIF NOT P_DATE IS INITIAL.
      IF SCREEN-GROUP1 = 'SC2' .
        SCREEN-INPUT = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
  ENDLOOP.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
708

It works, but probably not the way you want. You can assign a function key to a radio button or a checkbox, but not a regular input field.

So in this case, the date will only be disabled after the user presses enter.

Rob

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
708

HI,

Since we dont go to AT SELECTION SCREEN event we cannot identify the value in MATNR as the value is not transfered from screen to the DATA filed. This transfer happens only at AT SELECTION-SCREEN. So you can do one thing

Create two radio buttons with sameradio button group and assign function code using MODIF ID.

Then when you select radio button corresponing to MATNR you will goto AT SELECTION SCREEN then your code of AT SELECTION-SCREEN OUTPUT will work.

Regards,

Sesh

Read only

Former Member
0 Likes
708

Hi Priya

Your requirement seems to be raising few doubts:

If MATNR is used for Input then P_DATE should be disabled. If so, once this is done all through the execution P_DATE will be disabled and it can not be changed.

For inputting P_DATE you need to re-run the program again.

Is this what you need????

Kind Regards

Eswar

Read only

Former Member
0 Likes
708

Hi

I understand, you requirement is soon after giving some value in for matnr the date field should be disabled.

In this method it's not possible. Your AT SELECTION-SCREEN OUTPUT event will trigger only when you press either enter or execute. So you can't do in this method.

But you can do it by creating a radio button and by assigning a function key to it.

Regards

Surya.

Read only

Former Member
0 Likes
708

Hi,

ue below logic

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: MATNR FOR MARA-MATNR .

SELECT-OPTIONS: : P_date for mara-ersda MODIF ID sc1.

SELECTION-SCREEN END OF BLOCK b1.

<b>AT SELECTION-SCREEN .

LOOP AT SCREEN.

IF not matnr[] is initial .

IF screen-group1 = 'SC1' .

screen-input = 0.

MODIFY SCREEN.

CONTINUE.

ENDIF .

ENDIF.

endloop.</b>

Regards

amole

Read only

Former Member
0 Likes
708

Hi priya,

1. The user has to atleast press ENTER

so that the other field is disabled.

2. just copy paste (ur program only, with some enhancement and modification)

3.

&----


*& Report ZAM_TEMP02

*&

&----


*&

*&

&----


report abc.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

TABLES : MARA.

SELECT-OPTIONS: MATNR FOR MARA-MATNR <b>MODIF ID SC2 .</b>

SELECT-OPTIONS: : P_date for mara-ersda MODIF ID sc1.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

*----


LOOP AT SCREEN.

IF matnr is not initial .

IF screen-group1 = 'SC1' .

screen-input = 0.

MODIFY SCREEN.

CONTINUE.

ENDIF .

ENDIF.

endloop.

<b>*----


LOOP AT SCREEN.

IF P_DATE is not initial .

IF screen-group1 = 'SC2' .

screen-input = 0.

MODIFY SCREEN.

CONTINUE.

ENDIF .

ENDIF.

endloop.</b>

regards,

amit m.

Read only

Former Member
0 Likes
708

Priya,

Below code will suit for your requirement.

REPORT zextest595 .

*--- Radiobuttons

PARAMETERS: p_up RADIOBUTTON GROUP a DEFAULT 'X' USER-COMMAND rb,

p_list RADIOBUTTON GROUP a.

PARAMETERS: p_pcfile LIKE rlgrap-filename OBLIGATORY DEFAULT 'C:\'

MODIF ID ccc,

p_pctype LIKE rlgrap-filetype OBLIGATORY DEFAULT 'ASC'

MODIF ID ccc,

p_unix LIKE rlgrap-filename OBLIGATORY DEFAULT '.\'

MODIF ID ccc.

PARAMETERS: p_dir LIKE rlgrap-filename OBLIGATORY DEFAULT '.'

MODIF ID ddd,

p_fp LIKE rlgrap-filename

MODIF ID ddd.

*----


  • AT SELECTION-SCREEN

*----


AT SELECTION-SCREEN OUTPUT.

IF p_up = 'X' .

LOOP AT SCREEN.

CASE screen-group1.

WHEN 'CCC'.

screen-input = 1. "Enable

screen-invisible = 0. "Disable

MODIFY SCREEN.

WHEN 'DDD'.

screen-input = 0.

screen-invisible = 1.

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

ENDIF.

IF p_list = 'X'.

LOOP AT SCREEN.

CASE screen-group1.

WHEN 'CCC'.

screen-input = 0.

screen-invisible = 1.

MODIFY SCREEN.

WHEN 'DDD'.

screen-input = 1.

screen-invisible = 0.

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

ENDIF.

Pls. reward points it is helpful.