I'm working on a project and having a couple of problems.
1. I wrote a program to upload a file from Kronos of employee activity and load into PS. That works. However, I would like to also be able to confirm the activity. I thought I was doing this correctly, the BAPI returns no errors, I do a BAPI_TRANSACTION_COMMIT, yet when I go to CJ20N and do the pull-down EDIT
>CONFIRM, it still shows that the user needs to manually confirm. Here's the code:
Maintain the activity.
LT_METHOD_PROJECT-REFNUMBER = '000001'.
LT_METHOD_PROJECT-OBJECTTYPE = 'NETWORKACTIVITY'.
LT_METHOD_PROJECT-METHOD = 'UPDATE'.
CONCATENATE LT_ACT-NETWORK ' ' LT_ACT-ACTIVITY INTO LT_METHOD_PROJECT-OBJECTKEY.
LT_METHOD_PROJECT-METHOD = 'SAVE'.
LT_ACTIVITY_ELEMENT-NETWORK = LT_ACT-NETWORK.
LT_ACTIVITY_ELEMENT-ACTIVITY = LT_ACT-ACTIVITY.
LT_ACTIVITY_ELEMENT-WORK_ACTIVITY = WA_UPLOAD-ARBEI.
LT_ACTIVITY_ELEMENT_UPDATE-NETWORK = 'X'.
LT_ACTIVITY_ELEMENT_UPDATE-ACTIVITY = 'X'.
LT_ACTIVITY_ELEMENT_UPDATE-WORK_ACTIVITY = 'X'.
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
CALL FUNCTION 'BAPI_NETWORK_MAINTAIN'
RETURN = ls_return
I_METHOD_PROJECT = LT_METHOD_PROJECT
E_MESSAGE_TABLE = LT_MESSAGE_TABLE
I_ACTIVITY_ELEMENT = LT_ACTIVITY_ELEMENT
I_ACTIVITY_ELEMENT_UPDATE = LT_ACTIVITY_ELEMENT_UPDATE.
IF ls_return IS INITIAL.
REFRESH: E_MESSAGE_TABLE, I_CONFIRMATIONS, return.
NUMBER = LT_ACT-NETWORK.
I_CONFIRMATIONS-ACTIVITY = LT_ACT-ACTIVITY.
I_CONFIRMATIONS-PERS_NO = HOLD_PERNR_SAP.
I_CONFIRMATIONS-ACT_TYPE = HOLD_PERNR.
I_CONFIRMATIONS-ACT_WORK = WA_UPLOAD-ARBEI.
CALL FUNCTION 'BAPI_NETWORK_CONF_ADD'
NUMBER = NUMBER
RETURN = return
I_CONFIRMATIONS = I_CONFIRMATIONS
E_MESSAGE_TABLE = E_MESSAGE_TABLE.
READ TABLE E_MESSAGE_TABLE INDEX 1.
IF E_MESSAGE_TABLE-TYPE = 'I'
AND E_MESSAGE_TABLE-MESSAGE_ID = 'RU'
AND E_MESSAGE_TABLE-MESSAGE_NUMBER = '105'.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
ET_RETURN = return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
RETURN = return.
PERFORM WRITE_REPORT USING WA_UPLOAD-PROJECT_DEFINITION
2. I'm creating an ALV report which shows activity by period. The column on the left is essentially the secondary cost element. It joins several tables (COKA, PRPS, PROJ, CSKS, CSU), but the amounts come from COSS. I think these amounts are correct. The user wants a drill-down to see the detail. From what I've seen, I thought that I could get the detail of activity by reading COBK inner join COEP (on akokrs = bkokrs and abelnr = bbelnr) inner join AFRU (on arefbn = crueck and aaworg = crmzhl). What I'm returning however, is nothing like what I want.
Can some tell me how to retrieve the activity (in dollars) by period? I don't want to show the hours (which is in AFRU). I need the costed activity.
Thanks for your help