2023 Feb 17 12:32 PM
Hi experts,
My requirement is to add a document as attachment into a FI document using program and on the next step on clicking a button i need to display that particular attachment. I used FM "BDS_BUSINESSDOCUMENT_CREA_TAB" and i was able to add the document to the attachment list with a new description. But I'm not able to display it. But when i add the attachment using fb03 directly the same code worked. So any suggestions will be appreciated.
Note: When i using the method cl_binary_relation=>read_links_of_binrels ,not able to get value in table int_links.
Also when we attaching the document via program that details not saving in table SRGBTBREL which stores the attachments. so do i need to use any other functions for attaching the document instead of BDS_BUSINESSDOCUMENT_CREA_TAB
wa_rel_options-low = 'ATTA'. "" Attachemnts
wa_rel_options-sign = 'I'.
wa_rel_options-option = 'EQ'.
APPEND wa_rel_options TO int_rel_options.
DATA: attlist LIKE soattlsti1 OCCURS 1 WITH HEADER LINE.
TRY.
CALL METHOD cl_binary_relation=>read_links_of_binrels
EXPORTING
is_object = wa_object " Start object
it_relation_options = int_rel_options " Link Types
ip_role = 'GOSAPPLOBJ' " Role type
IMPORTING
et_links = int_links. " Table with Relationship Records
CATCH cx_obl_parameter_error. " Incorrect Calling of Interface
CATCH cx_obl_internal_error. " Internal Error of Relationship Service
CATCH cx_obl_model_error. " Error with Model Roles
ENDTRY.
IF int_links[] IS NOT INITIAL.
LOOP AT int_links INTO wa_links.
CLEAR : lv_doc_id, wa_doc_data.
lv_doc_id = wa_links-instid_b.
CALL FUNCTION 'SO_DOCUMENT_READ_API1'
EXPORTING
document_id = lv_doc_id
* FILTER = 'X'
IMPORTING
document_data = wa_doc_data
EXCEPTIONS
document_id_not_exist = 1
operation_no_authorization = 2
x_error = 3
OTHERS = 4.
IF wa_doc_data-obj_descr = 'Wire Instructions' .
lv_img_exist = abap_true.
CREATE OBJECT lo_gos_service.
CALL METHOD lo_gos_service->display_attachment
EXPORTING
* is_object =
ip_attachment = wa_links-instid_b.
ENDIF.
CLEAR wa_links.
ENDLOOP.
2023 Feb 17 12:58 PM
2023 Feb 22 11:14 AM
Hi every one , I was able to solve the issue.
Thanks to this blog This.
2024 Feb 01 12:42 PM
Hi Akshay,
Could you please let me know how did you solve it?
2024 Feb 01 2:33 PM
Did you look at the blog post that Akshay mentioned as being the solution? Please explain why it doesn't help you and clarify precisely what is your exact issue.