‎2007 Aug 09 4:05 PM
Hi,
Can this select statement be changed with removing endselect.
SELECT partner INTO t_db_pos_match-partner
FROM ekun
WHERE dr_license = t_bp_obj-act-ekun-dr_license
AND partner NE t_bp_obj-act-ekun-partner.
SORT t_db_pos_match BY partner.
READ TABLE t_db_pos_match WITH KEY
partner = t_db_pos_match-partner BINARY SEARCH.
IF sy-subrc NE 0.
t_db_pos_match-match_type = '2'.
APPEND t_db_pos_match.
ELSE.
CLEAR: t_db_pos_match.
ENDIF.
ENDSELECT.
Please reply me.
Thanks,
Binay.
‎2007 Aug 09 4:09 PM
You should be able to read all the entries you are currently getting from the SELECT directly into an internal table and then loop through it and do the further processing then.
Rob
‎2007 Aug 09 4:09 PM
You should be able to read all the entries you are currently getting from the SELECT directly into an internal table and then loop through it and do the further processing then.
Rob
‎2007 Aug 10 4:57 AM
Hi,
try using the following code.
**********************************************************************
data t_temp like t_db_pos_match.
SELECT partner INTO corresponding fields of table t_temp
FROM ekun
WHERE dr_license = t_bp_obj-act-ekun-dr_license
AND partner NE t_bp_obj-act-ekun-partner.
loop at t_temp.
SORT t_db_pos_match BY partner.
READ TABLE t_db_pos_match WITH KEY
partner = t_temp-partner BINARY SEARCH.
IF sy-subrc NE 0.
t_temp-match_type = '2'.
APPEND t_temp to t_db_pos_match.
ELSE.
CLEAR: t_temp.
ENDIF.
endloop.
‎2007 Aug 10 5:25 AM
Hi,
SELECT partner INTO CORRESPONDING FIELDS OF TABLE t_db_pos_match-partner
FROM ekun
WHERE dr_license = t_bp_obj-act-ekun-dr_license
AND partner NE t_bp_obj-act-ekun-partner ORDER BY partner. "sort done by ORDER BY addition
*SORT t_db_pos_match BY partner. " TSort can also be done out side SELECT for that remove ORDER BY in above query
loop at t_db_pos_match where match_type <> '2'. " Delete where match_type not equal to 2.
delete t_db_pos_match.
endloop.
Regards,
Sesh
‎2007 Aug 10 5:32 AM
Hi Binay,
first get all the data into internal table,
if t_bp_obj [] is not initial.
select partner from ekun into table it_part for all entries in t_bp_obj where dr_license = t_bp_obj-act-ekun-dr_license
AND partner NE t_bp_obj-act-ekun-partner.
now u have data in it_part.
sort it_part by partner.
loop at it_part.
READ TABLE t_db_pos_match WITH KEY
partner = it_part-partner BINARY SEARCH.
IF sy-subrc NE 0.
it_part-match_type = '2'.
APPEND it_part.
ELSE.
CLEAR: it_part.
ENDIF.
please reward points to all helpful answers
kiran.M
‎2007 Aug 10 10:25 AM
Hi
yes
SELECT partner
INTO <u><b>table</b></u> t_db_pos_match-partner
FROM ekun
WHERE dr_license = t_bp_obj-act-ekun-dr_license
AND partner NE t_bp_obj-act-ekun-partner.
SORT t_db_pos_match BY partner.
READ TABLE t_db_pos_match WITH KEY
partner = t_db_pos_match-partner BINARY SEARCH.
IF sy-subrc NE 0.
t_db_pos_match-match_type = '2'.
APPEND t_db_pos_match.
ELSE.
CLEAR: t_db_pos_match.
ENDIF.
reward if usefull