Skip to Content
-1

meaning of this error message and how to rectify.

select-options: reservno for RESB-rsnum.

START-OF-SELECTION.

select rsnum matnr bdmng meins enmng bdter from resb into table itab1 where rsnum in reservno.
if itab1[] is not initial.
select matnr maktg from makt into table itab2 for all entries in itab1 where matnr = itab1-matnr.
loop at itab1 into wa_itab1.
read table itab2 into wa_itab2 with key matnr = wa_itab1-matnr.
if sy-subrc eq 0.
wa_itab1-maktg = wa_itab2-maktg.
Modify itab1 from wa_itab1 transporting maktg.
endif.
endloop.
endif.

the code show this error msg=

error msg=The database field or the result type of the aggregate function MATNR and the component "RSNUM" of "ITAB2" are not compatible.

Add comment
10|10000 characters needed characters exceeded

  • select rsnum matnr bdmng meins enmng bdter from resb into table itab1 where rsnum in reservno.
    if itab1[] is not initial.
    select matnr maktg from makt into table itab2 for all entries in itab1 where matnr = itab1-matnr.
    loop at itab1 assiging field-symbol(< wa_itab1>).
    read table itab2 into wa_itab2 with key matnr = <wa_itab1>-matnr.
    if sy-subrc eq 0.
    <wa_itab1>-maktg = wa_itab2-maktg.
    *Modify itab1 from wa_itab1 transporting maktg. One less statement :)
    endif.
    endloop.
    endif.

  • Get RSS Feed

