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

accessing fields from a method

Former Member
0 Likes
2,364

Hello,

I am in BEFORE_UPDATE Method in class ZCL_IM_PP_WOUPDATE & I want to select

from IT_ITEM parameter the AUFNR , VAPLZ , ADPSP.

How can I do this?

11 REPLIES 11
Read only

rajkumarnarasimman
Active Contributor
0 Likes
2,179

Can you explain in detail

Read only

Former Member
0 Likes
2,179

IF_EX_WORKORDER_UPDATE~BEFORE_UPDATE ,I have my code inside this interface or method how will you call it,The fields that I want are in the IT_ITEM Parameter =>double click in assosiated type(COBAI_T_ITEM) has cobai_t_item TYPE TABLE OF cobai_s_item,=>double click again =>cobai_s_item LIKE afpob, Inside afpob are the fields I want.How do I use them in my code?

Read only

matt
Active Contributor
2,179

IT_ITEM is an ordinary internal table. So you use normal basic ABAP to read the information you need.

Read only

Former Member
0 Likes
2,179

then it gives me this error "IT_ITEM" is not defined in the ABAP Dictionary as a table, projection view, or database view.

Read only

2,179

It is an internal table, I think you are using select on this.

You should use read table rather than select.

Read only

Former Member
0 Likes
2,179

You are right but If I do this for example

READ TABLE IT_ITEM into lt_caufv WITH TABLE KEY aufnr = IT_ITEM_OLD-aufnr. it_item_old is a table without a header line.

Read only

matt
Active Contributor
2,179

I'm sorry but I can't give assistance to anyone who is visible as "former member".

Read only

Former Member
0 Likes
2,179

Hi,sorry you can now

Read only

matt
Active Contributor
2,179

As Horst Keller as commented below, reading internal tables is basic ABAP. Perhaps you should revisit your training notes.

Tables with header lines are obsolete and have been for years.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
2,179

Learn some basic ABAP, working with internal tables?

Read only

retired_member
Product and Topic Expert
Product and Topic Expert