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

Creating two screen fields with a LIKE reference

Former Member
0 Likes
1,805

Hello,

I have created a custom screen in SE51 (Screen painter) with two input fields. I want both these two fields to be of the same type, with a like reference to a field in a custom table. This is required so that the search help for the custom table field can be used for both fields on the screen.

At the attributes for the field in screen painter, on tab Dict, there is a checkbox "From dict.". Checking this gives me the result I require. However the field has to be named according to the table field, i.e. screen field name has to be ZMYTABLE-FIELD1. This works fine for one field. But I need this for both fields. The system won't allow me to name the second field with the same name, so I can't access my search help from the second field. Incidentally, the "Ref. field" box is also grayed out, so I cant define anything there. How can I accomplish this? Help is appreciated. Thanks.

Regards

1 ACCEPTED SOLUTION
Read only

former_member787646
Contributor
0 Likes
1,230

Hi,

Try the following..

Declare the 2 fields in the Main Program itself referring to the

Dictionary field. Save the program and in the Screen Painter

Choose the fields by selecting the PROGRAM instead of

selecting DICTIONARY reference...

Hope it helps you.

Murthy

5 REPLIES 5
Read only

former_member787646
Contributor
0 Likes
1,231

Hi,

Try the following..

Declare the 2 fields in the Main Program itself referring to the

Dictionary field. Save the program and in the Screen Painter

Choose the fields by selecting the PROGRAM instead of

selecting DICTIONARY reference...

Hope it helps you.

Murthy

Read only

0 Likes
1,230

Hi Murthy,

I tried declaring the fields in the program using:

DATA: FIELD1 LIKE ZMYTAB-FIELD1,

FIELD2 LIKE ZMYTAB-FIELD1.

In the screen painter I created a textbox, went to the 'Attributes' windows and named the fields as FIELD1 and FIELD2. Under tab 'Program' there is no option for verifying or assigning fields. I ran the screen after doing this but got two text boxes with default attributes, not picking up search help or anything. Am I doing something wrong? Suggestions appreciated.

Regards

Read only

Former Member
0 Likes
1,230

Hi Khan,

You create a search help for the field and assign it in the search help in attributes of the text field.. Use the same name for both the fields

this should help you

regards

padma

Read only

0 Likes
1,230

Thats the entire problem. The screen painter won't let me create two fields with the same name. Suggestions welcome.

Regards

Read only

0 Likes
1,230

Hi Khan,

You can do one thing.....

use one Data dictionary element and the other variable declared in program of type data dictionary variable

or else

Declare two different variables with same search help name so that you get the same f4 help for both

this should help you.

regards

padma