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: 

help needed on field symbols

Former Member
0 Kudos

Hi All,

Need help on field symbols.

Below is the piece of code that i want to modify.

Loop at itab_prps ASSIGNING <itab_prps_fs>.

SELECT gjahr wrttp wljhr

INTO TABLE itab_amounts

FROM bpja

WHERE lednr = '0001'

AND objnr = <itab_prps_fs>-objnr

AND ( wrttp = '41' or

wrttp = '42' )

AND gjahr IN sel_year.

endloop.

Now i want to take the select out of the loop(before it).

And with read i want to get data inside the loop.

But since it has field symbols it is giving me error.

Please could you help me out.

regards,

SG

4 REPLIES 4

Former Member
0 Kudos

try this

select gjahr wrttp wljhr

INTO TABLE itab_amounts from bpja

for all entries in itab_prps where

objnr = itab_prps-objnr

AND ( wrttp = '41' or

wrttp = '42' )

AND gjahr IN sel_year.

Regards

MD

Former Member
0 Kudos

Hi,

Try with below code


field-symbols <fs_objnr> type any.

SELECT gjahr wrttp wljhr
INTO TABLE itab_amounts 
FROM bpja
for all entries in itab_prps
WHERE lednr = '0001'
AND objnr = itab_prps-objnr
AND ( wrttp = '41' or
wrttp = '42' )
AND gjahr IN sel_year.

Loop at itab_prps ASSIGNING <itab_prps_fs>.
assign component 'OBJNR' of structure <itab_prps_fs> to <fs_objnr>.
read table itab_amounts with key lednr = '0001'
                                                objnr = <fs_objnr>.
endloop.

Cheers,

Kothand

Former Member
0 Kudos

Hi Kothand,

I tried but giving me error

"itab_amounts" without header line......

0 Kudos

Hi,

Declare the itab_amounts with header line. Then only you can use it in READ statement

e.g) data: itab_amounts type standard table of gd_amount WITH HEADER LINE.

Cheers,

Kothand