Skip to Content
avatar image
Former Member

function module

hi guyz..

can anybody please solve this one for me..

this is my function module....

CALL FUNCTION 'ZCRMFUN_PARAMETER'

EXPORTING

parentid = 'ZBDREP_CANCELLATIONS'

identifier = p_client

  • zparameter = lv_form

TABLES

PARAMETERS = gt_zcrmtab_param.

code inside this

DATA : gt_zcrmtab_param TYPE TABLE OF zcrmtab_param WITH HEADER LINE.

  • Get all from ZPARAMETER

SELECT *

INTO TABLE gt_zcrmtab_param

FROM zcrmtab_param

WHERE parentid = parentid

AND identifier = identifier.

    • Addition to retrieve common parameters

    IF get_common = 'X'.

    SELECT *

    APPENDING TABLE gt_zcrmtab_param

    FROM zcrmtab_param

    WHERE parentid = '*'

    AND identifier = '*'.

    ENDIF.

    • Append entires to paramters

    READ TABLE gt_zcrmtab_param INDEX 1.

    ENDFUNCTION.

    my problem is when the control goes into function module internal table has values in it...when the control comes out from the function module sourcecode internal table is empty..why this is happening..

    plz advise

    regards..

    Add comment
    10|10000 characters needed characters exceeded

    • Follow
    • Get RSS Feed

    3 Answers

    • Best Answer
      avatar image
      Former Member
      Oct 08, 2007 at 10:24 AM

      here in fm you are populating the local int table gt_zcrmtab_param but i cant see any code to assign the value of this int table to your table parameter i.e. PARAMETERS.

      I think you have to write

      *READ TABLE gt_zcrmtab_param INDEX 1.

      PARAMETERS[] = gt_zcrmtab_param[].

      ENDFUNCTION.

      now you can access table gt_zcrmtab_param in your program

      regards

      shiba dutta

      Add comment
      10|10000 characters needed characters exceeded

    • avatar image
      Former Member
      Oct 08, 2007 at 10:06 AM

      Try using the parameters in "CHANGING" rather than using "TABLES" in the FM....

      Add comment
      10|10000 characters needed characters exceeded

    • avatar image
      Former Member
      Oct 08, 2007 at 10:37 AM

      Hi Sudheer,

      Try this:

      DATA : gt_zcrmtab_param TYPE TABLE OF zcrmtab_param WITH HEADER LINE.

      • Get all from ZPARAMETER

      SELECT *

      INTO TABLE gt_zcrmtab_param

      FROM zcrmtab_param

      WHERE parentid = parentid

      AND identifier = identifier.

        • Addition to retrieve common parameters

        IF get_common = 'X'.

        SELECT *

        APPENDING TABLE gt_zcrmtab_param

        FROM zcrmtab_param

        WHERE parentid = '*'

        AND identifier = '*'.

        ENDIF.

        • Append entires to paramters

        <b>READ TABLE gt_zcrmtab_param into PARAMETERS INDEX 1.

        APPEND PARAMETERS.</b>

        ENDFUNCTION.

        Regards,

        Amit

        Add comment
        10|10000 characters needed characters exceeded