cancel
Showing results for 
Search instead for 
Did you mean: 

The function of getting total activity to be confirmed

henry_sun3
Explorer
0 Kudos

Hi Experts,

Could you please let me know what it the function to get "total activities to be confirmed"? As I know,there is no report can see them. I am trying to add them into COOIS/IOOPER. But I can not find out a function to get them. It looks like a function CX_TK_GET_ACTS_FOR_CAPA is avaiable. but the input parameter AFVGD has a lot fields. I don't know how to us it in my BADI program. Perhaps, you have another better solution. Thank you.

Regards

Henry

Accepted Solutions (0)

Answers (9)

Answers (9)

Hamad
Explorer
0 Kudos

This Custom Report will return you Activities confirmed and to be confirmed Data or Planned and Actual Data.

REPORT.

TABLES: afru, afko, crhd, rc68a.

DATA: BEGIN OF itab OCCURS 100,

aufnr TYPE afko-aufnr,
rueck TYPE afru-rueck,
vornr TYPE afru-vornr,
aufpl TYPE afru-aufpl,
plnbez TYPE afko-plnbez,
meinh TYPE afru-meinh,
lmnga TYPE afru-lmnga,
smeng TYPE afru-smeng,
charg TYPE afpo-charg,
maktx TYPE makt-maktx,
budat TYPE afru-budat,
arbpl TYPE crhd-arbpl,
ktext TYPE crtx-ktext,
msg TYPE char100,

lar01 TYPE afvgd-lar01,
vge01 TYPE afvgd-vge01,
rum01 TYPE afvgd-vgw01,
ism01 TYPE afvgd-ism01,
slm01 TYPE afvgd-vgw01,
dif01 TYPE afvgd-ism01,
acti1 TYPE ttl_activ-acti1,
unit1 TYPE ttl_activ-unit1,

lar02 TYPE afvgd-lar02,
vge02 TYPE afvgd-vge02,
rum02 TYPE afvgd-vgw02,
ism02 TYPE afvgd-ism02,
slm02 TYPE afvgd-vgw02,
dif02 TYPE afvgd-ism02,
acti2 TYPE ttl_activ-acti2,
unit2 TYPE ttl_activ-unit2,

lar03 TYPE afvgd-lar03,
vge03 TYPE afvgd-vge03,
rum03 TYPE afvgd-vgw03,
ism03 TYPE afvgd-ism03,
slm03 TYPE afvgd-vgw03,
dif03 TYPE afvgd-ism03,
acti3 TYPE ttl_activ-acti3,
unit3 TYPE ttl_activ-unit3,

lar04 TYPE afvgd-lar04,
vge04 TYPE afvgd-vge04,
rum04 TYPE afvgd-vgw04,
ism04 TYPE afvgd-ism04,
slm04 TYPE afvgd-vgw04,
dif04 TYPE afvgd-ism04,
acti4 TYPE ttl_activ-acti4,
unit4 TYPE ttl_activ-unit4,

lar05 TYPE afvgd-lar05,
vge05 TYPE afvgd-vge05,
rum05 TYPE afvgd-vgw05,
ism05 TYPE afvgd-ism05,
slm05 TYPE afvgd-vgw05,
dif05 TYPE afvgd-ism05,
acti5 TYPE ttl_activ-acti5,
unit5 TYPE ttl_activ-unit5,

lar06 TYPE afvgd-lar06,
vge06 TYPE afvgd-vge06,
rum06 TYPE afvgd-vgw06,
ism06 TYPE afvgd-ism06,
slm06 TYPE afvgd-vgw06,
dif06 TYPE afvgd-ism06,
acti6 TYPE ttl_activ-acti6,
unit6 TYPE ttl_activ-unit6,

END OF itab.


DATA: BEGIN OF it_afru OCCURS 10,
aufnr LIKE afru-aufnr,
vornr LIKE afru-vornr,
werks LIKE afru-werks,
rueck LIKE afru-rueck,
END OF it_afru.


DATA:
oper_key LIKE cooprkey,
afrud_exp LIKE afrud,
afvgd_exp LIKE afvgd,
ls_activ LIKE ttl_activ,
act_unit_of_time LIKE t006-msehi.

