Skip to Content
author's profile photo Former Member
Former Member

Can I use ucomm with HIDE?

Hi all,

I wrote a program in order to try & use sy-ucomm & HIDE. Intention is to get a number from user & go to the basic list where it will be displayed which number user has entered & 3 push-buttons will be there for ℹī¸ EVEN series numbers less than the number entered by user, (ii) ODD series numbers less than the number entered by user & (iii) EXIT to the program page. Now I've enabled hot-spot on the numbers displayed so that if you click on it the next page should display "You Clicked on _ number.'. But I aint getting this particular page. Need some help guys!! Here is the code :

REPORT ZUCOMM .

set pf-status 'NUM'. "pf-status name always in caps

selection-screen skip 2.

parameter x type i.

data: r type i,y type i value 1, t type i,c type c.

t = ( 2 * x ).

write: 'Number entered is -',x.skip 2.

write: 'SY-LSIND - ', sy-lsind.skip.

at user-command.

case sy-ucomm.

when 'EVEN'.

sy-lsind = 1.

perform even.

when 'ODD'.

sy-lsind = 1.

perform odd.

when 'EXIT'.

leave program.

endcase.

&----


*& Form even

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM even .

write: 'First',x,'even numbers are :'.

y = 1.

while y <= t.

r = y mod 2.

if r = 0.

write / y hotspot on.

endif.

hide y.

y = y + 1.

new-line.

endwhile.

write: 'SY-LSIND -',sy-lsind.

ENDFORM. " even

&----


*& Form odd

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM odd .

write: 'First',x,'odd numbers are :'.

y = 1.

while y <= t.

r = y mod 2.

if r = 1.

write / y hotspot on.

endif.

hide y.

y = y + 1.

new-line.

endwhile.

write: 'SY-LSIND -',sy-lsind.

ENDFORM. " odd

AT LINE-SELECTION.

if sy-lsind = 2.

write:/ 'You have clicked on',y hotspot on.

endif.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Nov 09, 2011 at 05:04 AM

    Hi,

    Though this questions sounds basic I would like to answer because you have tried it by your own 😊

    Sy-lsind starts from value 0 for the basic list, remove sy-lsind = 1 from your code and check it will work.

    SET PF-STATUS 'NUM'. "pf-status name always in caps
    
    SELECTION-SCREEN SKIP 2.
    
    PARAMETER x TYPE i.
    
    DATA: r TYPE i,y TYPE i VALUE 1, t TYPE i,c TYPE c.
    
    t = ( 2 * x ).
    
    WRITE: 'Number entered is -',x.SKIP 2.
    WRITE: 'SY-LSIND - ', sy-lsind.SKIP.
    
    AT USER-COMMAND.
      WRITE: 'SY-LSIND -',sy-lsind.
      SKIP 1.
      CASE sy-ucomm.
        WHEN 'EVEN'.
          PERFORM even.
        WHEN 'ODD'.
          PERFORM odd.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
    
    START-OF-SELECTION.
    
    * &---------------------------------------------------------------------
    *& Form even
    * &---------------------------------------------------------------------
    * text
    * ----------------------------------------------------------------------
    * --> p1 text
    * <-- p2 text
    * ----------------------------------------------------------------------
    FORM even .
    
      WRITE: 'First',x,'even numbers are :'.
      y = 1.
      WHILE y <= t.
    
        r = y MOD 2.
        IF r = 0.
          WRITE / y HOTSPOT ON.
        ENDIF.
        HIDE y.
        y = y + 1.
        NEW-LINE.
    
      ENDWHILE.
      WRITE: 'SY-LSIND -',sy-lsind.
    ENDFORM. " even
    *&---------------------------------------------------------------------
    *& Form odd
    *&---------------------------------------------------------------------
    * text
    *----------------------------------------------------------------------
    * --> p1 text
    * <-- p2 text
    *----------------------------------------------------------------------
    FORM odd .
    
      WRITE: 'First',x,'odd numbers are :'.
      y = 1.
      WHILE y <= t.
    
        r = y MOD 2.
        IF r = 1.
          WRITE / y HOTSPOT ON.
        ENDIF.
        HIDE y.
        y = y + 1.
        NEW-LINE.
    
      ENDWHILE.
      WRITE: 'SY-LSIND -',sy-lsind.
    ENDFORM. " odd
    
    AT LINE-SELECTION.
      IF sy-lsind = 2.
        WRITE:/ 'You have clicked on',y HOTSPOT ON.
      ENDIF.
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.