Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Need input values for the FM: SO_DOCUMENT_READ_API1

6,888

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?

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
6,460

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.
8 REPLIES 8
Read only

Gourab_Dey
Product and Topic Expert
Product and Topic Expert
Read only

Sandra_Rossi
Active Contributor
6,460

I think your question is exactly the one answered by the note 927407 - Determining the content of GOS and SAPoffice documents.

Read only

RaymondGiuseppi
Active Contributor
6,461

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.
Read only

0 Likes
6,460

what are the values to be provided in structure lw_bor example: INSTID, TYPEID, CATID ?

Read only

6,460

Set a break-point in class CL_GOS_MANAGER method CONSTRUCTOR and execute MIR4. Look at method parameter such as IS_OBJECT.

Read only

0 Likes
6,460

I'm getting exception error "No role for the object BUS2081 was found with key"

Read only

6,460

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.
Read only

6,460

Thank you all resolved now and able to read content.