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

HRABAP

Former Member
0 Likes
478

Hi ,

I developed bdc using recording to create employee using infotypes

0000

0100

0006

0007

0105

0901

Here I want to any lsmw or Bapi whichi will develop emp based on following infotypes.

Thanks

perform upload_file.

*clear: it_gt.

perform open_group.

loop at it_gt into wa_it.

perform bdc_dynpro using 'SAPMP50A' '2000'.

perform bdc_field using 'RP50G-PERNR' ''. "RK

perform bdc_field using 'BDC_CURSOR'

'T529T-MNTXT(02)'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

perform bdc_field using 'RP50G-SELEC(02)'

'X'.

  • PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'. "R

perform bdc_dynpro using 'MP000000' '2000'.

perform bdc_field using 'BDC_CURSOR'

'PSPAR-PLANS'.

perform bdc_field using 'P0000-BEGDA' wa_it-begda.

  • '07.08.2008'.

*perform bdc_field using 'P0000-ENDDA'

  • '31.12.9999'.

*perform bdc_field using 'P0000-MASSN' wa_it-massn.

  • 'U1'.

perform bdc_field using 'P0000-MASSG' wa_it-massg.

  • 'U1'.

perform bdc_field using 'PSPAR-PLANS' wa_it-plans.

  • '50000107'.

          • PERFORM bdc_field USING 'BDC_OKCODE'

          • '/00'.

*****

*****

          • PERFORM bdc_dynpro USING 'MP000000' '2000'.

          • PERFORM bdc_field USING 'BDC_CURSOR'

          • 'PSPAR-PERNR'.

perform bdc_field using 'BDC_OKCODE'

'=UPD'.

perform bdc_dynpro using 'MP000100' '2010'.

perform bdc_field using 'BDC_CURSOR'

'P0001-BEGDA'.

          • PERFORM bdc_field USING 'BDC_OKCODE'

          • '/00'.

*****

          • PERFORM bdc_dynpro USING 'MP000100' '2010'.

          • PERFORM bdc_field USING 'BDC_CURSOR'

          • 'P0001-BEGDA'.

perform bdc_field using 'BDC_OKCODE'

'=UPD'.

perform bdc_dynpro using 'MP000200' '2010'.

perform bdc_field using 'BDC_CURSOR'

'Q0002-GESC3'.

perform bdc_field using 'BDC_OKCODE'

'=UPD'.

<LOCKED BY MODERATOR - USE APPROPRIATE TITLES>

Edited by: Alvaro Tejada Galindo on Aug 18, 2008 1:03 PM

Hi ,

I developed bdc using recording to create employee using infotypes

0000

0100

0006

0007

0105

0901

Here I want to any lsmw or Bapi whichi will develop emp based on following infotypes.

Thanks

perform upload_file.

*clear: it_gt.

perform open_group.

loop at it_gt into wa_it.

perform bdc_dynpro using 'SAPMP50A' '2000'.

perform bdc_field using 'RP50G-PERNR' ''. "RK

perform bdc_field using 'BDC_CURSOR'

'T529T-MNTXT(02)'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

perform bdc_field using 'RP50G-SELEC(02)'

'X'.

  • PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'. "R

perform bdc_dynpro using 'MP000000' '2000'.

perform bdc_field using 'BDC_CURSOR'

'PSPAR-PLANS'.

perform bdc_field using 'P0000-BEGDA' wa_it-begda.

  • '07.08.2008'.

*perform bdc_field using 'P0000-ENDDA'

  • '31.12.9999'.

*perform bdc_field using 'P0000-MASSN' wa_it-massn.

  • 'U1'.

perform bdc_field using 'P0000-MASSG' wa_it-massg.

  • 'U1'.

perform bdc_field using 'PSPAR-PLANS' wa_it-plans.

  • '50000107'.

          • PERFORM bdc_field USING 'BDC_OKCODE'

          • '/00'.

*****

*****

          • PERFORM bdc_dynpro USING 'MP000000' '2000'.

          • PERFORM bdc_field USING 'BDC_CURSOR'

          • 'PSPAR-PERNR'.

perform bdc_field using 'BDC_OKCODE'

'=UPD'.

perform bdc_dynpro using 'MP000100' '2010'.

perform bdc_field using 'BDC_CURSOR'

'P0001-BEGDA'.

          • PERFORM bdc_field USING 'BDC_OKCODE'

          • '/00'.

*****

          • PERFORM bdc_dynpro USING 'MP000100' '2010'.

          • PERFORM bdc_field USING 'BDC_CURSOR'

          • 'P0001-BEGDA'.

perform bdc_field using 'BDC_OKCODE'

'=UPD'.

perform bdc_dynpro using 'MP000200' '2010'.

perform bdc_field using 'BDC_CURSOR'

'Q0002-GESC3'.

perform bdc_field using 'BDC_OKCODE'

'=UPD'.

<LOCKED BY MODERATOR - USE APPROPRIATE TITLES>

Edited by: Alvaro Tejada Galindo on Aug 18, 2008 1:03 PM

2 REPLIES 2
Read only

Former Member
0 Likes
444

Hi,

Please find the below code..

REPORT ZSAPHR_SAMP.

tables: pa0105.

infotypes: 0105.

DATA : I_RETURN TYPE BAPIRETURN1,

I_KEY TYPE BAPIPAKEY,

PERNR TYPE P0001-PERNR,

I_P0105 TYPE TABLE OF P0105 WITH HEADER LINE,

ENDDA TYPE P0105-ENDDA,

BEGDA TYPE P0105-BEGDA.

MOVE '00000010' TO PERNR.

BEGDA = SY-DATUM + 1.

ENDDA = SY-DATUM + 1.

i_p0105-pernr = PERNR.

i_p0105-infty = '0105'.

i_p0105-subty = '0002'.

i_p0105-endda = ENDDA.

i_p0105-begda = BEGDA.

I_P0105-USRTY = '0002'.

I_P0105-USRID = 'VOICE@xyz'.

APPEND i_p0105.

CALL FUNCTION 'DEQUEUE_ALL' .

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = PERNR.

IF SY-SUBRC = 0.

WRITE 'Employee Locked Successfully'.

ENDIF.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '0105'

NUMBER = PERNR

SUBTYPE = '0002'

VALIDITYEND = BEGDA

VALIDITYBEGIN = ENDDA

RECORD = i_p0105

OPERATION = 'INS'

TCLAS = 'A'

DIALOG_MODE = '0'

NOCOMMIT = 'X'

IMPORTING

RETURN = I_RETURN

KEY = I_KEY.

IF SY-SUBRC = 0.

WRITE : 'FM returns sy-subrc 0'.

ENDIF.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'.

I hope this is helpfull

Raghunath.S

Read only

0 Likes
444

Thanks,

This program does for existing emp,

Here I want to create new wmployee.

Thanks