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

Doubt in select statement

Former Member
0 Likes
387

hi guys ,

i am writing a select statement like

select ebeln into fp_records from eket for all entries in fpi_getrecords where

(menge - wemng) gt 0.

how to subtract two fields in the where condition.

1 ACCEPTED SOLUTION
Read only

former_member189059
Active Contributor
0 Likes
367

make a workarea

data: fp_records_wa like line of fp_records.

select ebeln menge wemng from eket into corresponding fields of fp_records_wa for all entries in fpi_getrecords.

if fp_records_wa-menge - fp_records_wa-wemng gt 0.
 append fp_records_wa to fp_records.
endif.

endselect.

2 REPLIES 2
Read only

Former Member
0 Likes
367

Hi,

You cannot use this kind of natation in the select statement.

Rather

select ebeln menge wemng into fp_records from eket for all entries in fpi_getrecrods where condition.

if sy-subrc eq 0.

loop at fp_records.

if fp_records-menge - fp_records-wemng le 0.

delete fp_records index sy-tabix.

endif.

endloop.

endif.

Thanks,

mahesh

Read only

former_member189059
Active Contributor
0 Likes
368

make a workarea

data: fp_records_wa like line of fp_records.

select ebeln menge wemng from eket into corresponding fields of fp_records_wa for all entries in fpi_getrecords.

if fp_records_wa-menge - fp_records_wa-wemng gt 0.
 append fp_records_wa to fp_records.
endif.

endselect.