Regarding abap Macros
Hi Experts,
I am wring the programming in Abap-Hr usnig Macros.
But my clients requirement is, don't use macros when using LDB's. Is it possible for payroll results.
By using the macro
RP_PROVIDE_FROM_LAST P0002 SPACE LOW-DATE HIGH-DATE
what is the alternative of this macro by retrieving the data from infotype based on PERNR.
thanks in advance.
Sai
Edited by: Sai Babu on Nov 21, 2008 8:19 AM
Hi
You can use HR_READ_INFOTYPE function module to read latest record of an employee.
pass system date (sy-datum) in importing parameters validbegin and validend.
Thanks
Vishal Kapoor
Similar Messages
-
HR ABAP Macro include files?
Hi all ABAPers,
I am trying to develope a BAPI using HR ABAP Macro. (Eg RP-EXP-C1-TX ,RP-EXP-C3-TY)
obviously, ABAP Macro is pretty new to me....
I have a feeling HR ABAP macro requires me to "Include" some file beforeI can use it.
Can anyone please let me know what include file I should put it on.
Any help appreciated!!!!Hi,
before you can use it ABAP macro requires you to define it
in the program ( or one of its includes) or in table TRMAC.
In the macro definition you can use tables, files etc.
e. g. for macro
AA-BB-DD-XX
you should code in the program ( or one of its includes):
DEFINE AA-BB-DD-XX.
LOOP AT ITAB.
MOVE-CORRESPONDING ITAB TO ITAB2.
ITAB2-FIELD1 = 8.
APPEND ITAB2. " or write or upload etc.
ENDLOOP.
END-OF-DEFINITION. -
Regarding ABAP Query authorization group
Hi Team,
This is regarding ABAP Query!
I have created one authorization group, for testing i have assigned my id in authorization group.
After creation of ABAP query,standard program got generated. Now i have created one transaction code at the last for the ABAP Query.
Now the isse is even though i have deleted my id from the authorization group. I am able to execute the query from SQ01 and with the Transaction code .
It should not happen...i want who soever id is mapped to the transaction code ...that member should only be able to run that query, otherwise there is no use of authorization group.
Please help me out in this case.
Thanks & Regards,
Anil Kumar SahniAre you sure that you don't have access to that authorisation group? Execute report RSUSR002. In the 'Authorization Object 1' block inform S_TABU_DIS in 'Auth.Object' and accept. Then inform Activity=03 and Auth.Gruop= your group.
You will get a list of all the users which, theoretically, will be able to execute the query. If you press 'Roles' or 'Profiles' in the toolbar of the listing you will get to know why you have authorisation. May be you have the SAP_ALL profile.
Also, one more thing to take into account: how have you created your transaction? Is it referring directly to the generated report? Then it is an error, you should execute program SAP_QUERY_CALL. Read this post: [Relate transaction to query; -
How to debug abap macros?
Hi,
Can anyone tell me How to debug abap macros?
Thanks in advance.
-SelvaHi Rigel,
Understand it is a very old thread, but still could you please help me out with this? I tried to search for the option which you mentioned, but to no avail. I have SAP ECC 7.0.
Thanks in advance. -
hi experts,
i'm getting small problem in creation of infotype
i have created one custom infotype in PA by using table control
problem is
i have entered 5 rows data for one duration
when i'm checking data in overview it showing 5 records for single duration it should show only one record like IT 0008 but it showing 5 records plz help meHi,
maybe someone here can help you otherwise I would try it in the ABAP Data Transfer forum:
ABAP Connectivity
Regards
Patrick -
there is a problem in hr abap with the macros like rp-provide from frst and rp-provide from last. is there any solution in the form of sample codes it will be very helpful.
the exact problem with the code is that
rp-provide from last and frst are providing the same data from the table which is the last record, but which is not the desired function of the rp-provide from frst.
if there are any solutions to the problem please mail me the solution.
thank you
rameshHello,
Instead of using the rp-provide from last you can use the provide statement only. See attached a program here using the rp-read-infotype macro you can have a better control.
AUTHOR : shekhar s kulkarni
DATE : 18th july 2003
DESCRIPTION :
DEV REQUEST :
MODIFICATION LOGS
VERSION
DATE
REQUEST NO
DESCRIPTION
REPORT zpyr_overseasemplist.
*Declaration for type pool
TYPE-POOLS :slis.
*Declaration for tables
TABLES : pa0000,pa0008, zhrrole, zhrband, zhrrole_assg,t001p,t503t,t500p
,t005h,t591s.
<b>*Declaration for infotypes
INFOTYPES : 0000,0001,9009,0008,9001,9015.</b>
*Declaration data for alv list
DATA: lv_tmplt LIKE disvariant VALUE 'ZPYR_ELIGIBLESALARY',
lv_fieldcat TYPE slis_t_fieldcat_alv,
lv_ls_layout TYPE slis_layout_alv,
driver LIKE sy-repid,
wa_lv_fieldcat TYPE slis_fieldcat_main,
farben TYPE slis_specialcol_alv, "color display
it_events TYPE slis_t_event,
wa_events TYPE slis_alv_event,
gs_extract1 LIKE disextract.
DATA: BEGIN OF it_leavedate OCCURS 0.
INCLUDE STRUCTURE hida.
DATA: END OF it_leavedate.
*Declaration data for program zpyr_overseasemplist
DATA : BEGIN OF it_overseas OCCURS 0,
empno LIKE pa0008-pernr,
name LIKE pa0001-ename,
c_role_desc LIKE zhrrole-zrole_desc,
band LIKE zhrband-zband_desc,
perband LIKE pa0008-trfgr,
category LIKE pa0001-ename,
country LIKE t591s-stext,
currency LIKE pa0008-waers,
pu LIKE pa0001-btrtl,
du LIKE pa9009-du_cd,
location LIKE t500p-name1,
region LIKE t005h-bezei,
doj LIKE sy-datum,
start_period LIKE sy-datum,
end_period LIKE sy-datum,
basic LIKE pa0008-bet01,
hra LIKE pa0008-bet01,
insurance LIKE pa0008-bet01,
oda LIKE pa0008-bet01,
car_all LIKE pa0008-bet01,
gross_1 LIKE pa0008-bet01,
bonus LIKE pa0008-bet01,
cpi LIKE pa0008-bet01,
gross_2 LIKE pa0008-bet01,
provision LIKE pa0008-bet01,
tax LIKE pa0008-bet01,
total LIKE pa0008-bet01,
gross LIKE pa0008-bet01,
END OF it_overseas.
DATA : BEGIN OF it_empoverseas OCCURS 0,
empno LIKE pa0008-pernr,
name LIKE pa0001-ename,
category LIKE pa0001-ename,
country LIKE t591s-stext,
currency LIKE pa0008-waers,
gross LIKE pa0008-bet01,
END OF it_empoverseas.
*Declaration data for program
DATA : gc_startdate TYPE pa0008-begda,
gc_enddate TYPE pa0008-endda,
lc_dt TYPE sy-datum,
li_tdt TYPE i,
li_days TYPE i,
lf_mon_bonus TYPE pa0008-bet01,
gc_chkdate TYPE pa0000-begda,
lc_flag TYPE c.
DATA: BEGIN OF ppbwla OCCURS 10.
INCLUDE STRUCTURE pbwla.
DATA: END OF ppbwla.
***********************Selection screen *******************************
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: p_pabrp LIKE qppnp-pabrp,
p_pabrj LIKE qppnp-pabrj.
PARAMETERS: p_prcnt LIKE pa0008-bet01 DEFAULT '8',
p_bprcnt LIKE pa0008-bet01 DEFAULT '50'.
SELECTION-SCREEN END OF BLOCK blk1.
**********************Initialization*********************************
INITIALIZATION.
lv_ls_layout-group_change_edit = 'X'.
lv_ls_layout-get_selinfos = 'X'.
driver = 'ZPYR_OVERSEASEMPLIST'.
p_pabrp = sy-datum+4(2).
p_pabrj = sy-datum+0(4).
*********************Start of selection*****************************
START-OF-SELECTION.
PERFORM data_selection. "Data selection from tables
PERFORM alv_listdisplay. "alv grid display
END-OF-SELECTION.
*& Form INIT_FIELDCAT
Intialization of text for columns in the internal table
FORM init_fieldcat.
LOOP AT lv_fieldcat INTO wa_lv_fieldcat.
CASE wa_lv_fieldcat-fieldname.
WHEN 'EMPNO'.
wa_lv_fieldcat-seltext_l = 'Emp Number'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'DOJ'.
wa_lv_fieldcat-seltext_l = 'Join Date'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'NAME'.
wa_lv_fieldcat-seltext_l = 'Name'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'BAND'.
wa_lv_fieldcat-seltext_l = 'Job Band'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'PERBAND'.
wa_lv_fieldcat-seltext_l = 'Personal Band'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'COUNTRY'.
wa_lv_fieldcat-seltext_l = 'Country'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'CURRENCY'.
wa_lv_fieldcat-seltext_l = 'Currency'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'BASIC'.
wa_lv_fieldcat-seltext_l = 'Basic'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'HRA'.
wa_lv_fieldcat-seltext_l = 'HRA'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'INSURANCE'.
wa_lv_fieldcat-seltext_l = 'Insurance'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'ODA'.
wa_lv_fieldcat-seltext_l = 'ODA'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'CAR_ALL'.
wa_lv_fieldcat-seltext_l = 'Car Allow.'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'GROSS_1'.
wa_lv_fieldcat-seltext_l = 'Total excl. Bonus & CPI'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'BONUS'.
wa_lv_fieldcat-seltext_l = 'Bonus'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'CPI'.
wa_lv_fieldcat-seltext_l = 'CPI'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'GROSS_2'.
wa_lv_fieldcat-seltext_l = 'Total incl. Bonus & CPI'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'PU'.
wa_lv_fieldcat-seltext_l = 'PU'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'DU'.
wa_lv_fieldcat-seltext_l = 'DU'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'LOCATION'.
wa_lv_fieldcat-seltext_l = 'Location'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'REGION'.
wa_lv_fieldcat-seltext_l = 'Region'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'PROVISION'.
wa_lv_fieldcat-seltext_l = 'Bonus @ 100 %'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'TAX'.
wa_lv_fieldcat-seltext_l = 'Tax'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'TOTAL'.
wa_lv_fieldcat-seltext_l = 'Total Bonus Cost @ 100%'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'START_PERIOD'.
wa_lv_fieldcat-seltext_l = 'Start Period'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'END_PERIOD'.
wa_lv_fieldcat-seltext_l = 'End Period'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'CATEGORY'.
wa_lv_fieldcat-seltext_l = 'Category'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
WHEN 'GROSS'.
wa_lv_fieldcat-seltext_l = 'Expected Bonus Payout'.
wa_lv_fieldcat-ddictxt = 'L'.
wa_lv_fieldcat-ddic_outputlen = 13.
MODIFY lv_fieldcat FROM wa_lv_fieldcat.
ENDCASE.
ENDLOOP.
ENDFORM. " INIT_FIELDCAT
*& Form ALV_LISTDISPLAY
Use the function to display the alv list
FORM alv_listdisplay.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = driver
i_internal_tabname = 'IT_OVERSEAS'
i_client_never_display = 'X'
i_inclname = driver
CHANGING
ct_fieldcat = lv_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
*Add correct column names..
PERFORM init_fieldcat.
*Display the list.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = driver
it_fieldcat = lv_fieldcat[]
i_default = 'X'
i_save = 'A'
is_variant = lv_tmplt
is_layout = lv_ls_layout
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = it_overseas
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDFORM. " ALV_LISTDISPLAY
*& Form DATA_SELECTION
Select the data from various tables and logical database
FORM data_selection.
CONCATENATE p_pabrj p_pabrp '01' INTO lc_dt.
*Get the last date of the month
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
day_in = lc_dt
IMPORTING
last_day_of_month = gc_enddate
EXCEPTIONS
day_in_no_date = 1.
IF sy-subrc <> 0.
WRITE : / 'Error in date entry'.
ENDIF.
CONCATENATE p_pabrj p_pabrp '01' INTO gc_startdate. "startdate
SELECT * FROM pa0008
WHERE (
( begda BETWEEN gc_startdate and gc_enddate )
OR ( endda BETWEEN gc_startdate AND gc_enddate )
OR ( begda >= gc_startdate AND endda >= gc_enddate )
OR ( begda <= gc_startdate AND endda = '99991231' )
AND subty NE '0'
AND subty NE '11'.
it_overseas-empno = pa0008-pernr.
IF sy-subrc = 0.
*Check whether employee has left.
CALL FUNCTION 'HR_LEAVING_DATE'
EXPORTING
persnr = pa0008-pernr
IMPORTING
leavingdate = gc_chkdate
TABLES
leaving_dates = it_leavedate
EXCEPTIONS
leaving_date_not_found = 1
pernr_not_assigned = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF sy-subrc = 0.
IF gc_chkdate BETWEEN gc_startdate AND gc_enddate
OR gc_chkdate >= gc_startdate.
ELSE.
CONTINUE.
ENDIF.
ENDIF.
*Check whether the start date is less than the enddate of the month
*If it is less than the enddate of the month then only take that record.
IF pa0008-begda <= gc_enddate.
Getting the name of the employees
CALL FUNCTION 'CATS_GET_EMPLOYEE_NAME'
EXPORTING
pernr = it_overseas-empno
IMPORTING
name = it_overseas-name
EXCEPTIONS
pernr_not_found = 1.
IF sy-subrc <> 0.
ENDIF.
*Get the joining date of the employees
CALL FUNCTION 'RP_GET_HIRE_DATE'
EXPORTING
persnr = it_overseas-empno
check_infotypes = '0000'
IMPORTING
hiredate = it_overseas-doj.
*Get the role information for the employee
rp-read-infotype pa0008-pernr 9001 p9001 gc_startdate gc_enddate.
PROVIDE * FROM p9001 BETWEEN gc_startdate AND gc_enddate.
*Get the role description for that particular period.
SELECT SINGLE zrole_desc INTO (it_overseas-c_role_desc)
FROM zhrrole WHERE zrole_cd = p9001-zrole_cd.
*Get the job Band for that employee
SELECT SINGLE * FROM zhrrole_assg WHERE zrole_cd = p9001-zrole_cd.
SELECT SINGLE zband_desc INTO it_overseas-band
FROM zhrband
WHERE zband_cd = zhrrole_assg-zband_cd.
ENDPROVIDE.
*Get Personal Sub Band
it_overseas-perband = pa0008-trfgr.
*Get pay data
CALL FUNCTION 'RP_FILL_WAGE_TYPE_TABLE'
EXPORTING
appli = 'E'
begda = pa0008-begda
endda = pa0008-endda
infty = '0008'
pernr = pa0008-pernr
subty = pa0008-subty
TABLES
ppbwla = ppbwla "output
EXCEPTIONS
error_at_indirect_evaluation = 1.
IF sy-subrc <> 0.
REFRESH ppbwla.
CLEAR ppbwla.
ELSE.
LOOP AT ppbwla.
it_overseas-currency = ppbwla-waers.
IF ppbwla-lgart = '8101'
OR ppbwla-lgart = '6001' OR ppbwla-lgart = '6002'
OR ppbwla-lgart = '6003' OR ppbwla-lgart = '6004'
OR ppbwla-lgart = '7151' OR ppbwla-lgart = '6005'
OR ppbwla-lgart = '6006' OR ppbwla-lgart = '6007'
OR ppbwla-lgart = '6008' OR ppbwla-lgart = '6009'
OR ppbwla-lgart = '6010' OR ppbwla-lgart = '6011'
OR ppbwla-lgart = '6012' OR ppbwla-lgart = '6013'
OR ppbwla-lgart = '6014' OR ppbwla-lgart = '6015'.
it_overseas-basic = ppbwla-betrg.
ELSEIF ppbwla-lgart = '8301'.
it_overseas-hra = ppbwla-betrg.
ELSEIF ppbwla-lgart = '7801'.
it_overseas-insurance = ppbwla-betrg.
ELSEIF ppbwla-lgart = '8302' OR ppbwla-lgart = '7802'
OR ppbwla-lgart = '6301' OR ppbwla-lgart = '6303'
OR ppbwla-lgart = '6302' OR ppbwla-lgart = '6304'
OR ppbwla-lgart = '6305' OR ppbwla-lgart = '6306'
OR ppbwla-lgart = '6307' OR ppbwla-lgart = '6308'
OR ppbwla-lgart = '6309' OR ppbwla-lgart = '6310'
OR ppbwla-lgart = '6311' OR ppbwla-lgart = '6312'
OR ppbwla-lgart = '6313' OR ppbwla-lgart = '6314'.
it_overseas-oda = ppbwla-betrg.
ELSEIF ppbwla-lgart = '6409'
OR ppbwla-lgart = '6410' OR ppbwla-lgart = '6411'
OR ppbwla-lgart = '6412' OR ppbwla-lgart = '6413'
OR ppbwla-lgart = '6414' OR ppbwla-lgart = '8303'
OR ppbwla-lgart = '6401' OR ppbwla-lgart = '6402'
OR ppbwla-lgart = '6403' OR ppbwla-lgart = '6404'
OR ppbwla-lgart = '6405' OR ppbwla-lgart = '6406'
OR ppbwla-lgart = '6407' OR ppbwla-lgart = '6408'
OR ppbwla-lgart = '7803' OR ppbwla-lgart = '6415'.
it_overseas-car_all = ppbwla-betrg.
ELSEIF ppbwla-lgart = '8945'
OR ppbwla-lgart = '6101' OR ppbwla-lgart = '6102'
OR ppbwla-lgart = '6103' OR ppbwla-lgart = '6104'
OR ppbwla-lgart = '7945' OR ppbwla-lgart = '6105'
OR ppbwla-lgart = '6106' OR ppbwla-lgart = '6107'
OR ppbwla-lgart = '6108' OR ppbwla-lgart = '6109'
OR ppbwla-lgart = '6110' OR ppbwla-lgart = '6111'
OR ppbwla-lgart = '6112' OR ppbwla-lgart = '6113'
OR ppbwla-lgart = '6114' OR ppbwla-lgart = '6115'.
it_overseas-bonus = ppbwla-betrg.
ELSEIF ppbwla-lgart = '8975'
OR ppbwla-lgart = '6201' OR ppbwla-lgart = '6202'
OR ppbwla-lgart = '6203' OR ppbwla-lgart = '6204'
OR ppbwla-lgart = '7975' OR ppbwla-lgart = '6205'
OR ppbwla-lgart = '6206' OR ppbwla-lgart = '6207'
OR ppbwla-lgart = '6208' OR ppbwla-lgart = '6209'
OR ppbwla-lgart = '6210' OR ppbwla-lgart = '6211'
OR ppbwla-lgart = '6212' OR ppbwla-lgart = '6213'
OR ppbwla-lgart = '6214' OR ppbwla-lgart = '6215'.
it_overseas-cpi = ppbwla-betrg.
ENDIF.
ENDLOOP.
REFRESH ppbwla.
ENDIF.
*Add which country according to the subtype of the record
SELECT SINGLE stext INTO it_overseas-country
FROM t591s WHERE subty = pa0008-subty
AND infty = '0008'
AND sprsl = sy-langu.
*Addition to gross components
it_overseas-gross_1 = it_overseas-basic + it_overseas-hra
+ it_overseas-insurance + it_overseas-oda
+ it_overseas-car_all.
it_overseas-gross_2 = it_overseas-bonus + it_overseas-cpi
+ it_overseas-gross_1.
*Get PU DU Location and Region for the employee
rp-read-infotype pa0008-pernr 0001 p0001 gc_startdate gc_enddate.
PROVIDE * FROM p0001 BETWEEN gc_startdate AND gc_enddate.
SELECT SINGLE * FROM t001p WHERE btrtl = p0001-btrtl.
SELECT SINGLE * FROM t503t WHERE persk = p0001-persk.
SELECT SINGLE * FROM t500p WHERE persa = p0001-werks.
SELECT SINGLE * FROM t005h WHERE land1 = t500p-land1 AND
regio = t500p-regio AND cityc = t500p-cityc.
it_overseas-pu = t001p-btext.
it_overseas-location = t500p-name1. "dev903953
it_overseas-region = t005h-bezei.
ENDPROVIDE.
*Get the DU Details from infotype 9009
<b> rp-read-infotype pa0008-pernr 9009 p9009 gc_startdate gc_enddate.
PROVIDE * FROM p9009 BETWEEN gc_startdate AND gc_enddate.
it_overseas-du = p9009-du_cd.
ENDPROVIDE.</b>*Decide the category
PERFORM get_category.
*Calculate the Provision
*Start and enddate of the period
IF pa0008-begda <= gc_startdate.
it_overseas-start_period = gc_startdate.
ELSE.
it_overseas-start_period = pa0008-begda.
ENDIF.
IF gc_enddate <= pa0008-endda.
it_overseas-end_period = gc_enddate.
ELSE.
it_overseas-end_period = pa0008-endda.
ENDIF.
*The monthly bonus is bonus / 12
lf_mon_bonus = it_overseas-bonus / 12.
*Working days onsite. Add 1 to days to consider todays day.
If employee has resigned.
li_tdt = it_overseas-end_period - it_overseas-start_period + 1.
li_days = gc_enddate - gc_startdate + 1.
it_overseas-provision = ( lf_mon_bonus * li_tdt ) / li_days.
*Tax Calculation.
it_overseas-tax = it_overseas-provision * p_prcnt / 100.
*Total Provision
it_overseas-total = it_overseas-provision + it_overseas-tax.
*Gross Provision
it_overseas-gross = it_overseas-total * p_bprcnt / 100.
APPEND it_overseas.
CLEAR it_overseas.
CLEAR gc_chkdate.
CLEAR : zhrrole, zhrband, zhrrole_assg,t001p,t503t,t500p.
CLEAR : p0001,p9001,p9009.
ENDIF.
ENDIF.
ENDSELECT.
ENDFORM. " DATA_SELECTION
FORM USER_COMMAND SK *
USER COMMAND FOR DYNAMIC REPORTING -SHEKHAR KULKARNI *
--> UCOMM *
--> SELFIELD *
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
READ TABLE it_overseas INDEX selfield-tabindex.
CHECK sy-subrc = 0.
CASE ucomm.
WHEN '&IC1'.
CASE selfield-sel_tab_field.
*If clicked on BAND.
WHEN 'IT_OVERSEAS-EMPNO' OR 'IT_OVERSEAS-NAME'.
PERFORM display_details USING it_overseas-empno.
*If clicked on Purchase order.
ENDCASE.
ENDCASE.
ENDFORM.
*& Form DISPLAY_DETAILS
Display the selected employee details.
-->P_IT_OVERSEAS_EMPNO text
FORM display_details USING p_it_overseas_empno.
READ TABLE IT_OVERSEAS WITH KEY EMPNO = P_IT_OVERSEAS_EMPNO
BINARY SEARCH.
*transporting empno total.
IF sy-subrc = 0.
LOOP AT it_overseas.
it_empoverseas-empno = it_overseas-empno.
it_empoverseas-country = it_overseas-country.
it_empoverseas-currency = it_overseas-currency.
it_empoverseas-category = it_overseas-category.
it_empoverseas-name = it_overseas-name.
it_empoverseas-gross = it_overseas-gross.
APPEND it_empoverseas.
ENDLOOP.
SORT it_empoverseas BY category currency empno.
REFRESH lv_fieldcat[].
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = driver
i_internal_tabname = 'IT_EMPOVERSEAS'
i_client_never_display = 'X'
i_inclname = driver
CHANGING
ct_fieldcat = lv_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
PERFORM init_fieldcat.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = driver
it_fieldcat = lv_fieldcat[]
i_default = 'X'
i_save = 'A'
is_variant = lv_tmplt
is_layout = lv_ls_layout
TABLES
t_outtab = it_empoverseas
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
REFRESH it_empoverseas.
ENDFORM. " DISPLAY_DETAILS
*& Form GET_CATEGORY
Find out the category of the person.
FORM get_category.
CASE p0001-btrtl.
WHEN '30' OR '31' OR '35' OR '36' OR '39' OR '45' OR '47' OR '48'
OR '49' OR '65' OR '71' OR '74'.
it_overseas-category = 'Sales'.
WHEN '63'.
it_overseas-category = 'IBCS'.
WHEN '54' OR '18' OR '19' OR '20'.
it_overseas-category = 'Banking Bonus'.
WHEN OTHERS.
it_overseas-category = 'Others'.
ENDCASE.
IF ( p9001-zrole_cd = 'BM'
OR p9001-zrole_cd = 'GEM'
OR p9001-zrole_cd = 'KEYACMGR'
OR p9001-zrole_cd = 'AM'
OR p9001-zrole_cd = 'BSM'
OR p9001-zrole_cd = 'ENGMGR' ).
it_overseas-category = 'AM/BM/EM'.
ENDIF.
IF ( p9001-zrole_cd = 'PRINCIPAL'
OR p9001-zrole_cd = 'SRPRIN' ).
it_overseas-category = 'IBCS'.
ENDIF.
ENDFORM. " GET_CATEGORY
<b></b> -
I am new to HR-ABAP
i want to avoid this macro
rp-provide-from-last p0000 space pn-begda pn-endda.
plz send how to write code , with this place.
2. i want to move one internal table fileds to another table
but i do not use move-corresponding ? how plz send code1. to avoid the macro, here is exact code which works behind that macro.
SORT P0000.
PNP-SW-FOUND = '0'.
CLEAR PNP-SY-TABIX.
LOOP AT P0000.
IF P0000-BEGDA LE PN-ENDDA AND P0000-ENDDA GE PN-ENDDA.
PNP-SW-FOUND = '1'.
EXIT.
ENDIF.
IF P0000-BEGDA LE PN-ENDDA AND P0000-ENDDA GE PN-BEGDA.
PNP-SY-TABIX = SY-TABIX.
ENDIF.
ENDLOOP.
IF PNP-SW-FOUND EQ '0'.
IF PNP-SY-TABIX NE 0.
PNP-SW-FOUND = '1'.
READ TABLE P0000 INDEX PNP-SY-TABIX.
ELSE.
CLEAR P0000.
ENDIF.
ENDIF.
2. To assign an internal table to another without move coresponding, just copy like this:
it_new[] = it_old[]. -
Regarding ABAP Engine (Web AS 6.40)
Hi All
Can you please tell me wheather we have ABAP Engine ( WAS 6.30 or 6.40 Evoluation ) in the SDN.SAP.com.
Thanks In Advance
Regards
SaravananHi,
As fas as I know there is no evaluation version yet of either 6.30 or 6.40 WAS ABAP stack.
There is however a NetWeaver demo available from SAP shop, but only for Linux. Maybe somebody knows if that includes an ABAP stack or not.
Regards -
Hi everyone,
Would anyone let me know the complete steps for configuring ABAP Mapping.
Regards,
Varun Reddy.KHi,
Inorder to configure an ABAP mapping do the follwoing steps.
1) Goto SE24 tcode and createa custom object e.g. 'Z_TEST_ABAP_MAPPING''
2) Use the standard interface IF_MAPPING in your object.
3) Now write your piece of code in the method IF_MAPPING~EXECUTE .
METHOD IF_MAPPING~EXECUTE.
initialize iXML
TYPE-POOLS: IXML.
CLASS CL_IXML DEFINITION LOAD.
create main factory
DATA: IXMLFACTORY TYPE REF TO IF_IXML.
IXMLFACTORY = CL_IXML=>CREATE( ).
create stream factory
DATA: STREAMFACTORY TYPE REF TO IF_IXML_STREAM_FACTORY.
STREAMFACTORY = IXMLFACTORY->CREATE_STREAM_FACTORY( ).
create input stream
DATA: ISTREAM TYPE REF TO IF_IXML_ISTREAM.
ISTREAM = STREAMFACTORY->CREATE_ISTREAM_XSTRING( SOURCE ).
parse input document =================================================
initialize input document
DATA: IDOCUMENT TYPE REF TO IF_IXML_DOCUMENT.
IDOCUMENT = IXMLFACTORY->CREATE_DOCUMENT( ).
parse input document
DATA: IPARSER TYPE REF TO IF_IXML_PARSER.
IPARSER = IXMLFACTORY->CREATE_PARSER( STREAM_FACTORY = STREAMFACTORY
ISTREAM = ISTREAM
DOCUMENT = IDOCUMENT ).
IPARSER->PARSE( ).
get message content of tag <BookingCode>
DATA: INCODE TYPE REF TO IF_IXML_NODE_COLLECTION.
INCODE = IDOCUMENT->GET_ELEMENTS_BY_TAG_NAME( 'BookingCode' ).
get XI header data (here: "Sender Service")
DATA: L_SENDER_SERVICE TYPE STRING.
L_SENDER_SERVICE = PARAM->GET( IF_MAPPING_PARAM=>SENDER_SERVICE ).
add trace (appears in message monitoring)
DATA: L_TRACE TYPE STRING.
CONCATENATE 'Sender Service = ' L_SENDER_SERVICE INTO L_TRACE.
TRACE->TRACE( LEVEL = '1'
MESSAGE = L_TRACE ).
build up output document =============================================
create output document
DATA: ODOCUMENT TYPE REF TO IF_IXML_DOCUMENT.
ODOCUMENT = IXMLFACTORY->CREATE_DOCUMENT( ).
create element 'SenderService' and add it to the document
DATA: MSGTYPE TYPE REF TO IF_IXML_ELEMENT.
MSGTYPE = ODOCUMENT->CREATE_SIMPLE_ELEMENT(
NAME = 'MsgOut'
PARENT = ODOCUMENT ).
create element 'SenderService' and add it to the output document
DATA: ELEMENTSENDER TYPE REF TO IF_IXML_ELEMENT.
ELEMENTSENDER = ODOCUMENT->CREATE_SIMPLE_ELEMENT(
NAME = 'SenderService'
VALUE = L_SENDER_SERVICE
PARENT = MSGTYPE ).
add node to the output document
DATA: OUTCODE TYPE REF TO IF_IXML_NODE.
OUTCODE = INCODE->GET_ITEM( INDEX = 0 ).
DATA IRC TYPE I.
IRC = MSGTYPE->APPEND_CHILD( OUTCODE ).
render document ======================================================
create output stream
DATA: OSTREAM TYPE REF TO IF_IXML_OSTREAM.
OSTREAM = STREAMFACTORY->CREATE_OSTREAM_XSTRING( RESULT ).
create renderer
DATA: RENDERER TYPE REF TO IF_IXML_RENDERER.
RENDERER = IXMLFACTORY->CREATE_RENDERER( OSTREAM = OSTREAM
DOCUMENT = ODOCUMENT ).
IRC = RENDERER->RENDER( ).
ENDMETHOD.
Now Add additional mapping types in your Exchange Profile:
com.sap.aii.repository.mapping.additionaltypes
Create a new Interface Mapping
Select Mapping Type Abap-class
Enter the name of the ABAP-OO class
Rest of the mapping proceedure remains the same..
Reward points if found useful
Regds,
Sandeep -
Regarding ABAP Dump found when saving the job.
Hi all,
Generally we create a job and once the job is created,we rasie Sales Order,Purchase Order and so on.
When we create a job we give the details of the Sold -to-party,client,parent and child job text,advertising category,project type, sales organisation,Cost and profit center,person incharge and purchase division.
After submitting these details the job gets created and the job number will be generated.
But now we have created a new Sales Organisation, which is leading to ABAP Dump.
The functional people have concluded that there is nothing wrong in the configaration settings.
If we enter an existing sales organisation in the job creation process the job is getting created and the job number is displayed.
But if we try to enter a new sales organisation the ABAP Dump is comming.
After debugging we came to know that BAPI function Module called
Bapi Project Maintain Call and inside that there is another bapi call called
BAPI_PROJECT_MAINTAIN which is taking some structures as inputs among them
this new sales org is there.Hi all,
Is there any answer regarding this question.
Thanx in advance -
Hi,
I want to learn SAP ABAP <b>HR</b>. So I need guidance how to start <u><i>HR ABAP</i></u>.
What is difference between normal ABAP and HR ABAP?
Please send me the documents to me if you have it via mail at <b>[email protected]</b>.
Waiting for your kind Reply.
Regards,
VMMhi,
here I am giving you some links what ever I am having prasanna.....
SAP HR
http://www.sapdevelopment.co.uk/hr/hrhome.htm
http://www.sap-basis-abap.com/saphr.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?track=NL-142&ad=500911#Transactions
http://help.sap.com/saphelp_47x200/helpdata/en/4f/d5275f575e11d189270000e8322f96/content.htm
http://www.sap-basis-abap.com/saphr.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?track=NL-142&ad=500911#Transactions
http://help.sap.com/saphelp_47x200/helpdata/en/4f/d5275f575e11d189270000e8322f96/content.htm
http://help.sap.com/saphelp_47x200/helpdata/en/4f/d5275f575e11d189270000e8322f96/content.htm
http://www.saptips.com/Previews/SAPtipsAugust-September2004TableOfContents.pdf
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?track=NL-142&ad=500911#Transactions
http://help.sap.com/saphelp_46c/helpdata/en/4f/d528be575e11d189270000e8322f96/frameset.htm.
http://www.sap-basis-abap.com/saphr.htm.
http://www.sapgenie.com/faq/hr.htm
http://www.sap-img.com/human/hr-faq.htm
http://www.sapdevelopment.co.uk/hr/hrhome.htm
http://www.sapgenie.com/mysap/mysap_hr.htm
Re: remunaration statement
HR ABAP
/message/1033820#1033820 [original link is broken]
http://sap.ittoolbox.com/groups/career/sap-career/interview-questions-needed-for-sap-hr-528597#
http://www.google.co.in/url?sa=U&start=3&q=http://www.fundoosite.com/interview-questions/type.asp%3FiType%3D72&e=15410
http://www.kyapoocha.com/category/sap-abap-interview-questions/
http://classifieds.sulekha.com/atlanta/clad.aspx?cid=840216&nma=ATL
http://searchsap.techtarget.com/general/0,295582,sid21_gci1091992,00.html
Re: Hr ABAP
Re: HR ABAP FAQS
If you find useful mark the points
~~Guduri -
Hi Friends
I am new to ABAP-HR.I am trying to analyze below peace of code but not yet succeeded till.
So any one please illustrates me the below peace of code step-by-step.
DATA: is_i77pr LIKE t77pr.
DATA: temp1 LIKE result_struc_obj.
DATA: temp2 LIKE result_struc_obj.
DATA: tmp_pnext LIKE struc-pnext.
DATA: mgr_name LIKE objec-stext.
DATA: tmp_sytabx LIKE sy-tabix.
CLEAR: result_tab_obj.
REFRESH: result_tab_obj.
evpath = 'ZPXO_GEN'.
CALL FUNCTION 'RH_STRUC_GET_MULTIPLE_ROOTS'
EXPORTING
act_wegid = evpath
ACT_INT_FLAG =
ACT_PLVAR = ' '
act_svect = '1'
act_begda = sy-datum
act_endda = sy-datum
act_tdepth = 0
act_tflag = 'X'
act_vflag = 'X'
act_sflag = 'X'
act_recurs = 'X'
act_text_buffer_fill = 'X'
authority_check = 'X'
BUFFER_MODE = ' '
keep_order = 'X'
IMPORTING
ACT_PLVAR =
ROOT_COPY =
TABLES
root_objects = root_objects
result_objec = result_objec_obj
result_struc = result_struc_obj
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
path_not_found = 3
root_not_found = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Delete Root Org Unit's Chief Personnel No.
LOOP AT root_objects.
REFRESH: result_tab_obj.
CLEAR: result_tab_obj.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'O'
act_objid = root_objects-objid
act_wegid = 'ZPX_CFPN'
act_begda = begda
act_endda = endda
TABLES
result_tab = result_tab_obj
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
LOOP AT result_tab_obj WHERE otype = 'P'.
Append Root Org Unit's Mgr Name into Description...
CLEAR: mgr_name.
LOOP AT result_objec_obj WHERE otype = 'P' AND objid = result_tab_obj-objid.
mgr_name = result_objec_obj-stext.
CONCATENATE mgr_name ')' INTO mgr_name.
CONCATENATE '(Mgr:' mgr_name INTO mgr_name
SEPARATED BY space.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
LOOP AT result_objec_obj WHERE otype = 'O' AND objid = root_objects-objid.
CONCATENATE result_objec_obj-stext mgr_name INTO result_objec_obj-stext
SEPARATED BY space.
MODIFY result_objec_obj. CLEAR result_objec_obj.
ENDLOOP.
ENDIF.
CLEAR: temp1, temp2.
Get references of Chief person...
LOOP AT result_struc_obj
WHERE otype = result_tab_obj-otype
AND objid = result_tab_obj-objid.
MOVE-CORRESPONDING result_struc_obj TO temp1.
ENDLOOP.
Get reference of Root Org.Unit...
LOOP AT result_struc_obj
WHERE otype = root_objects-otype
AND objid = root_objects-objid.
MOVE-CORRESPONDING result_struc_obj TO temp2.
ENDLOOP.
CLEAR : tmp_sytabx .
LOOP AT result_struc_obj
WHERE otype = result_tab_obj-otype
AND objid = result_tab_obj-objid
AND pup = temp2-seqnr.
tmp_sytabx = sy-tabix.
ENDLOOP.
LOOP AT result_objec_obj
WHERE otype = result_tab_obj-otype
AND objid = result_tab_obj-objid.
IF sy-tabix = tmp_sytabx.
DELETE result_objec_obj.
EXIT.
ENDIF.
ENDLOOP.
DELETE result_struc_obj
WHERE otype = result_tab_obj-otype
AND objid = result_tab_obj-objid
AND pup = temp2-seqnr.
1. If the value in field STRUCS-PDOWN for object U, which is
located above D, corresponds to the value STRUCS-SEQNR for D,
set the value of U STRUCS-PDOWN to the value of D STRUCS-PNEXT.
Reduce the value of U STRUCS-VCOUNT by 1.
CLEAR: tmp_pnext.
tmp_pnext = temp1-pup.
LOOP AT result_struc_obj WHERE seqnr = tmp_pnext.
result_struc_obj-vcount = result_struc_obj-vcount - 1.
MODIFY result_struc_obj. CLEAR result_struc_obj.
ENDLOOP.
CLEAR: tmp_pnext.
tmp_pnext = temp1-seqnr.
LOOP AT result_struc_obj WHERE pdown = tmp_pnext.
result_struc_obj-pdown = temp1-pnext.
MODIFY result_struc_obj. CLEAR result_struc_obj.
ENDLOOP.
2. If an object P exists, for which the value STRUCS-PNEXT corresponds
to the value of D STRUCS-SEQNR, set the value of P STRUCS-PNEXT
to the value of D STRUCS-PNEXT.
CLEAR: tmp_pnext.
tmp_pnext = temp1-seqnr.
LOOP AT result_struc_obj WHERE pnext = tmp_pnext.
result_struc_obj-pnext = temp1-pnext.
MODIFY result_struc_obj. CLEAR result_struc_obj.
ENDLOOP.
3. If an object N exists, for which the value STRUCS-PREV corresponds to
the value of D STRUCS-SEQNR, set the value of N STRUCS-PPREV to the value
of D STRUCS-PPREV.
CLEAR: tmp_pnext.
tmp_pnext = temp1-seqnr.
LOOP AT result_struc_obj WHERE pprev = tmp_pnext.
result_struc_obj-pprev = temp1-pprev.
MODIFY result_struc_obj. CLEAR result_struc_obj.
ENDLOOP.
ENDLOOP.
ENDLOOP.
@ start of code - vinay golchha
Data declarations
data : root_orgid type realo.
DATA : root_mgr_pernr TYPE realo.
DATA : emp_pernr TYPE realo.
DATA : mgr_pernr TYPE realo.
DATA : org_unit_id TYPE realo.
DATA : pernr_tabix LIKE sy-tabix.
DATA : struc_tabix LIKE sy-tabix.
DATA: leading_pos LIKE hrobject OCCURS 0 WITH HEADER LINE.
DATA : direct_emp_flag TYPE c VALUE ' '.
DATA: i1001 LIKE hri1001 OCCURS 0 WITH HEADER LINE.
DATA : root_mgr_pernr1 TYPE sobid.
DATA : result_objec_obj1 LIKE STANDARD TABLE OF result_objec_obj WITH HEADER LINE.
DATA : org_seqnr TYPE sseqnr.
Loop through all the root org units
LOOP AT root_objects.
result_objec_obj1[] = result_objec_obj[].
Get the Root Org Unit
root_orgid = root_objects-objid.
Get the Manager of the Root Org Unit
CALL FUNCTION 'RH_GET_LEADER'
EXPORTING
plvar = '01'
keydate = sy-datum
otype = 'O'
objid = root_orgid
IMPORTING
leader_id = root_mgr_pernr
EXCEPTIONS
no_leader_found = 1
no_leading_position_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Looping through the Employees for Root Org Unit
LOOP AT result_objec_obj1 WHERE otype = 'P'.
emp_pernr = result_objec_obj1-objid.
Set thye direct employee flag to blank
direct_emp_flag = ' '.
Get the leading positions
REFRESH leading_pos.
CALL FUNCTION 'RH_GET_LEADING_POSITION'
EXPORTING
plvar = '01'
otype = 'P'
sobid = emp_pernr
TABLES
leading_pos = leading_pos
EXCEPTIONS
no_lead_pos_found = 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 through the leading positions if there are
multiple leading positions
LOOP AT leading_pos.
org_unit_id = leading_pos-objid.
Get the Manager
REFRESH i1001.
CALL FUNCTION 'RHOM_READ_RELAT_BUFFERED'
EXPORTING
otype = 'S'
objid = leading_pos-objid
plvar = '01'
subty = 'A008'
TABLES
i1001 = i1001
EXCEPTIONS
no_active_plvar = 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.
root_mgr_pernr1 = root_mgr_pernr.
READ TABLE i1001 WITH KEY sobid = root_mgr_pernr1.
If manager found set directly reporting flag as 'X'
IF sy-subrc = 0.
direct_emp_flag = 'X'.
EXIT.
ENDIF.
ENDLOOP.
If the current Employee manager is NOT equal to Root Org Unit's Manager
IF direct_emp_flag = ' '.
Get sequence number of org unit
READ TABLE result_struc_obj
WITH KEY otype = root_objects-otype
objid = root_objects-objid.
org_seqnr = result_struc_obj-seqnr.
Remove entry from result_struc_obj and modify the table accordingly
CLEAR : temp1, temp2,tmp_sytabx.
LOOP AT result_struc_obj
WHERE otype = 'P'
AND objid = emp_pernr
AND pup = org_seqnr.
MOVE-CORRESPONDING result_struc_obj TO temp1.
ENDLOOP.
LOOP AT result_struc_obj
WHERE otype = root_objects-otype
AND objid = root_objects-objid.
MOVE-CORRESPONDING result_struc_obj TO temp2.
ENDLOOP.
CLEAR struc_tabix.
LOOP AT result_struc_obj
WHERE otype = 'P'
AND objid = emp_pernr
AND pup = temp2-seqnr.
struc_tabix = sy-tabix.
ENDLOOP.
LOOP AT result_objec_obj
WHERE otype ='P'
AND objid = emp_pernr.
Delete entry for directly reporting employee
IF sy-tabix = struc_tabix.
DELETE result_objec_obj.
EXIT.
ENDIF.
ENDLOOP.
DELETE result_struc_obj
WHERE otype = 'P'
AND objid = emp_pernr
AND pup = temp2-seqnr.
Delete count of vertically related objects by 1
if record deleted
CLEAR tmp_pnext.
tmp_pnext = temp1-pup.
LOOP AT result_struc_obj WHERE seqnr = tmp_pnext.
result_struc_obj-vcount = result_struc_obj-vcount - 1.
MODIFY result_struc_obj.
CLEAR result_struc_obj.
ENDLOOP.
Set the down pointer of the record previous to the
deleted one to the next pointer of the deleted one
CLEAR tmp_pnext.
tmp_pnext = temp1-seqnr.
LOOP AT result_struc_obj WHERE pdown = tmp_pnext.
result_struc_obj-pdown = temp1-pnext.
MODIFY result_struc_obj.
CLEAR result_struc_obj.
ENDLOOP.
Set the next pointer of the record previous to the deleted
one to the next pointer of the deleted one
CLEAR tmp_pnext.
tmp_pnext = temp1-seqnr.
LOOP AT result_struc_obj WHERE pnext = tmp_pnext.
result_struc_obj-pnext = temp1-pnext.
MODIFY result_struc_obj.
CLEAR result_struc_obj.
ENDLOOP.
Set the value of previous pointer
CLEAR tmp_pnext.
tmp_pnext = temp1-seqnr.
LOOP AT result_struc_obj WHERE pprev = tmp_pnext.
result_struc_obj-pprev = temp1-pprev.
MODIFY result_struc_obj.
CLEAR result_struc_obj.
ENDLOOP.
ENDIF.
ENDLOOP.
ENDLOOP.
@ End of Code - Vinay Golchha
REFRESH: result_objec, result_struc.
CLEAR: result_objec, result_struc.
result_objec[] = result_objec_obj[].
result_struc[] = result_struc_obj[].
Regards,
SreeHi,
1) DATA: temp1 LIKE result_struc_obj.-
it declares temp1 as a internal table of result_struc_obj table that means temp1 posses all functionality, attributes of result_struc_obj.
and we are not directly make any changes to database table for that we must have create internal table.
2) In the HR ABAP, there are function modules for everything.
like in your code 'RH_GET_LEADER' FM gives manager ID of that person.
If you want to know how this function module works just go to
SE37->give function module name->display-> on the Toolbar you will see ' Function module Documentation' option.
3) IF sy-subrc = 0.
sy-subrc 0 means your Function module worked out and get output. otherwise there must be some error.
4) CLEAR- clears header line of the internal table.
REFRESH- clears contents or body of the table.
5) LOOP AT root_objects.
ENDLOOP.
it will go through each record of the table root_objects. it will help when you want to check each record of the table. we can give any conditon after loop at. on that basis loop will execute.
6) READ TABLE -
it reads one record of the table at a time.
7) MOVE-CORRESPONDING - it will move all record to respective fields.
reward if useful. -
Regarding ABAP query layout changes
In 46C system, we have addon transaction ZXX created thru ABAP query displaying in ALV report
layout fields in order A,B,C,D. But after upgrade to ECC5.0 we found the layout is changed to fields D,B,C,A.
why its changed? Is it Patch problem or its SAP problem.
However after upgrade we could manualy drag and drop the fields as per the 46C existing report layout
it works fine.
But we would like to know the reason why its happenning.?
Could somebody give me suggestion.
Regards
AmbichanHi Ambikumar,
The ALV output layout is dependent on user settings.
THe order of layout fields is changed bcz user has saved the new layout.
In the output, check the ALV toolbar for CHANGE LAYOUT button. Click on it & check if anyone has saved any new layout. Delete the layout & you would alwyz get the fields in the same order as specified in the query.
No need to modify the query using SQ01/SQ02.
Simply execute the query & click button CHANGE LAYOUT.
Best regards,
Prashant -
Hi Gurus, regarding ABAP-CRM docs
Hi Gurus,
Now I am working in PCUI.
What an abaper needs to know to work in ABAP-CRM.
Should we know CRM funcionalities in deep?
I want to know what sort of work tehcnially people will do in ABAP-CRM. IS it simply with BADI's.
Please send me some related documents to work with ABAP-CRM. It will be very helpful to me.
my id <removed by SAP Community Network Moderator>
Regards,
Ramakrishna.Hi Tulasi,
To find the CRM Material refer the following link created by the forum moderator :
Link to CRM documentation :
Links to CRM Documentation
<b>Reward points if it helps.</b> -
Help regarding ABAP and ABAP Objects
Dear all,
I am very new in abap and abap objects. But i have some expr. in other language..specialy development. Right now i am working for srm module...So i want to move my self into abap object and specialy in workflow...Please provide me help regarding this...along with the starting point for this.
Best Regards
Vijay Patilhi
Object Oriented prg
A programming technique in which solutions reflect real world objects
What are objects ?
An object is an instantiation of a class. E.g. If Animal is a class, A cat
can be an object of that class .
With respect to code, Object refers to a set of services ( methods /
attributes ) and can contain data
What are classes ?
A class defines the properties of an object. A class can be instantiated
as many number of times
Advantages of Object Orientated approach
Easier to understand when the system is complex
Easy to make changes
Encapsulation - Can restrict the visibility of the data ( Restrict the access to the data )
Polymorphism - Identically named methods behave differently in different classes
Inheritance - You can use an existing class to define a new class
Polymorphism and inheritance lead to code reuse
Have a look at these good links for OO ABAP-
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
http://www.allsaplinks.com/
http://www.sap-img.com/
http://www.sapgenie.com/
http://help.sap.com
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com.
http://www.sapgenie.com/abap/OO/index.htm
http://www.sapgenie.com/abap/controls/index.htm
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
check the below links lot of info and examples r there
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
Check this cool weblog:
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
http://www.allsaplinks.com/
http://www.sap-img.com/
http://www.sapgenie.com/
http://help.sap.com
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://www.sapgenie.com/abap/controls/index.htm
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
these links
http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
For funtion module to class
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
for classes
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
for methods
http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
for inheritance
http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
for interfaces
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
Hope this helps
if it helped, you can acknowledge the same by rewarding
regards
ankit
Maybe you are looking for
-
A window popped up stating that there is a new version of iTunes 10.7 to download. I clicked the button to install the new version, and a short time later got an error. It said to try to go to Tools and download it manually. I did this and it down
-
I have a lot of HD video on my hard drive that I eventually want to edit in iMovie, but just don't have the time now. It is clogging up the computer, though. How do I take the Hd clips off Mac for later editing?
-
Dear all I still confuse with Logical System in ALE where we already have Client. And I see that relationship between Client and Logical System is 1:1 So why we need Logical System instead just use Client ? Regards, Halomoan
-
Menu drop won't show hover effect in IE
This was working. Not sure what I did. http://www.flair-productions.com/social.html All the pages under "portfolio" drop down have this issue. We embeded the swfoject to get the menu to drop over the flash file. Now in mac on the drop down it functio
-
I have recently installed the newest Java version on my XP computer. I can't get it to compile the programs I have written. I have it saved in C:/Program Files/java_save. When I go to compile I get "javac is not a recognized action or file name." I h