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

Execute button missing after displaying the error message on selection screen

Former Member
0 Likes
7,460

Hi,

Execute(F8) button is missing in my program after displaying the error message in the selection screen.

AT SELECTION-SCREEN.

If field IS INITIAL.

   Message s001 display like 'E'.

   call selection-screen 1000.

endif.

i tried different combinations after the message statement in the above code.

*       Set SCREEN 0.  <== Giving error message SET SCREEN not allowed in subscreens (Screen RVV50R10C 1010)

*       LEAVE to SCREEN 1000.<= Same error message as above.

*       call SCREEN 1000.<= Giving error message Selection screen RVV50R10C 1000 was not called using CALL SELECTION-SCREEN.

*       LEAVE to LIST-PROCESSING <== Giving same error as of SET SCREEN.

*       CALL SELECTION-SCREEN 1000.  <== Execute button missing.

In the AT SELECTION-SCREEN OUTPUT we have the FM.

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

          EXPORTING

               p_status  = sy-pfkey                           "hp_370442

               p_program = lf_program

          TABLES

               p_exclude = lt_cua_exclude.

Please let me know your inputs.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

VijayaKrishnaG
Active Contributor
0 Likes
6,297

Hi Uday,

After ERROR Message the report execution will be terminated and whatever code after that message statement will not be triggered.

As you written in the "At Selection Screen"

Message s001 display like 'E'.

"When you have specified message as "S", execution will not be terminated and no use of it in your case.

You can write like this, (ofcourse mentioned)

AT SELECTION-SCREEN.

IF FIELD IS INITIAL.

     MESSAGE E000(<message_class>).

ENDIF.

Thanks & Regards,

Vijay

33 REPLIES 33
Read only

Former Member
0 Likes
6,297

Hi Uday,

I guess this is a copy of standard....

Put the error in START-OF-SELECTION.

If field IS INITIAL.

   Message s001 display like 'E'.

   LEAVE LIST-PROCESSING.

endif.

Read only

0 Likes
6,297

Hi Mohammed,

if the put the error logic in start of selection the error message will be displayed in the next screen of the selection screen but I would like to display the error message in the selection screen itself.

Thanks!

Read only

Former Member
0 Likes
6,297

Hi Uday,

Tell me something, why don't you make the parameter (field) 'OBLIGATORY'?

Regards,

Koushik

Read only

0 Likes
6,297

In my requirement I can NOT make the parameter field OBLIGATORY as the user may or may not enter the field for the result. This field would be adding an extra filter to the result set.

Read only

0 Likes
6,297

Hi Uday,

As this field will add an extra filter to the result set, you can try with warning message on

AT SELECTION-SCREEN ON <parameter>.

So if the user feels he doesn't need the filter, he can go for further processing with an additional enter action.

Regards,

Koushik

Read only

0 Likes
6,297

Hi Uday,

Just a second thought. If you are not supposed to make the field mandatory for the user to enter, then why do you want to display an error is the field is empty?

Read only

0 Likes
6,297

Hi Koushik,

The issue is if the user enters the invalid data in that new extra field he has to wait till the program complete the execution to see no result as the invalid filter will remove all the records from the result set.

Thanks!

Read only

former_member491621
Contributor
0 Likes
6,297

Hi Uday,

You can try what Koushik suggested.

Also, i didn't get the purpose behind calling the selection screen again!! And also why are you using success message?? Any specific reason?(I don't find any though).

Anyway, the below code would still stop the processing if the field value is not entered.

If field IS INITIAL.

   Message e001. "display like 'E'.

   call selection-screen 1000.           " This part not required

endif.

Hope this helps

Read only

0 Likes
6,297

Hi Aniket,

If I do NOT display the error message as 'SUCCESS' all the fields in the selection screen are getting disabled and it is not allowing the user for input.

Thanks

Read only

0 Likes
6,297

Hi Uday,

Whenever i gave an error message in AT SELECTION SCREEN event, all the fields were editable.

You can also check the below link for your reference

http://help.sap.com/saphelp_40b/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/content.htm

The system itself allows the fields to be editable.

Hope this helps

Read only

Former Member
0 Likes
6,297

Hi Uday,

         Can you also make sure that the internal table 'lt_cua_exclude' which you are using in the FM RS_SET_SELSCREEN_STATUS doesn't contain the function code 'ONLI'. If it contains the specified function code, please write a code in the AT SELECTION-SCREEN OUTPUT event to remove the code 'ONLI' from the table lt_cua_exclude and execute the report.

Thanks & Regards,

Sarath.

Read only

0 Likes
6,297

Hi Sarath,

I was also looking for the same thing yesterday but the only function codes it has in lt_cua_exclude are FC01 , FC02 , FC03 and FC04..

