‎2008 Mar 24 8:02 PM
I have code the folowing example and i Keep recieving the error MSG The work area "list_of_planetypes" is not long enough, any suggestions???
THanks ins Advance!
Erick
CLASS lcl_airplane DEFINITION.
PUBLIC SECTION.
METHODS: constructor IMPORTING
im_name TYPE string
im_planetype TYPE saplane-planetype,
display_attributes.
CLASS-METHODS: display_no_airplanes,
class_constructor.
PRIVATE SECTION.
DATA: name TYPE string,
planetype TYPE saplane-planetype.
TYPES:BEGIN OF ty_planetypes,
planetype TYPE saplane-planetype,
END OF ty_planetypes.
CLASS-DATA no_airplanes TYPE i.
CLASS-DATA: wa_list_of_planetypes TYPE ty_planetypes,
list_of_planetypes TYPE STANDARD TABLE OF ty_planetypes.
ENDCLASS. "lcl_airplane
CLASS lcl_airplane IMPLEMENTATION.
METHOD constructor.
name = im_name.
planetype = im_planetype.
no_airplanes = no_airplanes + 1.
ENDMETHOD. "constructor
METHOD display_attributes.
WRITE: / icon_ws_plane AS ICON,
/ 'Name of airplane:'(001), AT 30 name,
/ 'Airplane type'(002), AT 30 planetype.
ENDMETHOD. "display_attributes
METHOD display_no_airplanes.
WRITE: /, /'Total of number planes'(ca1), AT 30 no_airplanes LEFT-JUSTIFIED.
ENDMETHOD. "display_no_airplanes
METHOD class_constructor.
SELECT * FROM saplane INTO TABLE list_of_planetypes.
ENDMETHOD. "class_constructor
ENDCLASS. "lcl_airplane IMPLEMENTATION
‎2008 Mar 24 8:45 PM
Hi.
This occurs because the type ty_planetypes that you defined have only one field from the saplane structure and in the select you´re are retrieving all the fields from the structure. Try to change the select command like follows:
SELECT planetype FROM saplane INTO TABLE list_of_planetypes.or change the type to have the same structure from the DDIC.
You can use the select command as follow, too:
SELECT * FROM saplane INTO CORRESPONDING FIELDS OF TABLE list_of_planetypes.But for performance reasons the first select it's recommended.
Regards,
‎2008 Mar 24 8:45 PM
Hi.
This occurs because the type ty_planetypes that you defined have only one field from the saplane structure and in the select you´re are retrieving all the fields from the structure. Try to change the select command like follows:
SELECT planetype FROM saplane INTO TABLE list_of_planetypes.or change the type to have the same structure from the DDIC.
You can use the select command as follow, too:
SELECT * FROM saplane INTO CORRESPONDING FIELDS OF TABLE list_of_planetypes.But for performance reasons the first select it's recommended.
Regards,