2006 Jul 26 1:37 AM
Hi,
I have to write a RFC for searching order number based on text, order type or order number.
There can be an instance any of the fields can be empty and search engin should get results based on input.
I guess I will have to write so many combinations to achieve this search. Can any one suggest if they know any other logic to write such kind of search.
Regards
Ria
Hi,
I have to write a RFC for searching order number based on text, order type or order number.
There can be an instance any of the fields can be empty and search engin should get results based on input.
I guess I will have to write so many combinations to achieve this search. Can any one suggest if they know any other logic to write such kind of search.
Regards
Ria
2006 Jul 26 3:30 AM
HI,
You can populate your search condition in the Ranges.
Create range table for each field namely text, order type, order number. Use
IN <text> and
IN <ORDERTYPE> and
IN <ORDERNUMBER> in the where clause.
Regards,
Vara
2006 Jul 26 10:17 AM
Hi ,
You can refer for the function module CPWBBROWSER_SEARCH_FOR_STRING, this might give some clue about how to go about doing this,
Rgds,
2006 Jul 26 12:42 PM
Hi
Kindly try this logic.
DATA: cond_text(255) TYPE c.
IF TEXT IS NOT INITIAL.
CONCATENATE 'and' 'TEXT like %search_text%'
INTO cond_text SEPARATED BY space.
ENDIF.
IF Order_type IS NOT INITIAL.
CONCATENATE 'and' 'Order_type like %Order_type%'
INTO cond_text SEPARATED BY space.
ENDIF.
...
...
...
if cond_text is not inital.
WRITE ' ' TO cond_text+0(4).
SELECT * FROM TABLE INTO CORRESPONDING FIELDS OF TABLE i_Tab
WHERE (cond_text).
else.
SELECT * FROM TABLE INTO CORRESPONDING FIELDS OF TABLE i_Tab.
endif.Hope this helps!
Kindly assign points for helpful answers!
best regards
Thangesh
2006 Jul 26 12:54 PM
parameters : po_type.
parameters : po_num.
ranges : ro_type for ORDER_TYPE?.
ranges : ro_num for ORDER_NUMBER?.
if po_type ne space.
move 'I' to ro_type-sign.
move 'EQ' to ro_type-option.
move po_type to ro_type-low.
append ro_type.
endif.
if po_num ne space.
move 'I' to ro_num-sign.
move 'EQ' to ro_num-option.
move po_num to ro_num-low.
append ro_num.
endif.
select * from TABLE where order_type IN ro_type
and order_num IN ro_num.
ibrahim
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |