‎2021 Jul 01 9:23 AM
Hi,
what is the input details exactly for the FM: SO_DOCUMENT_READ_API1. Want to read content of PDF from invoice pdf attachment transaction MIR4.
DOCUMENT_ID ? It is combination of what values?
‎2021 Jul 01 1:25 PM
You could get the required information with method cl_binary_relation=>read_links or read_links_of_binrels.
TRY.
CALL METHOD cl_binary_relation=>read_links
EXPORTING
is_object = lw_bor
it_relation_options = lt_relat
IMPORTING
et_links = lt_links.
CATCH cx_obl_parameter_error cx_obl_internal_error cx_obl_model_error INTO lo_root.
" lv_string = lo_root->if_message~get_text( ). " ...
REFRESH lt_links.
ENDTRY.
LOOP AT lt_links ASSIGNING <link>.
document_id = <link>-instid_b.
CALL FUNCTION 'SO_DOCUMENT_READ_API1'
EXPORTING
document_id = document_id
IMPORTING
document_data = document_data
TABLES
object_content = object_content
EXCEPTIONS
document_id_not_exist = 1
operation_no_authorization = 2
x_error = 3
OTHERS = 4.
IF sy-subrc EQ 0.
‎2021 Jul 01 9:27 AM
Hi Mohammed,
It seems you want to wok with GOS. Find below links where you can get more info on GOS:
http://friendlyabaper.blogspot.com/2008/07/oh-my-gos.html
https://blogs.sap.com/2012/10/17/generic-object-services-upload-download-list-programatically/
https://www.programmersought.com/article/91584669043/
Thanks,
Gourab
‎2021 Jul 01 9:59 AM
I think your question is exactly the one answered by the note 927407 - Determining the content of GOS and SAPoffice documents.
‎2021 Jul 01 1:25 PM
You could get the required information with method cl_binary_relation=>read_links or read_links_of_binrels.
TRY.
CALL METHOD cl_binary_relation=>read_links
EXPORTING
is_object = lw_bor
it_relation_options = lt_relat
IMPORTING
et_links = lt_links.
CATCH cx_obl_parameter_error cx_obl_internal_error cx_obl_model_error INTO lo_root.
" lv_string = lo_root->if_message~get_text( ). " ...
REFRESH lt_links.
ENDTRY.
LOOP AT lt_links ASSIGNING <link>.
document_id = <link>-instid_b.
CALL FUNCTION 'SO_DOCUMENT_READ_API1'
EXPORTING
document_id = document_id
IMPORTING
document_data = document_data
TABLES
object_content = object_content
EXCEPTIONS
document_id_not_exist = 1
operation_no_authorization = 2
x_error = 3
OTHERS = 4.
IF sy-subrc EQ 0.
‎2021 Jul 01 1:31 PM
what are the values to be provided in structure lw_bor example: INSTID, TYPEID, CATID ?
‎2021 Jul 02 8:04 AM
‎2021 Jul 03 3:15 PM
I'm getting exception error "No role for the object BUS2081 was found with key"

‎2021 Jul 03 3:56 PM
alimohammed0907gmail If you don't show the parameters you pass, how can we help you?
Again, everything is explained in note 927407 - Determining the content of GOS and SAPoffice documents. (ATTA)
ls_relat-sign = 'I'. ls_relat-option = 'EQ'. ls_relat-low = 'ATTA'.
APPEND ls_relat TO lt_relat.
‎2021 Jul 03 5:53 PM