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: 

Trouble in BAPI (for basic pay)

former_member187692
Participant
0 Kudos
536

Hi ,

      I have been trying to pass data by execute this bapi "BAPI_BASICPAY_CREATE"

As follows:-


call function 'BAPI_BASICPAY_CREATE'

   exporting

     EMPLOYEENUMBER             = '3'

     SUBTYPE                    = '0   '

     VALIDITYBEGIN              = '01012014'

     VALIDITYEND                = '31122014'

  IMPORTING

    RETURN                     = RETURN

TABLES

   WAGETYPES                  = WAGES.

          

In RETURN, these are the errors I have been facing

   

Type   E      Personal number not yet assigned.

Type   E      Employee/applicant is not locked yet

PS:- Here I am just trying to test the bapi ( in SE37 ) by passing dummy values.

Regards,

Naren.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
372

Could you try to execute the FM with correct values in internal format (e.g. replace '3' with '00000003', '01012014' with '20140101', etc.)

Remarks :

  • This is a BAPI and not a BDC, so strong suggestion to use internal format (SE37 test mode will convert the input using adequate conversion-exit, but not execution during a program) .
  • A small research on the message SE91, where-used (*)  would have enabled you to identify the problem, value not found in a basic infotype like PA0001, so check primary keys values : pernr, begda, endda, etc.

Regards,

Raymond

(*) Also either post the exact text or the id of a standard error message.

7 REPLIES 7

former_member187692
Participant
0 Kudos
372

The above RETURN value errors are for different values ( before I have taken Employee number as 12900)

My actually requirement is I need to be able to transfer infotype 0008 (basic pay) details from notepad to SAP using BAPI . So, I picked up this bapi "BAPI_BASICPAY_CREATE".

Regards,

Naren K.

0 Kudos
372

Call function module BAPI_EMPLOYEE_ENQUEUE before calling BAPI_BASICPAY_CREATE.


The error 'Type   E      Employee/applicant is not locked yet' will be gone.

0 Kudos
372

Thank you for your reply Amol but I have done that as well before, now from the last 5 try I am getting this error

" Personal number not yet assigned.".

Regards,

Naren.

0 Kudos
372

Hi,

Check whether entered employee is valid in the input date range

Regards,

raymond_giuseppi
Active Contributor
0 Kudos
373

Could you try to execute the FM with correct values in internal format (e.g. replace '3' with '00000003', '01012014' with '20140101', etc.)

Remarks :

  • This is a BAPI and not a BDC, so strong suggestion to use internal format (SE37 test mode will convert the input using adequate conversion-exit, but not execution during a program) .
  • A small research on the message SE91, where-used (*)  would have enabled you to identify the problem, value not found in a basic infotype like PA0001, so check primary keys values : pernr, begda, endda, etc.

Regards,

Raymond

(*) Also either post the exact text or the id of a standard error message.

0 Kudos
372

Thanks you Raymond. Will look into this and revert.

Regards,

Naren.

0 Kudos
372

Hi Raymond,

I have done it. Thanks for your remarks  ( it was like one hit on my head ), " Sometimes we think in such a fashion that even we become blind to the obvious things. "

I whole issue was with miss-communication from HR consultants in basic pay values.

Below is a program for further reference:-

types:begin of type_struc,

       empno type bapip0008-pernr,   " Personal Number

       sub type bapip0008-subty,     " Subtype

       from type bapip0008-begda,    " Start date

       to type bapip0008-endda,      " End date

       pstype type bapip0008-trfar" Payscale type

       psarea type bapip0008-trfgb" Payscale area

       psgrp type bapip0008-trfgr,   " Payscale group

       pslvl type bapip0008-trfst,   " Payscale level

       curr type bapip0008-waers,    " Currency

       cpstype type bapip0008-vglta, " Comparsion payscale type

       cpsarea type bapip0008-vglgb, " Comp. payscale area

       cpsgrp type bapip0008-vglgr" Comp. payscale group

       cpslvl type bapip0008-vglst" Comp. payscale level

       clvl type bapip0008-bsgrd,    " Utilities level

       wrkhrs type bapip0008-divgv" Works hours

   end of type_struc.

data: wa type type_struc,

       itab type table of type_struc.

data: return like bapireturn1,

       return2 like bapireturn1,

       wages like bapip0008p occurs 0.

call function 'GUI_UPLOAD'

   exporting

    filename                      = '   '

    filetype                      = 'DAT'

    has_field_separator           = 'X'

   tables

     data_tab                      = itab.

call function 'BAPI_PS_INITIALIZATION' .

loop at itab into wa.

call function 'BAPI_EMPLOYEE_ENQUEUE'

   exporting

     number        wa-empno "'12900'

  importing

    return        = return

           .

call function 'BAPI_BASICPAY_CREATE'

   exporting

     employeenumber             = wa-empno "'12900'

     subtype                    = wa-sub "'1   '

     validitybegin              = wa-from " '01.01.2014'

     validityend                = wa-to "'31.12.2014'

    payscaletype               wa-pstype " 01

    payscalearea               wa-psarea " 12

    payscalegroup              wa-psgrp  " 120A

    payscalelevel              wa-pslvl  " 00

    currency                   wa-curr   " INR

    comparisonpayscltype       wa-cpstype" 01

    comparisonpaysclarea       wa-cpsarea" 12

    comparisonpaysclgrp        wa-cpsgrp " 120A

    comparisonpayscllvl        wa-cpslvl " 00

    capacityutillevel          wa-clvl   " 100.00

    hoursworkedperperiod       wa-wrkhrs " 192.00

  importing

    return                     = return2

  tables

    wagetypes                  = wages

           .

call function 'BAPI_TRANSACTION_COMMIT' .

endloop.

Regards,

Naren K.