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

Selection-Subcreens & Error messages

Former Member
0 Likes
965

Hi experts.

I have a report where i use selection-subscreens. Depending on wich subcreen i am, i need some select-options to be obligatory but i can't use the obligatory condition because it will give an error when navigating to other screen if there's no input.

So what i did is that at selection screen, i check the user command and when it's 'ONLI' (= report launched) if the required data is not field i send an error message like this :


  CASE mytab_dynnr.
    WHEN 100.
      IF p_cont IS INITIAL.
        MESSAGE text-e01 TYPE 'E'.
      ENDIF.
    WHEN 200.
      ...
ENDCASE.

The thing is that when sending this message then, the input filled can't be editable. I have to change screen and come back to edit again.

How can i avoid that ?

Thanks for your help and time.

For more information here is my selection screen and initialization :


SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECT-OPTIONS p_cont FOR but000-partner NO INTERVALS.
SELECTION-SCREEN END OF SCREEN 100.

SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECT-OPTIONS p_cont2 FOR but000-partner NO INTERVALS.
PARAMETERS p_test_c TYPE c AS CHECKBOX.

SELECTION-SCREEN : SKIP.
PARAMETERS: rt1 RADIOBUTTON GROUP rad2 ,
            p_temp TYPE bu_partner.

SELECTION-SCREEN  SKIP.

PARAMETERS:  rt2 RADIOBUTTON GROUP rad2 DEFAULT 'X'.

*PARAMETERS : p_temp TYPE bu_partner.
*ULINE.
SELECT-OPTIONS p_meta FOR but000-zzmeta_customer NO INTERVALS.
SELECT-OPTIONS s_sold FOR but000-partner NO INTERVALS.
SELECT-OPTIONS s_inst FOR but000-partner NO INTERVALS.
SELECTION-SCREEN END OF SCREEN 200.

SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.

SELECT-OPTIONS p_cont3 FOR but000-partner NO INTERVALS.
PARAMETERS p_test_d TYPE c AS CHECKBOX.
SELECTION-SCREEN  SKIP.

SELECT-OPTIONS p_meta2 FOR but000-zzmeta_customer NO INTERVALS.
SELECT-OPTIONS s_sold2 FOR but000-partner NO INTERVALS.
SELECT-OPTIONS s_inst2 FOR but000-partner NO INTERVALS.

SELECTION-SCREEN END OF SCREEN 300.


SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
                  TAB (20) button1 USER-COMMAND push1,
                  TAB (20) button2 USER-COMMAND push2,
                  TAB (20) button3 USER-COMMAND push3,
                  END OF BLOCK mytab.


*-------------------------

AT SELECTION-SCREEN.
  CASE sy-dynnr.
    WHEN 1000.
      CASE sy-ucomm.
        WHEN 'PUSH1'.
          mytab-dynnr = 100.
        WHEN 'PUSH2'.
          mytab-dynnr = 200.
        WHEN 'PUSH3'.
          mytab-dynnr = 300.
        WHEN 'ONLI'.
          PERFORM screen_control USING mytab-dynnr.
        WHEN OTHERS.
          ...
      ENDCASE.
      ...
  ENDCASE.


INITIALIZATION.
  button1 = text-i01.
  button2 = text-i02.
  button3 = text-i03.
  mytab-prog = sy-repid.
  mytab-dynnr = 100.
  mytab-activetab = 'PUSH1'.
  w_repid = sy-repid.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
919

Hi

You can give warning message and then call your screen again.


At Selection-Screen.

  CASE SY-DYNNR.
    WHEN '0100'.
      MESSAGE W159(AT) WITH 'Screen 100'.
    
  ENDCASE.

Neha

Edited by: Neha Shukla on Dec 9, 2008 10:01 PM

Hi experts.

I have a report where i use selection-subscreens. Depending on wich subcreen i am, i need some select-options to be obligatory but i can't use the obligatory condition because it will give an error when navigating to other screen if there's no input.

