Application Development and Automation 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: 
Read only

Function Module

Former Member
0 Likes
615

here is the function module I'm using the bet the benefit coverage amount for an employee.

form coverage_reg_basic.

if pnp-sw-found eq 1.

data: ee_benefit_data like rpbeneedat,

covam like T74FC-COVAM,

salary like p0008-ansal,

error_table like rpbenerr occurs 0,

rule like t74fc,

currency like t5ud3-curre,

bcove like t74fb-bcove.

  • 2. get bcove

select bcove from t74fb into bcove

where barea = p0168-barea and bplan = p0168-bplan.

endselect.

if not bcove is initial.

  • Get employee data into the structure

CALL FUNCTION 'HR_BEN_READ_EE_BENEFIT_DATA'

EXPORTING

PERNR = pernr-pernr

DATUM = v_begda

REACTION = 'N'

ENDDA = v_endda

IMPORTING

EE_BENEFIT_DATA = ee_benefit_data

TABLES

ERROR_TABLE = error_table.

CALL FUNCTION 'HR_BEN_GET_PLAN_COVERAGE'

EXPORTING

EE_BENEFIT_DATA = ee_benefit_data

BPLAN = p0168-bplan

BCOVE = bcove

ADDNO = p0168-addno

DATUM = v_begda

SALARY_OVERRIDE = p0168-salov

COVERAGE_OVERRIDE = p0168-covov

DESIRED_CURRE = 'CAD'

REACTION = 'D'

IMPORTING

COVERAGE_RULE = rule

COVERAGE_SALARY = salary

COVERAGE_AMOUNT = covam

TABLES

ERROR_TABLE = error_table.

v_cov = covam.

wa_results_totals-reg_cov = v_cov.

clear v_cov.

endif.

endif.

endform.

this works perfect in my DEV client put when I transport it to the Production client, the function module always results in 0 for the salary and covam,

anyway ideas on what could be different across instances.

thanks

4 REPLIES 4
Read only

Former Member
0 Likes
523

Dear Jamie:

Using relevant transactions in SAP, you must first check the data in SAP whether what you are trying to retrieve is already there in production or not.

Almost all HR tables are client specific. In your case, most likely the issue is that production does not have the data matching the conditions that you are sending via function module call.

Check via SAP screens (in DEV and in production) the data that you want - and you will get the answer.

Read only

0 Likes
523

hi,

thanks for the reply,

I used the debugger in a copy of prod, and in DEV

and the data being sent to the function module is the same in both cases.

this is why it doesn't make sense to me.

thanks

Read only

Former Member
0 Likes
523

Have you checked the contents of the error table returned by the function modules for any errors? May be it is related to authorization.

Read only

0 Likes
523

check the contents of the error table, nothing in it, as if the function module ran fine,

I got a feeling it is a currency issue, because the salary isn't coming back either, and this is why the coverage amount is not coming back.

any other ideas

thanks