on 2018 Mar 22 12:56 PM
I have one Ztransaction which displays multiple deliveries as an ALV. Now if I select any row of delivery and click on custom created menu button(send mail) then it should send one mail with delivery attachment to the user.
How to achieve it?
Problem: For different deliveries , there can be different sap scripts and program. So, I can not go to each program and from FM: close_form get OTF data?
Still need solution for it.
Finally, after calling two subroutines of report RSNAST00:
I sent output to spool and then I read output from spool by following ways:
First read spool no. generated by FM RSPO_FIND_SPOOL_REQUESTS:
Then read pdf data from spool using FM: CONVERT_OTFSPOOLJOB_2_PDF:
Now LT_BIN_DATA contains data in binary format. Just use it for attachment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you analyze a standard report like SD70AV2A?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its not sending any mail.. and also for processing and preview its calling standard SAP program(RSNAST00) routines which directly generates previews/process output. I want to send mail by selecting any delivery row on screen from ALV, and by clicking custom button 'send mail' it should send mail to some mail id with that delivery output attachment.
So how can I generate data of output which can be send as attachment?
its finally calling subroutin ( tnapr-fonam ) from (Tnapr-progname).
which is not my solution as I can directly call this from my custom report also.
But for that I will have to go to each print program report and will have to do modification to not generate preview but only pass OTF data from close_form of SAP Script and for this we have 2000+ output types.
So this is not feasible.
Did you try to set a break-point and changing some values in NAST structure (defined with TABLES statement) before the dynamic perform. You should then understand the copy of values between nast and temp_nast in main program...
Hint: If it's too hard to generate an OTF export try to remove the print immediately flag, so you could read the spool into OTF before deleting it...
Yes. I was passing all the values to the nast structure but still did not find solution that way.
Well, I have found the solution for it. Just one question here is it possible to send preview as attachment even if transmission medium for any output type = 1, attachment goes perfectly in mail. But for other transmission medium, lets say 2(fax), if I trigger same logic then its sending fax but not mail. So, I changed transmission medium while passing data to standard report RSNAST00 as 1 for all but then its attaching different output to mail.
Transmission medium:
Hi Gaurav,
My understanding from above conversation - you want to leverage standard output determination functionality (/configuration) to send out an email from a custom report right? If yes, please try the following approach to achieve it:
1. Put a break point in the driver program's respective subrotuine
2. Issue output from standard delivery transaction
3. Then analyze, how the particular driver program's subroutine is called dynamically. Similarly, you can make a call from your custom program.
Actually, before driver program's subroutine is being triggered, couple of standard objects are executed, to fetch output determination configuration and prepares relevant information to pass to the respective driver program (using interface work areas).
Regards,
Balaji
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you should call cl_bcs and put tgether the email, like recipienbt sender body and attachment. There are gooe example
how to use cl_bcs, see report bcs_example_*
Best regards Jozsef Hegyi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
10 | |
9 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.