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

Update PA0105 subtype-fields, PA0006 fields to Custom table

Former Member
0 Likes
2,698

Hi Experts,

Please tell how can we UPDATE subtype-fields from PA0105 infotype to Custom tables. Is any functoin module is there. PA0105-USRTY(Subtype Fields:Primary Work Phone,Secondary Work Phone,Work Fax,Voice Mail,Pager,Email Address.) and UPDATE fields from PA0006 infotype (Fields:Mailcode,Building,Floor,Address1,City,State,Zip) to Custom table.

Thanks,

Spreddy

Hi Experts,

Please tell how can we UPDATE subtype-fields from PA0105 infotype to Custom tables. Is any functoin module is there. PA0105-USRTY(Subtype Fields:Primary Work Phone,Secondary Work Phone,Work Fax,Voice Mail,Pager,Email Address.) and UPDATE fields from PA0006 infotype (Fields:Mailcode,Building,Floor,Address1,City,State,Zip) to Custom table.

Thanks,

Spreddy

3 REPLIES 3
Read only

Former Member
0 Likes
1,492

hi

please use HR_INFOTYPE_OPERATION to update.you can use some BAPI'S as well.they are:

Change:

BAPI_EMPLCOMM_CHANGE

Create:

BAPI_EMPLCOMM_CREATE

You may want to look more BAPI's related to this so for that use transaction BAPI and look for object EmplCommunication.

hope this helps

regards

Aakash Banga

Read only

Shafiq_Rehman1
Active Contributor
0 Likes
1,492

If you are just reading from infotype and updating in custom table, then you dont need above mentioned FM or BAPI for that.

You simple need to write a simple program which will read data from infotype 105 and 6 (using select statement or FM HR_READ_INFOTYPE) as per requirement and update that using update statement in your custom z table.

Read only

Former Member
0 Likes
1,492

Hi Srinivas,

use like this

call function 'HR_READ_INFOTYPE'

exporting

pernr = pernr

infty = '0267' "INfotype no

begda = datum

endda = datum

  • importing

  • subrc = retcd

tables

infty_tab = i0267 " table type table of p0267

exceptions

infty_not_found = 1

others = 2.

read table i0267 into p0267 index 1.

-


Change the fields here u want to change

  • Fill infotype record

p0267-infty = '0267'.

p0267-subty = lgart.

p0267-pernr = pernr.

p0267-begda = datum.

p0267-endda = datum.

p0267-opken = ' '.

p0267-lgart = lgart.

p0267-betrg = betrg.

p0267-waers = 'USD'.

p0267-ocrsn = '0001'.

  • ENDIF.

*

  • Enqueue personnel number

-


lock that particular personal no which u r updating

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

number = pernr

IMPORTING

return = return.

IF NOT return IS INITIAL.

MESSAGE ID return-id TYPE return-type NUMBER return-number

WITH return-message_v1 return-message_v2

return-message_v3 return-message_v4.

RAISE action_stopped.

ENDIF.

*

  • Perform PA30 via infotype_operation

-


Function that update the record

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0267'

number = pernr

validityend = datum

validitybegin = datum

record = p0267

operation = 'INS'

dialog_mode = '2'

IMPORTING

return = return.

IF NOT return IS INITIAL.

MESSAGE ID return-id TYPE return-type NUMBER return-number

WITH return-message_v1 return-message_v2

return-message_v3 return-message_v4.

RAISE action_stopped.

ENDIF.

Thanks & Regards,

Ruchi Tiwari