Skip to Content
author's profile photo Former Member
Former Member

bdc for pa40

hi

i am going to make bdc program for pa40 which is of hr module .

i want to know whether bdc program will be similar or different for hr module .

regards

Rakesh singh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2008 at 08:55 AM

    >

    > hi

    >

    > i am going to make bdc program for pa40 which is of hr module .

    > i want to know whether bdc program will be similar or different for hr module .

    >

    > regards

    > Rakesh singh

    It is same for HR.Just record call transaction as same as other BDC's.But it will be Better , if you use LSMW than BDC for PA40 as there are large number of records.

    Hope this will help you

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 31, 2008 at 12:48 PM

    Hi

    bdc-for-pa40---why-not

    Regards

    Pavan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2008 at 05:21 AM

    Hi Rakesh,

    The BDC program is same for all the tocde .. and all the modules.. but the logic for handling the screen and processing would be different...

    What ur doing with PA40.. U can use PA30 tcode to update the data into data base.. if ur creating an new employee then U goo for PA40.. if ur updating any info about emp then goo for PA30...

    Insted of BDC u can use Funcation Modules to update the infotypes for any employee..

    ..

    Hope , Helpful

    Raghunath.S

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2008 at 05:28 AM

    Hi,

    It is same. PA0040 is like any other Table in the SAP.

    Record the BDC as you do with other TAbles it is hardly any difference.

    Regards

    Sumit Agarwal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 01, 2008 at 06:06 AM

    Rakesh,

    We never write BDC for PA40.

    Write it for PA30.

    Goto SHDB tcode and record for the required infotype.

    Or you can also use any of the following FM instead of BDc.

    HR_INFOTYPE_OPERATION

    HR_MAINTAIN_MASTERDATA.

    Amit.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2008 at 06:21 AM

    hi rakesh,

    check this out....

    *include bdcrecx1.

    TABLES: t100.

    ----


    • Type Declaration *

    ----


    TYPES : BEGIN OF t_pa40,

    *----INFO TYPE 0000

    pernr TYPE bapip0001-pernr, "EMPLOYEE NUMBER

    einda TYPE dats,

    begda(10) TYPE c, "start date

    plans(8) TYPE c, "POSITION

    massn(2) TYPE c, "Action Type

    massg(2) TYPE c, "reason for action

    werks(4) TYPE c, "PERSONAL AREA

    persg(1) TYPE c, "EMPLOYEE GROUP

    persk(2) TYPE c, "Employee Subgroup

    *----INFO TYPE 0002

    anrex(5) TYPE c, "Form of address text

    nachn(40) TYPE c, "Last Name

    vorna(40) TYPE c, "FIRST NAME

    inits(10) TYPE c, "INITIALS

    gesch(1) TYPE c, "gender key

    gbdat(10) TYPE c, "DATE OF BIRTH

    fatxt(1) TYPE c, "MARITAL STATUS,

    • famdt(10) TYPE c, "DATE OF MARRIAGE,

    *----INFO TYPE 0001

    btrtl(4) TYPE c, "Personnel Subarea

    gsber(4) TYPE c, "Business Area

    abkrs(2) TYPE c, "Payroll Area

    *----INFO TYPE 0006

    anssa(4) TYPE c, "ADDRESS TYPE

    stras(60) TYPE c, "STREET

    locat(40) TYPE c, "2nd LINE ADDRESS

    pstlz(10) TYPE c, "POSTAL CODE

    ort01(40) TYPE c, "City

    telnr(14) TYPE c, "Telephone number

    *----INFO TYPE 0007

    schkz(8) TYPE c, "Work Schedule Rule

    *----INFO TYPE 0008

    trfar(2) TYPE c, "PAY SCALE TYPE,

    trfgb(2) TYPE c, "PAY SCALE AREA

    divgv(5) TYPE c, "Hours worked per payroll period

    trfgr(8) TYPE c, "Pay Scale Group

    trfst(2) TYPE c, "level

    *----EMPLOYEE WAGE_TYPES

    lga01(4) TYPE c, "Wage type-----LINE ITEM 1(5000)

    lga02(4) TYPE c, "Wage type-----LINE ITEM 2(5010)

    lga03(4) TYPE c, "Wage type-----LINE ITEM 3(5020)

    lga04(4) TYPE c, "Wage type-----LINE ITEM 4(5030)

    lga05(4) TYPE c, "Wage type-----LINE ITEM 5(5040)

    *----EMPLOYEE WAGE AMOUNTS

    bet01(13) TYPE c, "Wage Type Amount for Payments

    bet02(13) TYPE c, "Wage Type Amount for Payments

    bet03(13) TYPE c, "Wage Type Amount for Payments

    bet04(13) TYPE c, "Wage Type Amount for Payments

    bet05(13) TYPE c, "Wage Type Amount for Payments

    *----INFO TYPE 0009

    bankl(15) TYPE c, "BANK KEY

    bankn(18) TYPE c, "BANK ACCOUNT NUMBER

    zlsch(1) TYPE c, "Payment Method,

    *----info-587,588,185.

    tstid(4) TYPE c, "PF TRUST ID

    penid(4) TYPE c, "PENSION TRUST ID

    eepfn(20) TYPE c, "PF NUMBER,

    eepnn(20) TYPE c, "PENSION NUMBER

    eevpf(5) TYPE c, "Voluntary Provident fund

    evpfa(15) TYPE c, "Employee VPF Amount

    pnflg(1) TYPE c, "Contribution for Pension scheme flag

    ptxel(1) TYPE c, "Eligibility for PTax

    ictyp LIKE p0185-ictyp, "Id Type

    icnum LIKE p0185-icnum, "ID NUMBER

    • auth1 LIKE p0185-auth1, "Author

    END OF t_pa40.

    ----


    • Internal table declaration *

    ----


    DATA : i_pa40 TYPE TABLE OF t_pa40 WITH HEADER LINE.

    • bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

    ----


    • data definition

    ----


    • Batchinputdata of single transaction

    DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

    • messages of call transaction

    DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

    • error session opened (' ' or 'X')

    DATA: e_group_opened.

    • message texts

    DATA: l_mstring(480).

    DATA: l_subrc LIKE sy-subrc.

    ----


    • Variables Declaration *

    ----


    DATA: v_fname TYPE string,

    v_ftype(10) TYPE c VALUE 'ASC'.

    ----


    • Constants Declaration *

    ----


    CONSTANTS: m1 VALUE 'E',

    u1 VALUE 'S'.

    ----


    • Selection screen *

    ----


    PARAMETERS: p_fname TYPE rlgrap-filename.

    ----


    • For F4 *

    ----


    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.

    CALL FUNCTION 'F4_FILENAME'

    IMPORTING

    file_name = p_fname.

    ----


    • start of selection *

    ----


    START-OF-SELECTION.

    MOVE p_fname TO v_fname.

    ----


    • GUI uploading *

    ----


    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    filename = v_fname

    filetype = v_ftype

    has_field_separator = 'X'

    TABLES

    data_tab = i_pa40.

    LOOP AT i_pa40.

    REFRESH bdcdata.

    *perform open_group.

    ----


    • BDC recording *

    ----


    PERFORM bdc_dynpro USING 'SAPMP50A' '2000'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'T529T-MNTXT(01)'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=PICK'.

    PERFORM bdc_field USING 'RP50G-PERNR'

    i_pa40-pernr. "'77116'.

    PERFORM bdc_field USING 'RP50G-EINDA'

    i_pa40-einda. "'13.12.2007'.

    PERFORM bdc_field USING 'RP50G-SELEC(01)'

    'X'.

    PERFORM bdc_dynpro USING 'MP000000' '2000'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'PSPAR-PERSK'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=UPD'.

    PERFORM bdc_field USING 'PSPAR-PERNR'

    i_pa40-pernr. "' 77116'.

    PERFORM bdc_field USING 'P0000-BEGDA'

    i_pa40-begda. "'13.12.2007'.

    PERFORM bdc_field USING 'P0000-ENDDA'

    '31.12.9999'.

    PERFORM bdc_field USING 'P0000-MASSN'

    i_pa40-massn. "'01'.

    PERFORM bdc_field USING 'P0000-MASSG'

    i_pa40-massg. "'01'.

    PERFORM bdc_field USING 'PSPAR-PLANS'

    i_pa40-plans. "'99999999'.

    PERFORM bdc_field USING 'PSPAR-WERKS'

    i_pa40-werks. "'1000'.

    PERFORM bdc_field USING 'PSPAR-PERSG'

    i_pa40-persg. "'1'.

    PERFORM bdc_field USING 'PSPAR-PERSK'

    i_pa40-persk. "'01'.

    PERFORM bdc_dynpro USING 'MP000200' '2040'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'P0002-NATIO'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=UPD'.

    PERFORM bdc_field USING 'P0002-BEGDA'

    i_pa40-begda. "'13.12.2007'.

    PERFORM bdc_field USING 'P0002-ENDDA'

    '31.12.9999'.

    PERFORM bdc_field USING 'Q0002-ANREX'

    i_pa40-anrex. "'Mr'.

    PERFORM bdc_field USING 'P0002-NACHN'

    i_pa40-nachn. "'eng'.

    PERFORM bdc_field USING 'P0002-VORNA'

    i_pa40-vorna. "'lish'.

    PERFORM bdc_field USING 'P0002-INITS'

    i_pa40-inits. "'E'.

    PERFORM bdc_field USING 'P0002-GESCH'

    i_pa40-gesch. "'1'.

    PERFORM bdc_field USING 'P0002-SPRSL'

    'EN'.

    PERFORM bdc_field USING 'P0002-GBDAT'

    i_pa40-gbdat. "'19.09.1985'.

    PERFORM bdc_field USING 'Q0002-FATXT'

    i_pa40-fatxt. "'Marr.'.

    PERFORM bdc_field USING 'P0002-NATIO'

    'IS'.

    PERFORM bdc_dynpro USING 'MP000100' '2000'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'P0001-ABKRS'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=UPD'.

    PERFORM bdc_field USING 'P0001-BEGDA'

    i_pa40-begda. "'13.12.2007'.

    PERFORM bdc_field USING 'P0001-ENDDA'

    '31.12.9999'.

    PERFORM bdc_field USING 'P0001-BTRTL'

    i_pa40-btrtl. "'1010'.

    PERFORM bdc_field USING 'P0001-GSBER'

    i_pa40-gsber. "'0001'.

    PERFORM bdc_field USING 'P0001-ABKRS'

    i_pa40-abkrs. "'01'.

    PERFORM bdc_field USING 'P0001-PLANS'

    i_pa40-plans. "'99999999'.

    PERFORM bdc_dynpro USING 'MP000600' '2000'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'P0006-TELNR'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=UPD'.

    PERFORM bdc_field USING 'P0006-BEGDA'

    i_pa40-begda. "'13.12.2007'.

    PERFORM bdc_field USING 'P0006-ENDDA'

    '31.12.9999'.

    PERFORM bdc_field USING 'P0006-STRAS'

    i_pa40-stras. "'vs homes'.

    PERFORM bdc_field USING 'P0006-LOCAT'

    i_pa40-locat. "'k nagar'.

    PERFORM bdc_field USING 'P0006-PSTLZ'

    i_pa40-pstlz. "'522006'.

    PERFORM bdc_field USING 'P0006-ORT01'

    i_pa40-ort01. "'gnt'.

    PERFORM bdc_field USING 'P0006-LAND1'

    'IN'.

    PERFORM bdc_field USING 'P0006-TELNR'

    i_pa40-telnr. "'2325161'.

    PERFORM bdc_dynpro USING 'MP000600' '2000'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '/ENXT'.

    PERFORM bdc_dynpro USING 'MP000700' '2000'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'P0007-SCHKZ'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=UPD'.

    PERFORM bdc_field USING 'P0007-BEGDA'

    i_pa40-begda. "'13.12.2007'.

    PERFORM bdc_field USING 'P0007-ENDDA'

    '31.12.9999'.

    PERFORM bdc_field USING 'P0007-SCHKZ'

    i_pa40-schkz. "'CGEN'.

    PERFORM bdc_field USING 'P0007-EMPCT'

    ' 100,00'.

    PERFORM bdc_dynpro USING 'MP000800' '2040'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'P0008-TRFAR'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=UPD'.

    PERFORM bdc_field USING 'P0008-BEGDA'

    i_pa40-begda. "'13.12.2007'.

    PERFORM bdc_field USING 'P0008-ENDDA'

    '31.12.9999'.

    PERFORM bdc_field USING 'P0008-TRFAR'

    i_pa40-trfar. "'01'.

    PERFORM bdc_field USING 'P0008-BSGRD'

    '100,00'.

    PERFORM bdc_field USING 'P0008-TRFGB'

    i_pa40-trfgb. "'01'.

    PERFORM bdc_field USING 'P0008-DIVGV'

    i_pa40-divgv. "'192,00'.

    PERFORM bdc_field USING 'P0008-TRFGR'

    i_pa40-trfgr. "'JRMGT'.

    PERFORM bdc_field USING 'P0008-TRFST'

    i_pa40-trfst. "'01'.

    PERFORM bdc_field USING 'P0008-ANCUR'

    'INR'.

    PERFORM bdc_field USING 'Q0008-IBBEG'

    '27.03.2008'.

    PERFORM bdc_field USING 'P0008-WAERS'

    'INR'.

    PERFORM bdc_field USING 'Q0008-LGART(01)'

    i_pa40-lga01. "'5000'.

    PERFORM bdc_field USING 'Q0008-LGART(02)'

    i_pa40-lga02. "'5001'.

    PERFORM bdc_field USING 'Q0008-LGART(03)'

    i_pa40-lga03. "'5002'.

    PERFORM bdc_field USING 'Q0008-LGART(04)'

    i_pa40-lga04. "'5020'.

    PERFORM bdc_field USING 'Q0008-LGART(05)'

    i_pa40-lga05. "'5021'.

    PERFORM bdc_field USING 'Q0008-BETRG(01)'

    i_pa40-bet01. "' 5000'.

    PERFORM bdc_field USING 'Q0008-BETRG(02)'

    i_pa40-bet02. "' 5001'.

    PERFORM bdc_field USING 'Q0008-BETRG(03)'

    i_pa40-bet03. "' 5002'.

    PERFORM bdc_field USING 'Q0008-BETRG(04)'

    i_pa40-bet04. "' 5020'.

    PERFORM bdc_field USING 'Q0008-BETRG(05)'

    i_pa40-bet05. "' 5021'.

    PERFORM bdc_dynpro USING 'MP000900' '2000'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'P0009-ZLSCH'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=UPD'.

    PERFORM bdc_field USING 'P0009-BEGDA'

    i_pa40-begda. "'13.12.2007'.

    PERFORM bdc_field USING 'P0009-ENDDA'

    '31.12.9999'.

    PERFORM bdc_field USING 'P0009-BNKSA'

    '0'.

    PERFORM bdc_field USING 'Q0009-EMFTX'

    'lish eng'.

    PERFORM bdc_field USING 'Q0009-BKPLZ'

    '522006'.

    PERFORM bdc_field USING 'Q0009-BKORT'

    'gnt'.

    PERFORM bdc_field USING 'P0009-BANKS'

    'IN'.

    PERFORM bdc_field USING 'P0009-BANKL'

    i_pa40-bankl. "'ICIC0000011'.

    PERFORM bdc_field USING 'P0009-BANKN'

    i_pa40-bankn. "'1403711'.

    PERFORM bdc_field USING 'P0009-ZLSCH'

    i_pa40-zlsch. "'T'.

    PERFORM bdc_field USING 'P0009-WAERS'

    'INR'.

    PERFORM bdc_dynpro USING 'MP002100' '2000'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '/ENXT'.

    PERFORM bdc_dynpro USING 'MP002100' '2040'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '/ENXT'.

    PERFORM bdc_dynpro USING 'SAPLSPO1' '0200'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=YES'.

    PERFORM bdc_dynpro USING 'MP002800' '2000'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '/ENXT'.

    ----


    • If pf no and Pension no are given, then irrespective of *

    • the flat file Contribution for Pension scheme flag must be checked *

    ----


    IF i_pa40-eepnn NE ' ' AND i_pa40-pnflg EQ ' '.

    PERFORM bdc_dynpro USING 'MP058700' '2000'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '/ENXT'.

    PERFORM bdc_dynpro USING 'SAPLSPO1' '0200'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=YES'.

    ELSE.

    PERFORM bdc_dynpro USING 'MP058700' '2000'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'P0587-EVPFA'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    'UPD'.

    PERFORM bdc_field USING 'P0587-BEGDA'

    i_pa40-begda. "'13.12.2007'.

    PERFORM bdc_field USING 'P0587-ENDDA'

    '31.12.9999'.

    PERFORM bdc_field USING 'P0587-TSTID'

    i_pa40-tstid. "'RPF1'.

    PERFORM bdc_field USING 'P0587-PENID'

    i_pa40-penid. "'RPF1'.

    PERFORM bdc_field USING 'P0587-EEPFN'

    i_pa40-eepfn. "'XX/XXX/999999/999999'.

    PERFORM bdc_field USING 'P0587-EEPNN'

    i_pa40-eepnn. "'XXXXX/501'.

    PERFORM bdc_field USING 'P0587-EEVPF'

    i_pa40-eevpf. "'25'.

    PERFORM bdc_field USING 'Q0587-EEPF2'

    'X'.

    PERFORM bdc_field USING 'P0587-EVPFA'

    i_pa40-evpfa. "' 1250'.

    PERFORM bdc_field USING 'Q0587-ERPF2'

    'X'.

    PERFORM bdc_field USING 'Q0587-ERPN1'

    'X'.

    PERFORM bdc_field USING 'P0587-PNFLG'

    i_pa40-pnflg. "'X'.

    ENDIF.

    PERFORM bdc_dynpro USING 'MP058800' '2000'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '/ENXT'.

    PERFORM bdc_dynpro USING 'MP058800' '2000'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'P0588-BEGDA'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=UPD'.

    PERFORM bdc_field USING 'P0588-BEGDA'

    i_pa40-begda. "'13.12.2007'.

    PERFORM bdc_field USING 'P0588-ENDDA'

    '31.12.9999'.

    PERFORM bdc_field USING 'Q0588-PTXEL'

    i_pa40-ptxel. "'X'.

    PERFORM bdc_dynpro USING 'MP018500' '2240'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'P0185-BEGDA'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '=UPD'.

    PERFORM bdc_field USING 'P0185-BEGDA'

    i_pa40-begda. "'13.12.2007'.

    PERFORM bdc_field USING 'P0185-ENDDA'

    '31.12.9999'.

    PERFORM bdc_field USING 'P0185-ICNUM'

    i_pa40-icnum. "'AAAAA9999A'.

    PERFORM bdc_dynpro USING 'SAPMP50A' '2000'.

    PERFORM bdc_field USING 'BDC_OKCODE'

    '/EBCK'.

    PERFORM bdc_field USING 'BDC_CURSOR'

    'RP50G-PERNR'.

    *perform bdc_transaction using 'PA40'.

    CALL TRANSACTION 'PA40' USING bdcdata

    MODE m1

    UPDATE u1

    MESSAGES INTO messtab.

    ----


    • Message Handling *

    ----


    LOOP AT messtab.

    SELECT SINGLE * FROM t100 WHERE sprsl = messtab-msgspra

    AND arbgb = messtab-msgid

    AND msgnr = messtab-msgnr.

    IF sy-subrc = 0.

    l_mstring = t100-text.

    IF l_mstring CS '&1'.

    REPLACE '&1' WITH messtab-msgv1 INTO l_mstring.

    REPLACE '&2' WITH messtab-msgv2 INTO l_mstring.

    REPLACE '&3' WITH messtab-msgv3 INTO l_mstring.

    REPLACE '&4' WITH messtab-msgv4 INTO l_mstring.

    ELSE.

    REPLACE '&' WITH messtab-msgv1 INTO l_mstring.

    REPLACE '&' WITH messtab-msgv2 INTO l_mstring.

    REPLACE '&' WITH messtab-msgv3 INTO l_mstring.

    REPLACE '&' WITH messtab-msgv4 INTO l_mstring.

    ENDIF.

    CONDENSE l_mstring.

    WRITE: / messtab-msgtyp, l_mstring(250).

    ELSE.

    WRITE: / messtab.

    ENDIF.

    ENDLOOP.

    ----


    • Success Check *

    ----


    if sy-subrc is initial.

    write : i_pa40-pernr, 'is created'.

    else.

    write : i_pa40-pernr, 'is not cretaed'.

    endif.

    ENDLOOP.

    ----


    • Start new screen *

    ----


    FORM bdc_dynpro USING program dynpro.

    CLEAR bdcdata.

    bdcdata-program = program.

    bdcdata-dynpro = dynpro.

    bdcdata-dynbegin = 'X'.

    APPEND bdcdata.

    ENDFORM. "BDC_DYNPRO

    ----


    • Insert field *

    ----


    FORM bdc_field USING fnam fval.

    IF fval <> '' .

    CLEAR bdcdata.

    bdcdata-fnam = fnam.

    bdcdata-fval = fval.

    APPEND bdcdata.

    ENDIF.

    ENDFORM. "BDC_FIELD

    Regards,

    Arun.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.