Skip to Content
0
Former Member
Apr 12, 2008 at 07:00 AM

Problem in BDC program

61 Views

HI to all

There is one existing BDC program.

coding as follows...

FORM f_update_pa9015 USING f_ovtm STRUCTURE t_ovtm.

DATA : l_date TYPE char10,

l_value TYPE char10,

l_opt TYPE ctu_params,

e_mess TYPE bdcmsgcoll OCCURS 40 WITH HEADER LINE.

CLEAR: bdcdata, bdcdata[], l_date, l_value, e_mess, e_mess[].

CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'

EXPORTING

input = f_ovtm-datum

IMPORTING

output = l_date.

l_value = f_ovtm-ovrtm.

PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=INS'.

PERFORM bdc_field USING 'RP50G-PERNR'

keytable-pernr.

PERFORM bdc_field USING 'BDC_SUBSCR'

'/1PAPAXX/HDR_19000A 0100SUBSCR_HEADER'.

PERFORM bdc_field USING 'BDC_SUBSCR'

'SAPMP50A 0320SUBSCR_ITMENU'.

PERFORM bdc_field USING 'BDC_SUBSCR'

'SAPMP50A 0330SUBSCR_TIME'.

PERFORM bdc_field USING 'BDC_SUBSCR'

'SAPMP50A 0350SUBSCR_ITKEYS'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RP50G-SUBTY'.

PERFORM bdc_field USING 'RP50G-CHOIC'

'9015'.

PERFORM bdc_dynpro USING 'MP901500' '2000'.

PERFORM bdc_field USING 'BDC_CURSOR'

'P9015-BEGDA'.

PERFORM bdc_field USING 'BDC_OKCODE'

'UPD'.

PERFORM bdc_field USING 'P9015-BEGDA'

l_date.

PERFORM bdc_field USING 'P9015-ENDDA'

l_date.

PERFORM bdc_field USING 'P9015-ESTDT'

l_date.

PERFORM bdc_field USING 'P9015-BETRG'

l_value.

PERFORM bdc_field USING 'P9015-WAERS'

'INR'.

PERFORM bdc_field USING 'P9015-YYREASN'

f_ovtm-ovtxt.

l_value = f_ovtm-apphr.

PERFORM bdc_field USING 'P9015-YYACTHR'

l_value.

CLEAR l_value.

l_value = f_ovtm-anzhl.

PERFORM bdc_field USING 'P9015-YYCALHR'

l_value.

CLEAR : l_opt.

l_opt-dismode = 'N'.

l_opt-updmode = 'S'.

l_opt-defsize = 'X'.

l_opt-racommit = 'X'.

bold PERFORM f_dequeue_employee USING keytable-pernr.

CALL TRANSACTION 'PA30' USING bdcdata OPTIONS FROM l_opt

MESSAGES INTO e_mess.

PERFORM f_enqueue_employee USING keytable-pernr.

bold

LOOP AT e_mess WHERE msgtyp = 'E' OR msgtyp = 'A'.

EXIT.

ENDLOOP.

IF sy-subrc = 0.

e_mess-msgtyp = 'E'.

e_mess-msgid = '333'.

e_mess-msgnr = 'S1'.

e_mess-msgv1 = 'Error in Posting OT Tracking for Date'.

e_mess-msgv2 = l_date.

APPEND e_mess. CLEAR e_mess.

PERFORM f_display_errors TABLES e_mess.

ENDIF.

ENDFORM. " f_update_pa9015

I am getting the error 'Personal number(s) could not be locked'.

message appeared.

It post the data in screen.

I want to stop processing if some other person is working on same PERNR(Emp no).

Is it the right to use first dequeue and then enqueue function module.

Please guide me where is the problem.

Regards

Anubhav Gupta