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

At Selection Screen EVENT

Former Member
0 Likes
1,523

Hi All,

I am trying to develop a check at selection screen which is having two select options,

S_PRODH and S_MATNR, the requirement is i need to check that both of them are not initial

also if one is entered the user should not be able to enter the other one, If he/she enters any value on the other field it should show an error messsage.

My current code is like this.

AT SELECTION-SCREEN.

IF S_MATNR IS INITIAL AND S_PRODH is initial.

MESSAGE e001(z9) WITH TEXT-005.

ELSE.

IF S_MATNR IS NOT INITIAL AND S_PRODH is not initial.

MESSAGE I001(z9) WITH TEXT-005.

gv_stop = 'X'.

STOP.

ENDIF.

ENDIF.

And after END-OF-SELECTION

IF gv_stop IS INITIAL.

perform output_data.

ENDIF.

Please help me on this,

Regards,

Tapodipta Khan

1 ACCEPTED SOLUTION
Read only

RoySayak
Active Participant
0 Likes
1,496

Hi Tapo,

Display the mesaage like this..

CONSTANTS: c_error TYPE char1 VALUE 'E'.

MESSAGE s001(z9) DISPLAY LIKE c_error.

Regards,

Sayak..

13 REPLIES 13
Read only

Former Member
0 Likes
1,496

Modify this line " IF S_MATNR IS NOT INITIAL AND S_PRODH is not initial. "

as " IF NOT S_MATNR IS INITIAL AND

( NOT S_PRODH is initial ).

Hope this helps,

Rajat

Read only

0 Likes
1,496

YEs, use Rajat' sugestion.

Read only

vinod_vemuru2
Active Contributor
0 Likes
1,496

Hi,

It seems there is some confusion in the requirement.


 the requirement is i need to check that both of them are not initial
also if one is entered the user should not be able to enter the other one, If he/she enters any value on the other field it should show an error messsage.

U r telling both should not be initial and if u enter one value u should not enter other. So it is

contradictory. Please check the requirement correctly and get back.

Thanks,

Vinod.

Read only

Former Member
0 Likes
1,496

Hi,

Actually it is displaying the Error message but creates another problem, if i am trying to delete

any of the ranges given, either matnr or prodh then it is again showing the error message.

Regards,

Tapodipta

Read only

Former Member
0 Likes
1,496

hi,

Try this way..

AT SELECTION-SCREEN.

IF S_MATNR IS INITIAL AND S_PRODH is initial.
   MESSAGE E001(z9) WITH TEXT-005.
ELSEIF S_MATNR IS NOT INITIAL AND S_PRODH is not initial.
   MESSAGE E001(z9) WITH TEXT-005.
ENDIF.

Don't give the Inforamtion Message and instead give the Error Message so the processing get's stoped and selection screen will be displayed..

Edited by: avinash kodarapu on Jan 2, 2009 11:38 AM

Read only

Former Member
0 Likes
1,496

Hi

AT SELECTION-SCREEN.

IF S_MATNR IS INITIAL AND S_PRODH is initial.

MESSAGE e001(z9) WITH TEXT-005.

ENDIF.

If s_matnr is not initial and S_PRODH is initial.

Loop at screen.

if screen-name = S_PRODH .

screen-active = 0.

screen-input = 0.

endif.

modify screen.

endloop.

elseif s_matnr is initial and S_PRODH is not initial.

Loop at screen.

if screen-name = S_matnr .

screen-active = 0.

screen-input = 0.

endif.

modify screen.

endloop.

endif.

this will not allow user to enter rathher than an error message.

hope it slves.

Reg

Ramya

Read only

Former Member
0 Likes
1,496

Hi Vinod,

The requirement is like that only, if your'e entering S_MATNR then S_PRODH should be blank

or disabled, and if you are entering S_PRODH then S_MATNR should be blank or disabled, or instead of disabling it they need one Error message.

Regards,

Tapodipta

Read only

Former Member
0 Likes
1,496

Hi,

I think ur requirement is, at a time either S_PRODH is not initial or S_MATNR is not initial, then only ur code should be executed.

if it is the requirement ur code will work.

Read only

RoySayak
Active Participant
0 Likes
1,497

Hi Tapo,

Display the mesaage like this..

CONSTANTS: c_error TYPE char1 VALUE 'E'.

MESSAGE s001(z9) DISPLAY LIKE c_error.

Regards,

Sayak..

Read only

Former Member
0 Likes
1,496

Hi guys,

Nothin helped actually i have already tried with all of these possibilities,

but when i am displaying the error message as both of them are filled. After that

i should be able to clear the selection-screen values, both S_MATNR and S_PRODH,

that is where i am getting stuck.

Regards,

Tapodipta.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,496

Hi Tapodipta Khan,

Use this way, its working:-


TABLES : aufk.

SELECT-OPTIONS : s_aufnr FOR aufk-aufnr,
                 s_objnr FOR aufk-objnr.

AT SELECTION-SCREEN.
  IF ( NOT s_aufnr IS INITIAL ) AND  ( NOT s_objnr IS INITIAL ).
    MESSAGE e000(zmsg_wo). "zmsg_wo is message class
  ELSEIF ( s_aufnr IS INITIAL ) AND  ( s_objnr IS INITIAL ).
    MESSAGE e001(zmsg_wo).
  ELSE.
    *your code
  ENDIF.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Read only

Former Member
0 Likes
1,496

Thanks Sayak , your solution solved the problem.

Regards,

Tapodipta

Read only

Former Member
0 Likes
1,496

Hi,

Try like this:

tables: mara, vbap.

select-options: s_matnr for mara-matnr,

s_prodh for vbap-prodh.

at selection-screen.

*break-point.

if ( ( s_matnr is initial ) and ( s_prodh is initial ) ).

message e000(01) with 'Must enter value in any field.'.

elseif ( not s_matnr is initial ) and ( s_prodh is initial ).

message i000(02) with 'You entered value in matnr field.'.

elseif ( s_matnr is initial ) and ( not s_prodh is initial ).

message i000(03) with 'You entered value in prodh field.'.

endif.

start-of-selection.

write:/ 'Value you entered in s_matnr is:', s_matnr-low,

/ 'Value you entered in s_prodh is:', s_prodh-low.

Regards,

Bhaskar