Skip to Content
H S

Why I am getting this error while working with Table Control on a screen?

I have made a screen with Table Control. When I try to activate, it is giving me an error. Kindly advise.

*&---------------------------------------------------------------------*
*& Module Pool       ZABAP_PRACTICE2_MODULE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

PROGRAM zabap_practice2_module.

TABLES ZABAP_MAKT.

DATA : v_matnr TYPE matnr,
       v_spras TYPE spras,
       v_maktx TYPE maktx.

DATA ok_code TYPE sy-ucomm.

CONTROLS : TBCONTROL TYPE TABLEVIEW USING SCREEN 101.
*&---------------------------------------------------------------------*
*&      Module  GET_MAKTX  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*

MODULE user_command_0101 INPUT.

ENDMODULE.                 " USER_COMMAND_0101  INPUT

MODULE get_maktx INPUT.
  CASE ok_code.
    WHEN 'SUBMIT'.
      CLEAR ok_code.
      SELECT SINGLE maktx FROM makt INTO v_maktx WHERE matnr EQ v_matnr AND spras EQ 'E'.
  ENDCASE.
ENDMODULE.





*&---------------------------------------------------------------------*
*&      Module  STATUS_0101  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0101 OUTPUT.

  SET PF-STATUS 'GUI100'.
  SET TITLEBAR 'TITLE'.


  DATA : lv_values TYPE vrm_values,
         lv_value LIKE LINE OF lv_values.

  IF lv_values IS INITIAL.

    lv_value-key = '100-100'.
    lv_value-text = 'Pen'.
    APPEND lv_value TO lv_values.

    lv_value-key = '100200hgfdjfgfdhjkl'.
    lv_value-text = 'Pencil'.
    APPEND lv_value TO lv_values.

    lv_value-key = '100-600'.
    lv_value-text = 'Rubber'.
    APPEND lv_value TO lv_values.

ENDIF.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = 'v_matnr'
      values          = lv_values
    EXCEPTIONS
      id_illegal_name = 1
      OTHERS          = 2.


  IF sy-subrc <> 0.
* Implement suitable error handling here
  ENDIF.



ENDMODULE.                 " STATUS_0101  OUTPUT
   " GET_MAKTX  INPUT
*&---------------------------------------------------------------------*
*&      Module  PBO  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE pbo OUTPUT.
ZABAP_MAKT-MATNR = '100-100'.
ZABAP_MAKT-SPRAS = 'EN'.
ZABAP_MAKT-MAKTX = 'Pencil'.
ENDMODULE.                 " PBO  OUTPUT

Here are the screenshots

11.jpg (43.4 kB)
12.jpg (344.1 kB)
Add a comment
10|10000 characters needed characters exceeded

  • See the differences with the Element List of the standard dynpro DEMO_DYNPRO_TABCONT_LOOP_AT 0100:

    Name                Type   Line  Column  DefLg  VisLg  Height
    FLIGHTS             Table  1     1       54     54     13
    TITEL               Text   1     0       9      53     1
    DEMO_CONN-CARRID    Text   1     1       2      3      1
    DEMO_CONN-CONNID    Text   1     2       9      4      1
    DEMO_CONN-CITYFROM  Text   1     3       11     20     1
    DEMO_CONN-CITYTO    Text   1     4       17     20     1
    DEMO_CONN-MARK      Check  1     0       1      1      1
    DEMO_CONN-CARRID    I/O    1     1       3      3      1
    DEMO_CONN-CONNID    I/O    1     2       4      4      1
    DEMO_CONN-CITYFROM  I/O    1     3       20     20     1
    DEMO_CONN-CITYTO    I/O    1     4       20     20     1
    OK_CODE             OK     0     0       20     20     1
  • MAKT-MANTR, MAKT-SPRAS, MAKT-MAKTX are part of the table control (column headings + I/O fields), so I don't understand why you have them above the table control, mixed with other screen fields. Maybe it's what the error message says.

Assigned Tags

Related questions

2 Answers

  • Posted on Aug 04, 2020 at 12:25 PM

    Hello H S,

    The THREAD deals with similar issue, this should help. If still not resolved please paste the layout of the screen

    Another correction:

    Kindly Use Capital letter in the below Code:

      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = 'v_matnr'    ---> It Must be 'V_MATNR'
          values          = lv_values
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.

    Regards!

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 07, 2020 at 04:20 AM

    Dear Satish Kumar Balasubramanian Sir,

    I am unable to understand why my Listbox1 start to show those MATNRs as a new listbox items which MATNRs are not available in MAKT table (As i case of Pencil above)?

    Kindly advise why this is behaving like that.

    With Regards

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.