Skip to Content

How can I ? End routine compare field values at the same time and derive new field

Mar 17, 2017 at 06:14 PM


avatar image

Hi Experts,

I have scenario that in my Result Package i have Employee Pin and C_Status and comparing c_status i have do fill value for f_status. the problem is there are cases where 1 employee have more than one c_status.

Below c_status values have text in MD. 0 = Not started, 1 = completed, 3 = fail , 2 = in progress.

Emp Pin C_status F_status 1234 1 2 1234 0 2 5678 0 5678 0 6547 3 6547 1 6935 1

in above example i have to read Emp Pin 1234 c_status if any of them is NW 1 then F_STATUS = 2 for both lines.

Same for empl 5678 c_status = 0 so F_status should be 0.

for emp 6547 c_status is 3 & 1 ==> so F_status should be 2 (in progress).

when there is only 1 record then perform below -

if c_Status = 1 then f_status = 1


f_status = 2.

Can some one provide me the code for this logic ASAP ? i am trying to do this in end routine.

My problem is when employee has more than one C_Status and i dont know how can i read them once to do comparison check.



10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Disney FL Mar 17, 2017 at 06:17 PM

Here is the sample data msg it didnt save the format i entered. so attaching the image.

data-sample.jpg (16.4 kB)
10 |10000 characters needed characters left characters exceeded
Mario Tibollo Mar 20, 2017 at 10:36 AM

copy the result_package itab to a second itab, lets call it result2. when looping over result_package, read result2 for same emp and check if there i an entry with c_status 0. do the same for 1, 2 and 3. for every read put the an 'X' or a ' ' into a variable. Check the combination of 'X' to determine f_status.

should not be that difficult to program.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Mario,

in the f_status - i am not supposed to have 'X' or blank.

Depending upon c_status value I need to have the values for f_status.

and because one employee can have different c_status based on that i need to derive f_Status.

I am not abap expert can you provide me the whole code pls ?



I do not provide codes.

Krishna Chaitanya Mar 28, 2017 at 09:35 AM

Hi Dinesh,

Employee C_status is based on time lines i.e, start date (BEGDA) and End date (ENDDA). All are time dependent values. So in this situation you have to enhance you Employee master data (Add one more time dependent attribute) and update this C_status using start date and End date at 0EMPLOYEE.

Hope this will help you. Later if you want to use this data to update in your transaction data. Please call function module at field level routine "READ_MASTER_DATA" and pass employee number (PERNR) and End date (ENDDA). You will get accurate attribute values.


Krishna Chaitanya.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Krishna,

There is no master data involved in this. i am loading data DSO to DSO. you missunderstood my question.


Disney FL Apr 13, 2017 at 12:36 PM


Any abapers can help me pls ? My code doesnt work all the time...for some employees i have correct f_status derived but for some its wrong. I am not abaper can some one provide me example code for my above scenario ?

Thanks for help

10 |10000 characters needed characters left characters exceeded
Nanda Anantha Apr 13, 2017 at 05:06 PM

Hi Disney FL,

Please share sample data along with expected result in image, so will help you.



10 |10000 characters needed characters left characters exceeded