Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Blank spaces in Email Excel Attachment

former_member758034
Participant
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

Use conversion routine for material number.

former_member758034
Participant
0 Kudos

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.

Sandra_Rossi
Active Contributor
0 Kudos

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

0 Kudos

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..

0 Kudos

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 ]

0 Kudos

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