Questions tagged [internal-tables]

Use this tag for questions regarding ABAP internal tables.

141 questions
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
3
votes
3 answers

How do I read and print a generic internal table?

I'm pretty new to this. I'm currently studying abap for my job and I have a problem that I can't seem to work out. How would I go about creating a Function Module that takes any kind of internal table and write it to the screen? I'm looking for a…
tis.sandor
  • 171
  • 1
  • 4
  • 12
3
votes
1 answer

The simplest and most concise way to delete a row?

Is there any simplest/fastest way for below code: DATA: lv_knuma_ag LIKE STANDARD TABLE OF zta_fg_hdr WITH HEADER LINE. RANGES: lr_knuma_ag FOR zta_fg_hdr-knuma_ag. "Select `knuma_ag` and save it to internal table `lv_knuma_ag` LOOP AT…
mrjimoy_05
  • 3,452
  • 9
  • 58
  • 95
3
votes
2 answers

How to convert a structure to an internal table dynamically

I'm trying to create a method that will import a structure assuming that all structure elements are flat and the same data type. Then I want to convert it to a table with that type dynamically and return it. Where should I start? I've been trying…
Robert McCraw
  • 663
  • 3
  • 8
  • 22
2
votes
1 answer

Loop At TO Where does not find lines

I have a problem with Loop through a using the condition that an attribute from one table is the same with the other. For better explaining i'll past the code. Is not something difficult but i don't understand where i make the mistake. LOOP AT…
kookies
  • 61
  • 2
  • 3
  • 8
2
votes
1 answer

Using REF within a FOR expression - unexpected behaviour

I have some example code below: DATA(t_strings) = VALUE char10_t( ( 'S1' ) ( 'S2' ) ( 'S3' ) ). TYPES : BEGIN OF gty_ref, string_ref TYPE REF TO data, END OF gty_ref, gty_t_ref TYPE STANDARD TABLE OF gty_ref. DATA :…
mmgro27
  • 475
  • 1
  • 8
  • 18
2
votes
1 answer

How is the internal table sorted by default?

So i was wondering if when i declare lt_table TYPE STANDARD TABLE OF mara. Is it the same as lt_table TYPE STANDARD TABLE OF mara WITH DEFAULT KEY. Or are the standard table keys selected differently when not declaring DEFAULT KEY?
Frontmaniaac
  • 221
  • 3
  • 14
2
votes
1 answer

MOVE-CORRESPONDING for internal tables?

I want MOVE fields from itab1 to itab2 based on their field names. I have tried following: CLEAR itab2. MOVE-CORRESPONDING itab1 TO itab2. This is working out, but only as long as the FIELDS are named equal. Now I want to to something like…
B0BBY
  • 1,012
  • 6
  • 24
2
votes
1 answer

Declare deep table in ABAP?

I need an internal table with a hashed key, but multiple rows for each key. I think a deep table is the right solution for my problem, but how do I define it?
András
  • 1,326
  • 4
  • 16
  • 26
2
votes
2 answers

Identify last group in a LOOP AT ... GROUP BY?

I'm looking for the equivalent of the AT LAST statement within the LOOP AT ... GROUP BY statement. I'm looping using group by, and for performance reasons, I execute a call method every few groups, when a certain amount of records has been…
RaTiO
  • 979
  • 2
  • 17
  • 33
2
votes
2 answers

Check whether an itab1 lines exist in itab2?

I have 2 internal tables typeв TYPE STANDARD TABLE OF string The first table contains the data | K1 | K2 | K3 | The second table contains the data | K1 | K2 | In ABAP, what is the fastest method to check if the second table entries are completely…
dever
  • 23
  • 1
  • 4
2
votes
1 answer

Hive 3.1 cannot create external table that copy schema from internal/managed table

we try to make an external hive table which its schema is similar from existing internal/managed table and the data for ecternal will be inserted next step. Below the code to create external table with copy schema of managed table CREATE EXTERNAL…
m hanif f
  • 406
  • 1
  • 7
  • 20
2
votes
2 answers

Using the same itab on left and right side of VALUE results in empty table. Why?

Here's one for you… How come this code results in an empty table gt_test2… gt_test2 = VALUE #( FOR gs_test1 IN gt_test1 WHERE ( v3 = gs_test3-v3 AND v4 = gs_test3-v4 ) FOR gs_test2 IN gt_test2 WHERE ( v1 = gs_test1-v1 AND v2 = gs_test1-v2 ) (…
Jagger
  • 10,350
  • 9
  • 51
  • 93
2
votes
3 answers

New ABAP syntax instead of COLLECT

Currently, I have this coding, and it works perfectly fine: TYPES: BEGIN OF tty_ekpo, ebeln TYPE ebeln, ebelp TYPE ebelp, END OF tty_ekpo. DATA: lt_ekpo TYPE TABLE OF tty_ekpo, …
András
  • 1,326
  • 4
  • 16
  • 26
1 2
3
9 10