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

Instead of OBLIGATORY function

Former Member
0 Likes
1,292

Hi All,

Instead of OBLIGATORY function in SELECTION SCREEN, how can I achieve in the other way.

Thanks & Regards

Santhosh

Hi All,

Instead of OBLIGATORY function in SELECTION SCREEN, how can I achieve in the other way.

Thanks & Regards

Santhosh

13 REPLIES 13
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,263

You can check the value in the AT SELECTION-SCREEN event.


parameters:  p_field type c.

at selection-screen.
  if p_field is initial.
    message e001(00) with 'Please enter a value'. 
  endif.

start-of-selection.

Regards,

Rich Heilman

Read only

former_member194669
Active Contributor
0 Likes
1,263

May be this way


at selection-screen.
  if sy-ucomm eq 'ONLI'. "check when execute or f8 press
    perform f_check_bukrs.
  endif.

form f_check_bukrs.
  if p_bukrs is initial.
      message e999(yxxx) .
      " Invalid company code
    endif.
  endif.
endform.                           

Read only

Former Member
0 Likes
1,263

Hi,

Write u r own logic in at selection-screen event.

at selection-screen

if field is initial.

message ' ' type 'E''.

endif.

Pls reward points.

Regards,

Raghu

Read only

0 Likes
1,263

What I wanted is When I execute the program it shoud not display until unless the condition is satisfied. But no message type as 'E'.

Thanks & Regards

Santhosh

Edited by: Santosh Subbanna on Feb 1, 2008 5:25 PM

Read only

0 Likes
1,263

misunderstood the requirement

thread deleted

a®s

Edited by: a®s on Feb 1, 2008 11:33 AM

Read only

0 Likes
1,263

Ok, but it is better to give a message to the user. But if you simply don't want to show the report, then you can use the STOP statement instead of the MESSAGE statement.



REPORT zrich_0001.

parameters:  p_field type c.

at selection-screen.
  if p_field is initial.
    stop.
  endif.

start-of-selection.

write:/ 'Report'.

Regards,

Rich Heilman

Read only

0 Likes
1,263

Can't I use any LEAVE LIST-PROCESSING or something like that. I hope using STOP is not a good practice.

Thanks & Regards

Santhosh

Read only

0 Likes
1,263

Ok..try like this...


DATA : mat LIKE marc-matnr.
PARAMETERS : p_matnr TYPE  marc-matnr.

AT SELECTION-SCREEN ON p_matnr.
  SELECT SINGLE matnr INTO mat FROM marc WHERE matnr EQ p_matnr.
  IF sy-subrc EQ 0.
    "do nothing
  ELSE.
    MESSAGE 'Enter valid material' TYPE 'S'.
    SUBMIT (sy-repid) VIA SELECTION-SCREEN.
  ENDIF

Read only

0 Likes
1,263

Geez, picky picky Kidding. How about this.




REPORT zrich_0001.

tables: sscrfields.

parameters:  p_field type c.

at selection-screen.
  if p_field is initial
       and  sscrfields-ucomm = 'ONLI'.
    sscrfields-ucomm = space.
  endif.

start-of-selection.


write:/ 'Report'.

Regards,

Rich Heilman

Read only

0 Likes
1,263

Thank you Rich.

Its working.

Thanks & Regards

Santhosh

Read only

0 Likes
1,263

Nice solution, thanks for the tip !

Best regards,

Paskalo

Read only

Former Member
0 Likes
1,263

PARAMETERS: p_x TYPE c.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

screen-required = 1.

MODIFY SCREEN.

ENDLOOP.

Put u r logic accordingly and then change screen required.

Pls reward points if useful.

Regards,

Raghu

Read only

Former Member
0 Likes
1,263

Got it!!!