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: 

Selection Screen Choice

Former Member
0 Kudos

Hi,

I am new to ABAP and facing following problem. I have a selection screen with following parameters. I want prompt the user enter appropriate values based on first value he enters.

Objective: To get production orders based on the values entered by user.

For example:

These are the combinations of required inputs:

If the user first enters

1) -> plant then he has to enter material number, Customer number, Prod. Heirarchy, workcenter, selection dates to get prod orders.

if the user enters

2) production number then he need not enter anything else to get the prod orders.

if the user enters

3) Sales order then he need not enter anything else to get the prod orders.

How do I achieve this.

Thanks in advance for your help.

Sachin

This is how my selection screen looks:

DATA: P_SD LIKE AFPOD-EDATU.

SELECTION-SCREEN BEGIN OF BLOCK SEL1 WITH FRAME TITLE TEXT-100.

PARAMETERS: P_PLANT LIKE CAUFV-WERKS ,

P_PROD LIKE CAUFV-AUFNR,

P_SORD LIKE CAUFV-KDAUF,

P_MATNO LIKE CAUFV-PLNBEZ,

P_CUSTNO LIKE AFPOD-KUNNR2.

SELECTION-SCREEN END OF BLOCK SEL1.

SELECTION-SCREEN BEGIN OF BLOCK SEL2 WITH FRAME TITLE TEXT-200.

PARAMETERS: P_HIER LIKE MARA-PRDHA OBLIGATORY VALUE CHECK.

SELECTION-SCREEN END OF BLOCK SEL2.

SELECTION-SCREEN BEGIN OF BLOCK SEL3 WITH FRAME TITLE TEXT-300.

PARAMETERS: P_WC LIKE CRHD-ARBPL.

SELECT-OPTIONS S_SELDAT FOR P_SD.

SELECTION-SCREEN END OF BLOCK SEL3.

SELECTION-SCREEN END OF SCREEN 500.

CALL SELECTION-SCREEN 500.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

DATA: P_SD LIKE AFPOD-EDATU.

selection-screen: begin of screen 500.

SELECTION-SCREEN BEGIN OF BLOCK SEL1 WITH FRAME TITLE TEXT-100.

PARAMETERS: P_PLANT LIKE CAUFV-WERKS modif id 123,

P_PROD LIKE CAUFV-AUFNR modif id 010,

P_SORD LIKE CAUFV-KDAUF modif id 789,

P_MATNO LIKE CAUFV-PLNBEZ modif id 234,

P_CUSTNO LIKE AFPOD-KUNNR modif id 234.

SELECTION-SCREEN END OF BLOCK SEL1.

SELECTION-SCREEN BEGIN OF BLOCK SEL2 WITH FRAME TITLE TEXT-200.

PARAMETERS: P_HIER LIKE MARA-PRDHA VALUE CHECK modif id 456 default '00115'.

SELECTION-SCREEN END OF BLOCK SEL2.

SELECTION-SCREEN BEGIN OF BLOCK SEL3 WITH FRAME TITLE TEXT-300.

PARAMETERS: P_WC LIKE CRHD-ARBPL modif id 567.

SELECT-OPTIONS S_SELDAT FOR P_SD modif id 567.

SELECTION-SCREEN END OF BLOCK SEL3.

SELECTION-SCREEN END OF SCREEN 500.

call selection-screen 500.

at selection-screen output.

loop at screen.

if p_plant is not initial.

if screen-group1 = '234'

or screen-group1 = '456'

or screen-group1 = '567'.

screen-REQUIRED = 1.

modify screen.

endif.

endif.

if p_prod is not initial.

if screen-group1 = '234'

or screen-group1 = '456'

or screen-group1 = '567'

or screen-group1 = '123'

or screen-group1 = '789'.

screen-input = 0.

modify screen.

endif.

endif.

if P_SORD is not initial.

if screen-group1 = '234'

or screen-group1 = '456'

or screen-group1 = '567'

or screen-group1 = '123'

or screen-group1 = '010'.

screen-input = 0.

modify screen.

