cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Form output to MS word using Mail Merge

Former Member
0 Kudos

Hi

I have requirement.I designed One ALV report. when user clicks on Word processing In ALV toolbar, smartform has to call and smartform output has to convert to MS word using mail merge. So finally i want to convert smartform output to MS word usingmail merge.Can Anyone suggest??

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi friend,

Welcome back.

Just do like this,

1. Just get the function code for the word processing button in the ALV display.

2. After getting the function code from there then you can call the smart form using the function module 'SSF_FUNCTION_MODULE'.

3. After that you can convert the function module in ASCII BIN or PDF format using the function module CONVERT_OTF.

4. Give the format as ASCII which generates a .txt file.

5. From this you can convert the file into an word format.

One more thing is that we can sent bulk letter mails using two concepts which are

1. Mail merge

2. Smart forms

So both are different just don't mix up both. If you requirement is particular just revert back to me i will help you.

Thanks,

Sri Hari

Former Member
0 Kudos

Hi Sri

Thanks Again. I had already used fm 'Convert_otf'. but this one generating '.txt' file not '.doc' file. My user is not agreeing for this one. My consultant said this can be done using mail merge. He shown one example ,when he clicks on word processing,he select ms word and he used existing template document and no password. it was opened with MS word. when he press Small right arrow in that mail merge doc. field values are changing. All the fields are coming fine. So My user wants this. So how can i acheive this one. is it possible to create a template?? and is it possible to send internal table values to that template like we passed to smartforms from the program??.If this can do means,i'll follow this approach. Can you please suggest how can acheive this one???

Former Member
0 Kudos

Hi Sri,

Finally i got this requirement. I have one designed template same look like smartform. So when user press on word processing in ALV Tool bar, Form letter processing with MS word prompt will be displayed. After that we have to use use mail merge fileds for exisitng word document. from there we select our template from front end. So the designed template will come.Just we need to pass the field values to that template.From there when user clicks on small right arrow on that doc. next record have to come. This is final requirement. So can u Suggest how to do this please?

Former Member
0 Kudos

Hi friend,

Here is the link which helps you in converting the smart form into word and then sending that word document as mail.

Link: [Smartform convert to WORD|;.

If you can achieve your requirement like this then please proceed.

In smart forms you can create the template and pass the values to that. Smart form is more advisable when we need to change only few things in the bulk mail.

For example if you want only the address to be changed in every letter which you print of send using smart form then you can just change the address window alone for each and every form and you can achieve the requirement.

So i think these two things help you in solving your requirement. Or if you requirement is different please specify as you did for your previous requirement i will try for a better and optimized solution for that.

See also this link

Link: [PERFORM MAIL MERGE DATA TO MS WORD|http://wiki.sdn.sap.com/wiki/display/Snippets/PERFORMMAILMERGEDATATOMSWORD]

This helps in getting the changed fields and passing new value to it just see the above code also.

Thanks,

Sri Hari

Edited by: srihari.kumar on Jan 9, 2012 12:25 PM

Former Member
0 Kudos

Hi Sri,

My Final Requirement is lIke this.

I have one designed template same look like smartform with empty data. So when user press on word processing in ALV Tool bar, Form letter processing with MS word prompt will be displayed. After that we have to use use mail merge fileds for exisitng word document. from there we select our template from front end. So the designed template will come.Just we need to pass the field values to that template.From there when user clicks on small right arrow on that doc. next record have to come.Si thriuth this, user can edit the fields easily. This is final requirement. So can u Suggest how to do this please?