03-16-2009 7:37 PM
Dear Expert,
How can I unlock a locked record from Infotype 2010. When I am using BDC how should I decide which record to select in PA30 once I have passed the date and Employee Number details on the screen.
If on the same date if there are more than one record and if the first one is not locked then the BDC is locking them insted of unlocking it.
Is there any function module which can help me. The Code I have used is as below.
The field SPRPS is coming during recording but bdc gives error stating this field is not there on the screen so could not use this one as well..
IF T_REPORT-INFOTYPE = '2010'.
PERFORM BDC_DYNPRO USING 'SAPMP50A' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '=LIST'.
PERFORM BDC_FIELD USING 'RP50G-PERNR' T_REPORT-PERNR.
PERFORM BDC_FIELD USING 'RP50G-TIMR6' 'X'.
PERFORM BDC_FIELD USING 'RP50G-BEGDA' TEMP_BEGDA.
PERFORM BDC_FIELD USING 'RP50G-ENDDA' TEMP_BEGDA.
PERFORM BDC_FIELD USING 'RP50G-CHOIC' '2010'.
PERFORM BDC_FIELD USING 'RP50G-SUBTY' T_REPORT-LGART.
PERFORM BDC_FIELD USING 'P50G-SPRPS' 'X'.
PERFORM BDC_DYNPRO USING 'MP200000' '3450'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'P2010-BEGDA(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '=EDQ'.
PERFORM BDC_FIELD USING 'RP50M-BEGDA' TEMP_BEGDA.
PERFORM BDC_FIELD USING 'RP50M-ENDDA' TEMP_BEGDA.
PERFORM BDC_FIELD USING 'RP50M-PAGEA' ' 1'.
PERFORM BDC_FIELD USING 'RP50M-SELE2(01)' 'X'.
PERFORM BDC_DYNPRO USING 'MP200000' '2450'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'.
PERFORM BDC_DYNPRO USING 'MP200000' '2450'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'P2010-LGART'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' 'UPD'.
Unlock the Details to the R/3 using Tcode PA30.
CALL TRANSACTION 'PA30' USING BDCDATA MODE 'P' MESSAGES INTO MESSTAB.
Regards,
Vidya..
03-16-2009 7:57 PM
first of all, use a BAPI instead of BDC.. HR_MAINTAIN_MASTERDATA
you may have to do some up-front logic to determine which records to unlock, if necessary.
EDIT: that is a FM, not BAPI.
Edited by: robert phelan on Mar 16, 2009 8:57 PM