Read only

Aiolos
Active Participant
0 Likes
6,297

hi, do what Sarath Babu said, maybe you can solve it.

Read only

Former Member
0 Likes
6,297

Hi Aiolos,

I tried what sarath babu mentioned but there is no ONLI in lt_cua_exclude.

Read only

VijayaKrishnaG
Active Contributor
0 Likes
6,298

Hi Uday,

After ERROR Message the report execution will be terminated and whatever code after that message statement will not be triggered.

As you written in the "At Selection Screen"

Message s001 display like 'E'.

"When you have specified message as "S", execution will not be terminated and no use of it in your case.

You can write like this, (ofcourse mentioned)

AT SELECTION-SCREEN.

IF FIELD IS INITIAL.

     MESSAGE E000(<message_class>).

ENDIF.

Thanks & Regards,

Vijay

Read only

0 Likes
6,297

Hi Vijay,

I agree with you that success message will not terminate the execution of the program but the       CALL SELECTION-SCREEN 1000 written after the MESSAGE SXXX DISPLAY LIKE 'E' is not allowing the program to execute the logic in SELECTION-SCREEN. it is taking the execution to the AT SELECTION-SCREEN OUTPUT. In my scenario that is what exactly what I need but execute button is missing after the selection screen got displayed.

Actually this issue is continution to my other resolved thread

http://scn.sap.com/thread/3392512

Read only

0 Likes
6,297

Hi Uday,

I saw your previous issue.

You can try using the below logic

AT SELECTION-SCREEN.

If field IS INITIAL.

   Message s001 display like 'E'.

   EXIT.

endif.

I tried it and it worked.

Hope this helps

Read only

0 Likes
6,297

Hi Uday,

I have seen your previous issue and also checked the program RVV50R10C. Have you tried the code I suggested previously in At-Selection-Screen of BLOCK in which you have added the select-options?

If No, please try that, I believe it should workout.

And If the select-options are in CHAIN and ENDCHAIN, this will be triggered only if there is any change in at-least one field between chain and endchain.

Once try this and let me know the result.

Thanks & Regards,

Vijay

Read only

0 Likes
6,297

Hi Aniket,

What I believe is EXIT command in AT SELECTION SCREEN will lead the execution control to the next event, may be START OF SELECTION.

When User clicks ENTER after providing input, AT SELECTION SCREEN message will be displayed.

When User directly executes after providing input, message at AT SELECTION SCREEN will not be triggered and START OF SELECTION will also be executed and if there is a message like,

START-OF-SELECTION.

   IF P_EBELN IS INITIAL.

     MESSAGE S000(ZMESSAGES) WITH 'START OF SELECTION' DISPLAY LIKE 'E'.

     EXIT.

   ENDIF.

this will be displayed.

-Vijay

Read only

0 Likes
6,297

Hi Vijay,

Thanx for pointing out the fault.

I have changed the code logic and tested it.

AT SELECTION-SCREEN.

If field IS INITIAL.

   Message s001 display like 'E'.

   LEAVE TO SCREEN 1000.

endif.

This should resolve the issue.

Read only

0 Likes
6,297

Calling the selection screen again is unnecessary. Just exit the program using exit statement after you display the error message which will take you back to your selection screen again.

Try this method.

Read only

0 Likes
6,297

Hi Aniket,

As my default screen 1000 in RVV50R10C (Tcode VL10A) has sub screens it is not allowing me

to use

LEAVE TO SCREEN 1000.

It is giving error message Selection screen RVV50R10C 1000 was not called using CALL SELECTION-SCREEN.

Thanks.

Read only

0 Likes
6,297

Hi Vijay,

Thank you for taking time to analyze the RVV50R10C program. I didnot add the select-options in the AT SELECTION-SCREEN OF BLOCK but i added at the

INCLUDE v50rsel3 --> INCLUDE v50rsel_block_header -->

SELECTION-SCREEN BEGIN OF BLOCK 0.                       

   INCLUDE v50rsel_ledat.   <== Standard field in the selection screen.
   INCLUDE v50rsel_lerul.    <== Standard field in the selection screen.
   include v50rsel_block_h.    <== I added my custom select-options here.     

SELECTION-SCREEN END   OF BLOCK 0.

Your explanation for why the fields were diabled even though the fields were inserted by default in between CHAIN...ENDCHAIN is convincing. Thank you for clarification.

Read only

chinni_adapa
Participant
0 Likes
6,297

Hi Uday,

Write the following syntax in your code.

MESSAGE S000(ZMSG) DISPLAY LIKE 'E',  and EXIT.

Try the following code, it  gives more explanation

TABLES: aufk.

