Application Development and Automation 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: 
Read only

AT selection screen on value request

ifat_bar
Participant
0 Likes
537

Hello,

On selection screen I have to create F4 selection.

I used the following code:

SELECT *

FROM ekbe

INTO CORRESPONDING FIELDS OF TABLE ekbe_lt

WHERE ebeln = p_ebeln AND

bewtp = 'D' AND

vgabe = '9'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'SO_LBLNI-LOW'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

value_org = 'C'

  • multiple_choice = 'X'

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

value_tab = ekbe_lt

  • FIELD_TAB =

return_tab = lt_return

  • DYNPFLD_MAPPING =

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3

.

I want to show the ekbe_lt table in the F4 window in ALV format, and then after clicking on a row,

return the belnr value to field 'SO_LBLNI-LOW'.

The problem is that i get no values found, eventhough ekbe_lt has lines.

Also it is important that the list will be in ALV format.

Thanks

Yifat

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
487


      t_dynpfields-fieldname  = 'P_EBELN'.
      append t_dynpfields.
      w_repid = sy-repid.


"call the below function module befre your code
  call function 'DYNP_VALUES_READ'
       exporting
            dyname     = w_repid
            dynumb     = sy-dynnr
       tables
            dynpfields = t_dynpfields
       exceptions
            others.
  clear : w_dynprofld.
  read table t_dynpfields index 1.
  p_ebeln  = t_dynpfields-fieldvalue.

SELECT *
    FROM ekbe
     INTO CORRESPONDING FIELDS OF TABLE ekbe_lt
     WHERE ebeln = p_ebeln AND
           bewtp = 'D' AND
           vgabe = '9'.
 
 CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
     EXPORTING
*       DDIC_STRUCTURE         = ' '
       retfield               = 'SO_LBLNI-LOW'
 *       PVALKEY                = ' '
 *       DYNPPROG               = ' '
 *       DYNPNR                 = ' '
 *       DYNPROFIELD            = ' '
 *       STEPL                  = 0
 *       WINDOW_TITLE           =
 *       VALUE                  = ' '
        value_org              = 'C'
 *       multiple_choice        = 'X'
 *       DISPLAY                = ' '
 *       CALLBACK_PROGRAM       = ' '
 *       CALLBACK_FORM          = ' '
 *       MARK_TAB               =
 *     IMPORTING
 *       USER_RESET             =
     TABLES
       value_tab              = ekbe_lt
 *       FIELD_TAB              =
        return_tab             = lt_return
 *       DYNPFLD_MAPPING        =
     EXCEPTIONS
        parameter_error        = 1
        no_values_found        = 2
        OTHERS                 = 3
             .
 
 

Prabhudas

2 REPLIES 2
Read only

Former Member
0 Likes
488


      t_dynpfields-fieldname  = 'P_EBELN'.
      append t_dynpfields.
      w_repid = sy-repid.


"call the below function module befre your code
  call function 'DYNP_VALUES_READ'
       exporting
            dyname     = w_repid
            dynumb     = sy-dynnr
       tables
            dynpfields = t_dynpfields
       exceptions
            others.
  clear : w_dynprofld.
  read table t_dynpfields index 1.
  p_ebeln  = t_dynpfields-fieldvalue.

SELECT *
    FROM ekbe
     INTO CORRESPONDING FIELDS OF TABLE ekbe_lt
     WHERE ebeln = p_ebeln AND
           bewtp = 'D' AND
           vgabe = '9'.
 
 CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
     EXPORTING
*       DDIC_STRUCTURE         = ' '
       retfield               = 'SO_LBLNI-LOW'
 *       PVALKEY                = ' '
 *       DYNPPROG               = ' '
 *       DYNPNR                 = ' '
 *       DYNPROFIELD            = ' '
 *       STEPL                  = 0
 *       WINDOW_TITLE           =
 *       VALUE                  = ' '
        value_org              = 'C'
 *       multiple_choice        = 'X'
 *       DISPLAY                = ' '
 *       CALLBACK_PROGRAM       = ' '
 *       CALLBACK_FORM          = ' '
 *       MARK_TAB               =
 *     IMPORTING
 *       USER_RESET             =
     TABLES
       value_tab              = ekbe_lt
 *       FIELD_TAB              =
        return_tab             = lt_return
 *       DYNPFLD_MAPPING        =
     EXCEPTIONS
        parameter_error        = 1
        no_values_found        = 2
        OTHERS                 = 3
             .
 
 

Prabhudas

Read only

Former Member
0 Likes
487

Yifat,

on the event at selecton-screen on value request cannot read value from a screen field directly.

so you need dynpro value read FM as suggested above..