Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use ABAP code to return Attachment

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to use ABAP code to return Attachment", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to use ABAP code to return Attachment" bar!

Maintain attachments for material with ID 16 in transaction code MM02:

How do I use ABAP code to get the name and file contents of the following attachments?

REPORT zgos_api.DATA ls_appl_object TYPE gos_s_obj.DATA lo_gos_api TYPE REF TO cl_gos_api.DATA lt_attachment_list TYPE gos_t_atta.DATA lt_role_filter TYPE gos_t_rol.DATA ls_attachment TYPE gos_s_atta.DATA ls_attachm_cont TYPE gos_s_attcont.DATA ls_atta_key TYPE gos_s_attkey.DATA: lv_id TYPE matnr VALUE '16' Lt_att TYPE TABLE OF sibflporb.CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT' EXPORTING input = lv_id IMPORTING output = lv_id. Ls_appl_object-typeid = 'BUS1001006'. Ls_appl_object-instid = lv_id. Ls_appl_object-catid = 'BO'. START-OF-SELECTION. TRY. Lo_gos_api = cl_gos_api= > create_instance (ls_appl_object). APPEND cl_gos_api= > c_attachment TO lt_role_filter. Lt_attachment_list = lo_gos_api- > get_atta_list (lt_role_filter). CATCH cx_gos_api INTO DATA (error). WRITE:/ error- > get_text (). RETURN. ENDTRY. DATA: ls_key TYPE gos_s_attkey. LOOP AT lt_attachment_list ASSIGNING FIELD-SYMBOL (). Ls_key-atta_id =-atta_id. Ls_key-atta_cat =-atta_cat. DATA (ls) = lo_gos_api- > get_al_item (ls_key). ENDLOOP.

Execution result:

Thank you for reading, the above is the content of "how to use ABAP code to return Attachment". After the study of this article, I believe you have a deeper understanding of how to use ABAP code to return Attachment, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report