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

regarding the selection screen

hi,

iam using the code like as below.

case sy-tcode.

when 'YTC1'.

selection-screen begin of screen 0100.

selection-screen begin of block b1 with frame title text-001.

select-options matnr for mara-matnr.

select-options lifnr for lfa1-lifnr no intervals.

selection-screen end of block b1.

selection-screen begin of block b2 with frame title text-002.

parameters r1 radiobutton group g.

parameters r2 radiobutton group g.

parameters r3 radiobutton group g.

selection-screen end of block b2.

selection-screen end of screen 0100.

when 'YTC2'.

selection-screen begin of screen 0200.

selection-screen begin of block b3 with frame title text-003.

select-options matnr for mara-matnr.

selection-screen end of block b3.

selection-screen begin of block b4 with frametitle text-004.

parameters r1 radiobutton group g.

selection-screen end of block b4.

selection-screen end of screen 0200.

endcase.

it is throwing the error as already matnr is defined.but i require this because i have to use to transaction codes for the same program and i have to display each screen for one transaction.

please correct me.

thanks in advance

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Nov 23, 2007 at 08:20 AM

    Hi,

    Change here for 'YTC2' : select-options s_matnr for mara-matnr.

    As matnr is alsready declared when 'YTC1'.

    *reward if helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2007 at 08:21 AM

    since it is the same program, you will have to rename your variables...you can still have the same type so that you are not affected.

    case sy-tcode.

    when 'YTC1'.

    selection-screen begin of screen 0100.

    selection-screen begin of block b1 with frame title text-001.

    select-options matnr for mara-matnr.

    select-options lifnr for lfa1-lifnr no intervals.

    selection-screen end of block b1.

    selection-screen begin of block b2 with frame title text-002.

    parameters r1 radiobutton group g.

    parameters r2 radiobutton group g.

    parameters r3 radiobutton group g.

    selection-screen end of block b2.

    selection-screen end of screen 0100.

    when 'YTC2'.

    selection-screen begin of screen 0200.

    selection-screen begin of block b3 with frame title text-003.

    select-options <b>s_matnr</b> for mara-matnr.

    selection-screen end of block b3.

    selection-screen begin of block b4 with frametitle text-004.

    parameters <b>r4</b> radiobutton group <b>g1</b>.

    selection-screen end of block b4.

    selection-screen end of screen 0200.

    endcase.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2007 at 08:22 AM

    Hi,

    Write all the parameters and selection-screen.

    use selection-screen output event

    ie select-options : matnr for mara-matnr modif id 'MRN'.

    at selection-screen output.

    if sy-tcode = 'YTC1'.

    loop at screen.

    if screen-group1 = 'MRN'.

    screen-active = '0'.

    modify screen.

    endif.

    endloop.

    endif.

    regards,

    Santosh Thorat

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2007 at 08:25 AM

    hi surya ,

    i think u have to handle this by using at selection screen output .

    under this event u have to check for ur tcode and then make the screen elements invisible or in display mode .

    Thanks

    ROhit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2007 at 08:50 AM

    The program will not allow to declare same variable twice. so you need to change the matnr with a cnange (i.e.<b> s_matnr</b>) in 'YTC2'.

    when 'YTC2'.

    selection-screen begin of screen 0200.

    selection-screen begin of block b3 with frame title text-003.

    select-options s_matnr for mara-matnr.

    selection-screen end of block b3.

    selection-screen begin of block b4 with frametitle text-004.

    parameters r4 radiobutton group g1.

    selection-screen end of block b4.

    selection-screen end of screen 0200

    Rewards if useful.

    Add a comment
    10|10000 characters needed characters exceeded

    • Selection-screen, parameters and select-options define the screen for the abap interpreter. They are NOT executed ABAP commands, and as such will ignore any control structures.

      e.g.

      IF 1 EQ 1.
        PARAMETERS p_1 TYPE c.
      ELSE.
        PARAMETERS p_2 TYPE c.
      ENDIF.

      Will produce a selection screen with <b>two</b> parameters - p_1 and p_2.

      So, your "WHEN" structure is useless. You have to define both screens. You can't make it conditional.

      matt

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.