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

Need help on selection screen

Former Member
0 Likes
797

Hello Experts,

I have a requirement. My user want when she run the report online all variable on selection screen should be parameters means not range or extension and some selection screen checks. But when she run the report in batch mode, all variable on the selection screen should be select-options means ranges with extension. Is it possible to create 2 selection screen in same report, I have no idea, is it possible or not. If possible please tell me how.

Thanks,

Amit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
760

Hi,

I think you can do like this.

If SY-BATCH = 'X'.

selection-screen: begin of block B1 with

frame title text-001.

select-options: s_bukrs for t001-bukrs obligatory.

selection-screen: end of block B1.

ELSE.

selection-screen: begin of block B1 with

frame title text-001.

parameters: s_bukrs like t001-bukrs obligatory.

selection-screen: end of block B1.

ENDIF.

Check this code.

Thanks.

If this helps you reward with points.

5 REPLIES 5
Read only

Laxmana_Appana_
Active Contributor
0 Likes
760

Hi,

Check this link , use Sy-batch to differentiate between online and background mode

Regards

Appana

Read only

Former Member
0 Likes
760

I think I would try one selection screen all with select options.

Then do a LOOP AT SCREEN. making the upper field and extension invisible if you are not in batch mode (sy-batch = X). Thus making your field look like a parameter

J

Message was edited by: J.J

Message was edited by: J.J

Read only

Former Member
0 Likes
761

Hi,

I think you can do like this.

If SY-BATCH = 'X'.

selection-screen: begin of block B1 with

frame title text-001.

select-options: s_bukrs for t001-bukrs obligatory.

selection-screen: end of block B1.

ELSE.

selection-screen: begin of block B1 with

frame title text-001.

parameters: s_bukrs like t001-bukrs obligatory.

selection-screen: end of block B1.

ENDIF.

Check this code.

Thanks.

If this helps you reward with points.

Read only

0 Likes
760

You can achieve it like this.



report zrich_0001.

data: d_parm type c.

selection-screen begin of screen 1001.
parameters: p_parm type c.
selection-screen end of screen 1001.


selection-screen begin of screen 1002.
select-options: s_parm for d_parm.
selection-screen end of screen 1002.

start-of-selection.

  if sy-batch = space.
    call selection-screen 1001.
    write:/ p_parm.
  else.
    call selection-screen 1002.
    loop at s_parm.
      write:/ s_parm.
    endloop.
  endif.

You can not wrap the selection screen statements with an IF statement.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
760

Hi,

Try this code,

<b>Important thing is, don't use default selection-screen(1000).</b>

DATA: w_matnr TYPE matnr.

SELECTION-SCREEN BEGIN OF SCREEN 1001.

PARAMETER: pr_param TYPE matnr.

SELECTION-SCREEN END OF SCREEN 1001.

SELECTION-SCREEN BEGIN OF SCREEN 1002.

SELECT-OPTIONS: so_sele FOR w_matnr.

SELECTION-SCREEN END OF SCREEN 1002.

INITIALIZATION.

IF sy-binpt = 'X'.

CALL SELECTION-SCREEN 1001.

ELSE.

CALL SELECTION-SCREEN 1002.

ENDIF.

<b>You should be the same logic in the remaining program(like in START-OF-SELECTION, END-OF-SELECTION etc) where ever the implication of selection screen fileds are there.</b>

Thanks and Regards,

Bharat Kumar Reddy.V