on 01-25-2011 10:17 AM
Hi ,
I have a requirement in which i need to create multiple adobe forms and email it.
i.e. If 2 records are selected then 2 pdf need to be generated. These PDF would have same layout but different data depending upon the record selected.
Is dynamic creation of entire Adobe form possible?
If yes then how? I tried searching but i could find how to add multiple pages in a single adobe form but i need to create multiple PDF depending upon the number of records selected.
Thanks,
Navya.
Hi Navya,
I belive you want to generate the forms using standard approach of functional modules, rather than WebDynpro / web requests.
if so follw the below approach.
My example below is I will have N records where program has to send 1 document per record to N customers.
loop through N records..
Set document parameters if any.
CALL FUNCTION 'FP_JOB_OPEN'
if subrc = 0 set xopen = 'Y'. (temp variable to see the fom generation is completed else handle respective message)
CALL FUNCTION save_fm_name passing on the requred record data.
if xopen == y
CALL FUNCTION 'FP_JOB_CLOSE'
if subrc == 0 clear xopen.
determine the required mailing address.
call email function module with PDF as attachment
end of loop.
Hope this helps you to think the approach, let me know if you need any more help in this regard.
Cheers,
Sai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sai ,
This is how we do using abap wherein we can use function modules but i am using web dynpro Java.
Any idea , how we can do this using webdynpro Java?
In my case , Number of PDF = Number of records .
For e.g:
If 'n' employees records are selected then 'n' number of pdf needs to be generated. Each pdf will have same layout but different data depending upon the employee.
Regards ,
Navya.
Edited by: navya_4321 on Jan 27, 2011 6:01 AM
Hi,
If the purpose is to display the PDF on the screen for user i would go for webdynpro.
but if the requirement is only to mail the documents whats the reason having a webdynpro component for that and having all these hassels.
anyways I never triggered a email function nor generated output forms in Webdynpro, let me check if i can find something for you @ this.
Cheers,
Sai
Hi,
The best way to solve your issue is to define in the context as bellow
DATA
- DATA_HEADER type internal table
--DATA_DETAIL type internal table
You make a link between header table and detail table with a key , then in the layout you define it with "Table" and for each record of HEADER you specify that it must be on top of page then it will make a page break on change of header.
Hope this help you
Regards
Hi Bertrand ,
I need to implement this using webdynpro Java.! approach that i could use here is create multiple InteractiveForm Child elements but this needs to be done dynamically.
Something similar to what is given in below link :
Link:[http://help.sap.com/saphelp_sm32/helpdata/EN/c0/ead8a21ba49f4896c64851677f8ec9/content.htm]
Do you have any link or any code snippet which show creation of InteractiveForm element at runtime.
Regards ,
Navya .
Hi,
I have never done this approach for interactiveforms in webdynpro but have done something like this for other UI elements.
sry also dont have any code as such now.
have a form created as required in the 1st place to a view, it might be giving a pdf source maintain it.
create a face less view in a new window
create a interactive form UI element at runtime in wDJ and add it to the root.
set the form properties.
trigger outbound plug to this view navigate to the form,
once form is loaded, immedatly close the window.
get the pdf file from the context and then write the emailing script.
this might give you a way of thinking, hope this works.
But as the other blogger posted to your post, if its like you need to display multiple form intances to a single PDF file, thats visible on the screen thats quite easily possible.
cheers,
Sai
Hi Sai,
Now i am able to generate multiple PDF but now the issue that i am facing is all the PDF show the same data.
I have a context node of cardinality 1:n which has all the records and which is the data source for th PDFs generated but in all the PDF it shows the same data .
I wish that if the context node has 3 records then the 3 PDFs generated should show 3 differnt records present in the context node.
Could you please tell me if it is possible to show different data in different these PDFs!!!!
Regards ,
Navya
Hi Navya,
Did you implement this with Web dynpro.?
When you say the context is with 3 records and the same context is being used for the PDF source.. then you need to fill 1 record each to the context in the loop.
some thing like this..
Context 1 for actual data in the WD View
Context 2 for pdf source.
loop at context 1
read record
set record to context2
call the pdf.
on sucess clear context 2
end loop.
does this help ...?
Cheers
Sai
Hi Sai ,
i did try this approach.
But now the problem is all the PDFs shows same data which is the last data populated in that context node.
Do you have any inputs on dynamic node creation which can be useful in this scenario
Regards ,
Navya.
Edited by: navya_4321 on Feb 9, 2011 7:44 AM
Edited by: navya_4321 on Feb 9, 2011 8:26 AM
Hi Sai ,
I could resolve the issue of data population in multiple PDFs.
I created the nodes which is the data source for the adobe forms dynamically.Now if 3 form needs to be generated , 3 different nodes are generated dynamically.Basically now all the forms would have different data source.
The issue was ; at runtime , even though the data in the node was refreshed but the data source for the adobe form was same.So it used to refer the latest data present in the context node.
Regards ,
Navya
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.