Skip to Content
0
Former Member
Jun 09, 2006 at 02:44 PM

BDC PA-30

85 Views

Hi all,

My Requirement is to change the cost centre of all the Employees present in SAP system. In Tcode pa30 when you enter employee number , then organisational data , it will take to the screen where cost centre is present i have to change the cost centre to some constant values for all the employees.

The problem is , I must NOT use any external file , I have to take the employees from SAP itself and then change the cost centre of those Employees. the Employees are present in PA0001 table.

How must i go about , i know the BDC part of it

=========================================================

FORM GENERATE_BDC_DATA_PA30.

REFRESH BDC_TAB.

PERFORM DYNPRO USING:

'X' 'SAPMP50A' '1000',

<b>' ' 'RP50G-PERNR' xxxx, -->?what must b the field</b>

' ' 'RP50G-CHOIC' '0001',

' ' 'BDC_OKCODE' '=MOD',

'X' 'MP000100' '2010',

' ' 'P0001-KOSTL' '99-00-09',

' ' 'BDC_OKCODE' 'UPD'.

  • call transaction

REFRESH MESSTAB.

CALL TRANSACTION 'PA30' USING BDC_TAB

MODE MODE

UPDATE UPDATE

MESSAGES INTO MESSTAB.

  • error handling

CLEAR BDCNAME.

BDCNAME = 'PA30'.

PERFORM ERROR TABLES: MESSTAB USING BDCNAME 'PA30'.

ENDFORM.

FORM DYNPRO USING DYNBEGIN NAME VALUE.

IF DYNBEGIN = 'X'.

CLEAR BDC_TAB.

MOVE: NAME TO BDC_TAB-PROGRAM,

VALUE TO BDC_TAB-DYNPRO,

'X' TO BDC_TAB-DYNBEGIN.

APPEND BDC_TAB.

ELSE.

CLEAR BDC_TAB.

MOVE: NAME TO BDC_TAB-FNAM,

VALUE TO BDC_TAB-FVAL.

APPEND BDC_TAB.

ENDIF.

ENDFORM.

&----


*& Form ERROR TABLES

&----


  • text *

----


FORM ERROR TABLES: XMESSTAB STRUCTURE BDCMSGCOLL USING BDCNAME TCODE.

LOOP AT MESSTAB WHERE MSGTYP EQ 'E'

OR MSGTYP EQ 'A'.

  • create bdc session for error record

PERFORM BDC_INSERT USING BDCNAME TCODE.

EXIT.

ENDLOOP.

ENDFORM.

=========================================================

Do i have to read the table pa0001 into internal table or must do in otherway.

do i have to use select statement for table pa0001 like

SELECT * FROM PA0001 CLIENT SPECIFIED

WHERE MANDT = SY-MANDT

AND PERNR = PA0001-PERNR

AND ENDDA = '99991231'.

ENDSELECT.

PERNR is the employee nnumber.

Please do let me know how to proceed with this

Regards,

Dan