Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

function module

Former Member
0 Kudos

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..

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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