Passing a SELECT-OPTIONS table as a parameter to a subroutine?

38,342

It's because selopt and piq_selopt_t are not for vbak-vbeln. Low and High are typed differently in those data types compared to your select option.

This should work

data: gv_sales_order type vbap-vbeln.

types: tr_vbeln like RANGE OF gv_sales_order.

SELECT-OPTIONS: gs_saord for gv_sales_order.


perform check_values CHANGING gs_saord[].

form check_values CHANGING p_gr_saord TYPE tr_vbeln.

endform.
Share:
38,342
vlad-ardelean
Author by

vlad-ardelean

Currently: Python backends + some experimenting with react Previously: ABAP, Java EE, C# I'm just another physics major that ended up in programming. I m trying to be as sciency as I can about computer related stuff...sometimes it helps.

Updated on December 27, 2020

Comments

  • vlad-ardelean
    vlad-ardelean over 3 years

    So i have this:

    SELECT-OPTIONS gr_saord FOR gv_sales_order OBLIGATORY.

    then

    PERFORM check_values CHANGING gr_saord.

    then

    FORM check_values CHANGING p_gr_saord TYPE selopt.

    What i also tried was instead of the structure SELOPT to use the Table Type piq_selopt_t and instead of passing gr_saord to pass gr_saord[].

    The presented version of the code and the alternative result both in the same error message:

    in PERFORM or CALL FUNCTION "CHECK_VALUES", the actual parameter "GS_SAORD" is incompatible with the formal parameter "P_GR_SAORD".

    Basically i want to simply pass a SELECT-OPTIONS table as a parameter and can't manage to do it.