Application Development 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: 

Delete employee from work centre - BDC

Former Member
0 Kudos

Hi ,

Iam doing a BDC to delete employee from workcentre. The tcode for workcentre is CNR2. when u enter CNR2, u need to enter workcentre number ( which has the employee to be deleted ) and plant and press enter. in the next screen there is a tab called " HR assignment " u need to click that. it will take u to another screen which has no of employees attached to the workcenter.

we need to expand the person list by clicking "+" icon next to person , here there is a list of persons attached to the workcentre. we need to choose the person to be deleted . keep the cursor on the employee name and click the delete icon or from the menu screen we can delate relationship. either ways it works , then we need to save.

The problem is when iam recording BDC for this the employee to be deleted is not getting recorded it just showing cursor for the screen , like

<b>perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'06/16'.

perform bdc_field using 'BDC_OKCODE'

'=TDEL'.</b>

Iam not able to link the employee filed to that of the text file.

Is there any way to do this , Please give me valuable inputs for this.

Regards,

Dan

7 REPLIES 7

Former Member

Former Member
0 Kudos

Dan,

Interactive controls are installed on desktop (these are the ActiveX controls on Windows) and operations on these are not recordable by SAP. I havent seen the workcenter screen, but when you say 'click on '+' sign', it looks as if the control is definitely activex.

Try looking for a menu path which does the same operation and record the BDC.

Regards,

Anand.

0 Kudos

Hi,

As you have said i tried doing it from menu path , but of no use, the deleting action is getting recorded, i dont have problem with that. the problem is when i keep my cursor on the employee (which has to be deleted ), this employee is not getting recorded.

i checked the help path , did not get the answer.

waiting for the reply

Regards,

Dan

0 Kudos

The next logical step would be to drop the BDC effort and look for a BAPI/SAP function module that does the same.

Run SE30 and analyze the delete operations. Look for function modules that process the delete action. Use that subsequently in the program instead of a BDC.

0 Kudos

Hi All,

I tried everything but cudnt get the solution for this, if there is a way to do it please let me know in detail .

Thanx in advance

Dan

0 Kudos

Hi i have copied the BDC code , this is the recording part , this where the problem is , even iam trying to explicitly assign the employee name to the field , iam not able to run the bdc. nor in debug i can see any values in the internal table for employee name.

DATA : BEGIN OF ITAB OCCURS 0 ,

ARBPL(8) ,

  • NACHN(40) ,

SHORT(12),

END OF ITAB .

PERFORM DYNPRO USING:

'X' 'SAPLCRA0' '0100',

' ' 'RC68A-ARBPL' ITAB-ARBPL, -


>This i know already & also getting recorded

' ' 'RC68A-WERKS' 'SRNF',

' ' 'BDC_OKCODE' '/00',

'X' 'SAPLCRA0' '4000',

' ' 'BDC_OKCODE' '=VKHR',

'X' 'SAPMSSY0' '0120',

' ' 'BDC_OKCODE' '=TREP',

  • Below is the screen where the Employees attach to work center

'X' 'SAPMSSY0' '0120',

  • ' ' 'SNODETEXT-TEXT' ITAB-NACHN,

' ' 'RC68A-SHORT' ITAB-SHORT,

' ' 'BDC_OKCODE' '=TDEL',

|

\ | /

This is the screen number where the employees

are attached to workcenter. when i do BDC

recording , Neither SNODETEXT-TEXT nor RC68A-SHORT

gets recorded . RC68A-SHORT gets recorded . As u had told I have explicitly added them by using F1 help on the employee field.

'X' 'SAPMSSY0' '0120',

' ' 'BDC_OKCODE' '=UPD'.

when i debug the BDC and check for itab , itab had two fields one is ARBPL for workcentre

and one is SHORT for employee, the Short field doesnt have any value at all. and BDC is failing.

i tried using find option to record the BDC just to check whther the employee field is getting recorded

but again that is also not getting recorded . There must be some procedure to over come .

if u know plz do lemme know.

Former Member
0 Kudos

You could remove the employee from the Work Centre from the HR side.


            SELECT * FROM hrp1001 INTO CORRESPONDING FIELDS OF TABLE it1001
              WHERE plvar = '01'
                AND otype = 'P'
                AND objid = pernr
                AND istat = '1'
                AND subty = 'B008'
                AND sclas = 'A'
                AND sobid = wa_crhd-hroid.

            CALL FUNCTION 'RH_DELETE_INFTY'
              EXPORTING
                vtask               = 'S'
              TABLES
                innnn               = it1001