2007 Dec 24 10:36 AM
Hello All,
Scenario : Create a Text File attachment (TAB DELIMITED) and the send the same via EMAIL.
I am able to create attachment(TB_ATTACH) and send it via EMAIL(SO_DOCUMENT_SEND_API1) but the file is not
a TAB DELIMITED File
Please have a look at the logic below
CONSTANTS :co_cret type x value '0D',
co_tab type x value '09',
concatenate wf_date_ext
wf_time
wa_vlcinfo-vhvin
wa_vlcinfo-zz_commnos
wa_vlcinfo-zz_lotno
wf_dest_key
''
into tb_attach separated by co_tab.
concatenate co_cret tb_attach into tb_attach.
Please let me know if I am using the Correct Delimiter (co_tab) ? Is It possible to create a TAB DELIMITED text file attachment ?
Regards
Saket Sharma
2007 Dec 24 10:42 AM
Hi Saket
May be you can change your constan as below.
co_tab type c value
CL_ABAP_CHAR_UTILITIES->HORIZONTAL_TAB,
Coz type x value when you move to char field it will not have that ASCII value.
~ Ranganath
PS : Reward points for all useful answer !
2007 Dec 24 10:48 AM
Hello,
I am working on 4.6 C. Unfortunately this Class is not availaible for my use
Regards
Saket Sharma
2007 Dec 24 10:49 AM
Hi,
If you are at 4.7 or above then use the class CL_ABAP_CHAR_UTILITIES else in 4.6c you will have to declare the hexadecimal delimiter which you have done.
Try putting the values in this way :
Field1 = wa_field-field1.
field2 = co_tab.
...
,..
,...
....
May be this would work.
Just give a try.
Regards,
Lalit
2007 Dec 24 11:20 AM
Hi ,
Check this
I am using below code to fill contents_bin table before passing it to FM : SO_NEW_DOCUMENT_ATT_SEND_API1, it is working fine for me.
DATA : contents_bin LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA :BEGIN OF i_data_tab OCCURS 0,
wf_date_ext TYPE sy-datum,
wf_time TYPE sy-uzeit,
vhvin(10) TYPE c,
zz_commnos TYPE c,
zz_lotno(10) TYPE c,
wf_dest_key(10) TYPE c,
END OF i_data_tab.
i_data_tab-wf_date_ext = sy-datum.
i_data_tab-wf_time = sy-uzeit.
*i_data_tab-vhvin(10)
*i_data_tab-zz_commnos
*i_data_tab-zz_lotno(10)
*i_data_tab-wf_dest_key(10)
APPEND i_data_tab.
CONSTANTS :co_cret TYPE x VALUE '0D',
co_tab TYPE x VALUE '09'.
CONCATENATE i_data_tab-wf_date_ext co_tab i_data_tab-wf_time INTO
contents_bin.
APPEND contents_bin.
CONCATENATE i_data_tab-wf_date_ext co_tab i_data_tab-wf_time INTO
contents_bin.
APPEND contents_bin.
CONCATENATE i_data_tab-wf_date_ext co_tab i_data_tab-wf_time INTO
contents_bin.
APPEND contents_bin.
Regards
L Appana
2007 Dec 24 12:06 PM
Hello
I tried via ur new FM also but the results are same. The problem is that when the file created is sent as
an attachment and when the attachment is opened, the fields are not tab delimited but instead are
separated by a Single Space.
Reagrds
Saket Sharma