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

Select statement - Please correct

Former Member
0 Likes
779

DATA : wa_awkey LIKE bkpf-awkey.

SELECT awkey FROM bkpf

UP TO 1 ROWS

INTO wa_awkey

WHERE bukrs = gt_regup-bukrs

AND belnr = gt_regup-belnr

AND gjahr = gt_regup-gjahr.

ENDSELECT.

What wsa wrong in this.

the error is "the data object 'wa_awkey' has no structure and therefore no component called 'awkey' ".

7 REPLIES 7
Read only

Former Member
0 Likes
739

data: wa_awkey like bkpf-awkey.

SELECT singe awkey FROM bkpf

INTO wa_awkey

WHERE bukrs = gt_regup-bukrs

AND belnr = gt_regup-belnr

AND gjahr = gt_regup-gjahr.

- Raj

Read only

Former Member
0 Likes
739

This query is working fine for me.

can you post ur code completely just to see whats going wrong?

Read only

Former Member
0 Likes
739

Hello Sam,

this program compiled and runs fine:

<b>TABLES: bkpf.

DATA : wa_awkey LIKE bkpf-awkey.

PARAMETERS: p_bukrs LIKE bkpf-bukrs,

p_belnr LIKE bkpf-belnr,

p_gjahr LIKE bkpf-gjahr.

START-OF-SELECTION.

SELECT awkey FROM bkpf

UP TO 1 ROWS

INTO wa_awkey

WHERE bukrs = p_bukrs

AND belnr = p_belnr

AND gjahr = p_gjahr.

ENDSELECT.

WRITE:/ wa_awkey.</b>

Read only

Former Member
0 Likes
739

Hi Sam,

which release do you have.

I have tried your code and have no problems.

But normaly select ... endselect gives more than

one record, therefore try it with an internal table.

otherwise you can use select single ...

Regards, Dieter

Read only

Former Member
0 Likes
739

Which SAP verion are you on?

Regards

Read only

Former Member
0 Likes
739

Check the below code:

DATA : wa_awkey LIKE bkpf-awkey.

SELECT SINGLE awkey FROM bkpf

INTO wa_awkey

WHERE bukrs = gt_regup-bukrs

AND belnr = gt_regup-belnr

AND gjahr = gt_regup-gjahr.

Regards,

Prakash.

Read only

Former Member
0 Likes
739

Hi sam

May be u have include the line Tables BKPF, in the starting. May be that is the problem. Otherwise it is running very fine.

Regards

Haritha