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: 

What is the best process for conversion moving district data to city data?

former_member184119
Active Contributor
0 Kudos

Hi ALL,

I Need to write one conversion which will move the district field data into city field data in infotype 6..

It need to apply for only one Specific country which can be identified by Employee Personnel Area..and it should be apply for all active , Terminated employee as well...

What is the best process so that i can catpure all the data records of employees of the Specific country?

my approacH is..

LDB: PNP.

Start-of-selection.

RP_PROVIDE_FROM_LAST P0001 space pn-begda pn-endda.

check p0001-weks = '5200'.

rp_provide_from_last p0006 space pn-begda pn-endda.

Loop at p0006.

move p0006 to T_p0006.

if ort01 is not initial

Move P0006-ORT01 TO T_P0006-ORT02.

endif.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0006'

subtype = P0006-subty

  • objectid = P_record-objps

number = p0006-pernr "employeenumber

validityend = validityend

validitybegin = validitybegin

record = T_p0006.

recordnumber = p_record-SEQNR

operation = 'MOD'

nocommit = nocommit

dialog_mode = '0'

IMPORTING

return = return_struct

key = personaldatakey

EXCEPTIONS

OTHERS = 0.

Endloop.

Is this using Loop is fine? or Using PROVIDE * from p0006 between PN-BEGDA AND PN-ENDDA

ENDPROVIDE is fine?

Is my code is accurate...Bapi_employee enque bapiemployee_deque i will add apart from that is this code is fine for my requirement or any additional need to take care to capture all the employee data ?

Regards

sas

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

When u re using macros in ABAP HR, try to use Provide - Endprovide, Instead of Loop & Endloop.

Hope this will help u.

Thanks & Regards,

Gaurav.

4 REPLIES 4

Former Member
0 Kudos

Hi,

When u re using macros in ABAP HR, try to use Provide - Endprovide, Instead of Loop & Endloop.

Hope this will help u.

Thanks & Regards,

Gaurav.

0 Kudos

thanks Gaourav any other inputs please!!

Regards

sas

0 Kudos

Hi,

Please use the following code: -

RP_PROVIDE_FROM_LAST P0001 space pn-begda pn-endda.

check p0001-weks = '5200'.

rp_provide_from_last p0006 space pn-begda pn-endda.

provide * from p0006 between PN-BEGDA AND PN-ENDDA

  • move p0006 to T_p0006.

if ort01 is not initial

Move P0006-ORT01 TO P0006-ORT02.

endif.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0006'

subtype = P0006-subty

  • objectid = P_record-objps

number = p0006-pernr "employeenumber

validityend = p0006-endda

validitybegin = p0006-begda

record = p0006.

recordnumber = p0006-SEQNR

operation = 'MOD'

  • nocommit = nocommit

dialog_mode = '0'

tclass = 'A'

IMPORTING

return = return_struct

key = personaldatakey

EXCEPTIONS

OTHERS = 0.

endprovide.

Hope this will help you.

Thanks & Regards,

Gaurav

0 Kudos

issue here is i want an japan employee

currently if he is usa and Previously he is in japan.

so how could we identify his data?

Regards

sas

Edited by: saslove sap on May 6, 2009 12:19 PM