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

Transfering the value from deep structure

0 Likes
4,089

error-low.pngI want to pass the below highlighted value to some variable so that i use that ..

like : Lv_comp = lv_comp1-low

can you suggest some way of transfering this value

error-low.pngI want to pass the below highlighted value to some variable so that i use that ..

like : Lv_comp = lv_comp1-low

can you suggest some way of transfering this value

16 REPLIES 16
Read only

FredericGirod
Active Contributor
0 Likes
3,995

What do you want to transfert and where do you want to transfert ? and what is the problem with your syntax ?

Read only

0 Likes
3,995

i am getting this error while transferring the value as : Lv_comp = lv_comp1-low

Read only

FredericGirod
Active Contributor
3,995

"LV_COMP is a table without a header line"

if you do :

data my_table type table_type with header-line. 

my_table-field = 'something'

you must have an header line, that means, a structure with exactly the same name as the table. This is old ABAP code, could not be use in Abap Object.

Now, to use your LV_COMP, you need to know:

  • Do you want to add an entry
  • Do you want to initiate a new entry
  • Do you want to update an entry

For modification, you could use simple

LOOP AT my_table into data(my_table_line).
  IF something = something_else.
    my_table_line-field = 'something_else_again'.
    UPDATE my_table FROM my_table_line TRANSPORTING field.
  ENDIF.
ENDLOOP.

if you need to initiate a new entry (empty table).

my_table = values #( ( field = 'something' ) ).

The internal ( ) represente an entry, if you need several entries value #( ( entry one ) (entry two ) ).

and to add you could use statement APPEND

Read only

0 Likes
3,995

You should add a basic ABAP tutorial link to that answer, and you'd nailed it.

Read only

0 Likes
3,995

I am not sure to not have made error, I wrote it very fast.

So, yes, for any help; you have the transaction : ABAPDOCU (in SAP) and you could enter any statement you will find full help

Read only

3,995

aarghhh... You shouldn't talk about header lines unless the OP talks about it, currently I understand that maybe I can try to use a header line even if it's obsolete. Header lines can be used ONLY when there's no other choice, when using or maintaining old programs.

Read only

0 Likes
3,995

If you are maintaining old programs, the first thing you must do is to remove those nasty header lines, occurs and tables declarations.

Read only

0 Likes
3,995

sandra.rossi there is no tabou in ABAP 🙂

Read only

0 Likes
3,995

I like the idea of having no taboo (in ABAP or whatever). There's just people who throw water on electricity fire ! Just kidding 😉

Read only

Sandra_Rossi
Active Contributor
3,995

If you search the forum, you'll see that the question has been answered lots of times:

"is a table without a header line" site:sap.com
Read only

matt
Active Contributor
3,995

No taboos, but I'm not convinced that your mention of header lines won't confuse the OP further. Best keep things simple.

I tell you what, let's talk about field groups. 😉

Read only

matt
Active Contributor
0 Likes
3,995

�� = wink. 😀

Read only

FredericGirod
Active Contributor
0 Likes
3,995

nobody remember field-groups 🙂

Read only

Sandra_Rossi
Active Contributor
3,995

Field groups are never far..., I refreshed my memory 2 days ago by looking at RSNAST00 😄

Read only

matt
Active Contributor
3,995

frdric.girod ... so young! 😉

Read only

Sandra_Rossi
Active Contributor
3,995

matthew.billingham so grandfatherish! 😉