Unit 9: Creating the Display Method Without Parameters
Use
In this unit, you will create and implement the method
Display as a method without a parameter.You must implement this method if your object type supports the SAP standard interface.
Prerequisites
The
Display method displays the object. It is one of the methods inherited by every object type from the SAP standard interface (technical name: IFSAP ).The method is already implemented for the interface, but this inherited implementation only displays the key fields of the object. To use the object-specific display functionality for the object from the application, the implementation must be redefined for your object type, and the transaction or function module of the application must be called, with which the object is displayed.

For sales orders, this is transaction VA03 .
Procedure
.The color of the entry changes.
.You can find the source text in the appendix in lines 113-116.
and exit the program editor.Result
Testing a method without parameters
.The system informs you if the object type still contains errors. Try to correct these errors in the error overview (Goto
® Error list).
.The Test Object Type <Object Name>: No Instance screen appears.
Instance.Identify an object of the type sales order by entering the number of a sales order of your choice. Use the F4 input help if necessary.
.The Test Object Type <Object Name> screen then appears, in which you can test your object type (execute methods, check attribute values).
Further note (can be ignored during the first read operation)
The exception The object does not exist is specified in the method definition. This exception is not implemented automatically. It should not normally occur.
To implement it anyway, the following program lines must be inserted immediately after
BEGIN_METHOD DISPLAY CHANGING CONTAINER :
SWC_CONTAINER CONT.
SWC_CREATE_CONTAINER CONT.
SWC_CALL_METHOD SELF 'ExistenceCheck' CONT.
IF SY-SUBRC NE 0.
EXIT_RETURN 0001 SPACE SPACE SPACE SPACE.
ENDIF.
First an empty container is created, which the subsequent macro expects as an input. The
ExistenceCheck method is then called and evaluated referring to itself (reference to the object SELF ).Notes on the calling and reporting behavior of this method
In order for the method to be used in a workflow, it must be encapsulated in a task. This task is represented at runtime by a work item.
If this work item is executed by one of its
recipients, the runtime system calls the method and thus, indirectly, the transaction. Since the Display method is a synchronous method without results, the work item is completed as soon as the method has been executed once. If the work item is to be executed several times, you must set the flag Confirm end of processing in the task definition.