Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

INSERT / CREATE infotype 0005

former_member207153
Participant
0 Likes
1,488

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.

10 REPLIES 10
Read only

Former Member
Read only

Former Member
0 Likes
1,331

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>.

Read only

0 Likes
1,331

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').

Read only

0 Likes
1,331

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.

Read only

0 Likes
1,331

>

> 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

Read only

0 Likes
1,331

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"

Read only

0 Likes
1,331

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?

Read only

Former Member
0 Likes
1,331

Are you using enqueue/dequeue in you program or not.

Rajneesh Gupta

Read only

former_member207153
Participant
0 Likes
1,331

case closed, thanks

Read only

0 Likes
1,331

Rudy, how did you get this to work, i am facing the same problem..

Could you please reply?

Regards,

Marcel