RH_RELATION_MAINTAIN/RH_INSERT_INFTY
I am trying to insert a new HRP1001 Cost Center record in a program and have been trying to use the above Function Modules. The problem I am having is that when they encounter a CONFIG problem, like the Cost Center is not open for posting, instead of coming back with a Return-Code other than 0 they are giving me the message in real time and actually starting the Transaction (PO02) in the first case and exiting the program in the 2nd case. Neither is an acceptable solution. I want it to just let me know it didn't work and keep going. Is this the way these are supposed to work?
When you are calling your FM give an extra exception parameter ERROR_MESSAGE i.e. = 9.
Now when some message of type I,S, W will be raised it will automatically be skipped. Messages E, A will trigger that error so you can react accordingly outside FM. Message X will dump the systme out.
This way you can handle old function modules which don't use exceptions or simply call some message inside their body. This is a preety handful way to handle such situations.
As for calling tcode PO02 I am not sure about that. If the processing requires that you will likely be branched to this tcode anyway.
Regards
Marcin
Similar Messages
-
Replacement for RH_RELATION_MAINTAIN
Hello everybody,
I've been using RH_RELATION_MAINTAIN function to create relation between objects for quite a while now.
Problem is that this function is not released, and its hard to trace errors in it.
The function doesnt have a proper error reporting, and sometimes throws an "Action Canceled" error instead of catcheble exceptions.
This leads to an undesired behavior which cannot be caught in code.
Is there another function that does the same operation and Is released / has a proper dump catching ?
thanks in advance,
Eli.Eli,
Try using any of the below function modules.
1) RH_PNNNN_MAINTAIN
2) RH_RELATION_WRITE
3) RH_INSERT_INFTY_1001_EXT
4) RH_INSERT_INFTY
Regards
Bala -
Checking Lock Status of Object before passing it to FM RH_RELATION_MAINTAIN
hi all,
While passing the object id to FM RH_RELATION_MAINTAIN if object id is locked i.e say open in a standard tcode then,this FM terminates.
is there any way to detect whether this Object is Locked or not before passing it to FM ??? this way i cud give the status msg that the " given object is locked" without termination the program.>
Ajay84 wrote:
> hi all,
> While passing the object id to FM RH_RELATION_MAINTAIN if object id is locked i.e say open in a standard tcode then,this FM terminates.
>
> is there any way to detect whether this Object is Locked or not before passing it to FM ??? this way i cud give the status msg that the " given object is locked" without termination the program.
Please check the FM 'HR_ENQUEUE_OBJECT', it is well documented.
Regards
Rajesh. -
RH_INSERT_INFTY in update mode not working properly
I am calling the FM RH_INSERT_INFTY using IN UPDATE TASK in my Inbound part of my IDOC.
The IDOC is getting generated successfully in the Outbound part but getting errorred out in the Inbound side.
I have checked for the attributes of the FM where the type of FM is NORMAL FUNCTION MODULE.
any pointers on this will be of immense help to me.This is the output of journalctl --all
May 12 20:55:04 egidiolaptop /usr/lib/gdm/gdm-x-session[19552]: Activating service name='org.gnome.Terminal'
May 12 20:55:04 egidiolaptop /usr/lib/gdm/gdm-x-session[19552]: Successfully activated service 'org.gnome.Terminal'
May 12 20:55:26 egidiolaptop gnome-session[19563]: 1431456926458 addons.update-checker WARN Update manifest for {972ce4c6-7e08-4474-a285-3208198ce6fd} did not contain an updates property
May 12 20:56:03 egidiolaptop systemd[19544]: [/home/egidio/.config/systemd/user/googledrive.service:2] Unknown lvalue 'Type' in section 'Unit'
May 12 20:56:03 egidiolaptop systemd[19544]: Cannot add dependency job for unit network-online.target, ignoring: Unit network-online.target failed to load: No such file or directory.
May 12 20:56:03 egidiolaptop systemd[19544]: Created slice -.slice.
May 12 20:56:03 egidiolaptop systemd[19544]: Starting -.slice.
May 12 20:56:03 egidiolaptop systemd[19544]: Started Google Drive mount.
May 12 20:56:03 egidiolaptop systemd[19544]: Starting Google Drive mount...
May 12 20:56:03 egidiolaptop fusermount[20547]: /usr/bin/fusermount: failed to unmount /home/egidio/Google Drive: Device or resource busy
May 12 20:56:03 egidiolaptop systemd[19544]: googledrive.service: control process exited, code=exited status=1
May 12 20:56:03 egidiolaptop systemd[19544]: Unit googledrive.service entered failed state.
May 12 20:56:03 egidiolaptop systemd[19544]: googledrive.service failed. -
Exception Handling in RH_RELATION_MAINTAIN
can we use Try...Catch Blocks for Exception Handling in RH_RELATION_MAINTAIN.....coz i need to Track the Status message
coz most of the times it doesn't CATCH and Exception........and i need to send the status msg via Proxy n PI to the JAVA based system............
So i need to Catch the Exception ................Pls assist................:)
FORM create_a008 USING l_pernr l_plans l_begda
CHANGING l_success.
CALL FUNCTION 'RH_RELATION_MAINTAIN'
EXPORTING
act_fcode = 'INSE'
act_plvar = '01'
act_otype = 'S'
act_objid = l_plans
act_istat = '1'
act_rsign = 'A'
act_relat = '008'
act_sclas = 'P'
act_sobid = l_pernr
act_begda = l_begda
act_endda = '99991231'
EXCEPTIONS
maintainance_failed = 1
OTHERS = 2.
IF sy-subrc EQ 0.
l_success = 'X'.
ELSE.
CLEAR : l_success.
ENDIF.
ENDFORM.sdf
-
RH_INSERT_INFTY is not working in BADI
Hello.
I've got the following issue:
I'm using RH_INSERT_INFTY within a BADI, just to limit a record in INFTOTYPE 1000 and is not working, even i don't get any error messages.
The thing is that i'm using the same function within a single report and works fine, it looks like the behaviour of the FM is different within a BADI (I guess).
Any ideas?I'm locking the object in a previous form.....
FORM infotipo_1010
USING p_plaza TYPE objektid
p_fecha TYPE datum
p_plvar TYPE plvar..
DATA: l_t_hrp1010 TYPE STANDARD TABLE OF p1010,
l_t_aux_hrp1010 TYPE STANDARD TABLE OF p1010,
l_wa_t_hrp1010 TYPE p1010,
l_wa_t_aux_hrp1010 TYPE p1010,
l_t_objects TYPE STANDARD TABLE OF hrobject,
l_wa_t_objects TYPE hrobject.
l_wa_t_objects-plvar = p_plvar.
l_wa_t_objects-otype = 'S'.
l_wa_t_objects-objid = p_plaza.
APPEND l_wa_t_objects TO l_t_objects.
CALL FUNCTION 'RH_READ_INFTY'
EXPORTING
AUTHORITY = 'DISP'
WITH_STRU_AUTH = 'X'
infty = '1010'
ISTAT = ' '
EXTEND = 'X'
SUBTY = ' '
BEGDA = '19000101'
ENDDA = '99991231'
CONDITION = '00000'
INFTB = '1'
SORT = 'X'
VIA_T777D = ' '
TABLES
innnn = l_t_hrp1010
objects = l_t_objects
EXCEPTIONS
all_infty_with_subty = 1
nothing_found = 2
no_objects = 3
wrong_condition = 4
OTHERS = 5
IF sy-subrc = 0.
SORT l_t_hrp1010 BY subty endda ASCENDING.
LOOP AT l_t_hrp1010
INTO l_wa_t_hrp1010.
l_wa_t_aux_hrp1010 = l_wa_t_hrp1010.
AT END OF subty.
l_wa_t_aux_hrp1010-endda = p_fecha.
REFRESH: l_t_aux_hrp1010.
APPEND l_wa_t_aux_hrp1010 TO l_t_aux_hrp1010.
CALL FUNCTION 'RH_INSERT_INFTY'
EXPORTING
fcode = 'CUTI'
vtask = 'B'
ORDER_FLG = 'X'
COMMIT_FLG = 'X'
AUTHY = 'X'
PPPAR_IMP =
OLD_TABNR = ' '
REPID = ' '
FORM = ' '
KEEP_LUPD =
WORKF_ACTV = 'X'
TABLES
innnn = l_t_aux_hrp1010
ilfcode = l_t_objects
EXCEPTIONS
no_authorization = 1
error_during_insert = 2
repid_form_initial = 3
corr_exit = 4
begda_greater_endda = 5
OTHERS = 6.
ENDAT.
ENDLOOP.
ENDIF. -
RH_INSERT_INFTY not creating new records
Hi All,
I am using the FM RH_INSERT_INFTY to insert new records in HRP1000.
See the below FM call :
CALL FUNCTION 'RH_INSERT_INFTY'
EXPORTING
fcode = 'INSE'
vtask = 'D'
order_flg = 'X'
commit_flg = 'X'
authy = 'X'
PPPAR_IMP =
OLD_TABNR = ' '
REPID = ' '
FORM = ' '
keep_lupd = keep_lupd
TABLES
innnn = it_i1000
EXCEPTIONS
no_authorization = 1
error_during_insert = 2
repid_form_initial = 3
corr_exit = 4
begda_greater_endda = 5
OTHERS = 6.
But instead of creating new records it is changing the existing record in HRP1000.
Actually I want to create new records with different long text and short text in different languages so in case object id and object type even the dates can be same but the language would be different.
So I need to create a new records with a different language key and different short text. But this function module is changing the existing object short text,long text and language.
Could you please reply at the earliest.
Thanks & Regards,
PoonamHi,
you're right, this function didn't create new record when i want to create a record with same object but have different language.
you can use this function for your problem : RH_INSERT_INFTY_DIRECT
i tried and it works.
CALL FUNCTION 'RH_INSERT_INFTY_DIRECT'
EXPORTING
vtask = 'V'
KEEP_LUPD =
tables
innnn = p1000
EXCEPTIONS
NO_AUTHORIZATION = 1
ERROR_DURING_INSERT = 2
REPID_FORM_INITIAL = 3
CORR_EXIT = 4
BEGDA_GREATER_ENDDA = 5
OTHERS = 6
Regards, -
I'm trying to create a new infotype 1028 for one of the object of the structure.
Unfortunatly I cannot use the function module RH_INSERT_INFTY... Is there any other function modules to be used?
data : lit_1028 type standard table of hrp1028,
lwt_1028 like line of lit_1028.
lwt_1028-begda = c_begda.
lwt_1028-endda = c_endda.
lwt_1028-stras = c_stras.
lwt_1028-hausn = c_hausn.
lwt_1028-pstlz = c_pstlz.
lwt_1028-ort01 = c_ort01.
lwt_1028-land1 = c_land1.
lwt_1028-infty = '1028'.
append lwt_1028 to lit_1028.
call function 'RH_INSERT_INFTY'
exporting
* FCODE = 'INSE'
vtask = 'S'
* ORDER_FLG = 'X'
* COMMIT_FLG = 'X'
AUTHY = space
* PPPAR_IMP =
* OLD_TABNR = ' '
* REPID = ' '
* FORM = ' '
* KEEP_LUPD =
* WORKF_ACTV = 'X'
tables
innnn = lit_1028
exceptions
no_authorization = 1
error_during_insert = 2
repid_form_initial = 3
corr_exit = 4
begda_greater_endda = 5
others = 6.HI GOOD
go through this link,which might help you to solve your problem.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PE/PE.pdf
thanks
mrutyun^ -
Unable to create org unit using RH_INSERT_INFTY
All,
We are using internal number range to create Org Units in the SAP System. However, there are some org objects present in a legacy SAP system that we need to upload to the new ECC system and create relationships for them .
Following is my code for the RH_INSERT_INFTY function module :
w1000-mandt = sy-mandt.
w1000-plvar = '01'.
w1000-otype = 'O'.
w1000-OBJID = ''.
w1000-infty = '1000'.
w1000-ISTAT = '1'.
w1000-begda = '20090101'.
w1000-endda = '99991231'.
w1000-langu = 'E'.
w1000-short = 'HR_AST5'.
w1000-stext = 'HR Assistant 5'.
append w1000 to i1000.
CALL FUNCTION 'RH_INSERT_INFTY'
EXPORTING
FCODE = 'INSE'
VTASK = 'S'
ORDER_FLG = 'X'
COMMIT_FLG = 'X'
TABLES
INNNN = i1000
IF SY-SUBRC <> 0.
ENDIF.
I am however unable to create the org units as i get an error saying "Creation of object ID 00000000 is not allowed".
I know im getting this error because im leaving the objid field blank, but I figured since it is internal number range, i would have to give this as blank .
Could somebody please help me figure out how to load these Organizational Objects and their Relationships ?
Thanks,
AmitHi Amit
try to use 'D' as a value of VTASK
or use FM
call function 'RH_OBJECT_CREATE'
exporting
langu = l_langu
plvar = plvar
otype = c_otype
EXT_NUMBER = '00000000' "???
SHORT = ' '
stext = stext
begda = begda
endda = endda
ostat = l_istat
vtask = 'B'
GUID =
KEEP_LUPD = ' '
importing
objid = objid
exceptions
text_required = 1
invalid_otype = 2
invalid_date = 3
error_during_insert = 4
error_ext_number = 5
undefined = 6
others = 7.
In this FM u dont need to pass the Object ID and call function
*---if the above steps are succesful update the database
call function 'RH_UPDATE_DATABASE'
exporting
vtask = vtask
BUFFER_UPD = ' '
ORDER_FLG = 'X'
COMMIT_FLG = 'X'
CLEAR_BUFFER = 'X'
KEEP_LUPD =
WORKF_ACTV = 'X'
exceptions
corr_exit = 1
others = 2 .
as VTASK 'B' will create the entry in buffer and it will only commit to database after the secondFM
or u can try with 'D' as VTASK
Hope this will resolve ur issue
Regards
Guds -
On using RH_INSERT_INFTY to change HRP1000 status
Dear Gurus,
I'm using RH_INSERT_INFTY to change the status(ISTAT) of HRP1000.
According to the FM documentation: In the case of a status change, however, note the following: The fact that the record is deleted with the old status (except PLVO).
But the result seems that, when I change the ISTAT by using RH_INSERT_INFTY, the record with the old status is still there in the DB table HRP1000. I think the time constraint of HRP1000 must be set to 1.
Could you please advise how could I delete the record with the old status in this case?
Thanks & Best Regards,Thanks for the advice.
Finally, I have to delete the record by myself by calling FM RH_DELETE_INFTY_DIRECT.
Even if I changed only the ISTAT field of the HRP1000 record, say, from 1 to 2, the old record with ISTAT = 1 would not be deleted after I inerted the ISTAT = 2 record.
If we don't delete the record with ISTAT = 1 before hand, there will be 2 record in the HRP1000 table, all the fileds' value are the same except the ISTAT field.
But it's also very tricky that, it seems that if I change the ISTAT and the BEGDA/ENDDA in 1 FM call of RH_INSERT_INFTY, the ISTAT = 2 record will be delimited too.
Thanks anyway! -
Exception "NO AUTHORIZATION" in FM "RH_INSERT_INFTY"
Hi all,
My requirement is to create the Infotypes by simulating the PP01 transaction. I used the FM RH_INSERT_INFTY. I am able to create the OBJECT Infotype and ADDRESS Infortype. But, When i am trying to create the Reletionship Infotype with Relation type A002. It is returning an exception as "NO AUTHORIZATION" and created an Infotype with relation B027, which i did ot ask for.
Does creation of Relationship needs any authorization?. Please help me out in this...
It would be gr8 help......
Thanks & Best Regards,
VishnuHi,
After getting the no-authorization error, go to transaction SU53 and there u can see what authorization object is needed .you can take the snapshot of the SU53 and tell the basis consultant to give the particular authorization object to ur user.
regards,
Santosh Thorat -
Function module RH_RELATION_MAINTAIN
Hi Experts,
I am using the function module RH_RELATION_MAINTAIN to create relation between position and costcenter. The relationship (a011) is getting created but the percentage field PROZT is not getting updated in HRP1001 table. Can anyone tell me why is this happening and how to update this particular field.
Thanks and Regards,
ShilpaThanks sir,
Ok with out percentage it is working fine.. I will upload without percentage.
Thanks and regards,
shilpa -
Using RH_RELATION_MAINTAIN from RFC causes dumps
Hello,
We had a need to make the "RH_RELATION_MAINTAIN" function to be an RFC function.
What we've done in order to do this, is to copy the code from the original function into a Z function.
We are using the visual composer to call this function using RFC
Most of the times, it works without a problem, but sometimes creating a relation between a person and an position causes a dump
what we're getting is a weird system dump, that reads "CNTL_SYSTEM_ERROR".
If the same data is run through R3 without rfc, everything works fine.
Is there anything we can do about this?
thanks in advance, Udi.im bumping this up after a week with no replies.
sorry. -
I have a loop in my program to create relationship of positions (created by RH_OBJECT_CREATE).. If I run debug mode ... position objects and relationship infotypes are created using functions RH_OBJECT_CREATE and RH_RELATION_MAINTAIN... but if I execute the program GUI displays 'action canceled'... I am not able to trap where this message is coming from. May you help me with this issue if you have encoutered as such? Thanks...
Message was edited by:
MILJOHi Miljo,
I'm looking for a program by which I can delimit a relationship and create new relation . It seems u worked on such program, can u send me the program for same , its urgent
Kavi -
RH_RELATION_MAINTAIN no dialog
Hi all,
it's the first time I use this FM RH_RELATION_MAINTAIN.
I use this FM in a loop. When there is an error, the screen with this error appears and stop all for a user input.
I have to develop a batch programm (I have to create something like 150000 position) so I need the error was catched and the report has to go on with the next record.
Is there a way to put the FM in a no dialog mode (like call transaction ) ?
thanks in advantage
enzoEnzo,
You might try function module RH_INSERT_INFTY_1001_EXT. There is also a function module called RH_UPDATE_INFTY_1001_EXT. Insert creates new, update modifies existing.
RH_RELATION_MAINTAIN call function module RH_PNNNN_MAINTAIN. In this call the "suppress_dialog" exporting paramter is hard coded to '1'. A '1' in this field will automatically stop when there is an error.
The other option would be to call RH_PNNN_MAINTAIN directly and skip the call to RH_RELATION_MAINTAIN. You would just need to incorporate the lines of code prior to RH_PNNN_MAINTAIN in your program.
Best Regards,
Chris H.
Maybe you are looking for
-
Selecting Multiple objects in Pages for ipad
On regular pages, I can select multiple objects (text boxes, etc) by holding shift then clicking on it. Is there a way to do that in Pages for IPAD?
-
Why cannot start database?
Hi, everyone: I have intalled Ora 9.2.0.1 system and generate database successful under RedHat 8.0, but can not start database (because no messages display after run the dbstart), if login at sqlplus, it will display two error message: "ORA-01034: OR
-
HT201342 i need help access my icloud account
I'm trying to replace my old icloud account by using my new gmail account. Problem is that my old icloud account was never verfity. Therefore I don't know wha to do. How can I replace the old icloud account with mt gmail account?
-
Hi, more and more often when i try to open something, (mostly happens with firefox or amsn) the programms opens fine, and is funtional but the window is tiny, as in a very small dash somwhere on the screen. It is so small it is only just possible to
-
Can not start x after installing nvidia 173.14.x drivers [SOLVED]
After installing nvidia-beta (version 173.14.05-5) I am unable to start x. I receive the errors: (EE) NVIDIA(0): Failed to initialize the NVIDIA graphics device PCI:1:0:0. (EE) NVIDIA(0): Please see the COMMON PROBLEMS section in the README for (EE)