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 failed

Former Member
0 Likes
287

Hi,

i used a select statement but in my selection screen user is not entering any lifnr value, then i am getting sy-subrc = 4.

I want if user also not enter any lifnr value in selection screen , the value should fetch.

is this mandatory to enter the lifnr value in selection screen?

SELECT matnr

werks

slabs

FROM mkol

INTO TABLE gt_mkol

FOR ALL ENTRIES IN gt_marc

WHERE matnr = gt_marc-matnr

AND werks = gt_marc-werks.

AND lifnr = so_lifnr.

2 REPLIES 2
Read only

Former Member
0 Likes
257

hi,

It not necessary to get the values from the user in the selection screen field..however if you want to run your query then you will have to use an OR condition in the where clause..

eg.

select x y x from <table name > into <table name>

for all enteries in <table name>

where <field 1> =/IN (in case of select options) <the field on the screen> OR <field 1> = some field value.

the better solution will be to give a default value for your screen field.

Read only

Former Member
0 Likes
257

Moderator message - Please do not ask or answer basic questions - thread locked Rob