‎2007 Feb 23 12:47 PM
Hi all,
I want to generate the report for pulling out basic pay - which is stored in Infotype 0008. Now the basic salary field is stored in structure q0008. Where to pull out the value of this basic salary? What code to write for it???
‎2007 Feb 23 1:54 PM
Hi,
Use Adhoc Query to get the data. Check whether an existing Adhoc query is there if it is there use it or create a new one using T-Code SQ02, SQ03 and SQ01.
Using Adhoc Query you can get most of the data from infotypes.
Regards,
Ramu N.
‎2007 Feb 23 12:54 PM
Hi,
First you need to check is the wage type InVal Wagetype
Then you way use Do Varying Enddo Statement to extract data into internal table.
please read help on Varying Statement.
Check this Sample Code.
DATA: BEGIN OF text,
word1 TYPE c LENGTH 4 VALUE 'AAAA',
word2 TYPE c LENGTH 4 VALUE 'BBBB',
word3 TYPE c LENGTH 4 VALUE 'CCCC',
word4 TYPE c LENGTH 4 VALUE 'DDDD',
END OF text.
DATA: word TYPE c LENGTH 4,
char1 TYPE c LENGTH 1,
char2 TYPE c LENGTH 1,
leng TYPE i.
FIELD-SYMBOLS <word> LIKE text-word1.
DATA inc TYPE i.
DESCRIBE FIELD text LENGTH leng IN CHARACTER MODE.
leng = leng / 2.
DO leng TIMES VARYING char1 FROM text(1)
NEXT text+2(1) RANGE text
VARYING char2 FROM text+1(1)
NEXT text+3(1) RANGE text.
WRITE: char1, char2.
char1 = 'x'.
char2 = 'y'.
ENDDO.
DO 4 TIMES VARYING word FROM text-word1 NEXT text-word2.
WRITE / word.
ENDDO.
DO.
inc = sy-index - 1.
ASSIGN text-word1 INCREMENT inc TO <word> RANGE text.
IF sy-subrc = 0.
WRITE / <word>.
ELSE.
EXIT.
ENDIF.
ENDDO.
~Bhawanidutt.
‎2007 Feb 23 12:55 PM
Hi,
Get the Payroll data from Infotype 8 as below:
form get_pay_data.
Get the Payroll data from Respective Infotypes
rp_provide_from_last p0008 space pnpbegda pnpendda.
pay_tab-pernr = pernr-pernr.
call function 'RP_FILL_WAGE_TYPE_TABLE_EXT'
exporting
appli = 'E'
begda = p0008-begda
endda = p0008-endda
infty = '0008'
objps = ' '
tclas = 'A'
pernr = pernr-pernr
seqnr = ' '
subty = '0 '
dlspl = 'X'
msgflg = ''
nordct = ''
tables
pp0001 = p0001
pp0007 = p0007
pp0008 = p0008
ppbwla = wage_tab
PP0230 =
PP0014 =
PP0015 =
PP0052 =
EXCEPTIONS
ERROR_AT_INDIRECT_EVALUATION = 1
OTHERS = 2
.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at wage_tab.
pay_tab-waers = wage_tab-waers.
case wage_tab-lgart.
when c_lga01.
pay_tab-basic = wage_tab-betrg.
when c_lga02.
pay_tab-sup_allow = wage_tab-betrg.
when c_lga03.
pay_tab-hra_allow = wage_tab-betrg.
when c_lga04.
pay_tab-chl_allow = wage_tab-betrg.
when c_lga05.
pay_tab-soc_allow = wage_tab-betrg.
when c_lga06.
pay_tab-fix_allow = wage_tab-betrg.
when c_lga07.
pay_tab-ra_allow = wage_tab-betrg.
when c_lga08.
pay_tab-per_allow = wage_tab-betrg.
when c_lga09.
pay_tab-pen_allow = wage_tab-betrg.
when others.
pay_tab-oth_allow = pay_tab-oth_allow + wage_tab-betrg.
endcase.
pay_tab-tot_allow = pay_tab-basic + pay_tab-sup_allow +
pay_tab-hra_allow + pay_tab-chl_allow +
pay_tab-soc_allow + pay_tab-fix_allow +
pay_tab-ra_allow + pay_tab-per_allow +
pay_tab-oth_allow - pay_tab-pen_allow.
endloop.
append pay_tab.
clear pay_tab.
endform. "get_pay_data
Regards,
Anji
‎2007 Feb 23 1:54 PM
Hi,
Use Adhoc Query to get the data. Check whether an existing Adhoc query is there if it is there use it or create a new one using T-Code SQ02, SQ03 and SQ01.
Using Adhoc Query you can get most of the data from infotypes.
Regards,
Ramu N.
‎2007 Feb 26 4:54 AM
Hey ppl,
I basically wanted to export the 'Basic Salary' to a BAPI and for that I wanted the source code, Maybe u can help. I think, in a BAPI, there is no place to declare your logical database..
Please help
‎2007 Feb 26 5:02 AM
Hi Ribhu,
Which BAPI r u using? you dont need to use logical data base in the source text you may use a select statement.
You may look at this Sample Code.
TYPES: BEGIN OF ty_0008,
lga01 TYPE p0008-lga01, " Wage type
wtext(25), " Wage type text
bet01 TYPE p0008-bet01," Amount
END OF ty_0008.DATA: it_0008 type table of ty_0008, " Internal table for wage type
wa_0008 like line of it_0008, "Workarea for wage type
wa_pa0008 type PA0008. "Workarea for Select from PA0008
SELECT SINGLE * FROM pa0008 INTO CORRESPONDING FIELDS OF wa_pa0008
WHERE pernr = pernr AND
endda = '99991231'.
IF sy-subrc = 0.
DO 20 TIMES VARYING wa_0008-lga01 FROM wa_pa0008-lga01 NEXT wa_pa0008-lga02
VARYING wa_0008-bet01 FROM wa_pa0008-bet01 NEXT wa_pa0008-bet02.
IF wa_0008-lga01 IS NOT INITIAL.
SELECT SINGLE * FROM t512t " Wage type text table
WHERE sprsl = 'EN' AND
* molga = '40' AND
lgart = wa_0008-lga01.
IF sy-subrc = 0.
wa_0008-wtext = t512t-lgtxt.
ENDIF.
APPEND wa_0008 TO it_0008. " Append into Internal Table
ENDIF.
ENDDO.
ENDIF.In this way you can pass the internal table filled with Details for a particular pernr to a BAPI.
Hope this helps you.
~Bhawanidutt
‎2007 Feb 26 5:09 AM
Hi,
There is an BAPI 'BAPI_BASICPAY_GETDETAIL' to get the details of infotype 8.
Regards,
Ramu N.
‎2007 Feb 26 7:44 AM
Hello,
I am trying to use the code supplied by you, but its not giving a proper solution. Lemme explain this - The infotype 0008 contains data for an employee number say '15'. Now the table pa0008 contains 0.00 as the 'basic salary'. But when i see infotype 0018 in pa 30, it is showing 'basic salary' as 10000. Do we have to process the payroll before putting the code supplied by you in the bapi or what? please suggest
‎2007 Feb 26 8:18 AM
Hi Ribhu,
Please check the wage type characteristics.
If it is Indirect valuation wage type then the Amount has to be picked up from InVal Table.
It goes like this.
1. If inval table is maintained for the <b>Wagetype</b> the values are picked up from the Table.
2. If the user enters the amount other than the amount maintained in Inval table the amount gets stored in Database table PA0008.
3. Now you have to put another if condition.
a. if amount = 0.00
b. Select single * from inval table pick the amount and do the futher processing.
c. Endif.
Ask you functional Guy to confirm the inval table where they are storing the values for a wage type. I think the table is <b>T7INA9</b>.
~ This will definitely help you. Now I need more points for this .. hee hee.
Bhawanidutt.
‎2007 Feb 26 8:40 AM
don worry about the points. I 'll give you a tenner soon. Please lemme know what is this inval table????
‎2007 Feb 26 8:52 AM
‎2007 Feb 26 8:56 AM
Hi Ribhu,
These tables are the customizing tables and the functional guys can set some default amount for the wage type depending upon the conditions and customizing done for <b>PayScaleArea</b> and <b>PayScaleType</b>.
For Details you may refer SAP help and as tech you may not concern about these tables.
I am providing you with a link on Indirect Evaluation (INVAL) and 40ECS Feature
<a href="http://help.sap.com/saphelp_47x200/helpdata/en/dd/38a63a04227748e10000000a11402f/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/dd/38a63a04227748e10000000a11402f/frameset.htm</a>
Hope this will help you to understand Wage type Features.
~Bhawanidutt.
‎2007 Feb 26 8:58 AM
‎2007 Feb 26 8:06 AM
Im not 100% right,
but these are the some of the Fm's which return the total salary,
HR_GET_TOTAL_AMOUNT_P0008
HRCM_ADJUSTMENT_SUM_CALCULATE
HRWPC_RFC_CP_HEADER_GET
HR_DEPBS_GET_HIGH_SALARY
HR_DEPBS_GET_NOMINAL_SALARY
HR_DEPBS_GET_PERCENT_SALARY
Actually, if you see, when the basic pay is displayed as 10k in PA30/20, its actually getting calculated and displayed. please use 'Where-Used-List" for the field and look for the FM's which gives the basic pay.