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: 

ABAP value help (F4 help / search help) in report for own datatype

monika_eggers
Active Participant
0 Kudos

I have problems getting the value help to work for parameters in report that have a datatype that I defined. I should say this is the first value help I try to create and the instructions on help.sap.com are not entirely clear to me.

What I mean / want to achieve:

In a report I have some parameters:

Header 1

PARAMETERS: bp      TYPE bu_partner,
            demo_id TYPE zdemo_id.

When I place the cursor in the bp field, there is the F4 / value help button for selecting a business partner (a complex value help / search help). The same works for many other pre-defined datatypes e.g. COMT_PRODUCT_ID (another complex search help) or COMT_CATEGORY_ID (an elementary search help).

In the demo_id field there is no value help button. I want there to be a value help button to select entries from table ZCREATEQUOTDEMO.


The table ZCREATEQUOTDEMO has a key column DEMO_ID of type ZDEMO_ID and some other columns for business partner, date, product and some conditions.

What I tried: (as I said I don't really know what I'm doing)

I created a domain ZDEMO_ID and associated the data type ZDEMO_ID with it.

In the domain ZDEMO_ID on the value range tab I put ZCREATEQUOTDEMO as the Value Table.

(Not sure what effect that had, if any.)

Am I even correct assuming I need a domain? Well, it can't really harm.

I created an elementary search help ZDEMO_ID (from se11).

Here I am mostly guessing what to put in.

In the Selection method field I put ZCREATEQUOTDEMO.

I set the Dialog type to D Display values immediately and left the Hot key blank.

I left the Search help exit field empty. If possible, I would like not to have to code an exit for this. According to help.sap.com they don't seem to be necessary unless one wants something fancy / non-standard?

In the table at the bottom I put the Search help parameter DEMO_ID and marked it as both IMP and EXP and I put LPos and SPos as 1 and 1.

I also put one of the other columns there, PRODUCT, made it neither IMP nor EXP and set LPos and SPos as 2 and 2 (not entirely sure what that does).

In the table ZCREATEQUOTDEMO I went to the Entry help/check tab, clicked in the line for DEMO_ID and clicked the Search Help button. I accepted the proposal, which was just Search help parameter DEMO_ID, Table Name ZCREATEQUOTDEMO and Field name DEMO_ID.

Outcome:

It seems to have worked a little bit. When I use transaction sm30 to maintain the generated view ZCREATEQUOTDEMO and I click New Entry, there is a value help button in the Demo ID field, and when I click it shows the Demo ID and the Product Id for all entries in the ZCREATEQUOTDEMO table. (Of course this is not very useful, as I need to enter a new ID manually, otherwise it would clash.)

But in the report, where I need it, there is still no value help button!

Other attempt:

I changed the data type ZDEMO_ID. On the Further Characteristics screen I entered Search Help Name ZDEMO_ID and selected Parameters DEMO_ID (which was the only one available).

=> No changes. (Maybe this cannot have an effect anyway when there is a domain attached to a data type?)

Can someone point me to an example of an elementary search help without an exit? Or tell me what is wrong with my steps?

1 ACCEPTED SOLUTION

anubhab
Active Participant
0 Kudos

HI Monika,

In the search help definition tab, give your custom table name(ZCREATEQUOTDEMO) as selection method. In the table for parameters, give the field name for which you need search help (DEMO_ID). Check both IMP & EXP checkbox. Now save and activate.

Now when you designing your selection screen, code like this:

PARAMETER demo_id TYPE zdemo_id MATCHCODE OBJECT ZDEMO_ID (This should be your search help name)

Now when you execute your selection screen, you will get F4 help option for that field.

Hope this helps.

Regards,

Anubhab

9 REPLIES 9

nithinjabraham
Explorer
0 Kudos

This message was moderated.

Former Member
0 Kudos

hi monika,

i think u should have a clear idea about how to create a search help. plz go to se11 .

select radio button searchhelp . click on to elementary search help.

on the selection text give the name of the table from where u want to pop the values.

on the search help parameter if u click the f4 help that will list u all the fileds of the table u typed in the selection text. u can choose the necessary fields that u would like to the diaplay when u press ur f4 help.

once u r done, save and activate it.

u can add this search help to a screen field in your module pool program as well to your field in the report program.

Screen field in module program : go to screen layout, add the search help u created to the search help column.

Report field : Field name mathcode object search help name.

With regrads

Suneesh

Former Member
0 Kudos

This message was moderated.

former_member946717
Contributor
0 Kudos

Hi Monika,

You can also use an FM F4IF_INT_TABLE_VALUE_REQUEST to provide F4 help to the demo field in your report. To know how to use this FM, you can do a where-used search on this FM. I'm sure your colleagues would have used it so you can refer to any program and do it or you can browse this forum for this FM.

Or you can select data from the table that would have values for Demo field. Then pass it to this FM. Then read the result table (this contains the entry that the user selects on the F4 help) and pass the value from the result table to the selection-screen field.

Hope this helps.

former_member220538
Active Participant
0 Kudos

Hi Monika,

Create a Search help and Implement in our program.

Creating Search help
Go to SE11 -> click search help radio button ->enter a name for search help->create.

Give a description and add your table name in selection method. (i.e. ZCREATEQUOTDEMO)
In search help parameter add the field  you need . (i.e. DEMO_ID )
Save ,check and activate.

Implementing Search help

Go to  report program.
Add search help to the parameter.

PARAMETERS: <parameter name> TYPE <type> MATCHCODE OBJECT <search help name>.

0 Kudos

I want to populate Banks, Bankl and Banka name based on Bukrs( coco) , but even after adding matchcodes ,only company code value is getting populated.

Any help will be appreciated .

anubhab
Active Participant
0 Kudos

HI Monika,

In the search help definition tab, give your custom table name(ZCREATEQUOTDEMO) as selection method. In the table for parameters, give the field name for which you need search help (DEMO_ID). Check both IMP & EXP checkbox. Now save and activate.

Now when you designing your selection screen, code like this:

PARAMETER demo_id TYPE zdemo_id MATCHCODE OBJECT ZDEMO_ID (This should be your search help name)

Now when you execute your selection screen, you will get F4 help option for that field.

Hope this helps.

Regards,

Anubhab

monika_eggers
Active Participant
0 Kudos

Thanks to everyone who suggested "MATCHCODE OBJECT ZDEMO_ID", that works very well!

How come it works with e.g. "TYPE bu_partner" without specifying the search help with "MATCHCODE OBJECT"?

0 Kudos

Hi Monica,

If you check the data-element for 'BU_PARTNER' in SE11, in the 'Further Characteristics' tab you can find a search help attached to it 'BUPA', which is a collective search help ( combination of multiple elementary search helps ). If you double click on that, it will take you to the details for that search help. In the 'Included search helps' tab you can find the list of elementary search helps included in it. That is the reason we get F4 help for this data element automatically.

Regards,

Anubhab