SELECTION-SCREEN BEGIN OF BLOCK bl WITH FRAME TITLE title_1.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (20) s_aufnr FOR FIELD aufnr.
SELECT-OPTIONS:
aufnr FOR afko-aufnr.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (20) s_budat FOR FIELD budat.
SELECT-OPTIONS:
budat FOR afru-budat.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (20) s_plnbez FOR FIELD plnbez.
SELECT-OPTIONS:
plnbez FOR afko-plnbez.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (20) s_arbpl FOR FIELD arbpl.
SELECT-OPTIONS:
* arbpl FOR CRHD-arbpl.
arbpl FOR rc68a-arbpl.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK bl.


INITIALIZATION.
title_1 = 'Work Center Information System'.
s_aufnr = 'Order Number'.
s_budat = 'Date'.
s_plnbez = 'Material'.
s_arbpl = 'Work Center'.

START-OF-SELECTION.

PERFORM get_data.

end-of-SELECTION.

*Set Output
PERFORM display_data.


FORM get_data.

BREAK abap_dev.

SELECT a~aufnr , a~plnbez ,
b~budat, b~rueck, b~vornr, b~aufpl,
d~arbpl,
e~ktext,
f~charg,
g~maktx

FROM afko AS a
INNER JOIN afru AS b ON ( a~aufnr EQ b~aufnr )
INNER JOIN afvc AS c ON ( b~aufpl EQ c~aufpl AND b~vornr EQ c~vornr )
LEFT OUTER JOIN crhd AS d ON ( c~arbid EQ d~objid )
LEFT OUTER JOIN crtx AS e ON ( b~arbid EQ e~objid )
LEFT OUTER JOIN afpo AS f ON ( a~aufnr EQ f~aufnr )
LEFT OUTER JOIN makt AS g ON ( a~plnbez EQ g~matnr )

WHERE a~aufnr IN @aufnr
AND a~plnty EQ '2'
AND a~plnbez IN @plnbez
AND b~budat IN @budat
AND d~arbpl IN @arbpl
INTO CORRESPONDING FIELDS OF TABLE @itab.

SORT itab ASCENDING BY aufnr rueck arbpl.
DELETE ADJACENT DUPLICATES FROM itab COMPARING aufnr rueck arbpl.


LOOP AT itab.

CLEAR: it_afru[], it_afru , oper_key, afvgd_exp, afrud_exp, ls_activ.

oper_key-aufnr = itab-aufnr.
oper_key-vornr = itab-vornr.

CALL FUNCTION 'CO_RU_CONFIRMATION_PREPARE'
EXPORTING
aktyp_imp = 'H'
autyp_imp = '40'
aufpl_imp = itab-aufpl
conf_nr = itab-rueck
oper_key = oper_key
no_dialog_flag = 'X'
IMPORTING
afrud_exp = afrud_exp
afvgd_exp = afvgd_exp
EXCEPTIONS
confirmation_not_allowed = 1
different_key = 2
interrupt_by_user = 3
key_not_defined = 4
material_data_not_found = 5
missing_authority = 6
mixed_confirmation = 7
new_status_not_possible = 8
operation_not_found = 9
operation_not_selectable = 10
order_already_locked = 11
order_category_not_valid = 12
order_deleted = 13
order_not_found = 14
order_without_operation = 15
predec_not_confirmed = 16
sequence_not_found = 17
table_entry_not_found = 18
unit_conversion_not_possible = 19
split_not_found = 20
OTHERS = 21.

IF sy-subrc <> 0.

CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = sy-msgid
lang = sy-langu
no = sy-msgno
v1 = sy-msgv1
v2 = sy-msgv2
v3 = sy-msgv3
v4 = sy-msgv4
IMPORTING
msg = itab-msg
EXCEPTIONS
OTHERS = 0.
ENDIF.

CALL FUNCTION 'DEQUEUE_ALL'.

IF afvgd_exp IS NOT INITIAL.

