2007 Jul 16 5:05 AM
I have to read from table vbak the vbeln and augru fields. In the where condition, I have to set the condition where the values of the fields from selection-screen(which are select-options type) must be equal to augru.
I have this statement:
SELECT vbeln
augru
FROM vbak
INTO TABLE i_vbak
WHERE augru IN s_rrets
AND augru IN s_rrefl
AND augru IN s_robst.
IF sy-subrc NE 0.
ENDIF.
s_rrets, s_rrefl and s_robst are of like vbak-augru.
Why my sy-subrc returns 4 which means I haven't retrieved any data from it?
2007 Jul 16 5:07 AM
hi,
try to change the and condition to or.
chk this code..
SELECT vbeln
augru
FROM vbak
INTO TABLE i_vbak
WHERE augru IN s_rrets <b>or</b> augru IN s_rrefl
<b>or</b> augru IN s_robst.
IF sy-subrc NE 0.
ENDIF.
regards,
Navneeth K.
2007 Jul 16 5:10 AM
Hi,
Hv u checked in the table VBAK if there is any data for the conditions u are specifying.
2nd thing I dont understand is that whats the need of giving three select-options for the same field AUGRU.
Regards,
Himanshu
2007 Jul 16 5:11 AM
i cant understand why 3 select options are there for a single field one select option is enough for your requirement. If you have to give three different ranges or three different single value then just click the arrow button beside the select option for giving the range(including) click the green range tab(for single(including) green single) and for excluding some ranges or value click on the red tabs.
now write your query
SELECT vbeln
augru
FROM vbak
INTO TABLE i_vbak
WHERE augru IN s_rrets.
IF sy-subrc NE 0.
ENDIF.
regards
shiba dutta
2007 Jul 16 5:23 AM
Hi Florianne,
No need to give three select options for augru. U can give it in only as one select option and can make it a range by clicking on the arrow button nxt to the right hand side selct option .
Further u shud also check whether the required data exists in the table or not.
U can write ure select query as
SELECT vbeln
augru
FROM vbak
INTO TABLE i_vbak
WHERE augru IN s_rrets.
Hope this solves ure pblem.
Reward if helpful.
Cheers,
Sharadendu
2007 Jul 16 5:36 AM
Now try the below one it was working for me .......
select-options : s_rrets for vbak-augru ,
s_rrefl for vbak-augru ,
s_robst for vbak-augru .
SELECT vbeln augru FROM vbak INTO TABLE i_vbak
WHERE ( augru IN s_rrets
PR augru IN s_rrefl
OR augru IN s_robst ).
IF sy-subrc NE 0.
ENDIF.
reward points if it is usefull.......
Girish
2007 Jul 16 6:46 AM
I have three select-options displayed in the selection-screen. Each of which is of like vbak-augru.and answers should be checked with vbak-augru.
Well, I just changed and to or.
Thanks for your replies.
2007 Sep 06 6:17 AM
Hi ,
U can use one select option instead of three and use OR instead of AND in ur select condition.
2007 Dec 20 3:23 AM