Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BAPI_CATIMESHEETMGR_CHANGE problem

Hi all,

I need to change some cats records but I have error with BAPI_CATIMESHEETMGR_CHANGE :

L'enregistrement de données pour le numéro 000000000033 ne peut être traité

The data record for the n° 000000000033 can't be performed

All works fine until the CHANGE bapi.

Here is the sample code I use for my test :

CONSTANTS :
  c_cats_profile   LIKE bapicats6-profile VALUE 'ZCATS'.

  DATA:
    it_employee TYPE STANDARD TABLE OF bapihrselemployee,
    ws_employee LIKE LINE OF it_employee.

  DATA:
    it_cats_in TYPE STANDARD TABLE OF bapicats1,
    ws_cats_in LIKE LINE OF it_cats_in.

  DATA:
    it_cats_out TYPE STANDARD TABLE OF bapicats2,
    ws_cats_out LIKE LINE OF it_cats_out,

    it_cats_mod TYPE STANDARD TABLE OF bapicats3,
    ws_cats_mod LIKE LINE OF it_cats_mod.

data: it_pernr type table of pa0002-pernr,
      wa_pernr like line of it_pernr.


data: return type table of BAPIRET2.



SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE t1.
PARAMETERS: p_date TYPE sy-datum DEFAULT '20090105',
            p_trig(3) TYPE c DEFAULT 'OCH'.
SELECTION-SCREEN END OF BLOCK b1.




START-OF-SELECTION.



select pernr into table it_pernr from PA0002 where inits = p_trig.

loop at it_pernr into wa_pernr.
CLEAR ws_employee.
ws_employee-sign = 'I'.
ws_employee-option = 'EQ'.
ws_employee-low = wa_pernr.
APPEND ws_employee TO it_employee.
endloop.


CALL FUNCTION 'BAPI_CATIMESHEETRECORD_GETLIST'
  EXPORTING
    fromdate              = p_date
    todate                = p_date
*   GET_LONGTEXT          =
*   TEXT_FORMAT_EXP       =
  tables
    sel_employee          = it_employee
    catsrecords_out       = it_cats_out
*   EXTENSIONOUT          =
    return                = return
*   LONGTEXT              =
          .








loop at it_cats_out into ws_cats_out.
MOVE-CORRESPONDING ws_cats_out TO ws_cats_mod.
        ws_cats_mod-catshours = 4.
append ws_cats_mod to it_cats_mod.
endloop.




    CALL FUNCTION 'BAPI_CATIMESHEETMGR_CHANGE'
*      EXPORTING
*        profile               = c_cats_profile
*        testrun               = p_test
*     RELEASE_DATA          =
*     AGENT                 =
*     TEXT_FORMAT_IMP       =
      TABLES
        catsrecords_in        = it_cats_mod
*     EXTENSIONIN           =
*     CATSRECORDS_OUT       =
*     EXTENSIONOUT          =
*     WORKFLOW_TEXT         =
        return                = return
*     LONGTEXT              =
              .

              if sy-subrc <> 0.

              endif.

I have read that if the bapi has 1error, none of the record are inserted/modified but I dont know what is the error :/

Regards,

Antoine

Former Member
Not what you were looking for? View more on this topic or Ask a question