‎2009 Dec 11 9:38 AM
Hi experts,
I want to select data when I inform only DATA_CREACIO:
SELECT ZISH_POS_INTER~FALNR
INTO table i_inter
FROM ZISH_POS_INTER
where ( ( DATA_CREACIO IN rg_erdat )
OR ( DATA_RESPOSTA IN rg_updat ) ).
But the trace, inform me :
10 ZISH_POS_X REOPEN 0 SELECT WHERE "MANDT" = '100'
4.944 ZISH_POS_X FETCH 2.708 0
1.015 ZISH_POS_X FETCH 1.747 1403
what happens? the OR is incorrect?
‎2009 Dec 11 9:42 AM
Hi Markus,
If OR is incorrect it will not fetch any data, in this case SY-SUBRC will be zero.
Regards
Abhii
‎2009 Dec 11 9:42 AM
Hi Markus,
If OR is incorrect it will not fetch any data, in this case SY-SUBRC will be zero.
Regards
Abhii
‎2009 Dec 11 9:47 AM
But when I debugg, the rg_erdat is EQ 20091112.
Why the trace is not inform about this date?
‎2009 Dec 11 9:50 AM
what about rg_updat.
if its blank it will take all the records from Z* table.. as the IN statement satisfies the condition..
Nag
‎2009 Dec 11 9:53 AM
Thanks.
And what I can do if I want only ERDAT or UPDAT informed??
‎2009 Dec 11 9:58 AM
You can try some thing like this
DATA: BEGIN OF ITAB OCCURS 0,
LINE(72) TYPE C,
END OF ITAB.
IF NOT rg_erdat[] IS INITIAL.
MOVE '(DATA_CREACIO IN rg_erdat)' TO ITAB.
APPEND ITAB.
CLEAR ITAB.
MOVE 'OR' TO ITAB.
APPEND ITAB.
CLEAR ITAB.
ENDIF.
IF NOT RG_UPDAT[] IS INITIAL.
MOVE '(DATA_RESPOSTA IN rg_updat) ' TO ITAB.
APPEND ITAB.
CLEAR ITAB.
ENDIF.
AND SELECT WOULD BE LIKE
SELECT ZISH_POS_INTER~FALNR
INTO table i_inter
FROM ZISH_POS_INTER
where (ITAB).
Hope this helps... Let me know if u need more info..
Nag
Edited by: Naga Mohan Kummara on Dec 11, 2009 11:03 AM
‎2009 Dec 11 9:43 AM
It can be either way around. Try reconsidering the Group-By replication waht you are using in your code.
‎2009 Dec 11 10:02 AM
SELECT ZISH_POS_INTER~FALNR
INTO table i_inter
FROM ZISH_POS_INTER
where ( ( DATA_CREACIO IN rg_erdat )
OR ( DATA_RESPOSTA IN rg_updat ) ).This is code.
If one of the ranges is empty, it will fetch all records. A range acts as a filter - if nothing is filtered, everything gos through.
Regards,
Clemens