cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Binding

Former Member
0 Kudos

Hi,

Can we bind dynamically for "PDFSource" property in Interactive form UI Element?

If I bind directly to attribute of type XSTRING, I'm facing performace issue, as the request is going to ADS everytime I trigger submit. But, I want the binary only after the final approval. So, at the time of final approval, I want the PDFSource property should be binded to Xstring attribute dynamically, so that I can generate PDF .

Appreciate your response.

Regards,

Ravi

Accepted Solutions (0)

Answers (3)

Answers (3)

RalfRuth
Employee
Employee
0 Kudos

Hi,

For general (performance) problems with interactive forms in Web Dynpro ABAP, see note 999998, esp. section "Web Dynpro applications with interactive forms are slow".

Alternative solution for your specific problem: Do not bind pdfSource at all. At the very end of your "process", generate the PDF for yourself with your own code using the template from templateSource and the corresponding data from the WD Context (dataSource). I think the coding doing so has already been posted several times.

Cheers,

Ralf

Former Member
0 Kudos

Hi

As I'm facing problem with dynamic binding, I have implemented the way Ralf suggested.

I'm generating pdf on my final server event by using cl_wd_adobe_services class and its methods by passing form name

and data source.

Thank you Thomas and Ralf for your suggestions.

Regards,

Ravi.D

Former Member
0 Kudos

hi ,

at the time of ur final approval event , bind the pdf source property with dynamic attribute of XSTRING TYPE under the dynamic context node.

u may wish to go thru these links for dynamically creating context nodes/attributes :

Refer Thomas jungu2019s reply in the thread :

Have a look at the documentation for the WDDOMODIFYVIEW section of the phase model:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d2/8acd409cc4dd50e10000000a1550b0/frameset.htm

There is also the class CL_WD_DYNAMIC_TOOL:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/67/6935425394033be10000000a1550b0/frameset.htm

Also have a look at the example application DEMODYNAMIC.

go thru this eLearning on the topic here as well:

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/201ddd3b-b4ce-2b10-8883-880ae814...

for dynamic node creation , pls refer :

https://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/201ddd3b-b4ce-2b10-8883-880ae8147f89&overri...

also refer to http://wiki.sdn.sap.com/wiki/x/9gQ5C , tht might help u

regards,

amit

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Certainly seems technically possible. I would suggest taking a few minutes and adding the logic to WDDOMODIFYVIEW and see if it works. I would think the hard part would be knowing when to create the binding. You can't wait until the final event. The WDDOMODIFYVIEW would be too late to effect the input processing of that server event. Therefore you would need to set the binding on the server event before the the one that you actually want to process the entire PDF document on.

Former Member
0 Kudos

Hi Thomas,

Thank you for the reply. what do you mean by server event. Can you please explain a bit more?

Actually I have found a class "cl_wd_interactive_form" which is having a method: "bind_pdf_source". I'm using in wdmodifyview method. Some how I'm getting short dumb.

Here I'm not creating the node and xstring attribute dynamically, I'm just trying to bind dynamically, for the exsisitng node and the attrbute.

Regards,

Ravi.D

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Thank you for the reply. what do you mean by server event. Can you please explain a bit more?

I guess I don't know what you don't understand. Server event is any event that goes back to the ABAP server for processing.

>Some how I'm getting short dumb.

Perhaps you should post your code here. We can't know what you are doing otherwise. I would guess that you trying to create a new InteractiveForm UI element. To create the binding dynamically, you need to access the instance of the UI element that already exists in the view.

Former Member
0 Kudos

Hi Thomas,

I'm able to bind dynamically to pdfsource on Action submit. Here Im facing some problem.

I'm able to get pdfsource xstring only if there is any error on action submit, if there is no error, then I'm not able to get pdfsource.

That means if submit action executes successfully with out any error first time itself, I'm not able to get pdf source.

I'm getting the view reference on action wdmodify method:

wd_this->iview = view.

I have defined iview of type IF_WD_VIEW under view attriutes.

And on action submit I'm binding like following

lr_interactive_form ?= wd_this->iview->get_element( 'INTERACTIVE' ).
  lr_method_handler ?= lr_interactive_form->_method_handler.
  lr_interactive_form->bind_pdf_source( path = 'PDF.PDFSOURCE').

Can you please suggest.

As I have one more submit button to trigger a pop-up before they click actual submit button , at that time I'm binding. But if the user dont click that button for pop up, then it will be a problem.

Regards,

Ravi.D

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You are violating the rules of the phase model. You can't dynamically change UI rendering (that includes data bindings) anywhere except the WDDOMODIFYVIEW event handler. Do so can lead to inconsistent results (as you are finding). SAP only expects and supports such dynamic changes in this one event handler.