2011 Sep 06 7:59 AM
Hi,
I need to send a mail with TEXT file attachment which has many records in it. It is working fine. But the only problem is, all records are displayed in the 1st line itself. So i need to separate the records by inserting new line.
constants: c_new type c value CL_ABAP_CHAR_UTILITIES=>NEWLINE.
LOOP AT it_final INTO wa_final.
lv_menge = wa_final-menge.
CONCATENATE wa_final-ebeln
wa_final-bukrs
wa_final-lifnr
wa_final-ebelp
wa_final-matnr
wa_final-werks
lv_menge
c_new " Newline
INTO lv_txt SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
APPEND lv_txt to text.
CLEAR: lv_txt, lv_menge.
ENDLOOP.
For this code, i'm not getting the new line for each record.
Plz help me out for the same.
Thanks,
Ramesh
2011 Sep 06 1:26 PM
just add one more line of code.... put a CRLF on the end of your tex string, like:
concatenate lv_text <and the CR_LF already mentioned> into lv_text.
append lv_text to....
etc.
2011 Sep 06 8:09 AM
SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
Do i need to say more?
2011 Sep 06 8:11 AM
Hi,
Declare c_new as below
constants: c_new type ABAP_CR_LF value CL_ABAP_CHAR_UTILITIES=>CR_LF.
Regards,
Smart
2011 Sep 06 9:08 AM
Hi,
I replaced my declaration code as u have mentioned but its not working..
@ Suhas Saha : Already i have written that code which u have posted..
2011 Sep 06 9:16 AM
You did not get my point
You should use LF(line feed / new line) when concatenating the table lines instead of the horizontal tab.
BR,
Suhas
2011 Sep 06 9:26 AM
Hi ,
Sorry i cant get u.. Plz let me know exactly.. Now i replaced the Horizontal tab with CR_LF but even this is not working..
CONSTANTS: c_new type ABAP_CR_LF value CL_ABAP_CHAR_UTILITIES=>CR_LF.
LOOP AT it_final INTO wa_final.
lv_menge = wa_final-menge.
CONCATENATE wa_final-ebeln
wa_final-bukrs
wa_final-lifnr
wa_final-ebelp
wa_final-matnr
wa_final-werks
lv_menge
" c_new
INTO lv_txt SEPARATED BY c_new. "cl_abap_char_utilities=>horizontal_tab.
APPEND lv_txt TO text.
CLEAR: lv_txt, lv_menge.
ENDLOOP.
Correct me if i'm wrong..
Thanks
Ramesh
2011 Sep 06 10:09 AM
Hello,
Horizontal tab - provides tab distance between two fields
line feed - provides "Enter" action
You have to give a LF at the end of the record, not separating the fields using it.
As this is a basic question which can be searched in SCN , I am afraid to answer this in detail....
2011 Sep 06 1:26 PM
just add one more line of code.... put a CRLF on the end of your tex string, like:
concatenate lv_text <and the CR_LF already mentioned> into lv_text.
append lv_text to....
etc.
2011 Sep 07 4:54 AM
Thanks for ur answers.. The Issue was solved by coding separately for Newline.
CONSTANTS: c_new type c value CL_ABAP_CHAR_UTILITIES=>CR_LF.
LOOP AT it_final INTO wa_final.
lv_menge = wa_final-menge.
CONCATENATE wa_final-ebeln
wa_final-bukrs
wa_final-lifnr
wa_final-ebelp
wa_final-matnr
wa_final-werks
lv_menge
INTO lv_txt SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
CONCATENATE lv_txt c_new INTO lv_txt.
APPEND lv_txt TO text.
CLEAR: lv_txt, lv_menge.
ENDLOOP.
2011 Nov 09 1:47 PM
HELLO,
i've tried to use this in same way with slight change,
i've concatenated strings instead of fields from work area. but its giving me value of '#' wherever i've used c_new.
*c_new type c value CL_ABAP_CHAR_UTILITIES=>CR_LF...
please reply....