Function RH_STRUC_GET
Hi All,
I'm using this function to get the staffing assignment.
But in case I have more than one person holding position the function return only one holder.
Are there any other functions that return structure (according to root objects and evaluation path) with all holders?
Thanks in advance
Itzik
Hi,
Try with the FM RH_READ_INFTY_1001 but here you have write some custom code for that.
Thanks & Regards,
Sandip Biswas.
Similar Messages
-
Function module to retrieve all the personnel numbers in the eval path
Hi all,
I want to retrieve all the personnel numbers that fall in the evaluation path.
Like if my evaluation path is "B002" ( eval path for relationship is line supervisor of ), I want a function module that retrieves all the pernrs in this wval path up to the bottom level.
if A reports to B and B reports to C and C reports to D . I want a function module to retrieve(either positions or pernrs) C, B and A when I run it for position D.
any help??
regards
Sam
regards
SamHi
U can use FM RH_STRUC_GET to get the pernr in the evaluation path
data : IT_RESULT_TAB TYPE STANDARD TABLE OF SWHACTOR .
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
ACT_OTYPE = C_OTYPE
ACT_OBJID = W_POSIT
ACT_WEGID = C_WEGID (relation B002 like )
ACT_BEGDA = W_BEGDA
ACT_ENDDA = W_BEGDA
ACT_TDEPTH = 1 ( depath 1, 2, etc )
TABLES
RESULT_TAB = IT_RESULT_TAB .
Nb : Give points if it worths -
Replace Function Module 'BBP_ORGUNIT_GET_EMPLOYEES'
Hi All,
we are in SRM5.0 upgrade. we are not able to find a replace function module of 'BBP_ORGUNIT_GET_EMPLOYEES' this.
if any one knows the replacement function module please and i could not find any replace function module in service market place, so is there any OSS notes available for this?
Thanks,
John.Hello John,
On a similar upgrade, I used the function RH_STRUC_GET with input parameter ACT_WEGID (evaluation path) = 'O-S-CP'to replace 'BBP_ORGUNIT_GET_EMPLOYEES'.
Avaible evaluation path are defined in table T778A.
Rgds,
Pierre -
Hi,
I am using RH_STRUC_GET with evalPath O-O-S-P and get the or g structure. I then loop through the table obtained from RH_STRUC_GET and re-use RH_STRUC_GET with a evaluation path 'bossonly' to find out who the managers are. But it does not work. I get No ROOTS FOUND error.
When I try the function module RH_STRUC_GET separately with the same input fields then it works!!!
Please let me know if I am doing anything wrong. My code is shown below....
FUNCTION Z_ORGBUILDER_CONN.
""Local interface:
*" IMPORTING
*" VALUE(OTYPE) LIKE OBJEC-OTYPE
*" VALUE(OBJID) LIKE OBJEC-OBJID
*" VALUE(PATHID) LIKE GDSTR-WEGID
*" VALUE(PLVAR) LIKE OBJEC-PLVAR
*" EXPORTING
*" VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2
*" TABLES
*" L_ZCONN_TAB TYPE ZCONN_TAB
*" RESULT_TAB STRUCTURE SWHACTOR OPTIONAL
*" RESULT_OBJEC STRUCTURE OBJEC OPTIONAL
*" RESULT_STRUC STRUCTURE STRUC OPTIONAL
*" L_ZCONN_ORG TYPE ZCONN_TAB
*" L_ZCONN_POS_HOLDER TYPE ZCONN_POS_TAB
*" L_MANAGERS STRUCTURE OBJEC
DATA: z_struc type zconn_struc.
DATA: xresult_struc like result_struc.
DATA: yresult_struc like result_struc.
DATA: z_struc1 type zconn_struc.
DATA: z_struc_pos type zconn_position.
DATA: temp_tab LIKE SWHACTOR occurs 0 with HEADER LINE.
DATA: temp like struc-objid.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = otype
act_objid = objid
act_plvar = plvar
act_wegid = pathid
TABLES
result_tab = result_tab
result_struc = result_struc
result_objec = result_objec
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
RAISE no_roots_found.
ENDIF.
LOOP AT result_struc into xresult_struc.
read table result_struc into yresult_struc with key seqnr =
xresult_struc-pup.
if sy-subrc = 0.
z_struc-objectID = xresult_struc-OBJID.
z_struc-objectType = xresult_struc-otype.
z_struc-parentID = yresult_struc-objid.
z_struc-parentType = yresult_struc-otype.
endif.
Append z_struc to l_zconn_tab.
ENDLOOP.
LOOP AT l_zconn_tab.
if l_zconn_tab-objectType = 'O' or l_zconn_tab-objectType = 'S'.
z_struc1-objectID = l_zconn_tab-objectID.
z_struc1-objectType = l_zconn_tab-objectType.
z_struc1-parentID = l_zconn_tab-parentID.
z_struc1-parentType = l_zconn_tab-parentType.
Append z_struc1 to l_zconn_org.
endif.
ENDLOOP.
LOOP AT l_zconn_tab.
if l_zconn_tab-objectType = 'P'.
z_struc_pos-position = l_zconn_tab-parentID.
z_struc_pos-pos_holder = l_zconn_tab-objectID.
Append z_struc_pos to l_zconn_pos_holder.
endif.
ENDLOOP.
loop at result_struc.
if result_struc-otype = 'O'.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'O'
act_objid = result_struc-objid
act_plvar = '01'
act_wegid = 'bossonly'
TABLES
result_tab = temp_tab
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
RAISE no_roots_found.
ENDIF.
APPEND LINES OF temp_tab to L_managers.
endif.
endloop.
ENDFUNCTION.data: begin of itab occurs 0,
orgunit(10) type c,
mananger(30) type c,
end of itab.
* This will add a record to your itab
loop at result.
itab-orgunit = result-orgunit. " I don't know what fields they are
itab-manager = result-manager.
append itab.
endloop.
Please remember to award points for helpful answers and mark this post as solved if you question has been answered. Thanks.
Regards,
Rich Heilman -
Hello,
I am new to ABAP and i am trying to loop through one table and make another table if certain fields match. Here is my code. It does not work Any help would be greatly appreciated.
FUNCTION Z_ORGBUILDER_CONN.
""Local interface:
*" IMPORTING
*" VALUE(OTYPE) LIKE OBJEC-OTYPE
*" VALUE(OBJID) LIKE OBJEC-OBJID
*" VALUE(PATHID) LIKE GDSTR-WEGID
*" VALUE(PLVAR) LIKE OBJEC-PLVAR
*" EXPORTING
*" VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2
*" TABLES
*" L_ZCONN_TAB TYPE ZCONN_TAB
*" RESULT_TAB STRUCTURE SWHACTOR OPTIONAL
*" RESULT_OBJEC STRUCTURE OBJEC OPTIONAL
*" RESULT_STRUC STRUCTURE STRUC OPTIONAL
*" L_ZCONN_TAB1 TYPE ZCONN_TAB
DATA: z_struc type zconn_struc.
DATA: OBJectID type struc-objid.
DATA: pointer type struc-pup.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = otype
act_objid = objid
act_plvar = plvar
act_wegid = pathid
TABLES
result_tab = result_tab
result_struc = result_struc
result_objec = result_objec
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
RAISE no_roots_found.
ENDIF.
LOOP AT result_struc.
z_struc-objectID = result_struc-OBJID.
z_struc-pointer = result_struc-PUP.
Append z_struc to l_zconn_tab.
ENDLOOP.
LOOP AT l_zconn_tab.
objectid = l_zconn_tab-OBJectID.
pointer = l_zconn_tab-pointer.
PERFORM FIND_PARENT using objectID
pointer
changing l_zconn_tab1.
endloop.
ENDFUNCTION.
FORM FIND_PARENT using u_objectID like objectID
u_pointer like pointer
changing c_zconn_tab like l_zconn_tab1.
LOOP AT result_struc.
if result_struc-pup = u_pointer.
z_struc-objectID = u_objectID.
z_struc-parentID = result_struc-objid.
endif.
Append z_struc to l_zconn_tab.
ENDLOOP.
ENDFORM.I guess I might be missing something, all you need to do is read the table with a key into a different work area, then move the values in to your structure and append to new table.
FUNCTION Z_ORGBUILDER_CONN.
*"*"Local interface:
*" IMPORTING
*" VALUE(OTYPE) LIKE OBJEC-OTYPE
*" VALUE(OBJID) LIKE OBJEC-OBJID
*" VALUE(PATHID) LIKE GDSTR-WEGID
*" VALUE(PLVAR) LIKE OBJEC-PLVAR
*" EXPORTING
*" VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2
*" TABLES
*" L_ZCONN_TAB TYPE ZCONN_TAB
*" RESULT_TAB STRUCTURE SWHACTOR OPTIONAL
*" RESULT_OBJEC STRUCTURE OBJEC OPTIONAL
*" RESULT_STRUC STRUCTURE STRUC OPTIONAL
*" L_ZCONN_TAB1 TYPE ZCONN_TAB
DATA: z_struc type zconn_struc.
DATA: OBJectID type struc-objid.
DATA: pointer type struc-pup.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = otype
act_objid = objid
act_plvar = plvar
act_wegid = pathid
TABLES
result_tab = result_tab
result_struc = result_struc
result_objec = result_objec
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
RAISE no_roots_found.
ENDIF.
<b>LOOP AT result_struc into xresult_struc.
read table result_struc into yresult_struc
with key pup = xresult_struc-pup.
if sy-subrc = 0.
z_struc-objectID = xresult_struc-OBJID.
z_struc-parentID = yresult_struc-objid.
endif.
Append z_struc to l_zconn_tab.
ENDLOOP.</b>
ENDFUNCTION.
Regards,
Rich Heilman -
Working of 'RH_STRUC_GET'
Hello,
I have a following Org structure
O (Org1)
|_ S
| |_ P (P1)
|
|_ S
| |_ P (P2)
|
|_ O (Org2)
|_ S
|_ P (P3)
I want to get P1 and P2
I am using RH_STRUC_GET function module to retrieve the same.
This is how I am passing the parameters
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'O'
act_objid = Org1
act_wegid = 'O-S-P'
act_plvar = '01'
act_begda = sy-datum
act_endda = sy-datum
act_tdepth = 3
TABLES
result_tab = it_sw
result_objec = it_objec
result_struc = it_struc
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
This way the FM returns P1, P2 and P3, but I want only P1 and P2.
Why is it happening so?
Are the depth and evaluation path I mentioned correct?
How is the level considered. Since I am passing Org1, is that org unit considered as level 1? Or is it that the level 1starts from Org2?
Where can I get the documentation for the function module 'RH_STRUC_GET'?
Please help me out.
Thanks & Regards,
Reena
Edited by: Reena Kandula on Aug 18, 2009 2:16 PM
Edited by: Reena Kandula on Aug 18, 2009 2:21 PMReena,
The values you have passed in 'RH_STRUC_GET' are correct.
You wont be able to get 'P3' if you give 'Depth' as 3.
Level 1 starts from Org1.
In your structure Org1- level 1,
S - level 2,
P1 - level 3,
Org2 - level 2,
P3 - level 4 (won't be displayed).
You can check this structure level in table RESULT_STRUC , check the 2nd column which contains level number.
Regards,
Thyagu. -
Funtion RH_STRUC_GET
Dear all,
I have a question about the function RH_STRUC_GET.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'P'
act_objid = employee number
act_wegid = 'B025'
act_plvar = '01'
act_begda = '1900/01/01'
act_endda = '2010/01/01'
act_tflag = space
act_vflag = 'X'
authortiy_check = space
what i want to get is the begda in the result_object,
i can get a record from the result_object,but the begda
and endda is blank,and actually the record in the table
HRP1001,its begda and endda is not blank,
can anybody help me ?
thank you very muchHello,
Please try Function Module HR_EHS00_READ_HRP1001.
Regards
Sabu. -
RH_STRUC_GET get different result
All experts,
As i use this FM to get OM structure, the evalation path it 'MSSDIREC'. it can ge resutl, but , i use two logon ID to check this, it gets different result, how to do this?My parameters is like this:
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
ACT_OTYPE = 'O'
ACT_OBJID = it_org-sobid "50006642
ACT_WEGID = 'MSSDIREC' "evalation path
ACT_PLVAR = '01'
ACT_BEGDA = lv_date1 "wa_begda M1 "21.10.2009
ACT_ENDDA = lv_date1 "wa_endda "21.10.2009
TABLES
RESULT_TAB = lt_d_result_tab
EXCEPTIONS
NO_PLVAR_FOUND = 1
NO_ENTRY_FOUND = 2.
I use two Logon ID to test this FM, but it get two different result.
i want to know why there is different result in different ID,
Edited by: Kevin Leung on Oct 21, 2009 9:40 AM -
RH_STRUC_GET STRUC
Hi,
the function RH_STRUC_GET returns an structure of type struc wich contains 2 date pairs:
(VBEGDA, VENDDA) and (SBEGDA, SENDDA).
Does anyone know which dates do they correspond with?
I suppose that VBEGDA and VENDDA corresponds with the dates of the link between an object and its predecessor, but i don't know it for sure and i don't know what are SBEGDA and SENDDA.
Can anyone help me?
I have tried to read the RH_STRUC_GET code but i don't speak german and this makes it difficult to understand the comments in the code.i have answered myself making several tests with PPOME transaction
-
RH_STRUC_GET (HR ABAP)
Hi All,
I am using the fuinction module RH_STRUC_GET in a custom function module.
When i enter an object id which does not exist it should raise an exception. But when i execute the FM it does not raise the exception , but gives an error
'Structure 01 k 234536 B011: No agent found' (Here 234536 is the ID which does not exist)
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = w_otype
act_objid = w_obj_id
act_wegid = c_b011
act_plvar = c_01
act_begda = w_curr_dt
act_endda = w_curr_dt
TABLES
result_tab = w_result_tab
result_objec = w_result_objec
result_struc = w_result_struc.
IF sy-subrc <> 0.
RAISE no_entry_found.
ENDIF.
I also tried using like this
MESSAGE e170(5w) WITH c_01 w_otype
w_obj_id c_b011
RAISING no_entry_found.
But i still get it as an error. I want to get the exception instead
Thanks in advance.Hi
Have you defined the exception in the function module definition. No_ENTrY_FOUND should be defined as a exception and then it can be raised.
handle it like this:
CALL FUNCTION 'STRING_SPLIT'
EXCEPTIONS
NOT_FOUND = 7.
IF SY-SUBRC = 7.
WRITE / 'There is a problem.'.
ELSE.
ENDIF.
Reward points, if helpful -
'RH_STRUC_GET' having issues after upgrade
Hi Wokflow experts,
I have a program tha uses the FM 'RH_STRUC_GET' to get users from work centers. The FM interface is as below. It was working fine in SAP enterprise, but in ECC 6.0 this FM has stopped returning any values. It returns the exception Structure 01 A 50000100 WF_ORGUS: No agent found.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
ACT_OTYPE = OTYPE
ACT_OBJID = OBJID
ACT_WEGID = 'WF_ORGUS'
AUTHORITY_CHECK = ' '
Can anyone suggest a solution to this problem.
Regards,
Kartik N.Hi Kartik,
Check the values you are passing to the FM. Also fetch the output of table RESULT_TAB and see if you are getting values.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
ACT_OTYPE = <enter value>
ACT_OBJID = <enter value>
ACT_WEGID = <enter value>
AUTHORITY_CHECK = 'X'
TABLES
RESULT_TAB = result_tab
EXCEPTIONS
no_plvar_found = 01
no_entry_found = 02
OTHERS = 99.
Try passing the following values and check.
Regards,
Saumya -
Testing FM RH_STRUC_GET
Hi All,
i will like to test this FM RH_STRUC_GET. i thought it is used to get the position and organizational unit the user is linked to
I proceed as follow:
Se37
i filled:
0type:S
0BJID:persnr.
WEGID:A008
Flag:?
PLVAR:01
Begda:24.08.2010
ENDA:24.08.2010
TDEPTH (What does that mean?):?:?
TFLAG (What does that mean?):?:?
TVFLAG (What does that mean?):?:?
Authority Check (What does that mean?):?:?
Text_Buffer-fille (What does that mean?):?:?
Buffer_Mode (What does that mean?):?
Could anyone help?
Thanks
giloHi Gilo,
Please check this example :
DATA: IOBJEC LIKE OBJEC OCCURS 0 WITH HEADER LINE,
ISWHACTOR LIKE SWHACTOR OCCURS 0 WITH HEADER LINE,
ISTRUC LIKE STRUC OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
ACT_OTYPE = 'S'
ACT_OBJID = MGR_POS ---> <Position>
ACT_WEGID = 'ZSPS' -
> Relation
ACT_PLVAR = '01'
ACT_BEGDA = PCHBEGDA
ACT_ENDDA = PCHENDDA
ACT_TDEPTH = 2
TABLES
RESULT_TAB = ISWHACTOR
RESULT_OBJEC = IOBJEC
RESULT_STRUC = ISTRUC
EXCEPTIONS
NO_PLVAR_FOUND = 1
NO_ENTRY_FOUND = 2
OTHERS = 3.
Note : The Variable ACT_TDEPTH denotes -->To indicate how many levels of an organizational structure should be processed in an inquiry/report, enter the appropriate level numberFor example, if the field contains a 3, the system processes three levels of the structure, beginning from the organizational unit you select as the root object, down.
The below fields always used default values unless for special cases.
HRRHAS-TFLAG - is checked if you need to fetch the texts
HRRHAS-VFLAG - is checked if you need to fetch the relation ship information
HRRHAS-AUTHY - is checked if you need to check the authorization
TEXT_BUFFER_FILL - denotes a test run
Remember the Objid is position based on the object type and relation you selected.
Thank you,
Kumar
Edited by: Kumar B on Aug 24, 2010 12:37 PM -
FM RH_STRUC_GET and buffer_mode
Hi,
The FM RH_STRUC_GET offer an importing parameter called BUFFER_MODE. I have come across severel buffer modes i existing coding, like X, F and D.
My problem is that we are using the FM a lot. And I have a performance problem, that the FM doing a lot of identical selects on dababase.
Is there a place where I am able to get a list of all possible buffer modes, and som documentation on the differences of the modes.
Best regards,
Martin MolzHi Gilo,
Please check this example :
DATA: IOBJEC LIKE OBJEC OCCURS 0 WITH HEADER LINE,
ISWHACTOR LIKE SWHACTOR OCCURS 0 WITH HEADER LINE,
ISTRUC LIKE STRUC OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
ACT_OTYPE = 'S'
ACT_OBJID = MGR_POS ---> <Position>
ACT_WEGID = 'ZSPS' -
> Relation
ACT_PLVAR = '01'
ACT_BEGDA = PCHBEGDA
ACT_ENDDA = PCHENDDA
ACT_TDEPTH = 2
TABLES
RESULT_TAB = ISWHACTOR
RESULT_OBJEC = IOBJEC
RESULT_STRUC = ISTRUC
EXCEPTIONS
NO_PLVAR_FOUND = 1
NO_ENTRY_FOUND = 2
OTHERS = 3.
Note : The Variable ACT_TDEPTH denotes -->To indicate how many levels of an organizational structure should be processed in an inquiry/report, enter the appropriate level numberFor example, if the field contains a 3, the system processes three levels of the structure, beginning from the organizational unit you select as the root object, down.
The below fields always used default values unless for special cases.
HRRHAS-TFLAG - is checked if you need to fetch the texts
HRRHAS-VFLAG - is checked if you need to fetch the relation ship information
HRRHAS-AUTHY - is checked if you need to check the authorization
TEXT_BUFFER_FILL - denotes a test run
Remember the Objid is position based on the object type and relation you selected.
Thank you,
Kumar
Edited by: Kumar B on Aug 24, 2010 12:37 PM -
Any function module to retrieve all Payment Run Data
I am looking for a RFC enabled function module which would retrieve all the data related to Payment Run.( Tables REGUH REGUP, PAYR, BKPF, BSEG)
Any idea or pointers ?Hi
U can use FM RH_STRUC_GET to get the pernr in the evaluation path
data : IT_RESULT_TAB TYPE STANDARD TABLE OF SWHACTOR .
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
ACT_OTYPE = C_OTYPE
ACT_OBJID = W_POSIT
ACT_WEGID = C_WEGID (relation B002 like )
ACT_BEGDA = W_BEGDA
ACT_ENDDA = W_BEGDA
ACT_TDEPTH = 1 ( depath 1, 2, etc )
TABLES
RESULT_TAB = IT_RESULT_TAB .
Nb : Give points if it worths -
Regarding Function Module Execution
Hi Friends
I am using the FM: ARCHIVFILE_SERVER_TO_CLIEN.
With the parameters:
Path = /tmp/TEST EMP COMP COE ECM_MB_07.txt
And target Path = c:\Bonusbudget\TEST EMP COMP COE ECM_MB_07.txt
While executing this FM , if I checked the uppercase/lower case checkbox, I am getting the proper results otherwise I am getting the error that:
Error in opening file /TMP/TEST EMP COMP COE ECM_MB_07.TXT for reading (No such file or directory).
As I am calling this in my program and getting the above error.
Can anyone please suggest me the solution for this.
Points are assured for useful answers.
Regards,
SreeramHi Nick
Thanks.
See my code to correct:
VARIABLE DECLARATION
DATA: lv_single_line TYPE string, "To split the file contents
lv_objid TYPE hrobjid, "Holds the Org Unit ID
p_file TYPE rlgrap-filename,"File from Application Server
lv_file_budget TYPE string. "Source File Name
DATA: it_orgunit TYPE hap_t_hrsobid , " Id of Org. unit
it_suborgunits TYPE hap_t_hrsobid , " Ids of Sub Org Units
wa_orgunit TYPE LINE OF hap_t_hrsobid ," Work Area of orgunit
lv_sobid TYPE hrp1001-sobid , " Org. Unit
lv_stext TYPE stext, "Org.Unit Description
lv_user TYPE sy-uname , "User
lv_afile TYPE epsf-epsfilnam, "Application Server file name
lv_objid1 TYPE hrobjid, "Holds the Org Unit ID
lv_uzeit TYPE syuzeit, "Application Server's time
lv_tpath TYPE sapb-sappfad, "Target Path on the Desktop
lv_spath type SAPB-SAPPFAD. "Source File
CONSTANTS DECLARATION
CONSTANTS: c_split(5) TYPE c VALUE ' ', " File spliting indicator
c_rsign TYPE rsign VALUE 'A', "Relationship Indicator
c_relat TYPE relat VALUE '300',"Relation ship
c_file(255) TYPE c VALUE '/tmp/Bonusfile3.txt',
c_file(255) TYPE c VALUE '/tmp/Sample Budget Upload File.txt',
c_currency(5) TYPE c VALUE 'USD'.
CONSTANTS: c_plvar(4) TYPE c VALUE '01', "Plan Version
c_o(3) TYPE c VALUE 'O', "Object
c_otype(4) TYPE c VALUE 'BU', "Object type
c_rsign1 TYPE rsign VALUE 'B'."Relationship
CONSTANTS : c_x(3) TYPE c VALUE 'X',
c_0(3) TYPE c VALUE '0',
c_usd(5) TYPE c VALUE 'USD'.
CONSTANTS: c_otype1 TYPE otype VALUE 'US', "Object Type for User
c_otype2 TYPE otype VALUE 'O', "Org.Unit
c_evalpath TYPE gdstr-wegid VALUE 'SAP_MANG', "Evaluation path
c_depth TYPE hrrhas-tdepth VALUE '0',"Depth
c_underscore TYPE c VALUE '_', "Underscore
c_mb(4) TYPE c VALUE 'MB', "Merit Bonus
c_pb(4) TYPE c VALUE 'PB', "Performance Bonus
c_spot(6) TYPE c VALUE 'SPOT', "Spot Bonus
c_star TYPE c VALUE '*', "To fecth all files
c_dirname TYPE epsf-epsdirnam VALUE '/tmp', "Directory name
c_tpath TYPE sapb-sappfad VALUE 'c:\Bonusbudget\'. "Target Path on the Desktop
INTERNAL TABLE DECLARATION.
TYPES: BEGIN OF ty_budget,
orgunit TYPE orgeh, "Org.Unit
kcurr TYPE cmp_bu_kcurr, "Monetery Falg
butyp TYPE ecm_butyp, "Budget Type
budgetperiod TYPE cmp_bu_finyr, "Budget Period
oldam(20) TYPE c, "Amount
oldcu TYPE waers, "Currency
END OF ty_budget.
DATA: it_budget TYPE STANDARD TABLE OF ty_budget,
wa_budget TYPE ty_budget.
*INTERNAL TABLE & WORK AREA HOLDS THE MANAGER ORG.UNIT
DATA: it_obj_tab_tmp TYPE STANDARD TABLE OF hrrootob.
DATA: wa_obj_tab_tmp TYPE hrrootob.
DATA: it_dir_list TYPE STANDARD TABLE OF epsfili,
wa_dir_list TYPE epsfili.
lv_user = sy-uname.
lv_uzeit = sy-uzeit.
lv_user = 'DALKW1'.
p_file = c_file.
lv_file_budget = p_file.
CALL FUNCTION 'RH_STRUC_GET' "#EC *
EXPORTING
act_otype = c_otype1
act_objid = lv_user
act_wegid = c_evalpath
act_begda = sy-datum
act_endda = sy-datum
act_tdepth = c_depth
TABLES
result_tab = it_obj_tab_tmp
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
LOOP AT it_obj_tab_tmp INTO wa_obj_tab_tmp.
lv_objid1 = wa_obj_tab_tmp-objid.
ENDLOOP.
SELECT SINGLE stext
FROM hrp1000
INTO lv_stext
WHERE otype = c_otype2
AND objid = lv_objid1.
IF sy-subrc EQ 0.
CONCATENATE lv_stext+0(18) c_star INTO lv_afile.
ENDIF.
GET THE FILE NAMES BY PASSING THE DIRECTORY NAME AND FILE NAME.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = c_dirname
file_mask = lv_afile
TABLES
dir_list = it_dir_list
EXCEPTIONS
invalid_eps_subdir = 1
sapgparam_failed = 2
build_directory_failed = 3
no_authorization = 4
read_directory_failed = 5
too_many_read_errors = 6
empty_directory_list = 7
OTHERS = 8.
IF sy-subrc EQ 0.
LOOP AT it_dir_list INTO wa_dir_list.
CONCATENATE c_tpath wa_dir_list-name INTO lv_tpath.
lv_spath = wa_dir_list-name.
concatenate c_dirname '/' lv_spath into lv_spath.
DOWNLOAD THE FILE TO THE PRESENATATION SERVER PATH.
CALL FUNCTION 'ARCHIVFILE_SERVER_TO_CLIENT'
EXPORTING
path = lv_spath
targetpath = lv_tpath
EXCEPTIONS
error_file = 1
OTHERS = 2.
IF sy-subrc EQ 0.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_tpath
filetype = 'ASC'
TABLES
data_tab = it_budget.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
CLEAR lv_tpath.
ENDLOOP.
ENDIF.
Regards,
Sree
Maybe you are looking for
-
View of values in nested table attribute of object type
Hi, I have:create or replace type ctx_line is object ( ctx_name varchar2(40), ctx_value varchar2(1000) create or replace type ctx_tab is table of ctx_line; create type tp as object ( id number, ctx ctx_tab create table tt of tp nest
-
Linking to more than one point in a PDF from a browser
Hi guys, i have been tasked with creating a website to house a few pdf's. I have set this up so that you click a link in the navigation and it displays the pdf in a frame on the right side of the page and goes directly to the page i specify. The prob
-
Iphoto needs aperture update (I dont have aperture)
Today I went to open iPhoto, and it says "To open this Aperture Library in iPhoto, you need Aperture 3.3 or later" The only thing is I don't have aperture, nor do I recall ever installing it in the past. I tried holding down command/option to reconfi
-
Mapviewer Map Tile layers in admin page
Just switched mapviewer over from AS10g to WebLogic10.3 and even though I kept the same config my cached maps are not showing up in the admin section. Anyone know how mapviewer loads the Map Tile Layers shown on the admin page ? The database is the s
-
When I save a document, it does not show up in Documents for a long time. I can use Finder to find and open the document if I can remember what I named it. Sometimes I remember the subject, but I can't remember the name I gave it, but it usually show