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: 

Populating values to screen field

Former Member
0 Kudos
423

Hi

I used the following code to populate the values to the screen field in a module pool, but the values are not displaying in the field

qpmk-version

qpmz-zaehler

DATA: BEGIN OF ty_qpmz OCCURS 0,

pmethode TYPE qpmethode,

werks TYPE werks_d,

version TYPE qversnrmk,

mkmnr TYPE qmerknr,

END OF ty_qpmz.

SELECT pmethode zaehler version mkmnr FROM qpmz INTO TABLE ty_qpmz WHERE pmethode = qmtb-pmtnr.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'QMTB-PMTNR'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'MKMNR'

value_org = 'S'

TABLES

value_tab = ty_qpmz

return_tab = return_tab

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc = 0.

version = ty_qpmz-version.

plant = ty_qpmz-werks.

qpmk-version = version.

qpmz-zaehler = plant.

MOVE version TO qpmk-version.

ENDIF.

please help to solve

1 ACCEPTED SOLUTION

former_member1245113
Active Contributor
0 Kudos
232

Hi Usman,

PARAMETERS : carrid TYPE spfli-carrid,
             connid TYPE spfli-connid,
             fldate TYPE sflight-fldate.
 
DATA : itab TYPE TABLE OF sflight WITH HEADER LINE.
DATA : fmap TYPE TABLE OF dselc WITH HEADER LINE.
 
 
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR carrid." If it is a selection Screen
else in PROCESS ON VALUE REQUEST
  SELECT * FROM sflight INTO TABLE itab. " Replace this select query with the above one
  SORT itab BY carrid connid fldate.
  DELETE ADJACENT DUPLICATES FROM itab
  COMPARING carrid connid fldate.
  fmap-fldname = 'CARRID'. " replace these by PLANT, VERSION and ZAEHLER in FMAP here
  fmap-dyfldname = 'CARRID'.
  APPEND fmap.
  fmap-fldname = 'CONNID'.
  fmap-dyfldname = 'CONNID'.
  APPEND fmap.
  fmap-fldname = 'FLDATE'.
  fmap-dyfldname = 'FLDATE'.
  APPEND fmap.
 
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
     ddic_structure         = 'SFLIGHT' " You can create your Own structure as declared above in Types declaration
      retfield               = 'CARIID' " Your Main Screen Field on which you are taking F4 help
*     PVALKEY                = ' '
     dynpprog               = sy-repid
     dynpnr                 = sy-dynnr
     DYNPROFIELD            = 'CARRID' " Your Main Screen Field on which you are taking F4 help
*     STEPL                  = 0
*     WINDOW_TITLE           =
*     VALUE                  = ' '
     value_org              = 'S'
*     MULTIPLE_CHOICE        = ' '
*     DISPLAY                = ' '
*     CALLBACK_PROGRAM       = ' '
*     CALLBACK_FORM          = ' '
*     MARK_TAB               =
*   IMPORTING
*     USER_RESET             =
    TABLES
      value_tab              = itab
*     FIELD_TAB              =
*     RETURN_TAB             =
     dynpfld_mapping        = fmap
*   EXCEPTIONS
*     PARAMETER_ERROR        = 1
*     NO_VALUES_FOUND        = 2
*     OTHERS                 = 3
            ." Just Execute this pilot program and verify
  IF sy-subrc  0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Cheerz

Ram

2 REPLIES 2

former_member1245113
Active Contributor
0 Kudos
233

Hi Usman,

PARAMETERS : carrid TYPE spfli-carrid,
             connid TYPE spfli-connid,
             fldate TYPE sflight-fldate.
 
DATA : itab TYPE TABLE OF sflight WITH HEADER LINE.
DATA : fmap TYPE TABLE OF dselc WITH HEADER LINE.
 
 
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR carrid." If it is a selection Screen
else in PROCESS ON VALUE REQUEST
  SELECT * FROM sflight INTO TABLE itab. " Replace this select query with the above one
  SORT itab BY carrid connid fldate.
  DELETE ADJACENT DUPLICATES FROM itab
  COMPARING carrid connid fldate.
  fmap-fldname = 'CARRID'. " replace these by PLANT, VERSION and ZAEHLER in FMAP here
  fmap-dyfldname = 'CARRID'.
  APPEND fmap.
  fmap-fldname = 'CONNID'.
  fmap-dyfldname = 'CONNID'.
  APPEND fmap.
  fmap-fldname = 'FLDATE'.
  fmap-dyfldname = 'FLDATE'.
  APPEND fmap.
 
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
     ddic_structure         = 'SFLIGHT' " You can create your Own structure as declared above in Types declaration
      retfield               = 'CARIID' " Your Main Screen Field on which you are taking F4 help
*     PVALKEY                = ' '
     dynpprog               = sy-repid
     dynpnr                 = sy-dynnr
     DYNPROFIELD            = 'CARRID' " Your Main Screen Field on which you are taking F4 help
*     STEPL                  = 0
*     WINDOW_TITLE           =
*     VALUE                  = ' '
     value_org              = 'S'
*     MULTIPLE_CHOICE        = ' '
*     DISPLAY                = ' '
*     CALLBACK_PROGRAM       = ' '
*     CALLBACK_FORM          = ' '
*     MARK_TAB               =
*   IMPORTING
*     USER_RESET             =
    TABLES
      value_tab              = itab
*     FIELD_TAB              =
*     RETURN_TAB             =
     dynpfld_mapping        = fmap
*   EXCEPTIONS
*     PARAMETER_ERROR        = 1
*     NO_VALUES_FOUND        = 2
*     OTHERS                 = 3
            ." Just Execute this pilot program and verify
  IF sy-subrc  0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Cheerz

Ram

Former Member
0 Kudos
232

Hi Nausal,

1. Check whether the field qmtb-pmtnr is having value before the

Select for your F4 internal table. If not you have read the

value of the field qmtb-pmtnr using the FM dynp_values_read.

2. If the above select works fine. No need to pass the values from

the table ty_qpmz to the fields version and plant. Instead use the

field mapping of the same F4 Fm that you are using.

3. Still problem persists use the FM dynp_values_update to update the

fields version and plant.

4. Modify the table control internal table inside the PAI loop.

Hope this will help you.

Regards,

Smart Varghese