3 Answers

  • Best Answer
    Sep 20, 2017 at 09:19 AM

    This Error is coming because structure is not correctly defined before this code.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 28 at 08:34 AM

    *&---------------------------------------------------------------------*
    *& Report ZRM123
    *&---------------------------------------------------------------------*
    *&
    *&---------------------------------------------------------------------*
    REPORT ZRM123.
    TABLES: ZRM_TEST.
    TYPES BEGIN OF TY_FINAL.
    INCLUDE TYPE ZMM_MIC.
    TYPES: MRN_NO(6) TYPE C.

    TYPES: RESULT_1(40) TYPE C,
    RESULT_2(40) TYPE C,
    RESULT_3(40) TYPE C,
    RESULT_4(40) TYPE C,
    CHK TYPE C,
    END OF TY_FINAL.

    DATA: IT_FINAL TYPE ztt_rmtest.
    DATA: WA_FINAL like LINE OF it_final.
    DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
    WA_FCAT LIKE LINE OF IT_FCAT.
    DATA:itprintparams TYPE slis_print_alv.
    DATA: WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    PARAMETERS BARCODE(15) TYPE C.
    DATA: V_RMCODE TYPE MATNR,
    V_MRNCODE(6) TYPE C.


    START-OF-SELECTION.
    SPLIT BARCODE AT '-' INTO V_RMCODE V_MRNCODE.
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
    EXPORTING
    INPUT = V_RMCODE
    IMPORTING
    OUTPUT = V_RMCODE
    EXCEPTIONS
    LENGTH_ERROR = 1
    OTHERS = 2.
    IF SY-SUBRC <> 0.
    * Implement suitable error handling here
    ENDIF.


    SELECT MANDT MATNR MAKTX TEST_PARAM SPECIFICATION TEST_METHOD
    INTO TABLE IT_FINAL FROM ZMM_MIC WHERE MATNR = V_RMCODE.
    END-OF-SELECTION.

    LOOP AT IT_FINAL INTO WA_FINAL.
    WA_FINAL-MRN_NO = V_MRNCODE.
    SHIFT WA_FINAL-MATNR LEFT DELETING LEADING '0'.
    MODIFY IT_FINAL FROM WA_FINAL INDEX SY-TABIX.

    IF SY-TABIX > 1.
    CLEAR: WA_FINAL-MATNR, WA_FINAL-MAKTX.
    MODIFY IT_FINAL FROM WA_FINAL INDEX SY-TABIX.
    ENDIF.
    ENDLOOP.

    WA_FCAT-FIELDNAME = 'MATNR'.
    WA_FCAT-SELTEXT_M = 'RM Code'.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.

    WA_FCAT-FIELDNAME = 'MAKTX'.
    WA_FCAT-SELTEXT_M = 'RM Desc.'.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.

    WA_FCAT-FIELDNAME = 'TEST_PARAM'.
    WA_FCAT-SELTEXT_L = 'Test Parameters'.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.

    WA_FCAT-FIELDNAME = 'SPECIFICATION'.
    WA_FCAT-SELTEXT_L = 'Specification'.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.

    WA_FCAT-FIELDNAME = 'TEST_METHOD'.
    WA_FCAT-SELTEXT_L = 'Test Method'.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.

    WA_FCAT-FIELDNAME = 'RESULT_1'.
    WA_FCAT-SELTEXT_L = 'Test Result 1'.
    WA_FCAT-EDIT = 'X'.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.

    WA_FCAT-FIELDNAME = 'RESULT_2'.
    WA_FCAT-SELTEXT_L = 'Test Result 2'.
    WA_FCAT-EDIT = 'X'.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.

    WA_FCAT-FIELDNAME = 'RESULT_3'.
    WA_FCAT-SELTEXT_L = 'Test Result 3'.
    WA_FCAT-EDIT = 'X'.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.

    WA_FCAT-FIELDNAME = 'RESULT_4'.
    WA_FCAT-SELTEXT_L = 'Test Result 4'.
    WA_FCAT-EDIT = 'X'.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.

    WA_FCAT-FIELDNAME = 'CHK'.
    WA_FCAT-CHECKBOX = 'X'.
    WA_FCAT-EDIT = 'X'.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.


    WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = 'ZRM123'
    I_CALLBACK_PF_STATUS_SET = 'ZSTANDARD'
    I_CALLBACK_USER_COMMAND = 'U-COMM'
    IS_LAYOUT = WA_LAYOUT
    IT_FIELDCAT = IT_FCAT
    TABLES
    T_OUTTAB = IT_FINAL
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    .
    IF SY-SUBRC <> 0.
    * Implement suitable error handling here
    ENDIF.





    FORM U-COMM USING P1 TYPE SY-UCOMM
    P2 TYPE SLIS_SELFIELD.
    DATA: IT_FINAL2 TYPE STANDARD TABLE OF TY_FINAL INITIAL SIZE 1.
    DATA: IT_STAB TYPE STANDARD TABLE OF ZRM_TEST INITIAL SIZE 1.
    DATA: WA_STAB TYPE ZRM_TEST.
    DATA: WA_MATNR TYPE MATNR,
    WA_MAKTX TYPE MAKTX.
    DATA : V_GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: V_ANS TYPE C.

    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    E_GRID = V_GRID.

    CALL METHOD V_GRID->CHECK_CHANGED_DATA.

    IF SY-UCOMM = 'SAVE'.

    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    TEXT_QUESTION = TEXT-Q01
    IMPORTING
    ANSWER = V_ANS
    EXCEPTIONS
    TEXT_NOT_FOUND = 1
    OTHERS = 2
    .
    IF SY-SUBRC <> 0.

    ENDIF.
    endif.
    IF SY-UCOMM = 'PRI'.
    DATA: V_FORM TYPE RS38L_FNAM.
    DATA: CONTROL TYPE SSFCTRLOP.
    DATA: OUTPUT_INFO TYPE SSFCRESCL.
    DATA: OTFDATA TYPE TSFOTF.

    CONTROL-GETOTF = 'X'.
    CONTROL-NO_DIALOG = 'X'.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME = 'ZRM_TEST_FORM'
    IMPORTING
    FM_NAME = V_FORM
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3
    .
    IF SY-SUBRC <> 0.
    * Implement suitable error handling here
    ENDIF.

    CALL FUNCTION V_FORM
    EXPORTING
    CONTROL_PARAMETERS = CONTROL
    IT_ZRM_TEST = it_final
    IMPORTING
    JOB_OUTPUT_INFO = OUTPUT_INFO
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5
    .
    IF SY-SUBRC <> 0.
    * Implement suitable error handling here.
    ENDIF.
    OTFDATA = OUTPUT_INFO-OTFDATA.

    CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
    EXPORTING
    I_OTF = OTFDATA
    EXCEPTIONS
    CONVERT_OTF_TO_PDF_ERROR = 1
    CNTL_ERROR = 2
    OTHERS = 3
    .
    IF SY-SUBRC <> 0.
    * Implement suitable error handling here
    ENDIF.
    ENDIF.
    *IF V_ANS = '1'.
    *
    *IT_FINAL2 = IT_FINAL.
    *
    *LOOP AT IT_FINAL2 INTO WA_FINAL.
    *IF WA_FINAL-MATNR IS NOT INITIAL.
    *WA_MATNR = WA_FINAL-MATNR.
    *WA_MAKTX = WA_FINAL-MAKTX.
    *ENDIF.
    *IF WA_FINAL-RESULT_1 IS INITIAL AND WA_FINAL-RESULT_2 IS INITIAL AND WA_FINAL-RESULT_3 IS INITIAL AND WA_FINAL-RESULT_4 IS INITIAL.
    *MESSAGE TEXT-E01 TYPE 'E' DISPLAY LIKE 'I'.
    *LEAVE LIST-PROCESSING.
    *ENDIF.
    *WA_STAB-MATNR = WA_MATNR.
    *WA_STAB-MAKTX = WA_MAKTX.
    *WA_STAB-ZDATE = SY-DATUM.
    *WA_STAB-ZTIME = SY-UZEIT.
    *WA_STAB-MRN_NO = WA_FINAL-MRN.
    *WA_STAB-TEST_PARAM = WA_FINAL-TEST_PARAM.
    *WA_STAB-SPECIFICATION = WA_FINAL-SPECIFICATION.
    *WA_STAB-TEST_METHOD = WA_FINAL-TEST_METHOD.
    *WA_STAB-RESULT_1 = WA_FINAL-RESULT_1.
    *WA_STAB-RESULT_2 = WA_FINAL-RESULT_2.
    *WA_STAB-RESULT_3 = WA_FINAL-RESULT_3.
    *WA_STAB-RESULT_4 = WA_FINAL-RESULT_4.
    *IF WA_FINAL-CHK IS INITIAL.
    * WA_STAB-END_RESULT = 'O.K'.
    *ELSE.
    * WA_STAB-END_RESULT = 'NOT O.K'.
    *ENDIF.
    *APPEND WA_STAB TO IT_STAB.
    *CLEAR WA_STAB.
    *ENDLOOP.
    *
    *MODIFY ZRM_TEST FROM TABLE IT_STAB.
    *IF SY-SUBRC = 0.
    * MESSAGE TEXT-I01 TYPE 'I'.
    * LEAVE TO SCREEN 0.
    *ENDIF.
    *ENDIF.
    *ENDIF.



    ENDFORM.

    FORM ZSTANDARD USING B1.

    SET PF-STATUS 'ZSTANDARD'.

    ENDFORM.

    the code show this error msg=

    error msg=The database field MATNR or the result type of the aggregate function MATNR and the component "MRN_NO" of "IT_FINAL" are not compatible.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 28 at 01:57 PM

    Hi Ankitha varma,

    Thank you Problem solved.

    Add comment
    10|10000 characters needed characters exceeded