Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Search Objects based on characteristics

Former Member
0 Likes
1,797

Hi everybody!

I am looking for an FM that would give me objects based on characteristics and valuations. I have tried CLSC_SEARCH_OBJECTS, but it seems I haven't specified the parameters correctly - the FM will give back all objects with the required class number. Good, but not good enough.

According to the documentation (and the interface parameters) it should be possible to pass selection criteria - but so far, the criteria I supplied are ignored.

Any suggestions or - even better - sample code?

Thanx in advance,

Joerg

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,413

This function module is used in a couple of programs, one being RCCLAUSPOLDNEW. Does this program offer any hints.

Regards,

Rich Heilman

Read only

0 Likes
1,413

Hi Rich!

Thanx for your reply. After just a few hours of debugging I now think now I've got it

Regards, Joerg

Read only

0 Likes
1,413

Hi Joerg,

I'm getting the same problem as you with 'CLSC_SEARCH_OBJECTS'. Dispite I call it exactly as the CL30N it does return too many objects.

So could you please tell me what is the trick for the selections of charact. to be taken into account ?

Read only

0 Likes
1,413

Hello Bertrand,

There are two answers to your question:

a) I now don't use CLSC_SEARCH_OBJECTS any more, but use BAPI_CLASS_SELECT_OBJECTS instead. It offers nearly the same functionality while being an "official" BAPI, i. e. release-stable etc.

b) If you receive too many results that might be because of the parameter STATUS_INCOMPLETE. Maybe you should check there...

Hope that helps!

Regards, Joerg

Read only

0 Likes
1,413

Hi joerg.

I'd discover the BAPI_CLASS_SELECT_OBJECTS while working on the CLSC_SEARCH_OBJECTS. Looking at the interface (quite simple) I immediatly move on it. Unfortunatly the BAPI_CLASS_SELECT_OBJECTS seems limited to a particular type of class.

This is why I continue to dig with the CLSC_SEARCH_OBJECTS which is definitly not a customer-friendly function !

After debugging a loooong time, I discover that all the attention should be put on the selection criteria table => i_selection_criteria_tab.

<b>The table fields slcod, atfor must be filled correctly.</b>

Transaction CL30N for searching characteristics was used as a model but SAP use CTMS_DDB_CLOSE which is very specific to the transaction and not reusable. So I add to do it dirty ...

Anyway searching using characteristics is a wrong idea

If I had to do it again I wonder if I would not do it by low-level dirty SELECT and JOIN

And thanks for your help Joerg.

Message was edited by: Bertrand LAFOUGERE

Read only

0 Likes
1,413

Hello Bertrand!

Well. Sometimes you have to use the dirty tricks to get the work done

However: In Report RCCLAUSPOLDNEW the FM is called with all the preparation needed for a successful call. The report is quite simple - maybe you'll get an idea which FMs have to be called in what order to be successful?!?

Regards, Joerg