10-14-2021 4:07 AM
Hi Experts
Recently I am developing an interface . I need deal with long text and send it to external system.
The raw data format is following :
I will get following format data.
1,2,3,4,5,6,7
Can you help me ?Thanks.
10-14-2021 6:33 AM
What is your issue with the "long text"? What "long text" are you talking about? What interface is it?
10-14-2021 6:40 AM
Hi Sandra.
I am sorry that I don't upload the attachment just now. Now I have uploaded it . the interface is that SAP sending data to externla system.
10-14-2021 6:43 AM
Search for READ_TEXT function module.
After you just have to make a loop on the internal table & a concatenate
10-14-2021 7:38 AM
Hi Fredeic
First, I must split it and then concatenate it. how to add comma ?
DATA: f_tdname TYPE tdobname, " add it by jingguilin 20211014
tab_sap_script_text TYPE tline OCCURS 10,
s_sap_script_text TYPE tline,
lw_name TYPE string.
CONCATENATE sy-mandt it_data-AUFNR into f_tdname .
CALL FUNCTION 'READ_TEXT' " Add it by jingguilin 20211014
EXPORTING
ID = 'KOPF'
LANGUAGE = sy-langu
NAME = f_tdname
OBJECT = 'AUFK'
TABLES
lines = tab_sap_script_text
EXCEPTIONS
ID = 01
LANGUAGE = 02
NAME = 03
NOT_FOUND = 04
OBJECT = 05
REFERENCE_CHECK = 06.
IF sy-subrc = 0.
READ TABLE tab_sap_script_text INTO s_sap_script_text INDEX 1.
ENDIF.
10-14-2021 9:44 AM
In the ABAP keyword help, there is exactly how to convert strings in a table into a delimited string, using REDUCE.
10-14-2021 9:51 AM
Loop at ... reference into data(o_...).
if sy-tabix ne 1.
concatenate my_string my_split o_..->tdline into my_string.
else .
my_string = o_...->tdline.
endif.
endloop.
something like that
matthew.billingham, I need to check this REDUCE, I never use it.
10-14-2021 12:35 PM
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenreduce_text_abexa.htm
DATA(sentence) = REDUCE string( INIT text = `` sep = ``
FOR word IN words
NEXT text = |{ text }{ sep }{ word }| sep = `,` ).