on 11-03-2009 11:38 AM
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á
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I guess modfiyview gets triggered.......using that you can set the value..
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.