endif.

endif.

endloop.

check this out.

santhosh

7 REPLIES 7

Former Member
0 Kudos

use three radio buttons for 3 requirements.

If user select the one make the other parameters disabled using screen internal table.

Cheers.

Former Member
0 Kudos

<b>for 1)</b>

at selection screen on <plantfield>.

if P_MATNO is initial.

message i001(zz) with "Enter Material".

stop.

endif.

if P_CUSTNO is initial.

message i001(zz) with "Enter Customer".

stop.

endif.

if P_HIER is initial.

message i001(zz) with "Enter Hierarchy".

stop.

endif.

if P_WC is initial.

message i001(zz) with "Enter Work center".

stop.

endif.

if S_SELDAT-low is initial.

message i001(zz) with "Enter Date".

stop.

endif.

<b>for 2)</b>

at selection screen.

if P_PROD is initial.

message i001(zz) with "Enter Production Order".

endif.

<b>for 3)</b>

at selection screen.

if P_SORD is initial.

message i001(zz) with "Enter Sales Order".

endif.

Former Member
0 Kudos

DATA: P_SD LIKE AFPOD-EDATU.

selection-screen: begin of screen 500.

SELECTION-SCREEN BEGIN OF BLOCK SEL1 WITH FRAME TITLE TEXT-100.

PARAMETERS: P_PLANT LIKE CAUFV-WERKS modif id 123,

P_PROD LIKE CAUFV-AUFNR modif id 010,

P_SORD LIKE CAUFV-KDAUF modif id 789,

P_MATNO LIKE CAUFV-PLNBEZ modif id 234,

P_CUSTNO LIKE AFPOD-KUNNR modif id 234.

SELECTION-SCREEN END OF BLOCK SEL1.

SELECTION-SCREEN BEGIN OF BLOCK SEL2 WITH FRAME TITLE TEXT-200.

PARAMETERS: P_HIER LIKE MARA-PRDHA VALUE CHECK modif id 456 default '00115'.

SELECTION-SCREEN END OF BLOCK SEL2.

SELECTION-SCREEN BEGIN OF BLOCK SEL3 WITH FRAME TITLE TEXT-300.

PARAMETERS: P_WC LIKE CRHD-ARBPL modif id 567.

SELECT-OPTIONS S_SELDAT FOR P_SD modif id 567.

SELECTION-SCREEN END OF BLOCK SEL3.

SELECTION-SCREEN END OF SCREEN 500.

call selection-screen 500.

at selection-screen output.

loop at screen.

if p_plant is not initial.

if screen-group1 = '234'

or screen-group1 = '456'

or screen-group1 = '567'.

screen-REQUIRED = 1.

modify screen.

endif.

endif.

if p_prod is not initial.

if screen-group1 = '234'

or screen-group1 = '456'

or screen-group1 = '567'

or screen-group1 = '123'

or screen-group1 = '789'.

screen-input = 0.

modify screen.

endif.

endif.

if P_SORD is not initial.

if screen-group1 = '234'

or screen-group1 = '456'

or screen-group1 = '567'

or screen-group1 = '123'

or screen-group1 = '010'.

screen-input = 0.

modify screen.

endif.

endif.

endloop.

check this out.

santhosh

0 Kudos

Hi Santosh,

I tried your suggestion. I cant see the desired effect. For example it does allow the user to proceed further without entering valid combination too. i.e if i enter plant then without even entering other values it executes. Am I missing something here?

TIA

Sachin

0 Kudos

DATA: P_SD LIKE AFPOD-EDATU.

*selection-screen: begin of screen 500.

SELECTION-SCREEN BEGIN OF BLOCK SEL1 WITH FRAME TITLE TEXT-100.

*PARAMETERS: P_PLANT2 LIKE CAUFV-WERKS AS LISTBOX VISIBLE LENGTH 4 user-command ucomm modif id 123.

PARAMETERS: P_PLANT LIKE CAUFV-WERKS modif id 123, "obligatory, "default '1005',

P_PROD LIKE CAUFV-AUFNR modif id 010,

