Skip to Content
0

Drop down box not populating values in internal table of table control in mpp

Nov 27, 2017 at 04:09 AM

54

avatar image
Former Member

Hi,

My Drop down box not populating values in Internal table after executing the given records in table control as when I enter values in Module Pool Program.

Screen Shot of Debugger where values are not populating in Internal Table :-

Data is fetched in Drop down but when i try to save data it is not populating in Internal Table.

As you can check after clicking on save button data is not populating in internal table in fields

SHIFT and LINE.

Please check my piece of code.

process before output.
  module validate.
*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TBC_1001'
  module tbc_1001_change_tc_attr.
*&SPWIZARD: MODULE TBC_1001_CHANGE_COL_ATTR.
  loop at   it_zpp_rtpm_target
       into wa_zpp_rtpm_target
       with control tbc_1001
       cursor tbc_1001-current_line.
    module tbc_1001_get_lines.
    module TC__shift_CHANGE_FIELD_ATTR.   # Populating the data module
    module TC__line_CHANGE_FIELD_ATTR.    # Populating the data module
*&SPWIZARD:   MODULE TBC_1001_CHANGE_FIELD_ATTR
  endloop.
  module status_0200.
process after input.
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TBC_1001'
  loop at it_zpp_rtpm_target.
    chain.
      field wa_zpp_rtpm_target-rt_date.
      field wa_zpp_rtpm_target-shift.
      field wa_zpp_rtpm_target-line.
      field wa_zpp_rtpm_target-target.
      field wa_zpp_rtpm_target-last_balance.
      field wa_zpp_rtpm_target-curr_balance.
      module tbc_1001_modify on chain-request.
    endchain.
  endloop.
  module tbc_1001_user_command.
*&SPWIZARD: MODULE TBC_1001_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TBC_1001_CHANGE_COL_ATTR.
      module user_command_0200.

Module where i wrote and use FM

*&---------------------------------------------------------------------*
*&      Module  TC__SHIFT_CHANGE_FIELD_ATTR  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE TC__SHIFT_CHANGE_FIELD_ATTR OUTPUT.
  data values_S type vrm_values with header line.
  data: begin of lt_selected occurs 0.
       include structure ddshretval.
   data: end of lt_selected.
      IF values_S[] IS INITIAL.
        values_s-text = 'I'.
        values_s-key = 1.
        append values_s.

        values_s-text = 'II'.
        values_S-key = 2.
        append values_S.

        values_s-text = 'III'.
        values_s-key = 3.
        append values_S.
      ENDIF.

   call function 'VRM_SET_VALUES'
         exporting
              id              = 'WA_ZPP_RTPM_TARGET-SHIFT'
              values          = values_S[]
         exceptions
              id_illegal_name = 1
              others          = 2.
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.

  CLEAR: gwa_values, gt_values, gv_selected_value.
  REFRESH gt_values.
  gwa_values-fieldname = 'WA_ZPP_RTPM_TARGET-SHIFT'.
  APPEND gwa_values TO gt_values.

    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname     = sy-cprog "Current program
      dynumb     = sy-dynnr "Current screen
    TABLES
      dynpfields = gt_values "Relevant screen fields
    EXCEPTIONS
      OTHERS     = 0.
ENDMODULE.                 " TC__SHIFT_CHANGE_FIELD_ATTR  OUTPUT
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sandra Rossi Dec 16, 2017 at 02:19 PM
0

The code seems ok for the "SHIFT" field. A prerequisite is to define the screen field as type "dropdown". Did you do it?

Share
10 |10000 characters needed characters left characters exceeded
Iftah Peretz
Dec 16, 2017 at 12:43 PM
0

Hi,

See here .

Share
10 |10000 characters needed characters left characters exceeded