‎2010 Nov 14 2:15 PM
I'm facing the problem while sending a mail to the user with the details in the text document which is attached to the email.
In my text document the length of the each record is about 500 to 600 characters.
but while downloading the attachment from SOST tcode, each record is breaking at 255 characters and the remaining record details are passed to the next line.
but I need to display in a single line.
please help to solve this issue...
thanks in advance,
SP.
‎2010 Nov 15 6:17 AM
hi guru,
please go through this example bcs_example_8.
thanku,
anji.
‎2010 Nov 14 2:38 PM
‎2010 Nov 14 4:10 PM
Thanks Max,
I'm using a function module 'SO_NEW_DOCUMENT_ATT_SEND_API1'
and in this FM i'm passing the SOLISTL internal table as parameters.
the problem is with SOLISTL structure as the field length of SOLISTL is limited to 255 characters.
if i'm trying to pass the internal table other than SOLISTL then this FM is giving dump.
how can i resolve this issue.
SP.
Edited by: skrishna1235 on Nov 14, 2010 5:16 PM
‎2010 Nov 14 5:27 PM
Hi
You should split ypur text into several records of SOLISTL
So if you have an input line of 500 char, you should transfer the first 255 char to the first record of SOLISTL and the rest to the second one and try to use TXT fiormat instead of RAW
Max
Edited by: max bianchi on Nov 14, 2010 6:27 PM
Edited by: max bianchi on Nov 14, 2010 6:35 PM
‎2010 Nov 14 6:22 PM
hi max,
my problem is to display the single record details in a single line in the text document.
while i'm passing the 500 (>255) character record details in the SOLISTL then this structure is splitting into two records.
so how to combine these two records into a single line and pass it into the function module. 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
please let me know if anymore details are required...
thnx max,
sai.
‎2010 Nov 14 6:52 PM
Hi,
just do not use SO_NEW_DOCUMENT_ATT_SEND_API1. Check BCS* reports.
Regards,
Clemens
P.S.: Ever wondered why you have tons of questions about SO_NEW_DOCUMENT_ATT_SEND_API1 but nearly none about CL_BCS?
‎2010 Nov 15 5:54 AM
Hi, Ciemens
i'm able to send the mail successfully
its the problem with the attachment as CL_BCS is related to sending the email.
As i have never used the classes before.
so can anyone please elaborate if you have the solution.
thnx in advance,
SP.
‎2010 Nov 15 6:26 AM
I think, this FM have limitation for sending more than 255 characters for each line because SOLISTI1 structure field LINE length is 255 char. I recomend to copy this FM into custom name space and change the associated data types.
‎2010 Nov 16 12:21 PM
problem resolved by removing a field from the record details.
‎2010 Nov 15 5:55 AM
Hi Krishna,
PFB code to get each record details on a single line.
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONSTANTS:
c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
c_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
*--concatenate header
CONCATENATE 'Material No'(f01)
'Material Description'(f02)
'Plant'(f03)
'Requirement Type'(f04)
'Version'(f05)
'Indicator-Version Active'(f06)
'Requirements Plan'(f07)
'BOM Explosion Number'(f08)
'Production Version'(f09)
'Base UoM'(f10)
'Manufacture Name'(f11)
'Manufacturer No'(f12)
INTO wl_attach SEPARATED BY c_tab.
CONCATENATE 'Planned qty 01'(f15)
'Planned qty 02'(f16)
'Planned qty 03'(f17)
'Planned qty 04'(f18)
'Planned qty 05'(f19)
'Planned qty 06'(f20)
'Planned qty 07'(f21)
'Planned qty 08'(f22)
'Planned qty 09'(f23)
'Planned qty 10'(f24)
'Planned qty 11'(f25)
'Planned qty 12'(f26)
'Planned qty 13'(f27)
'Planned qty 14'(f28)
'Planned qty 15'(f29)
'Planned qty 16'(f30)
'Planned qty 17'(f31)
INTO wl_attach SEPARATED BY c_tab.
CONCATENATE wl_attach c_cret INTO wl_attach.
APPEND wl_attach TO t_attach.
*--Concatenate data records one by one
LOOP AT t_output INTO wl_output.
CONCATENATE wl_output-matnr
wl_output-yynsdesc
wl_output-werks
wl_output-bedae
wl_output-versb
wl_output-vervs
wl_output-pbdnr
wl_output-sernr
wl_output-verid
wl_output-meins
wl_output-yymfcname
wl_output-yymfgno
INTO wl_attach SEPARATED BY c_tab.
CONCATENATE l_vpln01
l_vpln02
l_vpln03
l_vpln04
l_vpln05
l_vpln06
l_vpln07
l_vpln08
l_vpln09
l_vpln10
l_vpln11
l_vpln12
l_vpln13
l_vpln14
l_vpln15
l_vpln16
l_vpln17
INTO wl_attach SEPARATED BY c_tab.
CONCATENATE wl_attach c_cret INTO wl_attach.
APPEND wl_attach TO t_attach.
ENDLOOP.
In above code c_cret will create a new line only when you want to create a new line. Eg. if your single record contains 500 chars, move first 255 chars of that record to t_attach separated by c_tab and next 255 chars of that record again to t_attach and before inserting 2nd record to t_attach, append c_cret(new line) to t_attach.
I hope your problem is solved now.
Regards,
Pranjali
‎2010 Nov 15 6:17 AM
hi guru,
please go through this example bcs_example_8.
thanku,
anji.