08-04-2005 4:43 PM
I'm using RS_SELECTIONSCREEN_UPDATE to refresh the selection screen after an "ON F4" event but some of the fields on the screen are getting truncated because the field RSSELREAD-FIELDVALUE is only 45 char long.
Does anybody know of an alternate way of refreshing the selection screen after an F4?
Thanks,-tom
08-04-2005 4:48 PM
Check this sample.
report zrich_0002 .
parameters: p_bukrs(4) type c,
p_butxt(50) type c.
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.
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
dynfields-fieldname = 'P_BUTXT'.
select single butxt into dynfields-fieldvalue
from t001
where bukrs = return-fieldval.
append dynfields.
* Update the dynpro values.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = dynfields
exceptions
others = 8.
start-of-selection.
Regards,
Rich Heilman
08-04-2005 4:48 PM
Check this sample.
report zrich_0002 .
parameters: p_bukrs(4) type c,
p_butxt(50) type c.
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.
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
dynfields-fieldname = 'P_BUTXT'.
select single butxt into dynfields-fieldvalue
from t001
where bukrs = return-fieldval.
append dynfields.
* Update the dynpro values.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = dynfields
exceptions
others = 8.
start-of-selection.
Regards,
Rich Heilman
10-06-2005 3:58 PM
Rich, just wanted to say thanks. That fixed the problem. Cheers,-tom
08-04-2005 5:13 PM
Hello Tom,
I do not quite get why you want to refresh the screen after F4. When you hit the F4 button the event AT SELECTION-SCREEN on VALUE REQUEST will get triggerred. And inside that event you can write the code necessary to fetch the appropriate value for the screen field.
Are you already doing this ? If yes, is there something that's going wrong ?
Regards,
Anand Mandalika.