‎2006 Sep 11 10:40 AM
Hello,
I'am experiencing some problems with a Z-Class.
I want to read data from HR-Infotypes. Normaly you can use log. database PNP, macro PROVIDE, GET PERNR and so on.
This you can not use in a class (if there is a way, I would be happy to know how).
So far, I decided to use the function module:
HR_READ_INFOTYPE
So I need a different internal table every time I want to read/check a knew infotype.
Therefore I use the following attributes:
DDIC_TABLENAME;Instance Attribute;Private;Type TABNAME16
ITAB;Instance Attribute;Private;Type Ref To DATA
ITAB should be my dynamic internal table, DDIC_TABLENAME the name of the infotype in use.
Coding in my method:
FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE,
<W_TAB> TYPE ANY.
CREATE DATA: ITAB TYPE (ME->DDIC_TABLENAME).
ASSIGN: ME->ITAB->* TO <ITAB>.
But I'am getting the following dump:
CREATE DATA: The type entered (" ") is not a valid data type.
What's wrong with that?
Regards
Maik
‎2006 Sep 11 10:43 AM
hi,
Change the statement
CREATE DATA: ITAB TYPE (ME->DDIC_TABLENAME).
as
CREATE DATA: ITAB TYPE <b>ME->(DDIC_TABLENAME)</b>.
Regards,
Sailaja.
‎2006 Sep 11 10:50 AM
Hi,
this is causing the following error during activating:
You cannot use constructor parameters in a dynamic CREATE OBJECT.
Regards
Maik
‎2006 Sep 11 10:55 AM
table_name = ME->DDIC_TABLENAME.
CREATE DATA itab TYPE STANDARD TABLE OF (table_name).
Regards,
ravi
‎2006 Sep 11 11:11 AM
Hi,
no, it doesn't work: by the way:
System is 4.6C !!!!
CREATE DATA: ITAB TYPE STANDARD TABLE OF (TABLE_NAME).
Table is unknown
As I know, this coding works only with 4.7 and higher.
Regards
Maik
‎2006 Sep 11 11:15 AM
Hi
You're right and so you can create an internal table dunamically only using method CREATE_DYNAMIC_TABLE of cllass CL_ALV_TABLE_CREATE.
Max
‎2006 Sep 11 11:21 AM
Hi,
I tried this way already, but I'am getting a dump too:
GENERATE_SUBPOOL_DIR_FULL
What does this mean?
I used the same coding as I already used in productive programms:
DATA: I_FCAT TYPE LVC_T_FCAT,
ITABREF TYPE REF TO DATA,
WTABREF TYPE REF TO DATA.
*
FIELD-SYMBOLS: <S> TYPE ANY, "Structure
<T> TYPE STANDARD TABLE, "Table
<FCAT> TYPE LVC_T_FCAT.
*
FREE: I_FCAT, ITABREF.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = DDIC_TABLENAME
CHANGING
CT_FIELDCAT = I_FCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
*
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = I_FCAT
IMPORTING
EP_TABLE = ITABREF.
*
ASSIGN ITABREF->* TO <T>. "Tab
ASSIGN I_FCAT TO <FCAT>. "Fieldcat
CREATE DATA WTABREF LIKE LINE OF <T>. "Structure
ASSIGN WTABREF->* TO <S>.
Regards
Maik
‎2006 Sep 11 11:36 AM
Hi
If I remember it can generate only certain number of subroutine: from SAP help:
............
Up to 36 temporary subroutine pools can currently be managed for each roll area.
Max
‎2006 Sep 11 11:37 AM
Hi,
yes, you're right - 36 in one session.
So that's the end of it? A rat trap?
Regards
Maik