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: 

abap program and Cats integration

Former Member
0 Kudos
485

dear Experts:-

    how can u help me please??

i want to develop ABAP code that helps me as an interface between RFID/Biometric reader machine(Time and attendance) and CATS.

that is i want to upload files from application server or any other which is input from the machine to Z table and then making any update on the format equivalent to the CATS format  by creating UI connecting(sending) the information to CATS!!!

please help me if u r clear with my Question!!!

give me help on RFC on this idea !!!!!

best regards,

Hahu

1 ACCEPTED SOLUTION

kumud
Active Contributor
0 Kudos
135

Hi,

Do you mean the data from the third party system would be stored in a Z table and then from Z table you would update CATS? Detailed information on updating CATS with program is covered in this wiki:

http://wiki.sdn.sap.com/wiki/display/ERPHCM/CATS+-+Inserting+records+into+CATSDB

Regards,

Kumud

7 REPLIES 7

kumud
Active Contributor
0 Kudos
136

Hi,

Do you mean the data from the third party system would be stored in a Z table and then from Z table you would update CATS? Detailed information on updating CATS with program is covered in this wiki:

http://wiki.sdn.sap.com/wiki/display/ERPHCM/CATS+-+Inserting+records+into+CATSDB

Regards,

Kumud

Former Member
0 Kudos
135

Dear Kumud Singh:

really thanks!!!!!!!!!

that was my requirement and appreciate ur fast response and helpful answer!!!

and one more Question is :about the RFC?

can u please brief me how business works clearly!!!??

how the transaction works between the ZTable and CATSDB!! where the concept of bapi or any other RFC comes???

with best regards,

Hahu

kumud
Active Contributor
0 Kudos
135

Hi,

Are you in the designing phase of this work or have starting coding? If in coding then this end to end scenario must have been decided already. I would suggest you to discuss with your team.

To answer your questions: Please have a look at many discussions around BAPI and RFC here on SCN.

Once the data records have been populated in a Z table, your program would pick them, process them and use the BAPI as highlighted in the wiki to update CATSDB. Thanks.

Regards,

Kumud

Former Member
0 Kudos
135

Dearest,

i think the following Code is posted by u and i read that it is crude coding but i wanna know the type of

ycatt_bapicats1( is this DB tabel or structure??).

see below for brief understanding what i mean by..

(  METHODS: transfer_data IMPORTING tl_data TYPE ycatt_bapicats1,).

please brief me ma dear!!!


*&---------------------------------------------------------------------*
REPORT  CATS_BABI.
CLASS lcl_cats DEFINITION DEFERRED.
DATA: obj TYPE REF TO lcl_cats,
       num TYPE i,
       n1 TYPE i,
       n2 TYPE i,
       t_passrec TYPE STANDARD TABLE OF bapicats1.

DATA: tl_recin TYPE STANDARD TABLE OF bapicats1,
       wl_recin TYPE bapicats1,
       wl_bapicats1 TYPE bapicats1.

REFRESH: t_passrec[].
*----------------------------------------------------------------------*
*       CLASS lcl_cats DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_cats DEFINITION.
   PUBLIC SECTION.

     DATA: tl_recout TYPE STANDARD TABLE OF bapicats2,
           tl_message TYPE STANDARD TABLE OF bapiret2,
           tl_chkdata  TYPE STANDARD TABLE OF bapicats1,
           tl_rec2data TYPE STANDARD TABLE OF bapicats1.

     METHODS: transfer_data IMPORTING tl_data TYPE ycatt_bapicats1,
             distribute_data.
ENDCLASS.                    "lcl_cats DEFINITION

START-OF-SELECTION.
   REFRESH: tl_recin[].
   CLEAR:   wl_recin.
   CREATE OBJECT obj.

*C--Tested the algorithm by manually appending 25 records.
*C--This should be replaced as per the individual requirement
*C--Dummy coding to append records
   wl_bapicats1-employeenumber = '00956753'.
   wl_bapicats1-workdate = '20120110'.
   wl_bapicats1-catshours = '2.00'.
   wl_bapicats1-abs_att_type = '9P01'.
   APPEND wl_bapicats1 TO tl_recin.

   wl_bapicats1-employeenumber = '00956753'.
   wl_bapicats1-workdate = '20120107'.
   wl_bapicats1-send_cctr = '0109575002'.
   wl_bapicats1-acttype = 'DTOIND'.
   wl_bapicats1-rec_order = '006000015807'.
   wl_bapicats1-wagetype = 'MI10'.
   wl_bapicats1-catshours = '3.00'.
   APPEND wl_bapicats1 TO tl_recin.

    [.......]


