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

Screen handling problem

Former Member
0 Likes
486

Hello All,

I am using tab strip in my program.I have diffrent tabs. I want make some fields as mandatory fields in some of the tabs.

1)If these fields are not filled how can i stop the program and ask the user to fill it.

2) After i stop the program my cursor position must be in the relavent tab and on the relavent field.

How can i fulfill the above two things in the normal report programming.

<b>Note:I am not using dialog programming.</b>

Regards,

Lisa.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
442

Something like this.....



report zrich_0001
       no standard page heading.

tables sscrfields.

selection-screen begin of screen 101 as subscreen.
selection-screen begin of block b1 with frame title text-001.
parameters: p_char1 type c.
selection-screen end of block b1.
selection-screen end of screen 101.

selection-screen begin of screen 102 as subscreen.
selection-screen begin of block b2 with frame title text-002.
parameters: p_char2 type c.
selection-screen end of block b2.
selection-screen end of screen 102.

selection-screen begin of screen 103 as subscreen.
selection-screen begin of block b3 with frame title text-003.
parameters: p_char3 type c.
selection-screen end of block b3.
selection-screen end of screen 103.

selection-screen begin of tabbed block one for 20 lines.
selection-screen tab (15) name1 user-command ucomm1
default screen 101.
selection-screen tab (17) name2 user-command ucomm2
default screen 102.
selection-screen tab (17) name3 user-command ucomm3
default screen 103.
selection-screen end of block one.

initialization.

  name1 = 'Tab 1'.
  name2 = 'Tab 2'.
  name3 = 'Tab 3'.

at selection-screen output.


at selection-screen.

  check sy-ucomm = space
     or sy-ucomm = 'ONLI'.


  if p_char2 is initial.
    sscrfields-ucomm = 'UCOMM2'.
    set cursor field 'P_CHAR2'.
    message i001(00) with 'P_CHAR2 is not valid'.
  endif.


start-of-selection.

Regards,

Rich Heilman

3 REPLIES 3
Read only

Former Member
0 Likes
442

If you sub-screen displayed in table sstrip is active.

the obligatory statement will work.

oe esle on start-of-selection

write a code to check is initia and give appropriate message to user.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
443

Something like this.....



report zrich_0001
       no standard page heading.

tables sscrfields.

selection-screen begin of screen 101 as subscreen.
selection-screen begin of block b1 with frame title text-001.
parameters: p_char1 type c.
selection-screen end of block b1.
selection-screen end of screen 101.

selection-screen begin of screen 102 as subscreen.
selection-screen begin of block b2 with frame title text-002.
parameters: p_char2 type c.
selection-screen end of block b2.
selection-screen end of screen 102.

selection-screen begin of screen 103 as subscreen.
selection-screen begin of block b3 with frame title text-003.
parameters: p_char3 type c.
selection-screen end of block b3.
selection-screen end of screen 103.

selection-screen begin of tabbed block one for 20 lines.
selection-screen tab (15) name1 user-command ucomm1
default screen 101.
selection-screen tab (17) name2 user-command ucomm2
default screen 102.
selection-screen tab (17) name3 user-command ucomm3
default screen 103.
selection-screen end of block one.

initialization.

  name1 = 'Tab 1'.
  name2 = 'Tab 2'.
  name3 = 'Tab 3'.

at selection-screen output.


at selection-screen.

  check sy-ucomm = space
     or sy-ucomm = 'ONLI'.


  if p_char2 is initial.
    sscrfields-ucomm = 'UCOMM2'.
    set cursor field 'P_CHAR2'.
    message i001(00) with 'P_CHAR2 is not valid'.
  endif.


start-of-selection.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
442

Check this:

Rob