cancel
Showing results for 
Search instead for 
Did you mean: 

best way to upload form into WDA

Former Member
0 Kudos

I am working on WDA containing Adobe Interactive form with Vendor Payment request.

WDA will be called by workflow every time an approver has to approve the request.

The form will reside at URL.

What is the best way to upload an Adobe form into WDA?

I found Web Dynpro example WDR_TEST_ADOBE_PDF_ONLY.

This example demonstrates how to get a form data assuming the form object is created in the view.

Is there a way to also upload a template into WDA?

Or I have to have the form template in SAP repository and

then assign the form name to templateSource property in WDA?

WDR_TEST_ADOBE_PDF_ONLY:

method wddoinit.
  data:
    mime_repository type ref to if_mr_api,
    content type xstring,
    url type string value '/SAP/BC/WebDynpro/SAP/WDR_TEST_ADOBE_PDF_ONLY/test.pdf'.
  mime_repository = cl_mime_repository_api=>get_api( ).
  call method mime_repository->get
    exporting
      i_url = url
    importing
      e_content = content.
  wd_context->set_attribute( name = 'PDF' value = content ).
endmethod.

Thank you,

Tatyana

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thomas,

Now if you want retrieve a saved PDF document you would want to use a different approach. You would create something very similar to the sample you found. You load the binary string content into the context and then data bind the pdfSource property of the InteractiveForm UI element to it. You wouldn't supply a template in that case. For this solution you aren't restricted to reading the PDF source from the MIME Repository or the ABAP repository. You could have just as easily have read it from the database (stored as a raw string field).

I did what you said and this work. Thank you.

method WDDOINIT .
DATA:
  s_zadobe type zadobe,
  t_zadobe like table of s_zadobe,
  W_XML LIke s_zadobe-xml.

select single xml
  from zadobe
    into w_xml
      where id = '20080717201904'.

  DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->element_context.
  DATA lv_pdf_source LIKE ls_context-pdf_source.
* get element via lead selection
  lo_el_context = wd_context->get_element(  ).
* Set single attribute
  lo_el_context->set_attribute(
    EXPORTING
      name =  `PDF_SOURCE`
      value = w_xml ).
endmethod.

I bound pdfSource only. When i tried to bind dataSource so I could get data from the form into WDA (user is supposed to enter some data in this WDA) - then I got an error:

Access via 'NULL' object reference not possible

How could I get data from this form into SAP?

Thank you

Tatyana

Former Member
0 Kudos

At this point I will have two WDA's for application "Payment Request".

WDA1 will let Vendor to fill out the form online and send it to a location on Portal - so called C-folder accessed thru Share point on RPM portal.

WDA2 will upload that form from that location and allow Fiscal tech to enter Approvers and send it back to the same location.

So the form needs to be interactive after it is uploaded.

"You load the binary string content into the context and then data bind the pdfSource property of the InteractiveForm UI element to it."

This is how i supply pdfSource for the form. In this case I do not supply datasource and i do not supply templateSource, correct?

Will the form still be Interactive? Could you name a code example of extracting pdfSource data from a form located at URL?

Thank you,

Tatyana

Former Member
0 Kudos

Hello,

Take a look at this blog: [https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8554] [original link is broken] [original link is broken] [original link is broken];

Regards.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Do you want to upload an offline interactive form or just pull up an existing saved document on the server? Does it need to be interactive after uploaded?

If you want to upload an offline interactive form you can just use the fileUpload UI element. The blog that the previous poster does supply such a solution. However, please see the comments that I added to this blog. The approach that the author takes is really quite unnecessary and complicated if you are using Native/ZCI based forms:

This coding approach is not necessarily even needed any longer in Web Dynpro ABAP. If you switch your form displayType to native, the form will data bind to the Web Dynpro Context for you upon upload. This is possible as of NetWeaver 7.0 SPS 10 (although for SPS10-SPS12 you must also apply OSS Note 1055738).

Now if you want retrieve a saved PDF document you would want to use a different approach. You would create something very similar to the sample you found. You load the binary string content into the context and then data bind the pdfSource property of the InteractiveForm UI element to it. You wouldn't supply a template in that case. For this solution you aren't restricted to reading the PDF source from the MIME Repository or the ABAP repository. You could have just as easily have read it from the database (stored as a raw string field).

former_member188831
Contributor
0 Kudos

Hi Thomas,

can you please let me konw the simple way of reading the offline interactive form and map the same to the online interactive form uisng WDA.

Thanks,

Mahesh.Gattu

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I listed all the requirements in my previous post:

If you switch your form displayType to native, the form will data bind to the Web Dynpro Context for you upon upload. This is possible as of NetWeaver 7.0 SPS 10 (although for SPS10-SPS12 you must also apply OSS Note 1055738).

What more did you need to know?

former_member188831
Contributor
0 Kudos

Hi Thomas,

As you said if we are using Native/ZCI based forms these many stepts are not required as mentioned in the blog:

any how i have followed this blog but i got struck at this point

*Get the RESERVED Data Node and value.

DATA: KUNNR TYPE STRING,

VKORG TYPE STRING,

VTWEG TYPE STRING,

SPART TYPE STRING,

MATERIAL TYPE STRING,

TARGET_QTY TYPE STRING,

DELIVERY TYPE CHAR10.

NODE = DOCUMENT->FIND_FROM_NAME( NAME = 'KUNNR' ).

KUNNR = NODE->GET_VALUE( ).

NODE = DOCUMENT->FIND_FROM_NAME( NAME = 'VKORG' ).

VKORG = NODE->GET_VALUE( ).

i am not getting any value into 'NODE' object.

can you please help me is there any other simple way to read the offline interactive form and automatically bind to to pdf_source attribute of interactive form.

So that what ever the user upload it will be mapped in online form.

i am working on ECC 6.0 with SP13, i hope i need not to apply this note : OSS Note 1055738.

Thanks,

Mahesh.Gattu

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>can you please help me is there any other simple way to read the offline interactive form and automatically bind to to pdf_source attribute of interactive form.

As I have already stated twice, this exact functionality is already provided as of the listed Support Package level. I listed the requirements as well. Just use the fileUpload UI element and bind the uploaded PDF content to the pdfSource attribute of the interactiveForm UI element. If you are on SP13 then you should not need OSS note 1055738.

>i am not getting any value into 'NODE' object.

I suggest that you look at the XML document in the debugger to see the structure. I suspect that you are specifiying a node name that doesn't exist.