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

Dialog programing

Hi ,

If we include "Top-of-page" in dialog programing , under a case statement. my code is

WHEN 'F_1'.

SELECT SINGLE emp_id emp_name emp_age

emp_birthdate into

wa FROM zemp WHERE emp_id = id .

LEAVE TO LIST-PROCESSING .

TOP-OF-PAGE .

WRITE : SY-TITLE , 60 'EMPLOYEE DATA' .

ULINE .

END-OF-PAGE .

endcase .

But it is throwing an error that please write endcase before top-of-page .

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2007 at 11:03 AM

    <b>WHEN 'F_1'.

    SELECT SINGLE emp_id emp_name emp_age

    emp_birthdate into

    wa FROM zemp WHERE emp_id = id .

    LEAVE TO LIST-PROCESSING .

    endcase .</b>

    TOP-OF-PAGE .

    WRITE : SY-TITLE , 60 'EMPLOYEE DATA' .

    ULINE .

    END-OF-PAGE .

    Regards

    Peram

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 31, 2007 at 11:04 AM

    Hi,

    <b>There is no point in keeping TOP-OF-PAGE event in CASE ENDCASE.</b>

    <b>As the code below this TOP-OF-PAGE event will get executed only when the LIST is about to generated.</b>

    <b>

    That is when the first WRITE, ULINE or SKIP statement is executed in your program.</b>

    <b>SO you cannot put TOP-OF-PAGE in CASE ENDCASE as you cannot control when this event should be called.</b>

    <b>As TOP-OF-PAG event is something that is called based on the program behaviour at the run time, you cannot control when this should be called.</b>

    Regards,

    Sesh

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      What i wanted to say was There is no point in putting TOP-OF-PAGE in case endcase. Coz even if you put that there this will not get called. It will get called only when the list generation starts.

      That is the reason why I said dont put TOP-OF-PAGE in case endcase.

      Any way if you wanto call the list in new screen then this is the process.

      In your current screen CALL the new screen as follows.

      CALL SCREEN 9001.

      Screen 9001 flow logic.

      PROCESS-BEFORE-OUTPUT.

      module call_list.

      In the PBO module of the screen 9001 put this code

      MODULE call_list OUTPUT. 
      <b>  SUPPRESS DIALOG.</b> "Used to hide the screen and show the list directly
        SET PF-STATUS space. 
        WRITE 'Basic List'. 
        LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0. "Create the list.
      ENDMODULE. 
      

      Regards,

      Sesh

  • author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2007 at 11:08 AM

    Hi,

    After the endcase write the TOP-OF-PAGE, then you won't get this error

    Regards

    Sudheer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2007 at 11:57 AM

    Hi

    <b>WHEN 'F_1'.

    SELECT SINGLE emp_id emp_name emp_age

    emp_birthdate into

    wa FROM zemp WHERE emp_id = id .

    LEAVE TO LIST-PROCESSING .

    endcase .</b>

    TOP-OF-PAGE .

    WRITE : SY-TITLE , 60 'EMPLOYEE DATA' .

    ULINE .

    END-OF-PAGE .

    top of page is an event

    so we can't write an event under a condition

    it will be triggered when ever the top of page reached automatically

    thats why that is showing an error

    reward if usefull

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2007 at 02:40 PM

    Hi tarun,

    If it is compulsory for you to use a CASE statement

    for the TOP-OF-PAGE, then use this logic ...

    
    MODULE USER_COMMAND_0100 INPUT.
    data id TYPE zemp-emp_id.
    com_ok = OK_CODE .
    CLEAR OK_CODE .
    
    CASE com_ok .
    
    WHEN 'EXIT' or 'BACK' .
    Leave PROGRAM .
    
    WHEN 'F_1'.
    SELECT SINGLE emp_id emp_name emp_age
    emp_birthdate into
    wa FROM zemp WHERE emp_id = id .
    
    endcase .
    
    LEAVE TO LIST-PROCESSING .
    
    ENDMODULE .
    
    TOP-OF-PAGE .
    case com_ok.
    
    when 'F_1'.
    
    WRITE : SY-TITLE , 60 'EMPLOYEE DATA' .
    ULINE .
    WRITE : 'Emp_name = ',wa-emp_name .
    SKIP .
    WRITE : /,'Emp_Age = ',wa-emp_age ,
    'Emp_birthdate = ',wa-emp_birthdate .
    
    when 'F_2'.
    .....................
    .....................
    .....................
    
    endcase.
    
    END-OF-PAGE .
    
    

    Now, i think this will help you solve your problem ... 😊

    Happy coding ...:)

    Regards,

    SJ

    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.