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

problem with select statement

Former Member
0 Likes
865

hi friends, my requirement is:

types : begin of t_nonbonus,

sign type setleaf-valsign,

option type setleaf-valoption,

low type setleaf-valfrom,

high type setleaf-valto,

end of t_nonbonus.

DATA: nonbonus TYPE STANDARD TABLE OF t_nonbonus,

wa_nonbonus type t_nonbonus.

select * from setleaf into table nonbonus

where setname = 'znon_bonus'.

nonbonus-sign = setleaf-valsign .

nonbonus-option = setleaf-valoption.

nonbonus-low = setleaf-valfrom.

nonbonus-high = setleaf-valto.

append wa_nonbonus to nonbonus.

endselect.

When i ran the above code, it gave the following error

ERROR:

1)The work area "NONBONUS" is not long enough . .

2)Field "VALSIGN" is unknown. It is neither in one of the specified

tables nor defined by a "DATA" statement . . . . . . . . . .

3) For the statement "ENDSELECT",

there is no open structure introduced by SELECT.

can some one help plz.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
716

Hello Saritha,

Use like this


select * from setleaf into corresponding fields of table nonbonus   " Check here
where setname = 'znon_bonus'.
nonbonus-sign = setleaf-valsign .
nonbonus-option = setleaf-valoption.
nonbonus-low = setleaf-valfrom.
nonbonus-high = setleaf-valto.
append wa_nonbonus to nonbonus.
*endselect.  " reomuve endselect.


Vasanth

4 REPLIES 4
Read only

ferry_lianto
Active Contributor
0 Likes
716

Hi,

Please try this.


types : begin of t_nonbonus,
sign type setleaf-valsign,
option type setleaf-valoption,
low type setleaf-valfrom,
high type setleaf-valto,
end of t_nonbonus.

DATA: nonbonus TYPE STANDARD TABLE OF t_nonbonus,
wa_nonbonus type t_nonbonus.


select * from setleaf 
into corresponding fields of table nonbonus
where setname = 'znon_bonus'.
nonbonus-sign = setleaf-valsign .
nonbonus-option = setleaf-valoption.
nonbonus-low = setleaf-valfrom.
nonbonus-high = setleaf-valto.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
717

Hello Saritha,

Use like this


select * from setleaf into corresponding fields of table nonbonus   " Check here
where setname = 'znon_bonus'.
nonbonus-sign = setleaf-valsign .
nonbonus-option = setleaf-valoption.
nonbonus-low = setleaf-valfrom.
nonbonus-high = setleaf-valto.
append wa_nonbonus to nonbonus.
*endselect.  " reomuve endselect.


Vasanth

Read only

Former Member
0 Likes
716

Hi

1. select * from setleaf into table nonbonus - <b>Instead of * use the fields which u have declared while creating the table or use Corresponding fields of.</b>

3. Remove ENDSELECT.

Regards

Haritha.

Read only

Former Member
0 Likes
716

thank you friends,

now its not showing errors.

so we do not need those lines of assigning values and append stmt when we use into table. right?

thanks once again.