Application Development 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: 

Table Maintenance Pulldown For KEY fields....

Former Member
0 Kudos

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.

11 REPLIES 11

jayanthi_jayaraman
Active Contributor
0 Kudos

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.

0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

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.

0 Kudos

Hi Sanjay,

I am not looking for F4 help.

I am looking for PULLDOWN BOX.

If have any suggestion in this please....

Thanks.

0 Kudos

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.

0 Kudos

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

0 Kudos

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.

0 Kudos

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.

0 Kudos

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