avatar image
Former Member

AMDP with mutliple output parameters

Hello everyone,

I have created an AMDP and would like to return multiple Output Parameters with a method.

One example: With the method CALL_PAL_130 I fill the parameters

"et_car_out" and "OUT_REASON_MSG" I would like to return.

When I debug the code I see, that both variables "et_car_out" and "OUT_REASON_MSG" have the value I expect.

When I consume CALL_PAL_130 in an ABAP Report/Function module only et_car_out has a value. "OUT_REASON_MSG" is empty.

So how can I return multiple parameters (table type and scalar type) with an amdp method?

Thanks a lot in advance!

method CALL_PAL_130
    by database procedure
        for hdb
        language sqlscript

<....>

OUT_REASON_MSG = 'TEST Reason';

 et_car_out = SELECT "ID", "SCORING", :SCORING_LOW AS SCORING_LOW, :SCORING_HIGH AS SCORING_HIGH, :LV_OUTLIER AS OUTLIER
FROM "XXX" AS SCORING;
endmethod.

        class-methods CALL_PAL_130
        IMPORTING
            VALUE(lt_CAR_IN) TYPE tt_CAR_IN
            VALUE(FIN_IN) TYPE FIN_IN
            VALUE(SACO_SQL_IN) TYPE SACO_SQL_IN
        EXPORTING
        VALUE(et_car_out) TYPE tt_car
        VALUE(ex_message) TYPE STRING
        VALUE(OUT_REASON_MSG) TYPE ty_OUT_REASON_MSG.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 20, 2017 at 11:48 AM

    Can't reproduce the error.

    METHODS select_get_scarr_spfli
          IMPORTING
                    VALUE(clnt)            TYPE sy-mandt
          EXPORTING VALUE(scarr_spfli_tab) TYPE scarr_spfli_tab
                    VALUE(mess) type string.
    METHOD select_get_scarr_spfli
             BY DATABASE PROCEDURE FOR HDB
             LANGUAGE SQLSCRIPT
             OPTIONS READ-ONLY
             USING cl_kellerh_amdp=>get_scarr_spfli.
        SCARR_SPFLI_TAB =
        SELECT *
               FROM "CL_KELLERH_AMDP=>GET_SCARR_SPFLI"(
                      clnt => :clnt );
        mess = 'xxxx';
      ENDMETHOD.
    data itab type cl_kellerh_amdp=>scarr_spfli_tab.
    data mess type string.
    new cl_kellerh_amdp( )->select_get_scarr_spfli( EXPORTING clnt = sy-mandt
                                             IMPORTING scarr_spfli_tab = itab
                                                       mess = mess ).
    

    I get both parameters filled.

    Is it something with TYPE ty_OUT_REASON_MSG?

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content