Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem with internal table

Former Member
0 Likes
1,098

Hi,

someone could help me with this (ty_planetypes), so, I known that some table don´t have in a SAP netweaver v 7 TRIAL, how I could to find out another structure like this?

I´ll be glad to any help

Regards

10 REPLIES 10
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
956

I think that may be some sort of local internal type used in a specific program or component. Basically it could be just an internal type for plane type which really you could use PLANETYPE field in table SFLIGHT as your type, either in a structure or table type.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
956

Hi Elizeu,

ty_planetypes is user defined table types.

If programmer is using Only standard table structure

in table types you can use same structure.

EX :

TYPES : Begin of ty_planetypes,

INCLUDE STRUCTURE mara.

TYPES. END OF ty_planetypes.

You can add some fields to same type like

TYPES : Begin of ty_planetypes,

TYPES : INCLUDE STRUCTURE mara,

v_num TYPE I.

TYPES. END OF ty_planetypes.

Pls. reward if useful.

Read only

0 Likes
956

hi,

muralikrishna kaipha,

and a good day to all.

I think that your answer almost attend mine need, so, internal table "mara" don´t have on sap netweaver 7 trial dictionary, it´s possible to use other internal table?, below the sintax in the programm:

=====================================

class lcl_airplane definition.

public section.

constants: pos_1 type i value 30.

methods: constructor importing

im_name type string

im_planetype type saplane-planetype,

display_attributes.

class-methods: class_constructor.

class-methods: display_n_o_airplanes.

private section.

data: name type string,

planetype type saplane-planetype.

class-data: n_o_airplanes type i.

class-data: list_of_planetypes type ty_planetypes. * here give the message error - THE TYPE type_planetypes is unknown*

endclass. "lcl_airplane DEFINITION

Read only

Former Member
0 Likes
956

Please, see the post number 8, I think this post still unanswered.

Read only

Former Member
0 Likes
956

Some late, but it works...

try with this code...

TYPES:BEGIN OF ty_planetypes,

MANDT TYPE saplane-MANDT,

PLANETYPE TYPE saplane-PLANETYPE,

SEATSMAX TYPE saplane-SEATSMAX,

CONSUM TYPE saplane-CONSUM,

CON_UNIT TYPE saplane-CON_UNIT,

TANKCAP TYPE saplane-TANKCAP,

CAP_UNIT TYPE saplane-CAP_UNIT,

WEIGHT TYPE saplane-WEIGHT,

WEI_UNIT TYPE saplane-WEI_UNIT,

SPAN TYPE saplane-SPAN,

SPAN_UNIT TYPE saplane-SPAN_UNIT,

LENG TYPE saplane-LENG,

LENG_UNIT TYPE saplane-LENG_UNIT,

OP_SPEED TYPE saplane-OP_SPEED,

SPEED_UNIT TYPE saplane-SPEED_UNIT,

PRODUCER TYPE saplane-PRODUCER,

SEATSMAX_B TYPE saplane-SEATSMAX_B,

SEATSMAX_F TYPE saplane-SEATSMAX_F,

END OF ty_planetypes.

DATA: name TYPE string,

planetype TYPE saplane-planetype.

CLASS-DATA: n_o_airplanes TYPE i.

CLASS-DATA: list_of_planetypes TYPE STANDARD TABLE OF ty_planetypes. "itab type in Dic.

Read only

Former Member
0 Likes
956

Yes, By declaring Local Structure of type "SAPLANE" will solve the problem .

Read only

0 Likes
956

Hi all,

kindly need your help.

why do I still get this message error:

"The declaration for the key field MANDT is incomplete. However, MANDT is contained in the key of table lcl_airplane=>list_of_planetypes and must be filled."

The code:

METHOD get_technical_attributes.

DATA wa TYPE saplane.

READ TABLE list_of_planetypes INTO wa WITH TABLE KEY planetype = im_planetype

TRANSPORTING weight tankcap.

IF sy-subrc = 0.

ex_weight = wa-weight.

ex_tankcap = wa-tankcap.

ELSE.

RAISE wrong_planetype.

ENDIF.

ENDMETHOD.

ENDCLASS.

Tks

Read only

0 Likes
956

Hi,

Remove that line from your TYPES structure:


MANDT TYPE saplane-MANDT,

also, change your read statement:


READ TABLE list_of_planetypes INTO wa WITH KEY planetype = im_planetype
TRANSPORTING weight tankcap.

And check/update your query used to fill the table list_of_planetypes...

Kr,

m.

Read only

0 Likes
956

Hi,

If you use WITH TABLE KEY then its mandatory to specify all key fields as condition in READ TABLE statement.

Otherwise replace WITH TABLE KEY as WITH KEY and specify only the conditions you prefer.

READ TABLE list_of_planetypes INTO wa WITH TABLE KEY planetype = im_planetype

TRANSPORTING weight tankcap

reg

Ikshula

Read only

0 Likes
956

Hi Manu and Ikshula,

Tks for your help, it's working now