How to use FM CO_R0_DET_TOTAL_ACTIVITY to get Activity information of a Operation of a Production Order

Activity information of a Operation of a Production Order

CO03 -> click

EG: get To Be Conf.

DATA ls_act_afvgd TYPE afvgd.
DATA ls_exp_activities TYPE ttl_activ.
SELECT SINGLE
*
INTO CORRESPONDING FIELDS OF ls_act_afvgd
FROM caufv
WHERE aufnr ‘002010000005’.

SELECT SINGLE
*
INTO CORRESPONDING FIELDS OF ls_act_afvgd
FROM afvc
WHERE aufpl ‘0000000033’ AND aplzl ‘00000002’.

SELECT SINGLE
*
INTO CORRESPONDING FIELDS OF ls_act_afvgd
FROM afvv
WHERE aufpl ‘0000000033’ AND aplzl ‘00000002’.

CALL FUNCTION ‘CO_R0_DET_TOTAL_ACTIVITY’
EXPORTING
act_afvgd        ls_act_afvgd
*   ACT_FLG_CONSIDER_CONF       = ‘ ‘
*   ACT_FLG_NO_FIX   = ‘ ‘
act_quantity     ‘15.000’
*   ACT_UNIT_OF_TIME = ‘ ‘
*   ACT_DATUM        =
*   ACT_FLG_MST      = ‘ ‘
*   ACT_ARBID        = 0
*   ACT_PLNTY        = ‘ ‘
*   ACT_WERKS        = ‘ ‘
*   I_FLG_NO_DIALOG  = ‘ ‘
*   I_AUTYP          = ‘ ‘
IMPORTING
exp_activities   ls_exp_activities
EXCEPTIONS
division_by_zero 1
OTHERS           2.
IF sysubrc <> 0.
* Implement suitable error handling here
ENDIF.

WRITEls_exp_activitiesacti2.