Using HR_INFOTYPE_OPERATION
Hi '
I want to use with this Func. but i need to know if its operate dynamic action.
please anybody?
Hi celtic,
1. I want to use with this Func. but i need to know
No, this FM will not operate any dynamic action automatically.
regards,
amit m.
Similar Messages
-
Using HR_infotype_operations , locking problem
hi, i am using HR_infotype_operations func module,
basically a dynamic action triggers a subroutine in a report progrm and there I am using this functiom module, but it is not able to insert values in one of my custom infotype giving error in the return parameter as 'pernr could not be locked'
can u please help me ?Hello,
Please check the program by debugging the same.
In the debugging mode -> go to -> break points-> at statement here you give the keyword(MESSAGE) or Call function . this will stop the program at all message statements or call function.
You can now find what has triggered this.
Thanks,
Krishna
Message was edited by: Krishnakumar -
Using HR_INFOTYPE_OPERATION in external subroutine for Dynamic Actions
Hi,
I am calling an external subroutine in the Dynamic Actions of an Infotype. In this external subroutine, I am using HR_INFOTYPE_OPERATION to modify OTHER records of the same Infotype number.
However, when I tried to trigger the Dynamic Actions in PA30, the other infotypes get modified as intended. But when I refreshed the PA30 screen, the changes were reversed back as if the HR_INFOTYPE_OPERATION were not carried out at all. I have COMMIT WORK after the HR_INFOTYPE_OPERATION, refreshed the buffer. But it doesn't seem to work.
My question is: Can i use HR_INFOTYPE_OPERATION in an external subroutine which is called during dynamic actions? As I have some complicated logic, I do not want to embed the coding in the Dynamic Actions. Is there a way for HR_INFOTYPE_OPERATION to work in the external subroutine with the changes being committed to the database?
Thank you.Hi,
I remember the same problem being faced by some of the forum members.
Suresh Datti had replied that "Call the subroutine in a nother program using a SUBMIT statement. This will create two sessions and will update the DB". This was working fine for the users.
Hope you can try this.
Just call a program using SUBMIT statement and code your form routine inside that.
Hope this helps you.
Regards,
Subbu. -
How to create IT0128 subtype-02 record using HR_INFOTYPE_OPERATION
Hi All,
Can anyone suggest how to use HR_INFOTYPE_OPERATION to create/insert a record in IT0128 for an employee from an ABAP program.
Some background:::
Note that the field - "Short Title" which is mandatory in this Infotype. And it uses a Q-structure for its processing. Also it stores this field using a combination of text object, text id, language and text name.
Text object = HRMESS
Text id = HR_P
Goto SE16 of an employee and check PA0128, you will notice above fields. The actual value is stored somewhere in system memory using a combination of above 4 fields.
When i try using my program, it gives me an error "Make an entry in all required fields" (so not able to find how/what should i pass for field "Short Title"). Can anyone suggest how should i use HR_INFOTYPE_OPERATION to create an IT0128 record for subtype 02.
Appreciate any help asap!!
Best Regards,
Abbasi Sadikot
PS: Please dont post your reply if you dont have any idea of what this is.Hi
HR_INFOTYPE_OPERATION -> calls -> HR_MAINTAIN_MASTERDATA -> this Func. Mod. then creates a batch and calls ->
-> IF DIALOG_MODE EQ '0'.
-> CALL DIALOG 'HR_MAINTAIN_MASTER_DATA' USING BDCDATA MODE 'N'
-> EXPORTING
the SY-SUBRC value after this should be zero. But it isn't. Can anybody suggest something. Or have any idea as what could be going wrong ??
Here is my program by which i am trying to create IT0128 subtype-02:
REPORT ZABTWTEST .
data: it0128 like p0128 occurs 0 with header line.
data: return like BAPIRETURN1.
it0128-pernr = '20123001'.
it0128-subty = '2'.
it0128-begda = '20090101'.
it0128-endda = '20090131'.
it0128-SPRSL = 'EN'.
it0128-OBJCT = 'HRMESS'.
it0128-TXTID = 'HR_P'.
it0128-OBNAM = '<internally assigned name>'.
append it0128.
CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'
EXPORTING
number = '20123001'
validitybegin = '19000101' .
loop at it0128.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0128'
number = '20123001'
VALIDITYEND = it0128-endda
VALIDITYBEGIN = it0128-begda
record = it0128
operation = 'COP'
TCLAS = 'A'
NOCOMMIT = 'X'
IMPORTING
RETURN = return .
endloop.
CALL FUNCTION 'BAPI_EMPLOYEET_DEQUEUE'
EXPORTING
number = '20123001'
validitybegin = '19000101' .
write return. .
Kindly correct me if i am wrong anywhere.
Regards,
Abbasi -
Updating infotype 0041 using HR_INFOTYPE_OPERATION?
Hi All:
How do we update the dates in infotype 0041 using HR_INFOTYPE_OPERATION? lets say we have 6 dates populated in 41 and we another employee has 9 dates populated. We are reading these records and need to update the dates for all the employee records.
Thanks
VenkataHi Venkata,
What you can do is use the HR_INFOTYPE_OPERATION in Change or MOD(Modify) mode i.e.
pass 'MOD' in operation parameter.
Your recordnumber parameter should have the sequence number from infotype record you are updating (field SEQNR). All other parameters should be as it is had been for INS or insert operation.
Regards. -
Using hr_infotype_operation to update it0021 problem
I am using hr_infotype_operation to update data for it0021 and it0528.
In pa30, just in it0021 and different to update data for it0021 and it0528, IT0528 is not allowed maitain
when i am using hr_infotype_operation to update data for it0021 and it0528 one by one, the problem occurs, it 0528 is not update.
Any idea?Hi,
The FM HR_INFOTYPE_OPERATION infact copy a BDC & performs all the screen validations that normally occur in PA30. It uses the CALL DIALOG option.
Also, set the MODE to '2' which is like the display ALL option in the CALL TRANSACTION.
This will let you see the error in the foreground.
Regards,
Shamma -
Modify Infty 0057 using HR_INFOTYPE_OPERATION
Hi,
I am trying to update (MOD) an 0057-infotype record using HR_INFOTYPE_OPERATION. But no matter what I do, I cannot make it work. It works with INS and COP but then I get a new entry and the old entry is not delimited. When using MOD I receive the following message in RETURN (return_struct)
TYPE E
ID PG
NUMBER 009
MESSAGE No data stored for 0057 in the selected period
LOG_NO
LOG_MSG_NO 000000
MESSAGE_V1 0057
The code I am using look like this:
Do you please have any advices to give according to this?
*& Report ZHR_ESS_UPDATE_INFTY_0057
REPORT zhr_ess_update_infty_0057.
PARAMETERS: p_pernr TYPE p0057-pernr,
p_lgarto TYPE p0057-lgart, "old lgart
p_lgartn TYPE p0057-lgart. "new lgart
CONSTANTS: change TYPE pspar-actio VALUE 'MOD'.
DATA: lt_p0057 TYPE TABLE OF p0057.
DATA: ls_current_p0057 LIKE LINE OF lt_p0057,
ls_new_p0057 LIKE LINE OF lt_p0057.
DATA: l_p0057 LIKE p0057.
DATA: l_subrc LIKE sy-subrc.
DATA return_struct LIKE bapireturn1.
DATA w_return TYPE bapireturn1.
DATA: bapipakey_tab LIKE bapipakey OCCURS 0 WITH HEADER LINE.
DATA: validitybegin TYPE sy-datum,
validityend TYPE sy-datum.
CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
tclas = 'A'
pernr = p_pernr
infty = '0057'
IMPORTING
subrc = l_subrc
TABLES
infty_tab = lt_p0057
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
* Enqueue personnel number
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr
IMPORTING
return = w_return.
READ TABLE lt_p0057 INTO ls_current_p0057 INDEX 1..
ls_new_p0057-begda = sy-datum.
ls_new_p0057-endda = '99991231'.
ls_new_p0057-subty = p_lgartn.
ls_new_p0057-lgart = p_lgartn.
ls_new_p0057-mgart = p_lgartn.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0057'
subtype = ls_current_p0057-subty
objectid = ''
lockindicator = ''
number = ls_current_p0057-pernr "employeenumber
validityend = ls_current_p0057-begda
validitybegin = ls_current_p0057-endda
record = ls_new_p0057
recordnumber = ls_current_p0057-seqnr
operation = change "MOD
tclas = 'A'
nocommit = '1'
dialog_mode = '0'
* view_identifier = '23'
IMPORTING
return = return_struct
key = bapipakey_tab
EXCEPTIONS
OTHERS = 0.
IF return_struct IS INITIAL.
COMMIT WORK.
ENDIF.
* Enqueue personnel number
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = p_pernr
IMPORTING
return = w_return.Hi,
This was kind of embarrassing. Thanks for finding the error!
Kind regards
Andreas -
Problem in changing end date of PA-Infotype using HR_INFOTYPE_OPERATIONS .
Hi All,
I am trying to change the end date of an active record in an infotype using HR_INFOTYPE_OPERATIONS FM. But am getting an error, 'Infotype does not exist'.
I am using operation as 'MOD' and passing appropriate parameters as required.
it would be great if someone can help me out to understand, why could that error be coming?Hi Santosh,
With this FM you cannot change the enddate as enddate is a key field and used to determine the exact record in the database.
Why don't you use PA30 to change end date of an infotype record?
Or else delete the row first w. HR_INFOTYPE_OPERATION DEL and insert it again with INS operation and new end date.
Regards,
Dilek
Edited by: Dilek Ersoz Adak on Jan 8, 2010 7:54 AM -
Error While using HR_INFOTYPE_OPERATION to delete records
Hi All
I was able to find simlar error in SDN but it did not work for me. I am using HR_INFOTYPE_OPERATION to delete PA2006 records and update with new values. I get the following error message "No data stored for 2006 in the selected period". But The records exist. I debugged and found it fails for authorization checks. I have all the authorizations as I am able to delete it using PA30.
FYI inserting works fine.
Please advice.
Thanks, RajHi Santosh
I used the same code which you have send. Below is the one. FYI, throught my debug, I was able to figure out it fails in authorization, even though I have all authorization and I was able to delete using PA30. Please advice.
Below is teh code that I used.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = t_file1-pernr
IMPORTING
return = t_return
locking_user = sy-uname.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '2006'
NUMBER = t_file1-pernr
SUBTYPE = t_file1-subty
VALIDITYEND = t_file1-endda
VALIDITYBEGIN = t_file1-begda
RECORD = P2006
OPERATION = 'MOD'
DIALOG_MODE = '1'
NOCOMMIT = 'X'
IMPORTING
RETURN = t_return
KEY = personaldatakey.
"Unlock the employee
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
number = t_file-pernr
IMPORTING
return = t_return.
Thanks, Raj -
Error - while using HR_INFOTYPE_OPERATION - 'URG'
Hi Experts,
While using HR_INFOTYPE_OPERATION for updating master data i got a Error Message -
EPG 428A complex application error has occurred
But it is not for every time . after 3 or 4 sucessfull run i get this message and after that it will take long time to overcome automatically . I tried with log off but it is not successful.
Please Advice.If this is called from custom code, make sure you call function 'HR_PSBUFFER_INITIALIZE' for each new ee processed to clear the buffer. If not, when HR_INFOTYPE_OPERATION is executed, the buffer (internal table) may still have data from previous ee which can cause dump.
Rgds. -
About to use HR_INFOTYPE_OPERATION to create customer infotype issue:
hi
i want to create infotype use function(HR_INFOTYPE_OPERATION).
this infotype is customer infotype.
the first scenario is:
i'm be sure no data about one employee in this infotype(9004).
to call with data upload function and put data into internal table IT_PA9004.
and the table data as follow:
one line: it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
it_pa9004-zzvalue = 50 (customer field).
two line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
it_pa9004-zzvalue = 60 (customer field).
three line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
it_pa9004-zzvalue = 70 (customer field).
four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
it_pa9004-zzvalue = 80 (customer field).
i run the programme and get information is:
11022887 insert ok.
11022887 insert ok.
11022887 insert ok.
11022887 insert ok.
but i use the transation PA30 to view all data:
in database just exist one row:
four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
it_pa9004-zzvalue = 80 (customer field).
the second scenario is:
in database the infotype have exist one row:
pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
pa9004-begda = '20080318' , pa9004-endda = '20080318'
pa9004-zzvalue = X (customer field).
and i create another row:
line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
it_pa9004-begda = '20080318' , it_pa9004-endda = '99991231'
it_pa9004-zzvalue = 80 (customer field)
i run the programme and get information is:
11022887 insert ok.
the three scenario is:
set HR_INFOTYPE_OPERATION of import parameter operation = 'MOD'
in any scenario will get error :not exist subtype .
what heppend about HR_INFOTYPE_OPERATION working,i had to use this function to
create other infotype of SAP owner.
and will create successfully.
so i thank it may be config Constraints about customer infotype.
is time Constraints effect?
so i want to how to check it?
and if i want to create one infotype for customer using PM01 what some thing
must be taken into account.
think you advance.
partial source code as follow:
FORM ACTION_INSERT .
DATA: P_FLAG TYPE C.
DATA: WA_LOG LIKE LINE OF DATA_LOG.
DATA: PP_ACTION TYPE PSPAR-ACTIO.
LOOP AT IT_PA9004.
CLEAR P_FLAG.
CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.
PERFORM lock_employee USING IT_PA9004-pernr CHANGING P_FLAG.
PP_ACTION = IT_PA9004-ACTION.
PERFORM HR_INFOTYPE_OPERATION USING IT_PA9004 PP_ACTION CHANGING P_FLAG.
IF P_FLAG IS INITIAL.
if test_run = space.
COMMIT WORK.
else.
ROLLBACK WORK.
endif.
write:/ it_pa9004-pernr,'insert ok'.
ELSE.
ROLLBACK WORK.
write:/ it_pa9004-pernr,'error'.
ENDIF.
PERFORM unlock_employee USING IT_PA9004-pernr .
ENDLOOP.
ENDFORM. " ACTION_INSERT
FORM LOCK_EMPLOYEE USING P_PERNR
CHANGING PP_FLAG.
CHECK PP_FLAG IS INITIAL.
CLEAR P_RETURN.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = P_PERNR
IMPORTING
return = P_RETURN
EXCEPTIONS
OTHERS = 01.
CALL FUNCTION 'HR_INITIALIZE_BUFFER'
EXPORTING
pernr = P_PERNR.
IF P_RETURN IS NOT INITIAL.
PP_FLAG = '1'.
ENDIF.
ENDFORM. " LOCK_EMPLOYEE
FORM HR_INFOTYPE_OPERATION USING P_PA9004 LIKE IT_PA9004
P_ACTION type PSPAR-ACTIO
CHANGING PP_FLAG.
CHECK PP_FLAG IS INITIAL.
DATA: bapipakey type bapipakey,
P_SUBTY TYPE P9004-SUBTY,
PP_9004 TYPE TABLE OF P9004 WITH HEADER LINE.
CLEAR P_RETURN.
REFRESH PP_9004.
MOVE-CORRESPONDING P_PA9004 TO PP_9004.
IF P_ACTION = 'INS'.
PP_9004-AEDTM = SY-DATUM.
PP_9004-UNAME = SY-UNAME.
ENDIF.
IF P_ACTION = 'MOD'.
PP_9004-AEDTM = SY-DATUM.
PP_9004-UNAME = SY-UNAME.
ENDIF.
APPEND PP_9004.
P_SUBTY = P_LGART.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '9004'
subtype = 'FQ03'
subtype = P_SUBTY
number = PP_9004-pernr
validityend = PP_9004-ENDDA
validitybegin = PP_9004-begda
RECORDNUMBER = pp_9004-seqnr
record = PP_9004
operation = 'INS'
operation = P_ACTION
nocommit = 'X'
IMPORTING
return = P_RETURN
key = bapipakey
EXCEPTIONS
OTHERS = 0.
IF P_RETURN IS NOT INITIAL.
PP_FLAG = '9'.
ENDIF.
ENDFORM. " HR_INFOTYPE_OPERATION
FORM UNLOCK_EMPLOYEE USING P_PERNR.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = p_pernr
IMPORTING
return = P_RETURN
EXCEPTIONS
OTHERS = 01.
ENDFORM. " UNLOCK_EMPLOYEEhi
i want to create infotype use function(HR_INFOTYPE_OPERATION).
this infotype is customer infotype.
the first scenario is:
i'm be sure no data about one employee in this infotype(9004).
to call with data upload function and put data into internal table IT_PA9004.
and the table data as follow:
one line: it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
it_pa9004-zzvalue = 50 (customer field).
two line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
it_pa9004-zzvalue = 60 (customer field).
three line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
it_pa9004-zzvalue = 70 (customer field).
four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
it_pa9004-zzvalue = 80 (customer field).
i run the programme and get information is:
11022887 insert ok.
11022887 insert ok.
11022887 insert ok.
11022887 insert ok.
but i use the transation PA30 to view all data:
in database just exist one row:
four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
it_pa9004-zzvalue = 80 (customer field).
the second scenario is:
in database the infotype have exist one row:
pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
pa9004-begda = '20080318' , pa9004-endda = '20080318'
pa9004-zzvalue = X (customer field).
and i create another row:
line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
it_pa9004-begda = '20080318' , it_pa9004-endda = '99991231'
it_pa9004-zzvalue = 80 (customer field)
i run the programme and get information is:
11022887 insert ok.
but in database just exist the first data
pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
pa9004-begda = '20080318' , pa9004-endda = '20080318'
pa9004-zzvalue = X (customer field).
the three scenario is:
set HR_INFOTYPE_OPERATION of import parameter operation = 'MOD'
in any scenario will get error :not exist subtype .
what heppend about HR_INFOTYPE_OPERATION working,i had to use this function to
create other infotype of SAP owner.
and will create successfully.
so i thank it may be config Constraints about customer infotype.
is time Constraints effect?
so i want to how to check it?
and if i want to create one infotype for customer using PM01 what some thing
must be taken into account.
think you advance.
partial source code as follow:
FORM ACTION_INSERT .
DATA: P_FLAG TYPE C.
DATA: WA_LOG LIKE LINE OF DATA_LOG.
DATA: PP_ACTION TYPE PSPAR-ACTIO.
LOOP AT IT_PA9004.
CLEAR P_FLAG.
CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.
PERFORM lock_employee USING IT_PA9004-pernr CHANGING P_FLAG.
PP_ACTION = IT_PA9004-ACTION.
PERFORM HR_INFOTYPE_OPERATION USING IT_PA9004 PP_ACTION CHANGING P_FLAG.
IF P_FLAG IS INITIAL.
if test_run = space.
COMMIT WORK.
else.
ROLLBACK WORK.
endif.
write:/ it_pa9004-pernr,'insert ok'.
ELSE.
ROLLBACK WORK.
write:/ it_pa9004-pernr,'error'.
ENDIF.
PERFORM unlock_employee USING IT_PA9004-pernr .
ENDLOOP.
ENDFORM. " ACTION_INSERT
FORM LOCK_EMPLOYEE USING P_PERNR
CHANGING PP_FLAG.
CHECK PP_FLAG IS INITIAL.
CLEAR P_RETURN.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = P_PERNR
IMPORTING
return = P_RETURN
EXCEPTIONS
OTHERS = 01.
CALL FUNCTION 'HR_INITIALIZE_BUFFER'
EXPORTING
pernr = P_PERNR.
IF P_RETURN IS NOT INITIAL.
PP_FLAG = '1'.
ENDIF.
ENDFORM. " LOCK_EMPLOYEE
FORM HR_INFOTYPE_OPERATION USING P_PA9004 LIKE IT_PA9004
P_ACTION type PSPAR-ACTIO
CHANGING PP_FLAG.
CHECK PP_FLAG IS INITIAL.
DATA: bapipakey type bapipakey,
P_SUBTY TYPE P9004-SUBTY,
PP_9004 TYPE TABLE OF P9004 WITH HEADER LINE.
CLEAR P_RETURN.
REFRESH PP_9004.
MOVE-CORRESPONDING P_PA9004 TO PP_9004.
IF P_ACTION = 'INS'.
PP_9004-AEDTM = SY-DATUM.
PP_9004-UNAME = SY-UNAME.
ENDIF.
IF P_ACTION = 'MOD'.
PP_9004-AEDTM = SY-DATUM.
PP_9004-UNAME = SY-UNAME.
ENDIF.
APPEND PP_9004.
P_SUBTY = P_LGART.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '9004'
subtype = 'FQ03'
subtype = P_SUBTY
number = PP_9004-pernr
validityend = PP_9004-ENDDA
validitybegin = PP_9004-begda
RECORDNUMBER = pp_9004-seqnr
record = PP_9004
operation = 'INS'
operation = P_ACTION
nocommit = 'X'
IMPORTING
return = P_RETURN
key = bapipakey
EXCEPTIONS
OTHERS = 0.
IF P_RETURN IS NOT INITIAL.
PP_FLAG = '9'.
ENDIF.
ENDFORM. " HR_INFOTYPE_OPERATION
FORM UNLOCK_EMPLOYEE USING P_PERNR.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = p_pernr
IMPORTING
return = P_RETURN
EXCEPTIONS
OTHERS = 01.
ENDFORM. " UNLOCK_EMPLOYEE -
Error while modifying HR infotype PA0105 using HR_INFOTYPE_OPERATION
Hello All,
I am not able to modifying the infotype PA0105.
Currently I am using the FM HR_INFOTYPE_OPERATION.
But I am not able to modify the record.
Has anyone faced any such situation...
Please help..!!
Useful pointers will be appreciated...
Thanks & Regards,
Tarun GambhirHope this helps you out...
C_INS LIKE PSPAR-ACTIO VALUE 'INS',
W_000-PERNR = T_SAIDA-PERNR.
W_000-INFTY = C_0000.
W_000-ENDDA = C_DATA.
W_000-BEGDA = T_PA0000-BEGDA.
W_000-AEDTM = SY-DATUM.
W_000-UNAME = SY-UNAME.
W_000-MASSN = C_16.
W_000-MASSG = S_MASSG-LOW.
W_000-STAT1 = SPACE.
W_000-STAT2 = C_3.
W_000-STAT3 = C_1.
W_PSPAR-PERNR = T_SAIDA-PERNR.
W_PSPAR-INFTY = C_0000.
W_PSPAR-PLANS = T_P0001-PLANS.
W_PSPAR-WERKS = T_P0001-WERKS.
W_PSPAR-PERSG = T_P0001-PERSG.
W_PSPAR-PERSK = T_P0001-PERSK.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = C_0000
NUMBER = T_SAIDA-PERNR
LOCKINDICATOR = SPACE
VALIDITYEND = C_DATA
VALIDITYBEGIN = V_BASE
RECORD = W_000
OPERATION = C_INS
SECONDARY_RECORD = W_PSPAR
IMPORTING
RETURN = T_RET_FUNC "#EC *
KEY = T_KEY. "#EC *
Greetings,
Blag. -
Using HR_INFOTYPE_OPERATION dont call user exit
Hi ,
I need to write BAPI that create entry in infotype .
I am using FM "HR_INFOTYPE_OPERATION" ...
This FM don't call the user exit EXIT_SAPFP50M_002 ....
Am i using the FM correctly ?
How can i use the FM with the user-exit .
Thanks .Hi,
Why do you want to call user-exit. What it your requirement?
Regards,
Atish -
Using HR_INFOTYPE_OPERATION to update IT0021 and IT0106
We're trying to update dependent data information using FM hr_infotype_operation but it doesn't seem to be working properly for IT0106. It does work for changes i make for IT0021, though.
We have the requirement to modify an existing dep record, delimit the record, or add a new dependent record depending on some other logic.
I know in the FM, you can specify a secondary structure. In the case of IT0021, it's secondary structure would be IT0106.
I'm passing these fields to my p0106 structure:
pernr
subty
begda
endda
aedtm
uname
perid
but i'm not able to update the P0106 record. Any help would be appreciated.
thanks,
robert.ok great, i believe that fixed it. i think i had a couple of problems that when fixed separately didn't work, but when I put them altogether, it worked.
my p0106 struc was not declared properly and the view identifier was not set (this pernr's was indeed 10).
I need to fill in the rest of the p0106 struc from the existing record and it should work fine.
thanks a ton.
data: p0021_struc TYPE p0021,
p0106_struc TYPE p0106,
p_p_pskey TYPE pskey.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = p_pskey-infty
number = p_pskey-pernr
subtype = p_pskey-subty
objectid = p_pskey-objps
lockindicator = p_pskey-sprps
validityend = p0021-endda " '99991231'
validitybegin = p0021-begda
record = p0021_struc
operation = mode
tclas = 'A'
* dialog_mode = '2'
nocommit = p_test
VIEW_IDENTIFIER = p0003-viekn
secondary_record = p0106_struc
IMPORTING
return = return
key = familykey
EXCEPTIONS
OTHERS = 0.
Message was edited by: robert phelan -
Strange Dump while using HR_INFOTYPE_OPERATION.
Hi frnz,
I am facing dump while using the FM 'HR_INFOTYPE_OPERATION' as below. <b>If I swap positions of w_p0041-endda and w_p0041-begda it does not give a dump but error msg is generated saying that no selection in the period(as obviously dates are in propper range).</b> <u>Whlie testing the FM in SE37 with the same data, it works fine.</u> Please help me find the problem.
data: TCLAS like PSPAR-TCLAS,
OPERATION like PSPAR-ACTIO,
infty like PRELP-INFTY.
infty = '0041'.
OPERATION = 'MOD'.
TCLAS = 'A'.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = infty
NUMBER = w_p0041-pernr
SUBTYPE =
OBJECTID =
LOCKINDICATOR =
VALIDITYEND = w_p0041-endda
VALIDITYBEGIN = w_p0041-begda
RECORDNUMBER =
RECORD = w_p0041
OPERATION = OPERATION
TCLAS = TCLAS
DIALOG_MODE = '0'
NOCOMMIT = SPACE
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
RETURN = Return
KEY =Hi all ,
I have already tried converting date to internal format, the data types are also fine. I am not able to paste the screen shot so here is a part of it. Please help.
************DUMP************************************
If we can not remap we would like to just re-raise the
exception like below like "RAISE EXCEPTION exception.".
Unfortunately the kernel will then forget about the
original source position.
So this is the fallback strategy. Calling this method
is only allowed if the exception can be resolved. Since
this is not the case we indicate a parameter violation.
RAISE EXCEPTION TYPE cx_hrpa_invalid_parameter
EXPORTING
previous = exception
parameter = 'EXCEPTION'.
ENDMETHOD.
********************END**************
Thanks
Sachin -
How to use hr_infotype_operation fm
hi folks,
please let me know how to use this fm
what we need to pass at record field(syntax).
iam getting the data like
idoc_data-sdata format so how i convert this and pass to fm and also please provide how to use the other mandatory fields.Hi Venkat! I make the abap source in follow form.
In this form you can precede all dumps at system.
Regards!
REPORT ZHR0006.
INFOTYPES: 0006. "Declaration of infotype
DATA: exc TYPE REF TO cx_sy_conversion_no_number ,
text TYPE string.
DATA: bapi_return LIKE bapireturn1,
bapipakey LIKE bapipakey.
START-OF-SELECTION.
CLEAR: p0006."Initialization of record
TRY.
IF NOT p0006-pernr CO '0123456789' OR
NOT p0006-begda CO '0123456789' OR
NOT p0006-endda CO '0123456789'." OR
RAISE EXCEPTION TYPE cx_sy_conversion_no_number .
ENDIF.
CATCH cx_sy_conversion_no_number INTO exc.
text = exc->get_text( ).
ENDTRY.
CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'
EXPORTING
number = p0006-pernr
validitybegin = sy-datum
IMPORTING
return = bapi_return.
TRY.
CLEAR: bapipakey, bapi_return.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = p0006-infty
subtype = '0'
number = p0006-pernr
validityend = p0006-endda
validitybegin = p0006-begda
record = p0006
operation = 'INS'
IMPORTING
return = bapi_return
key = bapipakey.
CATCH cx_sy_conversion_no_number INTO exc.
text = exc->get_text( ).
ENDTRY.
Maybe you are looking for
-
The Unifier environment contains two single-instance project shells, INF and PBS, and two multiple-instance child project shells, INFS and PB. There is a single instance, non-workflow business process, ‘Project Information’ that contains a data
-
How do I import from old podcast library?
I just reinstalled Vista a few days ago. I backed up my iTunes podcasts (25g worth). How do I get those podcasts back in my list so I do not have to re-download all of them? *Update* Nevermind. Files just finished being transferred and everything is
-
FHA Mortgage Question New York
FHA Mortgage Question I'm a first time home buyer my credit scores are Trans. 683, Exper. 666 and Equ. 653.I had a bankruptcy and it will be four years this September. I have had zero late payments in the last 12 months. My last late payment was Janu
-
Adobe Reader 7.0 Extension
Hai, Is there any idea of the cost of the Adobe Reader 7.0 Extension software ? Regards, A.Mohammed Rafi.
-
How to break mirror disks?
Hello, I have a SF 280R was previously configured RAID 1 2x36GB ... OS 10 disk space is running low so I'd like to break the mirror and use the 2nd HD for storage. Is this possible? Has anyone done this before without reloading the OS? Thanks in adva