Created
July 4, 2014 02:55
-
-
Save js1972/633e4aa655505dc3919b to your computer and use it in GitHub Desktop.
Using the new ABAP 7.40 constructor operation CONV for converting data-types on the fly.
In this example we need to pass the name to the get_as_string method. i_delivery is type vbeln_vl yet a string is expected. CONV # takes car of the conversion in-line.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
method payment_terms_text. | |
data(text) = new lcl_text_reader( )->get_as_string( | |
id = '0002' | |
name = conv #( i_delivery ) | |
object = 'VBBK' | |
). | |
data proxy_text_collection type zxi_text_collection_text_tab. | |
data proxy_text_line like line of proxy_text_collection. | |
proxy_text_line-content_text-language_code = cl_abap_syst=>get_language( ). | |
proxy_text_line-content_text-content = text. | |
append proxy_text_line to proxy_text_collection. | |
r_result = proxy_text_collection. | |
endmethod. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment