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

BAPI_BASICPAY_GETDETAIL

Former Member
0 Likes
1,375

Experts,

I am trying to get basic pay of an employee using BAPI_BASICPAY_GETDETAIL. This is the first time i am making use of this FM. How this FM is different from RP_ANSAL_FROM_PERNR.

what is WAGETYPES LIKE BAPIP0008P in this FM.

which parameter gets the basic pay?

what is lock indicator?

why do we need record number?

It would be great if anyone would provide with a sample code where you make use of BAPI_BASICPAY_GETDETAIL FM

Thanks In advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
988

Hi there. If you take a look at include LHRXSS_US_EMPSAL_VERIFICF01, you can see that BAPI_BASICPAY_GETDETAIL is used with BAPI_BASICPAY_GETLIST. The list FM is used first to get the pay records for an employee during a specific time interval, and then the detail FM is used to get the details for a specific record in the list results. Here's part of the code from that include:

CALL FUNCTION 'BAPI_BASICPAY_GETLIST'

EXPORTING

employeenumber = employeenumber

timeintervallow = readdate

timeintervalhigh = readdate

IMPORTING

return = return

TABLES

basicpayempkey = basicpaytab.

IF return IS INITIAL.

*

LOOP AT basicpaytab.

CLEAR: return.

CALL FUNCTION 'BAPI_BASICPAY_GETDETAIL'

EXPORTING

employeenumber = basicpaytab-employeeno

subtype = basicpaytab-subtype

objectid = basicpaytab-objectid

lockindicator = basicpaytab-lockindic

validitybegin = basicpaytab-validbegin

validityend = basicpaytab-validend

recordnumber = basicpaytab-recordnr

IMPORTING

return = return

annualsalary = salary_line-ansal

currencyannualsalary = salary_line-ancur.

ENDLOOP.

ENDIF.

I hope this helps.

- April King

6 REPLIES 6
Read only

Former Member
0 Likes
989

Hi there. If you take a look at include LHRXSS_US_EMPSAL_VERIFICF01, you can see that BAPI_BASICPAY_GETDETAIL is used with BAPI_BASICPAY_GETLIST. The list FM is used first to get the pay records for an employee during a specific time interval, and then the detail FM is used to get the details for a specific record in the list results. Here's part of the code from that include:

CALL FUNCTION 'BAPI_BASICPAY_GETLIST'

EXPORTING

employeenumber = employeenumber

timeintervallow = readdate

timeintervalhigh = readdate

IMPORTING

return = return

TABLES

basicpayempkey = basicpaytab.

IF return IS INITIAL.

*

LOOP AT basicpaytab.

CLEAR: return.

CALL FUNCTION 'BAPI_BASICPAY_GETDETAIL'

EXPORTING

employeenumber = basicpaytab-employeeno

subtype = basicpaytab-subtype

objectid = basicpaytab-objectid

lockindicator = basicpaytab-lockindic

validitybegin = basicpaytab-validbegin

validityend = basicpaytab-validend

recordnumber = basicpaytab-recordnr

IMPORTING

return = return

annualsalary = salary_line-ansal

currencyannualsalary = salary_line-ancur.

ENDLOOP.

ENDIF.

I hope this helps.

- April King

Read only

0 Likes
988

Thanks for a quick response.

have a basic doubt

i am getting an exception

which says

fm BAPI_BASICPAY_GETDETAIL was called

with parameter 'ANNUALSALARY'

the parameter is not defined

but i have defined that as like BAPIP0008-ANSAL

i dont understand what the problem is?

help plz

Thanks in advance.

Read only

0 Likes
988

Did you do a syntax check before you tried your code? Perhaps there is a spelling error. You are correct, that is how the field is defined in the BAPI. Could you post the code for how you defined the parameter?

- April

Read only

0 Likes
988

thanks

Yes i did a syntax check i have same error for return too..

p_pernr is a parameter.

here is the code.

data : sal1 like BAPIP0008-ANSAL.

data : return like BAPIRETURN1.

DATA BEGIN OF itabbapi OCCURS 1.

INCLUDE STRUCTURE BAPIPAKEY.

DATA END OF itabbapi.

...

....

CALL FUNCTION 'BAPI_BASICPAY_GETLIST'

EXPORTING

EMPLOYEENUMBER = p_pernr

  • SUBTYPE =

TIMEINTERVALLOW = '18000101'

TIMEINTERVALHIGH = '99991231'

  • IMPORTING

RETURN = return

TABLES

BASICPAYEMPKEY = itabbapi.

IF return IS INITIAL.

*

LOOP AT itabbapi.

CLEAR: return.

CALL FUNCTION 'BAPI_BASICPAY_GETDETAIL'

EXPORTING

EMPLOYEENUMBER = itabbapi-employeeno

SUBTYPE = itabbapi-subtype

OBJECTID = itabbapi-objectid

LOCKINDICATOR = itabbapi-lockindic

VALIDITYBEGIN = itabbapi-validbegin

VALIDITYEND = itabbapi-validend

RECORDNUMBER = itabbapi-recordnr

  • IMPORTING

RETURN = return

  • PAYSCALETYPE =

  • PAYSCALEAREA =

  • PAYSCALEGROUP =

  • PAYSCALELEVEL =

  • NEXTINCREASE =

  • LOCALALLOWLEVEL =

  • PARTNERSHIP =

  • CURRENCY =

  • COMPARISONPAYSCLTYPE =

  • COMPARISONPAYSCLAREA =

  • COMPARISONPAYSCLGRP =

  • COMPARISONPAYSCLLEVEL =

  • COMPNEXTINCREASE =

  • CAPACITYUTILLEVEL =

  • HOURSWORKEDPERPERIOD =

ANNUALSALARY = sal1

  • CASEGROUPCATALOG =

  • CASEGROUP =

  • CURRENCYANNUALSALARY =

  • REASON =

  • NAMEOFBASICPAYTYPE =

  • NAMEOFPAYSCALETYPE =

  • NAMEOFPAYSCALEAREA =

  • NAMEOFCOMPPAYSCLTYPE =

  • NAMEOFCOMPPAYSCLAREA =

  • TABLES

  • WAGETYPES =

.

endloop.

endif.

write : / 'annual salary:', sal1.

Read only

0 Likes
988

You have your IMPORTING statement commented out for both FMs. You need to uncomment those.

- April

Read only

0 Likes
988

Thanks

You are a LEGEND

Solved my problem and I have submitted it.

Thanks for a quick response. Personally thank you for your help.

Also make note that FM BAPI_BASICPAY_GETDETAIL is based on FM RP_ANSAL_FROM_PERNR

Thanks and regards.