CALL FUNCTION 'CO_R0_DET_TOTAL_ACTIVITY'
EXPORTING
act_afvgd = afvgd_exp
act_flg_consider_conf = space
act_quantity = afrud_exp-smeng
act_unit_of_time = act_unit_of_time
act_datum = afrud_exp-budat
act_arbid = afrud_exp-arbid
act_werks = afrud_exp-werks
IMPORTING
exp_activities = ls_activ
EXCEPTIONS
division_by_zero = 1.

ENDIF.

" Add QTY and UoM
itab-lmnga = afvgd_exp-lmnga.
itab-meinh = afvgd_exp-meinh.
itab-smeng = afrud_exp-smeng.

CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
input = itab-meinh
language = sy-langu
IMPORTING
output = itab-meinh
EXCEPTIONS
unit_not_found = 1
OTHERS = 2.

" Fill Activities
itab-lar01 = afvgd_exp-lar01.
itab-vge01 = afvgd_exp-vge01.
itab-rum01 = afvgd_exp-vgw01.
itab-ism01 = afvgd_exp-ism01.
itab-slm01 = ls_activ-acti1.
itab-dif01 = itab-ism01 - itab-slm01.
itab-acti1 = ls_activ-acti1.
itab-unit1 = ls_activ-unit1.

itab-lar02 = afvgd_exp-lar02.
itab-vge02 = afvgd_exp-vge02.
itab-rum02 = afvgd_exp-vgw02.
itab-ism02 = afvgd_exp-ism02.
itab-slm02 = ls_activ-acti2.
itab-dif02 = itab-ism02 - itab-slm02.
itab-acti2 = ls_activ-acti2.
itab-unit2 = ls_activ-unit2.

itab-lar03 = afvgd_exp-lar03.
itab-vge03 = afvgd_exp-vge03.
itab-rum03 = afvgd_exp-vgw03.
itab-ism03 = afvgd_exp-ism03.
itab-slm03 = ls_activ-acti3.
itab-dif03 = itab-ism03 - itab-slm03.
itab-acti3 = ls_activ-acti3.
itab-unit3 = ls_activ-unit3.

itab-lar04 = afvgd_exp-lar04.
itab-vge04 = afvgd_exp-vge04.
itab-rum04 = afvgd_exp-vgw04.
itab-ism04 = afvgd_exp-ism04.
itab-slm04 = ls_activ-acti4.
itab-dif04 = itab-ism04 - itab-slm04.
itab-acti4 = ls_activ-acti4.
itab-unit4 = ls_activ-unit4.

itab-lar05 = afvgd_exp-lar05.
itab-vge05 = afvgd_exp-vge05.
itab-rum05 = afvgd_exp-vgw05.
itab-ism05 = afvgd_exp-ism05.
itab-slm05 = ls_activ-acti5.
itab-dif05 = itab-ism05 - itab-slm05.
itab-acti5 = ls_activ-acti5.
itab-unit5 = ls_activ-unit5.

itab-lar06 = afvgd_exp-lar06.
itab-vge06 = afvgd_exp-vge06.
itab-rum06 = afvgd_exp-vgw06.
itab-ism06 = afvgd_exp-ism06.
itab-slm06 = ls_activ-acti6.
itab-dif06 = itab-ism06 - itab-slm06.
itab-acti6 = ls_activ-acti6.
itab-unit6 = ls_activ-unit6.

SHIFT itab-aufnr LEFT DELETING LEADING '0'.
SHIFT itab-plnbez LEFT DELETING LEADING '0'.
SHIFT itab-rueck LEFT DELETING LEADING '0'.
SHIFT itab-charg LEFT DELETING LEADING '0'.

MODIFY itab.
CLEAR itab.

ENDLOOP.

ENDFORM.

FORM display_data.

TYPE-POOLS: slis.

TYPES:
t_fieldcat TYPE slis_fieldcat_alv,
t_events TYPE slis_alv_event,
t_layout TYPE slis_layout_alv.

DATA:
w_fieldcat TYPE t_fieldcat,
w_events TYPE t_events,
w_layout TYPE t_layout.
DATA:
i_fieldcat TYPE STANDARD TABLE OF t_fieldcat,
i_events TYPE STANDARD TABLE OF t_events,
count TYPE int4.

DATA: gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid,
g_variant TYPE disvariant.

CLEAR :
w_fieldcat,i_fieldcat[].

count = 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'AUFNR'.
w_fieldcat-seltext_l = 'Process Order'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'RUECK'.
w_fieldcat-seltext_l = 'Confirmation'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'VORNR'.
w_fieldcat-seltext_l = 'Operation'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'PLNBEZ'.
w_fieldcat-seltext_l = 'Material'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'MAKTX'.
w_fieldcat-seltext_l = 'Material Description'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'L'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'SMENG'.
w_fieldcat-seltext_l = 'Planned Qty'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'L'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'LMNGA'.
w_fieldcat-seltext_l = 'Actual Qty'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'L'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'MEINH'.
w_fieldcat-seltext_l = 'UoM'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'L'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'CHARG'.
w_fieldcat-seltext_l = 'Batch'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'ARBPL'.
w_fieldcat-seltext_l = 'Work Center'.
w_fieldcat-outputlen = 40.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'KTEXT'.
w_fieldcat-seltext_l = 'Work Center Description'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'L'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'BUDAT'.
w_fieldcat-seltext_l = 'Posting Date'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C100'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'SLM01'.
w_fieldcat-seltext_l = 'Planned Machine Hours'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C500'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'SLM02'.
w_fieldcat-seltext_l = 'Planned Labor Hours'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C500'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'SLM03'.
w_fieldcat-seltext_l = 'Planned Headcount (Run)'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C500'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'SLM04'.
w_fieldcat-seltext_l = 'Planned Setup Hours'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C500'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'SLM05'.
w_fieldcat-seltext_l = 'Planned Setup Labor'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C500'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'SLM06'.
w_fieldcat-seltext_l = 'Planned Headcount(Setup)'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C500'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'ISM01'.
w_fieldcat-seltext_l = 'Actual Machine Hours'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C300'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'ISM02'.
w_fieldcat-seltext_l = 'Actual Labor Hours'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C300'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'ISM03'.
w_fieldcat-seltext_l = 'Actual Headcount (Run)'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C300'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'ISM04'.
w_fieldcat-seltext_l = 'Actual Setup Hours'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C300'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'ISM05'.
w_fieldcat-seltext_l = 'Actual Setup Labor'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C300'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'ISM06'.
w_fieldcat-seltext_l = 'Actual Headcount(Setup)'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C300'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'DIF01'.
w_fieldcat-seltext_l = 'Variance Machine Hours'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C700'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'DIF02'.
w_fieldcat-seltext_l = 'Variance Labor Hours'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C700'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'DIF03'.
w_fieldcat-seltext_l = 'Variance Headcount (Run)'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C700'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'DIF04'.
w_fieldcat-seltext_l = 'Variance Setup Hours'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C700'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'DIF05'.
w_fieldcat-seltext_l = 'Variance Setup Labor'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C700'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'DIF06'.
w_fieldcat-seltext_l = 'Variance Headcount(Setup)'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C700'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.

count = count + 1.
w_fieldcat-col_pos = count.
w_fieldcat-fieldname = 'MSG'.
w_fieldcat-seltext_l = 'Message'.
w_fieldcat-outputlen = 10.
w_fieldcat-just = 'C'. w_fieldcat-emphasize = 'C700'.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.


gd_repid = sy-repid.
gd_layout-colwidth_optimize = 'X'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_user_command = ''
is_layout = gd_layout
it_fieldcat = i_fieldcat
i_save = 'X'
is_variant = g_variant
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.

CLEAR: itab[], itab.

ENDFORM.

FORM top-of-page.

DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
t_line LIKE wa_header-info,
ld_lines TYPE i,
ld_linesc(10) TYPE c.

wa_header-typ = 'H'.
wa_header-info = 'Systems Pvt Ltd.'.
APPEND wa_header TO t_header.
CLEAR wa_header.

wa_header-typ = 'S'.
wa_header-key = 'Report:'.
wa_header-info = 'Work Center Information System Report'.

APPEND wa_header TO t_header.
CLEAR: wa_header.

wa_header-typ = 'S'.
wa_header-key = 'USER'.
wa_header-info = sy-uname.

APPEND wa_header TO t_header.
CLEAR: wa_header.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header
i_logo = 'COMPANY_LOGO'.

ENDFORM.

Thanks

Hamad Ahmad

johnatan_gomez
Contributor
0 Kudos

hi!

did you solve this issue?

Regards

Johnatan

henry_sun3
Explorer
0 Kudos

Johnatan,

not solve it yet.

Regards

Henry

johnatan_gomez
Contributor
0 Kudos

Hi Henry,

I will check it, if I discover something, I will wirite you.

Regards

Johnatan

Former Member
0 Kudos

Dear friend.

     Do you solve this problem, I meet the same question, and don't know how to do it?

The parameter of BAPI:CO_R0_DET_TOTAL_ACTIVITY is complex. and we should use bapi: CO_R0_CREATE_ACTIVITY_TAB  too in order to get the correct table we need.

     if you have solved this problem, please share to me, thank you very mush.

henry_sun3
Explorer
0 Kudos

Hi R.Brahmankar,

I checked the function module BAPI_PRODORD_GET_DETAIL. It can return several tables. but in the operation table, there is no fields of 'Total activities to be confirmed'.

Actually, these fields look like the structure CORUF.

Regards

Henry

rupesh_brahmankar3
Active Contributor
0 Kudos

Hello,

Structure CORUTCACT Total activity to be confirmed CO_SMNG13

Best Regards,

R. Brahmankar

henry_sun3
Explorer
0 Kudos


Hi Ayoub,

I checked COOIS/Operation/000000000002. There is no 'Total activities to be confirmed'. I want the planned total Activities of operation, isn't Times.

Hi R.Brahmankar, and JH,

The function model CO_R0_DET_TOTAL_ACTIVITY isn't what I want. There is a same reason with CX_TK_GET_ACTS_FOR_CAPA. In these two functions, they both need a import parameter AFVGD. This structure is different with structure IOOPER.

I expect a function. it can get total activities tobe confirmed for operation. and then I call this function in the BADI:COOIS/IOOPER. therefore, add the function result into COOIS/operation report.

Regards

Henry

rupesh_brahmankar3
Active Contributor
0 Kudos

Hello Henry,

In the table OPERATION, the function module BAPI_PRODORD_GET_DETAIL returns operations for the production order from there you can fetch the Total activities to be confirmed'.

Best Regards,

R.Brahmankar

former_member196530
Active Contributor
0 Kudos

You can also try the following -

1.CO_R0_DET_ACT_STANDARD_VALUES

2.CO_R0_DET_TOTAL_ACTIVITY

Regards

JH

rupesh_brahmankar3
Active Contributor
0 Kudos

Hello,

Please try Function module CO_R0_DET_TOTAL_ACTIVITY.

Best Regards,

R.Brahmankar

former_member196530
Active Contributor
0 Kudos

Did you check following FM in case if you wanted pull out Actual data for all the activity type -

BAPI_PRODORDCONF_CANCEL        Cancel production order confirmation

BAPI_PRODORDCONF_CREATE_ACT    Enter activity confirmation

BAPI_PRODORDCONF_CREATE_HDR    Enter Order Confirmations

BAPI_PRODORDCONF_CREATE_TE     Enter Confirmation Time Event

BAPI_PRODORDCONF_CREATE_TT     Enter Time Ticket Confirmation

BAPI_PRODORDCONF_EXIST_CHK     Existence Check for Confirming Production Order

BAPI_PRODORDCONF_GETDETAIL     Detailed Data for Production Order Confirmation

BAPI_PRODORDCONF_GETLIST       Confirmations List

Ayoub_Habchi
Contributor
0 Kudos

Hi Henry,

I am not sure if i understood your question well. If you are trying to list the activities for operations, you can use COOIS with the following selection :

List ==> Operation

Layout ==> 000000000002   Standard Layout Time Elements

Let me know if this is what you are looking for.

Regards,

Ayoub.