Application Development 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: 

In infotype 27,how to Upload 10 cost distribution for an Emp ?

Former Member
0 Kudos

Hi,

While uploading data in infotype 27 only 8 cost distribution got

uploaded for an employee.

for employees with 10 cost distribuion,is it advisable to use the

access key and increase the length of the screen or

do we need to add scroll functionality in bdc.

Also we would like to know that if if we modify the screen using access

key,will it be overwritten with the old screen when a higher patch is

been applied?

Kindly suggest how to add scroll function in the existing bdc without creating a new recording.

Regards,

Rachel

6 REPLIES 6

Former Member
0 Kudos

Hi Rachel,

It is highly advisable to use standard FM or BAPI to upload infotype datas. Use the below FM to upload the same.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '2006'

NUMBER = pernr-pernr

SUBTYPE = gd_subty

  • OBJECTID =

  • LOCKINDICATOR =

VALIDITYEND = gd_val_end

VALIDITYBEGIN = gd_val_beg

  • RECORDNUMBER =

RECORD = p2006

OPERATION = 'MOD'

  • TCLAS = 'A'

  • DIALOG_MODE = '0'

  • NOCOMMIT =

  • VIEW_IDENTIFIER =

  • SECONDARY_RECORD =

IMPORTING

RETURN = gs_return

  • KEY =.

Br/Manas

Former Member
0 Kudos

I tried FM 'HR_INFOTYPE_OPERATION for infotype 27.

how does cost center and internal orders gets uploaded from this FM?

does it work for multiple cost center & internal orders?

i tried this fm using the below code but nothing happenned...Kindly guide me.

infotypes : 0027.

tables : pernr.

data: return type bapiret1.

start-of-selection.

get pernr.

rp-provide-from-last p0027 space sy-datum sy-datum.

*locks the personnel

call function 'HR_EMPLOYEE_ENQUEUE'

exporting

number = p0027-pernr

importing

return = return.

if pernr-pernr = 75.

call function 'HR_INFOTYPE_OPERATION'

exporting

infty = '0027'

number = 75

subtype = p0027-subty

objectid = p0027-objps

recordnumber = p0027-seqnr

validityend = p0027-endda

validitybegin = p0027-begda

record = p0027

operation = 'MOD'

*tclas = ''

*nocommit = ' '

importing

return = return.

endif.

*unlocks the employee

if sy-subrc = 0.

write : '27 Updated' .

endif.

call function 'HR_EMPLOYEE_DEQUEUE'

exporting

number = p0027-pernr

importing

return = return.

end-of-selection.

Edited by: Rachel on May 14, 2009 1:49 PM

0 Kudos

Hi,

Once u get the data into structure p0027 by rp-provide-from-last p0027 space sy-datum sy-datum.

you need to update the costcenter and internal order fields of it. Then when u pass it to the FM it will update.

the structure has 25 costcenter field KST01-KST25 and 25 internal order fields AUF01-AUF25. You need need update the fields as per the requirement the call the FM.

Let me know if you require any other info.

Br/Manas

0 Kudos

if i need to upload 100 employee details to an internal table

and say employee1 has 2 cost center and employee2 has 15 cost center for a month

query 1 : does my upload file should have 15 cost center column (ks01,ks02-----ks15)

query 2:do I have to assign this internal table cost center to p0027.

p00027-ks01 = itab-ks01.

p00027-ks02 = itab-ks02.

p00027-ks03 = itab-ks03.

....

...

...

p00027-ks15 = itab-ks15.

Kindly suggest if there is a better way

Regards,

Rachel

Edited by: Rachel on May 27, 2009 8:21 AM

0 Kudos

Query 1:

Yeah, your file should have all the cost center details

Query 2:

You can write the code the way u hv written or take the help of field symbols to compact your code.

Sample code for infotype 41, same way you do for infotype 27. Write a exit statement if the value of a costcenter field is null so need not to continue further.

DATA: gd_count TYPE i VALUE 0,

gd_cnt_ch(2) TYPE c,

gd_fname1(15) TYPE c, "Dynamic field name

gd_fname2(15) TYPE c. "Dynamic field name

FIELD-SYMBOLS: <gd_field1> TYPE ANY,

<gd_field2> TYPE ANY.

CLEAR: gd_count, gd_found.

DO 12 TIMES.

gd_count = gd_count + 1.

gd_cnt_ch = gd_count.

IF gd_count BETWEEN 1 AND 9.

CONCATENATE 'DAR0' gd_cnt_ch INTO gd_fname1.

CONCATENATE 'DAT0' gd_cnt_ch INTO gd_fname2.

ELSE.

CONCATENATE 'DAR' gd_cnt_ch INTO gd_fname1.

CONCATENATE 'DAT' gd_cnt_ch INTO gd_fname2.

ENDIF.

ASSIGN COMPONENT gd_fname1 OF STRUCTURE gs_0041

TO <gd_field1>.

ASSIGN COMPONENT gd_fname2 OF STRUCTURE gs_0041

TO <gd_field2>.

IF <gd_field1> = 'Z4'.

CLEAR <gd_field2>.

gd_found = 'X'.

ENDIF.

ENDDO.

Former Member
0 Kudos

Hi,

Does this FM creates a new record ?

if the internal table contains 100 employees cost center & internal order details for current month.

how to assign the cost center in HR_INFOTYPE_OPERATION.

Kindly send me sample code to assign cost center from internal table.

empno. internalorder percentage start date enddate

1 170017 13 01.04.09 30.04.09

1 170029 2 01.04.09 30.04.09

1 170063 78 01.04.09 30.04.09

1 170084 1 01.04.09 30.04.09

Regards,

Rachel

Edited by: Rachel on May 26, 2009 11:13 AM