*C--Fill in the data for 25 records now
   CALL METHOD obj->transfer_data
     EXPORTING
       tl_data = tl_recin.
*----------------------------------------------------------------------*
*       CLASS lcl_cats IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_cats IMPLEMENTATION.
   METHOD transfer_data.
     DATA: me_return TYPE STANDARD TABLE OF bapiret2.
     REFRESH: tl_recout,
              tl_message,
              tl_chkdata,
              me_return.

     CALL FUNCTION 'BAPI_CATIMESHEETMGR_INSERT'
  EXPORTING
    profile               = 'YCATUS'
    testrun               = 'X'
   TABLES
     catsrecords_in        = tl_data
*      extensionin           = mi_extension_in
     catsrecords_out       = tl_recout
*      extensionout          = me_extension_out
     return                = tl_message.
*      longtext              = mi_longtext.
     me_return = tl_message[].
     tl_chkdata = tl_data[].
     distribute_data( ).
   ENDMETHOD.                    "transfer_data

   METHOD distribute_data.
     DATA:  tl_recin1 TYPE STANDARD TABLE OF bapicats1,
            tl_recin2 TYPE STANDARD TABLE OF bapicats1,
            tl_rec3data TYPE STANDARD TABLE OF bapicats1.
     REFRESH: tl_recin1[].
     IF tl_message IS NOT INITIAL.
       DESCRIBE TABLE tl_chkdata LINES num.
       IF tl_message IS NOT INITIAL.
         n1 = num DIV 2.
         n2 = n1 + 1.
*C--Check the ending criteria
         CHECK n1 IS NOT INITIAL.
*C--Form two tables of records
*C--First half of internal table
         LOOP AT tl_chkdata INTO wl_recin FROM 1 TO n1.
           APPEND wl_recin TO tl_recin1.
         ENDLOOP.
*C--Second half of internal table
         LOOP AT tl_chkdata INTO wl_recin FROM  n2  TO num.
           APPEND wl_recin TO tl_recin2.
         ENDLOOP.
       ENDIF.
*C--Append this in public variable of data
       APPEND LINES OF tl_recin2 TO tl_rec2data.
*C--Call BAPI update
       CALL METHOD obj->transfer_data
         EXPORTING
           tl_data = tl_recin1.

       tl_rec3data[] = tl_rec2data[].
       REFRESH: tl_rec2data[].
       CALL METHOD obj->transfer_data
         EXPORTING
           tl_data = tl_rec3data.
     ELSE. "MESSAGE IS INTIAL
*C--Append the contents in an internal table containing correct records
       APPEND LINES OF tl_chkdata TO t_passrec.
     ENDIF.
   ENDMETHOD.                    "distribute_data
ENDCLASS.                    "lcl_cats IMPLEMENTATION

regards,

HaHu

kumud
Active Contributor
0 Kudos
135

Hi,

YCATT_BAPICATS1 is a table type of line type BAPICATS1 (standard structure). Thanks.

Regards,

Kumud

Former Member
0 Kudos
135

thanks again Kumud!!! please brief me more !!!

you know i want to update catsdb by taking your code as an input so please share me more

i have done every thing on configuration and enhancement one more thing is coding only so please ma dear show me the way!!!!!!

regards,

HaHu

raymond_giuseppi
Active Contributor
0 Kudos
135

To fill CATSDB (as you could find in the previous link posted) use BAPI like BAPI_CATIMESHEETMGR_INSERT, BAPI_CATIMESHEETMGR_CHANGE and BAPI_CATIMESHEETMGR_DELETE.  You can also read data from catsdb and convert it using MAP2E_CATSDB_EXT_TO_BAPICATS2.

For simple Attendance data, you may not actually require time sheet but time infotype 2011 and interface like BAPI_CC1_UPLOAD_TIMEEVENT.

That can be easily found via transaction BAPI or searching scn. What is the issue that is causing you problems?

Regards,

Raymond