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

Disable the select-options dynamically based on value selected in listbox

Former Member
0 Likes
1,956

Hi friends,

I have a peculiar problem in my program.

I have a list box with two values.

1) With Ref to Reservation No.

2) Production order.

I am doing the object for Transfer Posting ( Similar to MIGO).

The contents of the listbox here are acting as the label to my select-options.

I have two select-options in my program.

1) Reservation No (s_rsnum for rsnum)

2) Production Order (s_porder for aufnr)

In runtime, based on the label selected in the listbox, the corresponding select-option should be in visible mode.

for eg: if i select "With ref to Reservation No" S_rsnum should be enabled and vice-versa.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,392

Hi,

perhaps this helps:

tables: mara.

*

PARAMETERS: P1 DEFAULT 'X' RADIOBUTTON GROUP PR1 USER-COMMAND DUMMY.

PARAMETERS: P2 RADIOBUTTON GROUP PR1.

selection-screen: skip 3.

select-options: s_matnr for mara-matnr MODIF ID DI1.

selection-screen: skip 3.

select-options: s_matkl for mara-matkl MODIF ID DI2.

*

AT SELECTION-SCREEN OUTPUT.

*

IF P1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 EQ 'DI1'.

SCREEN-ACTIVE = '1'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 EQ 'DI2'.

SCREEN-ACTIVE = '0'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

*

IF P2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 EQ 'DI1'.

SCREEN-ACTIVE = '0'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 EQ 'DI2'.

SCREEN-ACTIVE = '1'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Regards, Dieter

Hi friends,

I have a peculiar problem in my program.

I have a list box with two values.

1) With Ref to Reservation No.

2) Production order.

I am doing the object for Transfer Posting ( Similar to MIGO).

The contents of the listbox here are acting as the label to my select-options.

I have two select-options in my program.

1) Reservation No (s_rsnum for rsnum)

2) Production Order (s_porder for aufnr)

In runtime, based on the label selected in the listbox, the corresponding select-option should be in visible mode.

for eg: if i select "With ref to Reservation No" S_rsnum should be enabled and vice-versa.

7 REPLIES 7
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,392

hi santosh,

you should do something like:

IF listbox EQ With ref to...

LOOP AT screen.

IF SREEN-NAME EQ 'S_RSNUM'.

screen-active = 0.

MODIFY screen.

ENDIF.

ENDIF.

and vice versa fopr the other field

hope this helps

ec

Read only

Former Member
0 Likes
1,393

Hi,

perhaps this helps:

tables: mara.

*

PARAMETERS: P1 DEFAULT 'X' RADIOBUTTON GROUP PR1 USER-COMMAND DUMMY.

PARAMETERS: P2 RADIOBUTTON GROUP PR1.

selection-screen: skip 3.

select-options: s_matnr for mara-matnr MODIF ID DI1.

selection-screen: skip 3.

select-options: s_matkl for mara-matkl MODIF ID DI2.

*

AT SELECTION-SCREEN OUTPUT.

*

IF P1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 EQ 'DI1'.

SCREEN-ACTIVE = '1'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 EQ 'DI2'.

SCREEN-ACTIVE = '0'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

*

IF P2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 EQ 'DI1'.

SCREEN-ACTIVE = '0'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 EQ 'DI2'.

SCREEN-ACTIVE = '1'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Regards, Dieter

Read only

0 Likes
1,392

Hi Dieter,

this is working fine. but i need to do the visibility based on values selected in listbox. the code u said work fine with the radio buttons.

Read only

0 Likes
1,392

Hi,

can you shortly show how do you use listboxes?

Regards, Dieter

Read only

0 Likes
1,392

Hi,

here an example with listbox:

TABLES: MARA.

*

PARAMETERS: P0 DEFAULT 'KAUF' LIKE MARA-MTART AS LISTBOX VISIBLE LENGTH 8 USER-COMMAND DUMMY.

*

SELECTION-SCREEN: SKIP 3.

SELECT-OPTIONS: S_MATNR FOR MARA-MATNR MODIF ID DI1.

SELECTION-SCREEN: SKIP 3.

SELECT-OPTIONS: S_MATKL FOR MARA-MATKL MODIF ID DI2.

*

AT SELECTION-SCREEN OUTPUT.

*

IF P0 = 'KAUF'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 EQ 'DI1'.

SCREEN-ACTIVE = '1'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 EQ 'DI2'.

SCREEN-ACTIVE = '0'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

*

IF P0 <> 'KAUF'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 EQ 'DI1'.

SCREEN-ACTIVE = '0'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 EQ 'DI2'.

SCREEN-ACTIVE = '1'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

  • use your own listbox in If-Clauses.

Regards, Dieter

Read only

0 Likes
1,392

Hi Dieter,

Even the second solution u gave is not working. can u plse send me u r mailid. i will send the screen-shot to u. it is very urgent.

Thanks & Regards,

Santosh Kumar.

Read only

0 Likes
1,392

It is working fine Dieter. thanks a lot. My problem is solved. I alloted 10 points to you. Thanks for co-operation.