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

Value-Help with fields of data dictionary structure

Missschaaa
Participant
0 Likes
2,385

Hello guys,

is it possible to create a value-help for the fields (not the content!) of a data dictionary structure? I have my custom ddic structure Z1 with the fields A, B and C. Now I have ddic table Z2 where I want to input field-names. Therefor i have a field FIELDNAMES in this table. For this field I want as value-help the names of fields A, B and C of structure Z1. Is this possible?

Regards

Michael

Hello guys,

is it possible to create a value-help for the fields (not the content!) of a data dictionary structure? I have my custom ddic structure Z1 with the fields A, B and C. Now I have ddic table Z2 where I want to input field-names. Therefor i have a field FIELDNAMES in this table. For this field I want as value-help the names of fields A, B and C of structure Z1. Is this possible?

Regards

Michael

7 REPLIES 7
Read only

pokrakam
Active Contributor
2,081

I am not aware of any standard feature to enable this, but should be easy enough to create by reading the fields with cl_abap_structdef and building your selections from that.

Read only

0 Likes
2,081

Yes, I know that too. But I need the value help in the ddic field when user inputs fieldnames with SM30 and not in some report.

Regards
Michael

Read only

pokrakam
Active Contributor
0 Likes
2,081

Ah, ok. I interpreted 'value help' as the one you define in a report, as opposed to a search help.

You can create your own Z search help. I would go this way and attach it to a custom data element based on the fieldname domain.

Read only

bertrand_delvallee
Active Participant
0 Likes
2,081

Hello,

- Copy function module F4IF_SHLP_EXIT_EXAMPLE in a new function module ZF4_Z1_FIELDNAMES

- Create a new domain Z1_FIELDNAMES (same as FIELDNAMES) with ZF4_Z1_FIELDNAMES as exit search-help.

- Create a new data element in SE11 Z1_FIELDNAMES with domain Z1_FIELDNAMES

- Customize output RECORD_TAB from FM ZF4_Z1_FIELDNAMES at will.

Something like :

IF callcontrol-step = 'DISP'.

DATA: lo_struct_descr   TYPE REF TO cl_abap_structdescr,
      lt_struct_fields  TYPE cl_abap_structdescr=>component_table.
FIELD-SYMBOLS <struct_fields> TYPE any.


lo_struct_descr ?= cl_abap_typedescr=>describe_by_name( 'Z1' ).
lt_struct_fields = lo_struct_descr->get_components( ).


LOOP AT lt_struct_fields ASSIGNING <struct_fields>.
* Append <struct_fields>-NAME to record_tab
ENDLOOP.

ENDIF.

Best regards,

Bertrand

Read only

0 Likes
2,081

That sounds good but I have some problems with the search help. When I only enter the exit in the data element, I get some errors while activating because it says parameters of search help are missing. But how can I use them? I do not have any fields or any database table where I can refer on some parameter fields. Therefor I use the exit I thought?

Read only

0 Likes
2,081

In your custom search help with ZF4_Z1_FIELDNAMES as exit you just have to have 1 parameter : FIELDNAME as export of type Z1_FIELDNAMES (positions 1).

Read only

0 Likes
2,081

Ok, worked for me. Thanks a lot until here. Now I have two detail questions.

1) How exact is the name of the export parameter? In my table where I use my search help I have three fields which all should use the same search help. But of course I can use only one field name as export parameter. I took the first field for example. As far as I can see it now it works for the other fields as well but is it also technically correct?

2) My goal was to avoid invalid entries. As far as I can see I now only have the search help but no value-check like in foreign keys. How can I achieve this? Also in the function to popup some custom message?