Application Development 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: 

Search help with fields from 2 tables (no foreign-key relationship)

0 Kudos
756

Hi,

I need to create a search help with fields from 2 tables namely PRPS and WCOCOH .The tables do not share any foreign-key relationship in order to create a view.So,is there any other way to create a search help without including search help exit .If not ,are there any standard search help exits which could help here.

7 REPLIES 7

AnnePetteroe
Community Manager
Community Manager
0 Kudos
619

Hello Epparla,

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers, as it provides tips for preparing questions that draw responses from our members.

Feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html as well, as that will also help you when preparing questions for the community.

Should you wish, you can revise your question by selecting Actions, then Edit.

Kind regards,
Anne

Sandra_Rossi
Active Contributor
0 Kudos
619

View of type database.

raymond_giuseppi
Active Contributor
619

619

Hi Raymond,

Thanks for the reply.But there is no foreign key relationship between the tables in order to create a help view.

Sandra_Rossi
Active Contributor
0 Kudos
619

Create a View of type database.

JackGraus
Active Contributor
619

Table PRPS does hold WBS elements. Table WCOCOH does hold contract header data.

You want a search help on these 2 tables a.k.a. on these 2 data sets but you do not indicate how these 2 data sets are to be linked.

There are some suggestions on your question by using a CDS or maintenance (or help or database) view. But then it must first be clear how these 2 tables are linked.

A contract does hold contract items and a contract item can potentially have a WBS element.

If you want search help on this linked data then there are 2 possibilities:

  • Read the data by ABAP code. Either use your own ABAP code to select the required data or use a SAP API. Please find an ABAP snippet for this below. Then you have the data available you can populate it into a search help by using a search help exit in the search help definition.
  • Find the tables that do link WBS element (Table PRPS) and contract (Table WCOCOH). Create a CDS view or maintenance view linking these table and include that view in you search help definition. The linking table might be VMPA.

*   Contract items on WBS element
cl_lord_services=>get_items_for_wbselmts(
EXPORTING
it_wbselmt = VALUE #( ( ls_item-pspnr->* ) )
it_vbtyp = VALUE #( ( if_sd_doc_category=>contract ) )
iv_filter_items = abap_true
IMPORTING
et_sditem = lt_sditem ).

Sandra_Rossi
Active Contributor
0 Kudos
619

jack.graus2 Just to clarify, Raymond and I were not proposing "CDS or maintenance view", we proposed respectively a help view and a database view 😉

(but I agree that the question needs to be clarified and your comment is worth being converted into an answer)