Show TOC

Background documentationCalling the Mail Class Locate this document in the navigation structure

 

You have now completed the mail class except for the method to read the mail text (GET_TEXT). This method reads the mail text and passes it to the caller in HTML format. In the following BSP you can display which mail is sent.

The methods are called only if no error has occurred during the input and if the mail address has been entered (page order.htm, event handler OnInputProcessing).

Syntax Syntax

  1. if page->messages->num_messages( ) eq 0.
    if mail_address is not initial.
End of the source code.

An instance of the class just created can be accessed under the attribute application everywhere in the page. The address can be set simply with:

Syntax Syntax

  1. application->set_address( name = name                               
                              street = street 
                              zipcode = zipcode
                              city = city ).
End of the source code.

Select the middle value from the earliest and latest times as the time point and then call method SET_TIME:

Syntax Syntax

  1. data: time_when type t.
    time_when = time_from + ( time_to - time_from ) / 2.
    
    application->set_time( date = date_at
                           time = time_when ).
    
End of the source code.

The mail address and the message object (see Object Messages) is transferred for sending, so that error texts can be entered into the message list.

Syntax Syntax

  1. call method application->send
    exporting mail_address = mail_address
    changing  messages     = page->messages .
End of the source code.

If everything has been processed without errors, transfer the mail text to the next page (after you have created and filled the method in the class). There the text is displayed.

Syntax Syntax

  1. if page->messages->num_messages( ) eq 0.
    data text type string.
    text = application->get_text( ).
    navigation->set_parameter( name = 'mailtext' value = text ).
    navigation->next_page( 'show' ).
    endif.
    else.
    navigation->next_page( 'no_address' ).
    endif.
    endif.
End of the source code.