Application Development 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: 

How to use for all entries with two fields of db table

ram_sahoo
Participant
0 Kudos

Hi Experts,

I have a requirement to use for all entries for table FMFMOAEOD02000132 fields SOUR1_FROM and SOUR1_TO with internal table ITAB with field SAKNR, I want to use SAKNR internal table field in where condition.

Example:

SELECT *

FROMFMFMOAEOD02000132

INTO table ITAB2

FOR ALL ENTRIES IN ITAB

WHERE sour1_from EQ ITAB-saknr AND

sour1_to EQ ITAB-saknr.

If i use same code getting error 'No component exists with the name "SAKNR". "SAKNR".

Anybody can help me on this.

Thanks,

7 REPLIES 7

mateuszadamus
Active Contributor
0 Kudos

Hello ram.sahoo

Check the definition of your ITAB. Seems like it's missing the SAKNR field.

Kind regards,
Mateusz

ram_sahoo
Participant
0 Kudos

Now error resolved but my confusion is, how i can read from and to field value with SAKNR, Please help me on this

0 Kudos

I don't understand the question. What is it that you'd like to do?


Kind regards,
Mateusz

0 Kudos

My question is table FMFMOAEOD02000132 fields sour1_from and sour1_to i wants to use in where condition with SAKNR for all entries, Is it possible?

0 Kudos

Yes. It is possible, but you need to fix the ITAB SAKNR field issue, which the error you showed points to.

If this is fixed and you still have an issue, please share your code and the error message.

Kind regards,
Mateusz

0 Kudos
ram sahoo maybe you mean that ITAB is a formal parameter declared generically? (and so, the compiler is not aware of the actual components at run time)
METHODS method IMPORTING ITAB TYPE ANY TABLE. " generic declaration

(TYPE ANY TABLE or also TYPE { STANDARD | INDEX | SORTED | HASHED } TABLE)

raymond_giuseppi
Active Contributor
0 Kudos

How is ITAB defined: as a structure or a single field, in second case there is no subfield SAKNR use pseudo-component table_line and not SAKNR.