SELECT-OPTIONS: s_aufnr FOR aufk-aufnr.

   IF s_aufnr IS INITIAL.

     MESSAGE S000(ZMSG) DISPLAY LIKE 'E'.

      Exit.

   ENDIF.

Here ZMSG is message class name,

        000 is message number,

         S is the sucess message but it display like Error message only.

Regards,

Chinni

Read only

Former Member
0 Likes
6,297

Hi Uday,

Write these statements just after your selection screen parameters declarations and don't explicitly put this code in any event.

IF field IS INITIAL.
   MESSAGE s076(message type) DISPLAY LIKE 'E'.
   EXIT.     "Dont forget to write exit
ENDIF.

thanks,

Aswath.

Read only

Former Member
0 Likes
6,297

Hi Uday,

Try it like this.

If field is initial.

message s001 display like 'E'.

SUBMIT  <your prog name> via selection-screen.

endif.

Thanks,

Satya

Read only

0 Likes
6,297

Hi Satya,

This option is also working to get back to the selection-screen. The only difference between using the EXIT and SUBMIT rvv50r10c VIA SELECTION-SCREEN is in the later one it is clearing out the valid data along with the invalid data.

Thanks for your suggestion.

Read only

Former Member
0 Likes
6,297

Hi Uday,

While giving an error message on the selection-screen, you can give it as error directly.

AT SELECTION-SCREEN on <selection screen field>

If <selection screen field> is initial.

Message e000 with 'Please enter a value in <selection screen field>'.

Endif.

With this above syntax, the selection-screen field <selection screen field> will be editable for you to put a correct  value in it.

If you do not mention AT SELECTION-SCREEN ON a particular screen field and just give AT SELECTION-SCREEN, then the entire screen gets disabled.

Please let me know if you need any more details and hope this helps.

Read only

0 Likes
6,297

Hi A N,

Maybe its the other way around.

Check the below Code

PARAMETERS : p_bukrs TYPE t001-bukrs,

                            p_cntry TYPE t001-land1,

                            p_waers TYPE t001-waers.

 

AT SELECTION-SCREEN.

  IF p_bukrs IS INITIAL.

    MESSAGE 'Enter Company Code' TYPE 'E'.

  ENDIF.

 

AT SELECTION-SCREEN ON p_cntry.

   IF p_cntry IS INITIAL.

     MESSAGE 'Enter Country' TYPE 'E'.

  ENDIF.

If you use AT SELECTION-SCREEN ON <field> and throw an error message in that block then the other selection screen fields get disabled.

If you put all your validations in AT SELECTION-SCREEN event, then all the fields are editable.

Hope this helps

Read only

0 Likes
6,297

Hi Aniket,

I meant that when we put AT SELECTION-SCREEN on FIELD, that field becomes editable (I missed mentioning that the other fields become disabled). However I have just said the same thing in other words "

With this above syntax, the selection-screen field <selection screen field> will be editable for you to put a correct  value in it."

When we give the validations AT SELECTION-SCREEN, the screen itself gets disabled. Strange, as I have experienced this but when I look at your code, nothing has got disabled with AT SELECTION-SCREEN.

Read only

0 Likes
6,297

Hi Aniket,

I already your syntax  AT SELECTION-SCREEN ON <field> and it works if I have to enable only the field in which the invalid data is entered.

But in my requirement

Standard Fields:

   field1:

   field2:

   field3:

Custom fields:  (My Scenario)

   field4:

  

   field5:

   field6:

My requirement here is the user can enter either field4 only or 'field5 and field6' in report or he need not enter any of these fields and

validations:

a)he should not enter all the 3 fields

b)He should not enter field4 and either of field5 or field6.

So I cannot make any of the fields as OBLIGATORY and if I use AT SELECTION-SCREEN ON <field> event it will enable only that particualr field for input after error and I cannot do above validations.

but your input is helpful though..

Thanks!

Read only

Former Member
0 Likes
6,297

Hi,

If you use message type 'E'. It will not provide you with execute button. Because program unable to excess next statement after error message.

So,

Solution : 1)

use first selection statement after AT SELECTION-SCREEN.

after select query write.

if sy-subrc <> '0'.

   message 'No data Exist' type 'E'.

endif.

and then

START-OF-SELECTION.

END-OF-SELECTION.

this will stop you on initial screen if no data fetched.

solution 2 ) Try to use message type 'I' with Exit statement.

ex:.

if sy-subrc <> '0'.

   message 'No data Exist' type 'I'.

   EXIT.

endif.

You will remain on initial screen.

Regards,

RAvi Pratap SIngh


Read only

Former Member
0 Likes
6,297

Thank you all for your valuable inputs. Now I got enough options to try and meet my requirement.

Uday.