‎2006 Nov 12 12:04 PM
i use it write ?
RANGES: r_course FOR hrp1001-sobid.
LOOP AT person_tab.
CLEAR r_course.
REFRESH r_course.
<b> r_course-high = hrp1001-sobid.
r_course-low = hrp1001-sobid.</b>
r_course-sign = 'I'.
r_course-option = 'BT'.
<b> APPEND r_course.</b>
ENDLOOP.
SELECT objid begda endda
FROM hrp1001
INTO (wa_itab-objid,wa_itab-begda,wa_itab-endda)
WHERE plvar ='01'
AND otype = 'D'
AND relat = '020'
AND rsign = 'B'
<b>AND objid IN r_course</b>
AND begda <= sy-datum
AND endda => sy-datum.
thankes for answer
‎2006 Nov 12 12:17 PM
Hi
I'm trying to understand your code because it's very confused.
<u>This code is wrong,</u> you transfer the value from hrp1001, but where the select I checked the structure of PERSON_TAB and there isn't the field SOBID.
LOOP AT person_tab.
CLEAR r_course.
REFRESH r_course. " Why're you refreshing the range
r_course-high = hrp1001-sobid. " Where is the select
r_course-low = hrp1001-sobid.
r_course-sign = 'I'.
r_course-option = 'BT'.
APPEND r_course.
ENDLOOP.I suppose you want write this:
REFRESH r_course.
LOOP AT person_tab.
CLEAR r_course.
r_course-high = hrp1001-sobid. " but where are you getting SOBID
r_course-low = hrp1001-sobid.
r_course-sign = 'I'.
r_course-option = 'BT'.
APPEND r_course.
ENDLOOP.Please to open several post for the same problem
Max
‎2006 Nov 12 2:54 PM
Hi,
If you use the REFRESH statement, the internal table gets emptied out.
So you probably have just the last record you added.
Remove the REFRESH Statement and execute your query.
Regards
Meera
‎2006 Nov 12 6:05 PM
In addition to not refreshing the table as the others have suggested, also consider that you are looping at person_tab, but assigning values from hrp1001-sobid. So the same values would be assigned each time anyway.
Since you are assigning the same value to both r_course-low and r_course-high, it would be better to test for equality on just r_course-low .
Rob
‎2006 Nov 13 2:29 PM
Hi
i corrected the code which is below..
RANGES: r_course FOR hrp1001-sobid.
CLEAR r_course.
REFRESH r_course.
LOOP AT person_tab.
r_course-high = person_tab-sobid.
r_course-low = person_tab-sobid.
r_course-sign = 'I'.
r_course-option = 'BT'.
APPEND r_course.
ENDLOOP.
SELECT objid begda endda
FROM hrp1001
INTO (wa_itab-objid,wa_itab-begda,wa_itab-endda)
WHERE plvar ='01'
AND otype = 'D'
AND relat = '020'
AND rsign = 'B'
AND objid IN r_course
AND begda LE sy-datum
AND endda GE sy-datum.
Mark points if helpful.
Regs
Manas Ranjan Panda
‎2006 Nov 13 2:34 PM
HI,
Please check this code. it will help u.
Define a range:
Ranges: r_field for <table>.
if not field1 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field1.
append r_field.
endif.
if not field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field2.
append r_field.
endif.
if field1 is initial and field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
append r_field.
endif.
select * from <table> where field1 in r_field.Rgds
Anver
if hlped kindly mark points
‎2006 Nov 13 2:42 PM
Hi sh,
1. I suppose u want to search / extract
for OBJID values,
which are contained in SOBID field.
2. Then do two changes :
a) RANGES: r_course FOR <b>hrp1001-OBJID</b>
(and not RANGES: r_course FOR hrp1001-sobid)
b) write hrp1001-sobid to r_course-high.
write hrp1001-sobid to r_course-low.
3. Also remove the
REFRESH r_course
(bcos it is clearing all times, in the looop)
regards,
amit m.