‎2010 Aug 16 7:55 PM
Dear,
i've created a BDC program to update time management status IT0007 from 7 to 1 , i got all employees number i want into table and looped at this table into work-area then wrote my BDC Code , the problem is when i run the session from sm35 it always retreive the first employee number only and do infinite loop of modify and update, Here/'s the Code:
LOOP AT it_employee INTO wa_employee.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'RP50G-PERNR'
wa_employee-pernr.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-CHOIC'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'0007'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MOD'.
PERFORM bdc_dynpro USING 'MP000700' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0007-ZTERF'.
PERFORM bdc_field USING 'P0007-BEGDA'
begda.
PERFORM bdc_field USING 'P0007-ENDDA'
endda.
PERFORM bdc_field USING 'P0007-ZTERF' '1'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'PA30'
TABLES
DYNPROTAB = it_bdcdata
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.
clear it_bdcdata.
ENDLOOP.
‎2010 Aug 17 8:05 AM
After the loop that you have given, check the entries in the table it_bdcdata if it has all the employee numbers against the field.
If it_bdcdata is a table with header line, clear the entire table. Refresh it_bdcdata.
Cheers,
Sujay
‎2010 Aug 16 8:25 PM
Hi,
The code looks ok. Try setting breakpoint to check IT_BDCDATA at each loop. Everytime BDC runs, check the SY-SUBRC value. If its 1001, there is a data related issue. Debug how each screen gets updated with what values.
Hope this helps. Regards, Liz
‎2010 Aug 17 7:50 AM
Hi
As yo have cleared it_bdcdata similarly clear your work area before endloop and then try.
‎2010 Aug 17 7:57 AM
Still update the transaction with the first entry and never go to the second one :S
‎2010 Aug 17 8:08 AM
Hi
can you please tell me how you have defined you internal table.
Please try this:
TABLES
DYNPROTAB = it_bdcdata[]
I am sure you have defined your internal table it_employee as a table without header line, and using the work area.
Also you are selecting your infotype as 0007 by default/hardcoded.
I think the problem is with your internal table.
please check its declaration part.
Thanks
Lalit Gupta
‎2010 Aug 17 8:05 AM
After the loop that you have given, check the entries in the table it_bdcdata if it has all the employee numbers against the field.
If it_bdcdata is a table with header line, clear the entire table. Refresh it_bdcdata.
Cheers,
Sujay
‎2010 Aug 17 8:10 AM