Skip to Content
author's profile photo Former Member
Former Member

Selection Screen Choice

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2007 at 02:21 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2007 at 02:03 PM

    use three radio buttons for 3 requirements.

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

    Cheers.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2007 at 02:04 PM

    <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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2007 at 06:44 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 02, 2007 at 03:04 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.