P_SORD LIKE CAUFV-KDAUF modif id 789,

P_MATNO LIKE CAUFV-PLNBEZ modif id 234,

P_CUSTNO LIKE AFPOD-KUNNR modif id 234.

SELECTION-SCREEN END OF BLOCK SEL1.

SELECTION-SCREEN BEGIN OF BLOCK SEL2 WITH FRAME TITLE TEXT-200.

PARAMETERS: P_HIER LIKE MARA-PRDHA VALUE CHECK modif id 456 default '00115'.

SELECTION-SCREEN END OF BLOCK SEL2.

SELECTION-SCREEN BEGIN OF BLOCK SEL3 WITH FRAME TITLE TEXT-300.

PARAMETERS: P_WC LIKE CRHD-ARBPL modif id 567.

SELECT-OPTIONS S_SELDAT FOR P_SD modif id 567.

SELECTION-SCREEN END OF BLOCK SEL3.

*SELECTION-SCREEN END OF SCREEN 500.

at selection-screen output.

loop at screen.

if p_plant is not initial.

if screen-group1 = '234'

or screen-group1 = '456'

or screen-group1 = '567'.

screen-required = 1.

*screen-input = 1.

modify screen.

endif.

endif.

if p_prod is not initial.

if screen-group1 = '234'

or screen-group1 = '456'

or screen-group1 = '567'

or screen-group1 = '123'

or screen-group1 = '789'.

screen-input = 0.

modify screen.

endif.

endif.

if P_SORD is not initial.

if screen-group1 = '234'

or screen-group1 = '456'

or screen-group1 = '567'

or screen-group1 = '123'

or screen-group1 = '010'.

screen-input = 0.

modify screen.

endif.

endif.

endloop.

start-of-selection.

*call selection-screen 500.

if p_plant is not initial.

if P_CUSTNO is initial.

message 'Enter all details' type 'I'.

leave list-processing.

endif.

endif.

hi, try this..unfortunately u need to enhance this code a bit ..i am leaving for the day ...

hope this will give u some idea..

santhosh

Former Member
0 Kudos

Thanks to all. I will try out the suggested solutions.

Former Member
0 Kudos

HI,

Try like this:

DATA: P_SD LIKE AFPOD-EDATU.

selection-screen begin of screen 500.

SELECTION-SCREEN BEGIN OF BLOCK SEL1 WITH FRAME TITLE TEXT-100.

PARAMETERS: P_PLANT LIKE CAUFV-WERKS ,

P_PROD LIKE CAUFV-AUFNR,

P_SORD LIKE CAUFV-KDAUF,

P_MATNO LIKE CAUFV-PLNBEZ,

P_CUSTNO LIKE AFPOD-KUNNR2.

SELECTION-SCREEN END OF BLOCK SEL1.

SELECTION-SCREEN BEGIN OF BLOCK SEL2 WITH FRAME TITLE TEXT-200.

PARAMETERS: P_HIER LIKE MARA-PRDHA OBLIGATORY VALUE CHECK.

SELECTION-SCREEN END OF BLOCK SEL2.

SELECTION-SCREEN BEGIN OF BLOCK SEL3 WITH FRAME TITLE TEXT-300.

PARAMETERS: P_WC LIKE CRHD-ARBPL.

SELECT-OPTIONS S_SELDAT FOR P_SD.

SELECTION-SCREEN END OF BLOCK SEL3.

SELECTION-SCREEN END OF SCREEN 500.

CALL SELECTION-SCREEN 500.

at selection-screen on p_plant.

if not p_prod is initial.

if p_matno is initial and

p_custno is initial and

p_hier is initial and

p_wc is initial and

s_seldat[] is initial.

message i000(xxxx) with

'Please enter Material no., customer no., Prod.hierar, workcenter, and sel.dates'.

stop.

endif.

endif.

at selection-screen.

if p_plant is initial and p_prod is initial and p_sord is initial.

message i000(xxx) with 'Please enter any one: prod.order, plant or Sales order'.

endif.

Regards

Subramanian