10-18-2005 9:13 AM
Hi,
I have 2 fields in Ztable.I also created function group, table maintenance generated.
The functionality i need is Pulldown for Key fields.
Where i need to code for this.
Thanks.
10-18-2005 9:22 AM
Hi,
You have to code in PBO of the Generated program.
Try the sample code[for getting list box] for the corresponding field in PBO and kindly reward points if it helps you.
report z.
type-pools: vrm.
data: it_val type vrm_values,
w_line like line of it_val.
parameters p_bukrs like t001-bukrs as listbox
visible length 25 obligatory.
initialization.
select bukrs butxt from t001 into (w_line-key, w_line-text).
append w_line to it_val.
check p_bukrs is initial.
p_bukrs = w_line-key.
endselect.
at selection-screen output.
call function 'VRM_SET_VALUES'
exporting
id = 'P_BUKRS'
values = it_val.
end-of-selection.
write: / 'Company Code:', p_bukrs.
10-18-2005 10:38 AM
Hi,
I also did the same code as you did.
But little change.That PARAMATERS is not accepting.
It is giving error.
I did some changes while seeing your code.
Help me in this .
Thanks.
10-18-2005 10:46 AM
You should change the attribute of key fields in the screen generated by table maintenance to show a list box.
In the PBO insert a module like this:
MODULE LIST_BOX.
refrsh it_val.
select * from table into (w_line-key, w_line-text).
append w_line to it_val.
endselect.
call function 'VRM_SET_VALUES'
exporting
id = FIELDNAME (here insert the name of i/o field
values = it_val.
ENDMODULE.
Max
Message was edited by: max bianchi
10-18-2005 11:06 AM
Hi,
See my code.....
******************
TYPE-POOLS VRM .
DATA:
p_provider type vrm_id,
pk_lst TYPE vrm_values,
pk_lstln LIKE LINE OF pk_lst.
data: begin of itab occurs 0,
provider like zfdmr_provider-provider,
provnm like zfdmr_provider-provnm,
end of itab.
select provider provnm from zfdmr_provider
into table itab.
p_provider = 'ZFDMR_PROVIDER-PROVIDER'.
loop at itab.
pk_lstln-key = itab-provider.
pk_lstln-text = itab-provider.
append pk_lstln to pk_lst.
clear pk_lstln.
endloop.
call function 'VRM_SET_VALUES'
exporting
id = p_provider
values = pk_lst.
*******************************
I did all this code in PBO of Generated program.
But the pulldown/Listbox box is not comming.
Any suggestions are welcome.
Thanks....
Message was edited by: Deepak333 k
Message was edited by: Deepak333 k
10-18-2005 11:12 AM
Hi Deepak,
You have to write all this in Screen PAI ( Flow logic )-
PROCESS ON VALUE-REQUEST.
FIELD P_PROVIDER MODULE F4_HELP.
Then you code will go in program in MODULE F4_HELP.
Cheers.
10-18-2005 11:24 AM
Hi Sanjay,
I am not looking for F4 help.
I am looking for PULLDOWN BOX.
If have any suggestion in this please....
Thanks.
10-18-2005 11:27 AM
Hi Deepak ,
For pull down also this will work .
Only in screen painter you have to mark the Dropdown field as List Box ( in the Text I/O templates tab of screen attributes of elements ).
Pull down is similar to F4 help and you have to code in
PROCESS ON VALUE-REQUEST.
Cheers.
10-18-2005 11:32 AM
DEEPAK, I THINK MAX HAS GVEN THE ANSWER.
first declare a data field as(may be inside the internal table you declared)
data: fieldname LIKE dd03l-fieldname in top include.
this is the field to show the key field.
activate your code.
You just go to screen layout(graphical mode). import this field by (from dictnary option).now in the attribute set it as listbox.thats it.
now in pbo write module as populate_keyfield_list.
inside this modulle populate the list box with the name of key fields , using call function 'VRM_SET_VALUES'
.
now use the code max has given
10-18-2005 12:13 PM
Hi,
Here I am getting LISTBOX, but I am not getting values in it.
****************************
TYPE-POOLS VRM .
DATA:
p_provider type vrm_id,
pk_lst TYPE vrm_values,
pk_lstln LIKE LINE OF pk_lst.
data: begin of itab occurs 0,
provider like zfdmr_provider-provider,
provnm like zfdmr_provider-provnm,
end of itab.
select provider provnm from zfdmr_provider into
(pk_lstln-key, pk_lstln-text ).
append pk_lstln to pk_lst.
p_provider = pk_lstln-key.
endselect.
call function 'VRM_SET_VALUES'
exporting
id = p_provider
values = pk_lst.
******************************
Please help in this.
I am not getting values in this.
I tried this code in PBO and in PAI.
Thanks.
10-18-2005 12:46 PM
What is your screen field on which you want dropdown. You have to pass this name to P_PROVIDER before calling the FM 'VRM_SET_VALUES'.
P_PROVIDER = '<SCREENFIELDNAME>'.
Also put a breakpoint on FM 'VRM_SET_VALUES' and see if you have values in internal table pk_lst.
Cheers.
10-18-2005 12:56 PM
Hi
data: begin of itab occurs 0,
provider like zfdmr_provider-provider,
provnm like zfdmr_provider-provnm,
end of itab.
select provider provnm from zfdmr_provider into
(pk_lstln-key, pk_lstln-text ).
append pk_lstln to pk_lst.
*----> ERROR-->p_provider = pk_lstln-key.
endselect.
p_provider = FIELD NAME OF THE FIELD OF THE DYNPRO
call function 'VRM_SET_VALUES'
exporting
id = p_provider
values = pk_lst.
See my example (it works fine):
REFRESH LIST.
Insert the field name
NAME = 'ZFAGSA01-FL_CH_GLOB'.
Fill the key table
PERFORM LOAD_DOMAIN_DATA USING CA_DOMAIN_9.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST.
But in my dynpro (by screen painter) I active the attribute to dysplay the field (ZFAGSA01-FL_CH_GLOB) as list box.
Max