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: 

RS_SELECTIONSCREEN_UPDATE field RSSELREAD-FIELDVALUE too short

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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

0 Kudos

Rich, just wanted to say thanks. That fixed the problem. Cheers,-tom

Former Member
0 Kudos

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.