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: 

automatically populate other fields on screen while applying search help on

Former Member
0 Kudos

Hi,

There is some urgent requirement

I have one screen in which 3 fields are there

Functionality is like this when I apply search help for one field it will call a FM which populate a internal table in which value for all 3 fields will be there and it should be populated in all 3 fields.

I am assigning proper value to all 3 fields in POV event but only one feild is getting populated on which I am applying search help.

Anybody can sort this out.

will be thankful to U.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi..,

just copy, paste and execute this code..

Check this code..will be helpful for u..

tables:mara,makt,mseg.

parameters: p_bukrs type t001-bukrs,

p_butxt type t001-butxt,

p_ort01 type t001-ort01,

p_land1 type t001-land1.

data: dynfields type table of dynpread with header line.

data: return type table of ddshretval with header line.

at selection-screen on value-request for p_bukrs.

call function 'F4IF_FIELD_VALUE_REQUEST'

exporting

tabname = 'T001'

fieldname = 'BUKRS'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'P_BUKRS'

tables

return_tab = return

exceptions

field_not_found = 1

no_help_for_field = 2

inconsistent_help = 3

no_values_found = 4

others = 5.

refresh dynfields.

read table return with key fieldname = 'P_BUKRS'.

  • Add it back to the dynpro.

dynfields-fieldname = return-retfield.

dynfields-fieldvalue = return-fieldval.

append dynfields.

  • Get the company code from db and add to dynpro

data: xt001 type t001.

clear xt001.

select single * into xt001

from t001

where bukrs = return-fieldval.

dynfields-fieldname = 'P_BUTXT'.

dynfields-fieldvalue = xt001-butxt.

append dynfields.

dynfields-fieldname = 'P_ORT01'.

dynfields-fieldvalue = xt001-ort01.

append dynfields.

dynfields-fieldname = 'P_LAND1'.

dynfields-fieldvalue = xt001-land1.

append dynfields.

  • Update the dynpro values.

call function 'DYNP_VALUES_UPDATE'

exporting

dyname = sy-cprog

dynumb = sy-dynnr

tables

dynpfields = dynfields

exceptions

others = 8.

<b>

plz do remember to close your thread, when ur problem is solvedd !! reward all helpful answers !!

regards,

sai ramesh</b>

2 REPLIES 2

former_member181962
Active Contributor
0 Kudos

YOu have to use the FM DYNP_VALUES_UPDATE to update the other fields on the screen.

It is documented with an example as well.

Regards,

Ravi

Former Member
0 Kudos

Hi..,

just copy, paste and execute this code..

Check this code..will be helpful for u..

tables:mara,makt,mseg.

parameters: p_bukrs type t001-bukrs,

p_butxt type t001-butxt,

p_ort01 type t001-ort01,

p_land1 type t001-land1.

data: dynfields type table of dynpread with header line.

data: return type table of ddshretval with header line.

at selection-screen on value-request for p_bukrs.

call function 'F4IF_FIELD_VALUE_REQUEST'

exporting

tabname = 'T001'

fieldname = 'BUKRS'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'P_BUKRS'

tables

return_tab = return

exceptions

field_not_found = 1

no_help_for_field = 2

inconsistent_help = 3

no_values_found = 4

others = 5.

refresh dynfields.

read table return with key fieldname = 'P_BUKRS'.

  • Add it back to the dynpro.

dynfields-fieldname = return-retfield.

dynfields-fieldvalue = return-fieldval.

append dynfields.

  • Get the company code from db and add to dynpro

data: xt001 type t001.

clear xt001.

select single * into xt001

from t001

where bukrs = return-fieldval.

dynfields-fieldname = 'P_BUTXT'.

dynfields-fieldvalue = xt001-butxt.

append dynfields.

dynfields-fieldname = 'P_ORT01'.

dynfields-fieldvalue = xt001-ort01.

append dynfields.

dynfields-fieldname = 'P_LAND1'.

dynfields-fieldvalue = xt001-land1.

append dynfields.

  • Update the dynpro values.

call function 'DYNP_VALUES_UPDATE'

exporting

dyname = sy-cprog

dynumb = sy-dynnr

tables

dynpfields = dynfields

exceptions

others = 8.

<b>

plz do remember to close your thread, when ur problem is solvedd !! reward all helpful answers !!

regards,

sai ramesh</b>