2023 Nov 28 2:26 PM
Hey,
I've created in include SEL this sum parameter:
PARAMETERS: p_sum type i.
In the CLI include I WROTE THIS select:
CLASS lcl_main_sfp IMPLEMENTATION.
METHOD select_data.
SELECT mara~matnr, mara~mtart, makt~maktx, mara~ersda
UP TO p_sum ROWS
FROM mara
INNER JOIN makt
ON makt~matnr = mara~matnr
INTO CORRESPONDING FIELDS OF TABLE @mt_table.
ENDMETHOD.
and I get the following error:
What can be the problem? is't this from the same type?
2023 Nov 29 8:22 AM
Hello 8it8
Your SELECT statement would be syntactically correct if:
You have declared P_NUM as a parameter with I type, still you get the error about P_NUM not being a number. That is strange and I suspect that you have also defined P_NUM as a parameter of the SELECT_DATA method.
Would you be able to share the declaration of the method?
Best regards
Dominik Tylczynski
2023 Nov 28 4:28 PM
Hi,
Try like this:
SELECT
*
UP TO @p_num ROWS
INTO TABLE @DATA(it_tmp)
FROM mara INNER JOIN makt
on mara~matnr = makt~matnr.
2023 Nov 28 4:54 PM
You activated the strict mode for ABAP SQL statement as soon as you used the @ in the resulting internal table. So use also @p_sum for the host variable.
2023 Nov 28 5:08 PM
It works in S/4HANA 1909(ABAP Platform 1909). what is the version of your system?
2023 Nov 29 6:59 AM
2023 Nov 29 7:58 AM
Thanks.
I really had to get rid of the @ from the table and actually there was another issue (very simple...)
the SEL INCLUDE was below the the CLI include.....
2023 Nov 29 8:22 AM
8it8
To answer your quote "how to deal with this", did you realize what Raymond and Eduardo have said before you ask? (@p_sum instead of p_sum)
2023 Nov 29 8:22 AM
Hello 8it8
Your SELECT statement would be syntactically correct if:
You have declared P_NUM as a parameter with I type, still you get the error about P_NUM not being a number. That is strange and I suspect that you have also defined P_NUM as a parameter of the SELECT_DATA method.
Would you be able to share the declaration of the method?
Best regards
Dominik Tylczynski