10-04-2011 12:53 PM
Hi all,
I am using a function module which uses the function module 'SXPG_COMMAND_EXECUTE' to send an excel file as an attachment in the email.
However, when the excel is opened, the MATNR field is showing trailing spaces which i cannot see during debugging. Anyone have an idea why this is happening?
Thanks
10-04-2011 1:00 PM
10-04-2011 1:27 PM
I used CONDENSE NO-GAPS. On doing this, in the debug mode when i checked, all spaces were removed but still on the Excel it showed the spaces.
The field has some 8 characters whereas MATNR is 18 characters. Is this the reason? Also the spaces are random in the sense, some fields have spaces some dont. Also only the alpha numeric MATNRS are having this problem.
10-04-2011 7:22 PM
Hi,
could you clarify how you really send the mail + attachment, step by step?
1) I guess you create a CSV file, or tab-separated fields?
2) Then you call a Unix command to send a mail, which command is it, how do you indicate the body, how do you indicate the attached file?
Assuming you generate a CSV file or tab-separated file:
a) You checked by debug before writing to the CSV file, but did you check the CSV file itself after it has been generated?
b) Moreover, you surely apply CONDENSE NO-GAPS on MATNR, but how do you "concatenate" it to the next field?
Sandra
10-07-2011 3:44 PM
I am using a function module which in turn calls the function module SXPG_COMMAND_EXECUTE. I send data through an internal table in which column has a column with a tab in it. Also passed to the function module is the header for the columns.
Hope i have made it clear..
10-08-2011 3:13 AM
Hi,
not really, to tell the truth. As you know, SXPG_COMMAND_EXECUTE may execute anything, not only mails. So, my question was not how the standard function module works, but what command you execute, and all the other questions I have asked above. If you don't give the command you use (and I hope it's standard, otherwise I don't see how we can help), what exact content you send, how do you want we can help you? Think of it in your next threads too
Sandra
Edited by: Sandra Rossi, 1 minute later: forgot to send the link to the doc: [SAP Library: SXPG_COMMAND_EXECUTE: Check Authorization for and Execute an External command|http://help.sap.com/saphelp_nw70/helpdata/en/fa/0971fb543b11d1898e0000e8322d00/frameset.htm ]
10-08-2011 8:06 PM
Hi kudra,
this is really easy: Just change your secret function modules to behave as they should
Summary: No info, no code, no solution.
Regards
Clemens