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

sql

Former Member
0 Likes
380

hi,

may i know why i got error for this? instead i must have into v_matnr then only is correct. i thought tables mara is already a working area defined, right?

thanks

tables mara.

select single matnr from mara where matnr = p_matnr.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
354

tables mara.

select single matnr into mara-matnr from mara where matnr = p_matnr.

yes it is a table work area you have defined but for field selection in which field you want to store the value you have to specifically declare. or you can use

select single * from mara where matnr = p_matnr.

it will fill all the corresponding fields in table work area mara.

regards

shiba dutta

2 REPLIES 2
Read only

Former Member
0 Likes
355

tables mara.

select single matnr into mara-matnr from mara where matnr = p_matnr.

yes it is a table work area you have defined but for field selection in which field you want to store the value you have to specifically declare. or you can use

select single * from mara where matnr = p_matnr.

it will fill all the corresponding fields in table work area mara.

regards

shiba dutta

Read only

Former Member
0 Likes
354

Hi,

You can use the following two options:

A)

tables mara.

select single * from mara where matnr = p_matnr.

B)

tables mara.

select sinle matnr from mara into mara-matnr where matnr = p_matnr.

The reason for error is when you are selecting some particular fields from a table you have to explicitly specify the target fields or variables.

You tried to select only the matnr field into the entire work area of table mara.

Reward all useful answers.

Thank you.