avatar image
Former Member

I cannot display the contents of my internal table to my table control. please help

I have received this error:

The database field or the result type of the aggregate function BOM~QUA and the component "MNUM" of "IT_BOM" are not compatible.

Below are parts of my code. Please help

*include
TYPES: BEGIN OF BOM_STRUC,
    MANDT(3) TYPE c,
    PNUM TYPE Z032_ITEM_DATATYPE,
    MNUM TYPE Z032_ITEM_DATATYPE,
    MNAME TYPE Z032_INAM_DATATYPE,
    BQUA TYPE INT4,
    PRUNIT(4) TYPE c,
    END OF BOM_STRUC.
    data: it_BOM TYPE TABLE OF BOM_STRUC,
          wa_BOM TYPE BOM_STRUC.

*Flow Logic
PROCESS BEFORE OUTPUT.

*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'BOM_TABLE'

  MODULE BOM_TABLE_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE BOM_TABLE_CHANGE_COL_ATTR.

  LOOP AT   IT_BOM

       INTO WA_BOM

       WITH CONTROL BOM_TABLE

       CURSOR BOM_TABLE-CURRENT_LINE.

    MODULE BOM_TABLE_GET_LINES.

*&SPWIZARD:   MODULE BOM_TABLE_CHANGE_FIELD_ATTR

  ENDLOOP.

MODULE USER_COMMAND_3031.

 MODULE STATUS_3031.

*
PROCESS AFTER INPUT.

*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'BOM_TABLE'

  LOOP AT IT_BOM.

    CHAIN.

      FIELD WA_BOM-MNUM.

      FIELD WA_BOM-MNAME.

      FIELD WA_BOM-BQUA.

      FIELD WA_BOM-PRUNIT.

    endchain.

  ENDLOOP.

  MODULE BOM_TABLE_USER_COMMAND.

*&SPWIZARD: MODULE BOM_TABLE_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE BOM_TABLE_CHANGE_COL_ATTR.


 MODULE USER_COMMAND_3031.

PROCESS ON VALUE-REQUEST.

   FIELD MAT_NUM MODULE BOX_3031.


*Main Program
MODULE USER_COMMAND_3031 INPUT.
 CASE sy-ucomm.
    WHEN 'BACK'.
      LEAVE TO SCREEN '303'.


    WHEN 'EXIT' or 'CANCEL'.
      LEAVE PROGRAM.
    WHEN 'SAVE'.


    WHEN 'ADD'.
      REFRESH it_BOM.
      clear wa_bom.
      wa_bom1-PNUM = ITEM_NUM.
      wa_bom1-MNUM = MAT_NUM.
      wa_bom1-BQUA = BQUA.
      INSERT INTO Z032_BOM_DB VALUES wa_bom1.


SELECT BOM~PNUM  BOM~MNUM BOM~BQUA ITEM~INAME  ITEM~PRUNIT INTO TABLE it_bom FROM Z032_BOM_DB AS BOM
    INNER JOIN Z032_ITEM_DB AS ITEM ON BOM~PNUM = ITEM~INUM WHERE PNUM EQ ITEM_NUM.


  ENDCASE.


  ENDMODULE.


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers

Skip to Content