
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).
if page->messages->num_messages( ) eq 0.
if mail_address is not initial.
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:
application->set_address( name = name
street = street
zipcode = zipcode
city = city ).
Select the middle value from the earliest and latest times as the time point and then call method SET_TIME:
data: time_when type t.
time_when = time_from + ( time_to - time_from ) / 2.
application->set_time( date = date_at
time = time_when ).
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.
call method application->send
exporting mail_address = mail_address
changing messages = page->messages .
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.
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.