05-15-2006 6:46 AM
hi
plz send me the sample code for calling subroutine (using the above mentioned FM) from dynamic action ..
Regds
Gunjan
05-15-2006 2:37 PM
Hi Gunjan,
I hope you already know how to call a subroutine from the Dynamic Action. If you put the function call to HR_INFOTYPE_OPERATION directly in that subrouitne, the results may be inconsistent due to the nature of this function ( CALL_DAILOG ). So you will have to export to memory the infotype record you want to update say P0001 & import P0001 from memory in another Report Program. In that Program put the function call to HR_INFOTYPE_OPERATION. In the subroutine that gets invoked via Dynamic Actions SUBMIT the second Program. This would isolate the roll area for the function call.
Regards,
Suresh Datti
05-15-2006 2:37 PM
Hi Gunjan,
I hope you already know how to call a subroutine from the Dynamic Action. If you put the function call to HR_INFOTYPE_OPERATION directly in that subrouitne, the results may be inconsistent due to the nature of this function ( CALL_DAILOG ). So you will have to export to memory the infotype record you want to update say P0001 & import P0001 from memory in another Report Program. In that Program put the function call to HR_INFOTYPE_OPERATION. In the subroutine that gets invoked via Dynamic Actions SUBMIT the second Program. This would isolate the roll area for the function call.
Regards,
Suresh Datti
05-15-2006 3:02 PM
Hi Gunjan,
I don't understood if your problem is the inteface of FM (i.e. which parameter have to pass to the FM) or the fact that when you call this FM from some transaction like PA30 or PA40 some standard variables like pspar are changed.
Supposing yuor problem is the latter I solved it in this way.
I create a custom FM with the same parameter of HR_INFOTYPE_OPERATION, but with the property Remote-Enalble Module.
The only difference is that you have to specify the type of the parameter "RECORD".
In the custom FM call the HR_INFOTYPE_OPERATION.
Call the Custom FM via RFC,
call function 'ZHR_INFTYPR_OPERATION'
destination your_destination
...
...
If you need more explanation ask me .
bye
enzo
05-15-2006 3:14 PM
It's here a little example.
FUNCTION ZHR_INFOTYPE_OPERATION.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(ZINFTY) LIKE PRELP-INFTY
*" VALUE(ZNUMBER) LIKE P0001-PERNR
*" VALUE(ZSUBTYPE) LIKE P0001-SUBTY OPTIONAL
*" VALUE(ZOBJECTID) LIKE P0001-OBJPS OPTIONAL
*" VALUE(ZLOCKINDICATOR) LIKE P0001-SPRPS OPTIONAL
*" VALUE(ZVALIDITYEND) LIKE P0001-ENDDA OPTIONAL
*" VALUE(ZVALIDITYBEGIN) LIKE P0001-BEGDA OPTIONAL
*" VALUE(ZRECORDNUMBER) LIKE P0001-SEQNR OPTIONAL
*" VALUE(ZRECORD) type p0014 "use the infotype number you need
*" VALUE(ZOPERATION) LIKE PSPAR-ACTIO
*" VALUE(ZTCLAS) LIKE PSPAR-TCLAS DEFAULT 'A'
*" VALUE(ZDIALOG_MODE) TYPE C DEFAULT '0'
*" VALUE(ZNOCOMMIT) LIKE BAPI_STAND-NO_COMMIT OPTIONAL
*" VALUE(ZVIEW_IDENTIFIER) LIKE P0003-VIEKN OPTIONAL
*" VALUE(ZSECONDARY_RECORD) OPTIONAL
*" EXPORTING
*" VALUE(ZRETURN) LIKE BAPIRETURN1 STRUCTURE BAPIRETURN1
*" VALUE(ZKEY) LIKE BAPIPAKEY STRUCTURE BAPIPAKEY
*"----------------------------------------------------------------------
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = znumber.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = zinfty
number = zpernr
subtype = zsubty
objectid = zobjps
lockindicator = zsprps
validityend = zvalidityend
validitybegin = zvaliditybegin
recordnumber = zrecordnumber
record = zrecord
dialog_mode = zdialog_mode
operation = zmod
IMPORTING
return = zreturn.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = znumber..
.
COMMIT WORK AND WAIT.
endfunction.
bye
enzo
05-16-2006 5:33 AM
Hi suresh,
Could u plz elaborate the same if possible giving sample code!!
Thx
gunjan
05-16-2006 5:34 AM