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: 

accessing fields from a method

Former Member
0 Kudos
1,110

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

rajkumarnarasimman
Active Contributor
0 Kudos
925

Can you explain in detail

Former Member
0 Kudos
925

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?

matt
Active Contributor
925

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

Former Member
0 Kudos
925

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

925

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

You should use read table rather than select.

Former Member
0 Kudos
925

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.

matt
Active Contributor
925

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

Former Member
0 Kudos
925

Hi,sorry you can now

matt
Active Contributor
925

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.

retired_member
Product and Topic Expert
Product and Topic Expert
925

Learn some basic ABAP, working with internal tables?

retired_member
Product and Topic Expert
Product and Topic Expert