Questions tagged [rtts]

RTTS (RunTime Type Services) allows to get the definition of variables or to create them during program execution. Part of SAP/ABAP.

RTTS (RunTime Type Services) allows to get the definition of variables or to create them during program execution. Part of SAP/ABAP. For more details see http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=42965.

19 questions
7
votes
1 answer

Create dynamic ABAP internal table

On selection screen, the user needs to insert a table name, and I need to get first 3 fields from that table and display them in an ALV for the output. What I understand from reading tutorials is that I need to call method…
usesser
  • 191
  • 3
  • 21
4
votes
1 answer

Do Runtime Type Services (RTTS) use database to get data descriptions?

Question Do methods like describe_by_data, get_ddic_field_list, get_components (of cl_abap_typedescr and similar), retrieve data from database or does it get generated on application server? I looked at those classes and all of the some methods…
Zero
  • 1,562
  • 1
  • 13
  • 29
3
votes
2 answers

Add line to dynamic internal table

I want to add a dynamic table line to a dynamic internal table. DATA: lo_structdescr TYPE REF TO cl_abap_structdescr, lo_tabledescr TYPE REF TO cl_abap_tabledescr, lt_components TYPE abap_component_tab, ls_component …
Niklas
  • 23,674
  • 33
  • 131
  • 170
3
votes
3 answers

Dynamically get structure of a dynamic table

I want to dynamically get the structure of a dynamic table. Getting the table is no problem, but I stuck with getting the structure of the table. DATA: lo_dynamic_table TYPE REF TO data. FIELD-SYMBOLS: TYPE table, …
Niklas
  • 23,674
  • 33
  • 131
  • 170
2
votes
2 answers

Determining the class inheritance hierarchy. How?

Our company provides ABAP system analysis services offline. That is, a system's ABAP code is extracted and sent to us as XML. We analyze the system with a tool written in Java. Personally, I'm not an ABAP expert. One upcoming task is building a…
Ulrich Scholz
  • 2,039
  • 4
  • 30
  • 51
2
votes
2 answers

Importing a generic table from an ABAP memory?

I am exporting a dynamicaly created internal table to memory. I'd like to know if it's possible to somehow get it back (from another program), with the addition that whereas the first program at least KNOWS the name of the table from which i…
vlad-ardelean
  • 7,480
  • 15
  • 80
  • 124
1
vote
1 answer

Create table type by name then add an arbitrary column?

I am attempting to write a class that can accept a table name, add a couple of extra columns for data ingestion purposes, then generate a CSV. I have it working for a table by sending in a table name as a parameter: " Get the data dictionary object…
jlrolin
  • 1,604
  • 9
  • 38
  • 67
1
vote
1 answer

CX_SY_STRUCT_COMP_NAME=>illegal_char_in_name while creating a type with RTTS

I'm trying to build a dynamic type using RTTS classes. I've build a component table containing column names 'COL_1', 'COL_2' and so on... The type creation fails inside the standard method CL_ABAP_STRUCTDESCR=>CREATE( ) on line 73: if…
Cutter
  • 1,673
  • 7
  • 27
  • 43
1
vote
4 answers

Get components of DDIC structure with includes

I am using cl_abap_structdescr->get_components to get a list of fields in a structure. It works fine when I use it on locally declared structure types, but when I use it on DDIC structures, it doesn't give me the results I expect. Reproducable…
Legxis
  • 886
  • 7
  • 19
1
vote
3 answers

Creating a range for a field from internal table using RTTS

I want to create a function/custom class method that takes in 2 parameters: 1) IM_ITAB type ANY TABLE 2) IM_COMPONENT type STRING and returns 1 parameter: 1) EX_RANGE type PIQ_SELOPT_T So, algorithm is like this: First of all, we check if the…
user9695260
  • 347
  • 3
  • 17
1
vote
3 answers

Create a structure from a dynamically assigned

In a method I have a reference to a table that was declared like this: DATA: tabname TYPE tabname, dref TYPE REF TO data, FIELD-SYMBOLS: TYPE ANY TABLE. CREATE DATA dref TYPE TABLE OF (tabname). ASSIGN dref->* TO . SELECT *…
kdobrev
  • 270
  • 1
  • 3
  • 11
1
vote
1 answer

Difference between TYPEKIND and TYPECATEGORY

Can anyone tell me the difference between CL_ABAP_TYPEDESCR=>kind and CL_ABAP_TYPEDESCR=>type_kind. Just want to know whether it is a structure or not. But which one do I have to use?
Florian
  • 5,918
  • 3
  • 47
  • 86
0
votes
1 answer

CREATE DATA: The specified type "BELNR,BUKRS,GJAHR,MANDT" is no valid data

At the moment it does something wrong with the primary key when it collects them, some tables have more that one primary key. The output error is this one for example if running the program with table BKPF, doing a short dump at line CREATE DATA…
sophatron
  • 1
  • 1
0
votes
0 answers

ABAP adding new field to a dynamic table

I have one big select like this; SELECT (lv_selection) FROM crms4d_serv_h INNER JOIN crm_jest ON crm_jest~objnr = crms4d_serv_h~header_guid AND crm_jest~inact = space INNER JOIN crms4c_stat_lc_t ON…
0
votes
1 answer

Clearing rows of dynamic internal table with empty value in one column

I am trying to remove rows that have empty values in one column segment. The table is declared dynamically so it does not have a standard type that I can use in DATA declaration like I used to do (DATA table_x TYPE BSEG). I tried to create structure…
1
2