So what i did is that at selection screen, i check the user command and when it's 'ONLI' (= report launched) if the required data is not field i send an error message like this :


  CASE mytab_dynnr.
    WHEN 100.
      IF p_cont IS INITIAL.
        MESSAGE text-e01 TYPE 'E'.
      ENDIF.
    WHEN 200.
      ...
ENDCASE.

The thing is that when sending this message then, the input filled can't be editable. I have to change screen and come back to edit again.

How can i avoid that ?

Thanks for your help and time.

For more information here is my selection screen and initialization :


SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECT-OPTIONS p_cont FOR but000-partner NO INTERVALS.
SELECTION-SCREEN END OF SCREEN 100.

SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECT-OPTIONS p_cont2 FOR but000-partner NO INTERVALS.
PARAMETERS p_test_c TYPE c AS CHECKBOX.

SELECTION-SCREEN : SKIP.
PARAMETERS: rt1 RADIOBUTTON GROUP rad2 ,
            p_temp TYPE bu_partner.

SELECTION-SCREEN  SKIP.

PARAMETERS:  rt2 RADIOBUTTON GROUP rad2 DEFAULT 'X'.

*PARAMETERS : p_temp TYPE bu_partner.
*ULINE.
SELECT-OPTIONS p_meta FOR but000-zzmeta_customer NO INTERVALS.
SELECT-OPTIONS s_sold FOR but000-partner NO INTERVALS.
SELECT-OPTIONS s_inst FOR but000-partner NO INTERVALS.
SELECTION-SCREEN END OF SCREEN 200.

SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.

SELECT-OPTIONS p_cont3 FOR but000-partner NO INTERVALS.
PARAMETERS p_test_d TYPE c AS CHECKBOX.
SELECTION-SCREEN  SKIP.

SELECT-OPTIONS p_meta2 FOR but000-zzmeta_customer NO INTERVALS.
SELECT-OPTIONS s_sold2 FOR but000-partner NO INTERVALS.
SELECT-OPTIONS s_inst2 FOR but000-partner NO INTERVALS.

SELECTION-SCREEN END OF SCREEN 300.


SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
                  TAB (20) button1 USER-COMMAND push1,
                  TAB (20) button2 USER-COMMAND push2,
                  TAB (20) button3 USER-COMMAND push3,
                  END OF BLOCK mytab.


*-------------------------

AT SELECTION-SCREEN.
  CASE sy-dynnr.
    WHEN 1000.
      CASE sy-ucomm.
        WHEN 'PUSH1'.
          mytab-dynnr = 100.
        WHEN 'PUSH2'.
          mytab-dynnr = 200.
        WHEN 'PUSH3'.
          mytab-dynnr = 300.
        WHEN 'ONLI'.
          PERFORM screen_control USING mytab-dynnr.
        WHEN OTHERS.
          ...
      ENDCASE.
      ...
  ENDCASE.


INITIALIZATION.
  button1 = text-i01.
  button2 = text-i02.
  button3 = text-i03.
  mytab-prog = sy-repid.
  mytab-dynnr = 100.
  mytab-activetab = 'PUSH1'.
  w_repid = sy-repid.

4 REPLIES 4
Read only

Former Member
0 Likes
920

Hi

You can give warning message and then call your screen again.


At Selection-Screen.

  CASE SY-DYNNR.
    WHEN '0100'.
      MESSAGE W159(AT) WITH 'Screen 100'.
    
  ENDCASE.

Neha

Edited by: Neha Shukla on Dec 9, 2008 10:01 PM

Read only

naimesh_patel
Active Contributor
0 Likes
919

Instead of only message,


MESSAGE text-e01 TYPE 'E'.

Use:


message text-e01 type 'S' DISPLAY LIKE 'E'.
leave list-processing.

Regards,

Naimesh Patel

Read only

0 Likes
919

Thanks to both of you.

Read only

Former Member
0 Likes
919

Hey .. before you call the error message reset the mytab-dynnr to '1000' .

Thanks,

Aditya. V