Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

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.

Tags:
Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question