cancel
Showing results for 
Search instead for 
Did you mean: 

F4 help issue

Former Member
0 Kudos

Hi!

I'm using an UI table, which has 2 columns, NAME and PERNR. They have the data elements ZZNAME and ZZPERNR, and in these data elements I bound the serch help (ZPERNRSHLP).

I would like to solve the following problem: if I choose the serch help for the PERNR column in the UI table, and I choose one entry from the search help, I would like to fill automatically the NAME column in the UI table also, based on the chosen search help entry.

How can I do this?

Thank you

Tamá

Accepted Solutions (1)

Accepted Solutions (1)

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

In the modifiy view write the code as belowu2026

When u to select PERNR from the F4 help.

Get the value using of the field bound toPERNR.

lo_el_resume_info->get_attribute(

EXPORTING

name = `PERNR`

IMPORTING

value = lv_PERNR).

SELECT NAME FROM THE TABLE(UR TABLE WHERE PERNRN AND CORRESPONDING NAME IS STORED) INTO LS_TABLE WHERE PERNR = LV_PERNR.

Move ls_table-name to lv_name

lo_el_resume_info->Set_attribute(

EXPORTING

name = `NAME`

value = Lv_name ).

Regards,

Priya

Answers (3)

Answers (3)

RalfRuth
Employee
Employee
0 Kudos

Hi Tamás,

You could also have this functionality without implementing any line of code by simply using the features of the ABAP Dictionary!

This is how it works:

1. You've already defined a searchhelp (ZPERNRSHLP) in the ABAP dictionary. Make sure that both parameters (NAME and PERNR) are exporting parameters too.

2. Define a structure ("ZMYSTRUCTURE") in the ABAP Dictionary (SE11) with fields NAME and PERNR (use your data elements ZZNAME and ZZPERNR)

3. Attach your searchhelp ZPERNRSHLP explicitely to the field PERNR: A popup will be opened to define the mapping of the shlp-parameters to the fields of the structure. Make sure that SHLP-parameter NAME is mapped to field NAME and SHLP-parameter PERNR is mapped to field PERNR.

4. In your Web Dynpro Component, make sure that the property "dictionary structure" of your Context node contains the value "ZMYSTRUCTURE". Add attributes from the structure.

5. Bind the property "value" of your input fields to these attributes.

That's it!

As an example, you could have a look at transp. table SCUSTOM: For field ID there's an explicit searchhelp attached (SCUSTOM)

Why does it work? Because the Web Dynpro runtime evaluates the parameter mapping of searchelps defined for structures of the ABAP Dictionary: PERNR and NAME are defined as exporting parameters of the searchhelp, so both context attributes will be filled.

Greetings,

Ralf

Former Member
0 Kudos

Hi, Ralf,

I did exactly what you itemized on your steps using the ddic structure and search help. I'm using the structure in an ALV grid. I've one field from which I choose a value from the search help and two other fields get populated automatically from the selected record. However, this is working only the first time the search help is called. The next time I select the same value, the two other fields do not get populated anymore.

What am I missing or did I something wrong?

Thanks,

Reyleene

Former Member
0 Kudos

Hi, Ralf,

I did exactly what you itemized on your steps using the ddic structure and search help. I'm using the structure in an ALV grid. I've one field from which I choose a value from the search help and two other fields get populated automatically from the selected record. However, this is working only the first time the search help is called. The next time I select the same value, the two other fields do not get populated anymore.

What am I missing or did I something wrong?

Thanks,

Reyleene

Former Member
0 Kudos

hi,

Which Serach help you are using ?

If this OVS , then in the last phase of OVS, you can bind both Pernr and Name to the Table Columns.

If you are using Dictionary Search help , then there are two possibilites where you could code for this :

1. Have a button 'Check'. after you are done with populating values for ONe column , clikc on Check button to populate values for second column also based on value entered in first column.

Code in OnAction of Button to put values in other column.

2. If you dont want to have a button, WdDomodify gets triggered aftere you have selected one value. Now here also you can write the code to populate second value.

Former Member
0 Kudos

Hi,

I guess modfiyview gets triggered.......using that you can set the value..

Regards,

Lekha.