In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about how to save the picture files stored in the S/4HANA system locally with Java programs. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
I maintain the picture file as an attachment for Material in S/4HANA 's transaction code MM02:
The binary content of the image file can be read out with the following simple ABAP code:
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: 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, lv_base64 type string. 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). BREAK-POINT. ENDLOOP.
Then I encapsulate this code in a Function moduleZDIS_GET_MATERIAL_IMAGES, consume the function module in the Java code, and save the binary content returned by S/4HANA as a local image file. In the ABAP system, the content type of the picture binary file is RAWSTRING, how to use it in Java?
The above is the editor for you to share how to save the picture files stored in the S/4HANA system to the local Java program, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.