F4 dinámico para cualquier campo

Si queremos crear una ayuda (F4) para cualquier campo, basta con utilizar el siguiente código:

DATA: carrid TYPE spfli-carrid,
      hlp    TYPE string,
      struc  TYPE dfies-tabname,
      comp   TYPE dfies-fieldname.

DESCRIBE FIELD carrid HELP-ID hlp.

SPLIT hlp AT '-' INTO struc comp.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
  EXPORTING
    tabname           = struc
    fieldname         = comp
  EXCEPTIONS
    field_not_found   = 1
    no_help_for_field = 2
    inconsistent_help = 3
    no_values_found   = 4
    OTHERS            = 5.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: