Skip to Content
avatar image
Former Member

It´s possible to using Approve Contract App

I'm using the Approve Contract App for Transport Scheduling Agmt:

Technical Solution

In the first, should be put one enhancement-point at the end of class/metod:

CL_SRA001_WF_API~GET_BOIDENT_FOR_WORKITEMS

( It´s necessary because the object BUS2013 it´s ignored in the selection and the data of Transport Scheduling Agmt. not appeared in the Approve Contract App.

Example Code:

*$*$-Start: (1)---------------------------------------------------------------------------------$*$*ENHANCEMENT 1 ZENH_PROGRAMA_REMESSA. "active version
IF <fst_objects_2_workitem> IS ASSIGNED.LOOP AT <fst_objects_2_workitem> ASSIGNING <fs_objects_2_workitem>.ASSIGN COMPONENT 'WI_ID' OF STRUCTURE <fs_objects_2_workitem> TO <fs_fval>.ASSIGN COMPONENT 'OBJECT' OF STRUCTURE <fs_objects_2_workitem> TO <fs_object>.
ls_object = <fs_object>.
IF ( ls_object-catid CS cl_sra001_wf_api=>gc_bo ) AND( ls_object-typeid CS 'BUS2013' ).
READ TABLE lt_wiid_boident ASSIGNING <fs_wiid_boident> WITH KEY workitem_id = <fs_fval>.
<fs_wiid_boident>-botype = ls_object-typeid.
<fs_wiid_boident>-object_id = ls_object-instid(10).
<fs_wiid_boident>-object_line = ls_object-instid+10(5).
ENDIF.ENDLOOP.
DELETE ADJACENT DUPLICATES FROM lt_wiid_boident COMPARING WORKITEM_ID.

et_wiid_boident[] = lt_wiid_boident[].
ENDIF.
ENDENHANCEMENT.*$*$-End: (1)---------------------------------------------------------------------------------$*$*ENDMETHOD.

In the second, should be put one enhancement-point at the end of class/metod:

CL_SRA001_CMN~ GET_HEADER_GOS_ATTACHMENTS

( It´s necessary because the object BUS2013 it´s ignored in the selection and the Attached Files not appeared in the Approve Contract App.

Example Code:

*$*$-Start: (1)---------------------------------------------------------------------------------$*$*ENHANCEMENT 1 ZENH_PROGRAMA_REMESSA3. "active version
IF et_attachments IS INITIAL.

ls_lporb-typeid = 'BUS2013'.
TRY .CALL METHOD cl_binary_relation=>read_links_of_binrelEXPORTING
is_object = ls_lporb
ip_relation = 'ATTA'
ip_role = 'GOSAPPLOBJ'IMPORTING
et_links = lt_links.
CATCH cx_obl_parameter_error . "#EC NO_HANDLERCATCH cx_obl_internal_error . "#EC NO_HANDLERCATCH cx_obl_model_error . "#EC NO_HANDLERENDTRY.

ls_filter-send_info = 'X'.
ls_filter-no_content = 'X'.
LOOP AT lt_links INTO ls_links.
CLEAR : ls_docid, ls_doc_data, ls_attachment.

ls_docid = ls_links-instid_b.
CALL FUNCTION 'SO_DOCUMENT_READ_API1'EXPORTING
document_id = ls_docid
filter = ls_filterIMPORTING
document_data = ls_doc_dataEXCEPTIONS
document_id_not_exist = 1
operation_no_authorization = 2
x_error = 3OTHERS = 4.IF sy-subrc EQ 0.

ls_attachment-object_id = iv_doc_number.
ls_attachment-attach_guid = ls_docid.
ls_attachment-description = ls_doc_data-obj_descr.
SET LOCALE LANGUAGE sy-langu.
ls_attachment-file_name = ls_doc_data-obj_descr.CONCATENATE ls_attachment-file_name '.' ls_doc_data-obj_type INTO ls_attachment-file_name.
ls_attachment-created_by_id = ls_doc_data-creat_name.
ls_attachment-created_by_name = ls_doc_data-creat_fnam.CONCATENATE ls_doc_data-creat_date ls_doc_data-creat_time INTO lv_date.
ls_attachment-created_at = lv_date.
ls_attachment-is_gos_attachment = abap_true.
ls_attachment-file_size = ls_doc_data-doc_size.SHIFT ls_attachment-file_size LEFT DELETING LEADING '0'.* compute mimetypeCALL FUNCTION 'SDOK_MIMETYPE_GET'EXPORTING
extension = ls_doc_data-obj_typeIMPORTING
mimetype = ls_attachment-mime_type.
APPEND ls_attachment TO et_attachments.ENDIF.ENDLOOP.
ENDIF.
ENDENHANCEMENT.*$*$-End: (1)---------------------------------------------------------------------------------$*$*

In the last, don’t forgive: Put the Workflow Task of Transport Scheduling Agmt. in the back end Fiori Contract App configuration.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers