‎2008 Nov 21 6:25 AM
Could anyone suggest how to insert/create infotype 0005 record using HR_MAINTAIN_MASTERDATA or HR_INFOTYPE_OPERATION ?
i try using this 2 FM , both cant work due to field Q0002 screen field.
please help.
‎2008 Nov 21 6:42 AM
Hi Rdy,
Check this link.
http://help.sap.com/saphelp_47x200/helpdata/en/4f/d5267d575e11d189270000e8322f96/frameset.htm
Thanks
‎2008 Nov 21 6:50 AM
Hi ,,,
There was already a post for this and i came across ...so sending it for u to have look
hope this will solve your requirement
Regards
RachelArun
. Here is a sample method which does read on any HR infotype and returns a table which you request.
1. Create a class via SE24. For this example i named my class ZTEST_IT_READ.
2. Create a STATIC method in the class named READ_IT with the following parameters.
3. Paste the following code there in the class.
METHOD read_it.
DATA: lv_it TYPE char5,
lt_data TYPE REF TO data.
FIELD-SYMBOLS: <table> TYPE STANDARD TABLE.
mimic P Structure
CONCATENATE 'P' mi_infotype INTO lv_it.
Create P structure specific to the Infotype
CREATE DATA lt_data TYPE STANDARD TABLE OF (lv_it).
ASSIGN lt_data->* TO <table>.
Disable Authority check if requested
IF mi_authority_chk = space.
CALL FUNCTION 'HR_READ_INFOTYPE_AUTHC_DISABLE'.
ENDIF.
Call function to read infotype passed
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = mi_pernr
infty = mi_infotype
begda = mi_begda
endda = mi_endda
TABLES
infty_tab = <table>
EXCEPTIONS
infty_not_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.
ELSE.
If all Ok pass back the table
me_it = <table>.
ENDIF.
ENDMETHOD.
4. You must be wondering how do we use this method ? Below is a simple implementation of this method.
PROGRAM ztest.
PARAMETERS: p_pernr TYPE persno DEFAULT '900347',
p_begda TYPE datum DEFAULT '18000101',
p_endda TYPE datum DEFAULT '99991231',
p_info LIKE prelp-infty DEFAULT '2001'.
DATA: lv_it TYPE char5,
lt_data TYPE REF TO data.
FIELD-SYMBOLS: <table> TYPE STANDARD TABLE.
CONCATENATE 'P' p_info INTO lv_it.
CREATE DATA lt_data TYPE STANDARD TABLE OF (lv_it).
ASSIGN lt_data->* TO <table>.
CALL METHOD ztest_it_read=>read_it
EXPORTING
mi_pernr = p_pernr
mi_begda = p_begda
mi_endda = p_endda
mi_infotype = p_info
IMPORTING
me_it = <table>.
‎2008 Nov 21 7:20 AM
Appreciate for quick respond to my question.
but i believe my question related with "insert / create infotype 0005 record".
which is not read or create method.
let me brief again what i trouble with , i'm stuck when i use this 2 FM which finally only able to use BDC.
i try this 2 FM into rest of infotype without any problem.
i notice that infotype 0005 during record creation using PA30, they have using Q0005 in the screen input.
Even i populate this information into proposed_value parameter, its still not working (i debug using dialog mode '2').
‎2008 Nov 21 7:34 AM
Yes, i did, like the rest of other infotype , its very common to enq and denq every process.
but im stuck for this particular infotype 0005.
‎2008 Nov 21 8:27 AM
>
> Appreciate for quick respond to my question.
> but i believe my question related with "insert / create infotype 0005 record".
> which is not read or create method.
>
> let me brief again what i trouble with , i'm stuck when i use this 2 FM which finally only able to use BDC.
> i try this 2 FM into rest of infotype without any problem.
>
> i notice that infotype 0005 during record creation using PA30, they have using Q0005 in the screen input.
> Even i populate this information into proposed_value parameter, its still not working (i debug using dialog mode '2').
when you have QNNNN field in the infotype screen and if you are using the FM 'HR_INFOTYPE_OPERATION' to maintain the infotype then you have to fill the corresponding field in the PNNNN structure and pass it to the FM.
In your example(IT0005), the screen field
Leave type Q0005-URART corresponds to the field P0005-UAR01
Entitlement Q0005-UANSP corresponds to the field P0005-UAN01
Ded begin date Q0005-UABEG corresponds to the field P0005-UBE01
Ded end date Q0005-UAEND corresponds to the field P0005-UEN01
‎2008 Nov 24 1:34 AM
Rajesh,
Yes i did use that method , even i also use Q0005 method as well.,
P0005-UAR01 = 01
P0005-UAN01 = 10
P0005-UBE01 = 20080602
P0005-UEN01 = 20091231
it cant work , error message still appear :
i had this message : "Error : PG 015 - Required screen change cannot be made"
‎2008 Nov 24 1:59 AM
error failed for Q0005-UANSP, The rest of other 3 field is being populate.
seem that UANSP field using data element of PTM_HENTITLE.
is it the cause of problem which cause FM couldnt populate this field?
‎2008 Nov 21 7:25 AM
Are you using enqueue/dequeue in you program or not.
Rajneesh Gupta
‎2009 Jun 08 4:17 AM
‎2009 Jul 23 3:49 PM
Rudy, how did you get this to work, i am facing the same problem..
Could you please reply?
Regards,
Marcel