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: 

Calculation of number of training programmes attended

Former Member
0 Kudos

Hi experts,

Can anybody explain me how to calculate number of training programmes attended for the given employee. Also let me to know is there any function modules to execute the earlier.

useful replies will be rewarded.

Regards,

Sankar.

2 REPLIES 2

Former Member
0 Kudos

Hi,

I am not sure how you are maintaining these entries in a table. But there are 2 possibilities.

Scenario 1.

If the table consists of

EMPID COURSE_NAME No.Of. Trainings(NOTrg)

001 ABAP 5

002 OOPs 3

001 OOPs 3.

In this case you can use COLLECT.

Here is a simple example

====

DATA: BEGIN OF training,

empid TYPE emp-empid,

NOTrg TYPE emp-NOTrg,

END OF training.

DATA training_attended LIKE HASHED TABLE OF training

WITH UNIQUE KEY empid.

SELECT empid NOTrg

FROM emp

INTO training WHERE empid = 001.

COLLECT training INTO training_attended.

ENDSELECT.

====

Scenario 2.

If table consists of each training as a apecific line

EMPID COURSE_NAME

001 ABAP

002 OOPs

001 OOPs

In this case you can do the following

Select count(*) from emp into wa where empid = 001.

I hope this answers your query.

Regards,

Saurabh

Former Member