cancel
Showing results for 
Search instead for 
Did you mean: 

How to upload the pdf file to the next view?....urgent

Former Member
0 Kudos

Hi Experts,

I need to upload the pdf file( a interactive form ) using the fileupload element in the A_view and the pdf file can be displayed in the b_view.

But I don't know how to complete the function?

Action:

0. Create a adobe form (c_form)in the R/3 using sfp with a inputfield.

1. Create a adobe interactive form (A_interactive_form)in the view(display_view) of the WDA for abap.

2. Create a context attribute(upload) in the display_view.

3. Bind the c_form to the A_interactive_form, so that the data can be transfered to the c_form.

4. Bind the "pdfSourth" property to context attribute "upload" in the A_interactive_form.

4. Type code in the WDA for abap for setting data("old") to the context.

5. Active the WDA and run the WDA.

6. In the IE, the interactive form is displayed with the value "old" in the field. Save the pdf form as "test.pdf" and close the IE.

7. Open the test.pdf, and type the inputfield "new" in the form, and save the test.pdf.

8. Create a context node(Pdfsourth) in the component controller, and create a attribute("upload") that type is xstring in the Pdfsourth.

9. Create a view(C_view), mapping the context node(Pdfsourth) in the component controller.

10. Create a fileupload element in the C_view, and the "data" property is binded the "upload" attribute in the context node(Pdfsourth).

11. Create a button(Display_form) and create the action with the outplug for upload the pdf file(test.pdf).

12. Change the window and set the C_view as default view, and set the Navigation link from the C_view to B_view.

13. Type code in the wddoinit method in the display_view for transfering the test.pdf file.

method WDDOINIT .

DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .

DATA upload TYPE xstring.

lo_componentcontroller = wd_this->get_componentcontroller_ctr( ).

lo_componentcontroller->getupload(

IMPORTING

upload = upload " xstring

).

DATA lo_nd_pdfsourch TYPE REF TO if_wd_context_node.

DATA lo_el_pdfsourch TYPE REF TO if_wd_context_element.

DATA ls_pdfsourch TYPE wd_this->element_pdfsourch.

  • navigate from <CONTEXT> to <PDFSOURCH> via lead selection

lo_nd_pdfsourch = wd_context->get_child_node( name = wd_this->wdctx_pdfsourch ).

  • get element via lead selection

lo_el_pdfsourch = lo_nd_pdfsourch->get_element( ).

  • get single attribute

lo_el_pdfsourch->set_attribute(

EXPORTING

name = `UPLOAD`

value = upload ).

endmethod.

15. Active the WDA and run the WDA.

In the fileupload of the C_view, I select the test.pdf from my local machine. and click the button(Display_form), the display_view is displayed with the A_interactive_form.

But in the A_interactive_form, the value "old" is in the field in the form rather than "new".

I hope to display the test.pdf in the A_interactive_form. I don't know how to change my code or configuration?

Do you give some example or some hint for this problem ?

Thanks & Regards,

Tao

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Tao.

I got confused reading your steps

Just go through the example WDR_TEST_ADOBE. It will definitely solve your problem. Scenario, though not exactly same, is quite similar - > From first view, you press a button, and go to second view.

In the second view, see the Change PDF file options.

Hope it helps...

Former Member
0 Kudos

Hi, Shishir Agarwal,

Thanks a lot for your help in advance.

In the WDR_TEST_ADOBE, I don't find the fileupload element to upload the pdf file .

In the 6 step, I save the pdf file(test.pdf) to my local machine. Open and change the value of the field from "old" to "new" for uploading the changed test.pdf using the fileupload element to the second view.

I hope to look the changed test.pdf in the second view. But the changed test.pdf isn't displayed.

Do you give some example or some hint for this problem ? my email: tao.wang@besuretech.com

Thanks again.

Thanks & Regards,

Tao

Former Member
0 Kudos

Hi, Shishir Agarwal,

Thanks a lot for your help in advance.

The problem is which the user downloads a PDF-template, fills in that form, uploads it back to WD for further processing.

Now I have the following problem:

- The context bindings between the different views in WDA are mapped. But when the user uploads the form and then views it, the context fields are not filled with the data the user had entered in the form. But when he changes a field in WD (after upload) the context field is filled.

According to the upload/download tutorial this should happen automatically, which it doesn't.

Can anyone give me some advice so I could move on?

Thanks again.

Thanks & Regards,

Tao

Former Member
0 Kudos

I tried an example in my system. It works though I did not use SFP to create a form.

I used an existing PDF form, in the FILEUPLOAD, i bound the data to a context attribute of type XSTRING.

I use the same context attribute in the next view to show the PDF form.

It comes correctly.

Make sure your PDF UI element's properties are set to Enabled, and of type ActiveX.

Additionally, you can try to write the following code in the WDMODIFYVIEW method:

data:

lr_interactive_form type ref to cl_wd_interactive_form,

lr_method_handler type ref to if_wd_iactive_form_method_hndl.

check first_time = abap_true.

lr_interactive_form ?= view->get_element( 'INTERACTIVE_FORM' ).

lr_method_handler ?= lr_interactive_form->_method_handler.

lr_method_handler->set_legacy_editing_enabled( abap_true ).

Please award points if it helps....

Former Member
0 Kudos

Hi, Shishir Agarwal,

Thanks a lot for your help in advance.

My R/3 version is:

Netweaver 7.0, ABAP Support Package 10

SAP_BASIS Support Package 11.

The following is the code of WDDOMODIFYVIEW in the second view.

method WDDOMODIFYVIEW .

data:

lr_interactive_form type ref to cl_wd_interactive_form,

lr_method_handler type ref to if_wd_iactive_form_method_hndl.

lr_interactive_form ?= view->get_element( 'INTERACTIVE_FORM' ).

lr_method_handler ?= lr_interactive_form->_method_handler.

lr_method_handler->set_legacy_editing_enabled( abap_true ).

lr_interactive_form->SET_READ_ONLY( abap_false ).

endmethod.

Do you tell me your verion of the R/3?

Thanks again.

Thanks & Regards,

Tao

Former Member
0 Kudos

ABAP and BASIS support package both 12.

Last line in the code is not needed to set read only to false.

Did you set the enabled to true?

Former Member
0 Kudos

Hi, Shishir Agarwal,

Thanks a lot for your help in advance.

Now, It is not the problem of version of the R/3. But now, I really don't know why it is?

Do you give some hint for this problem ?

Thanks again.

Thanks & Regards,

Tao

Former Member
0 Kudos

Hi, Shishir Agarwal,

Thanks a lot for your help in advance.

The following is the code of WDDOMODIFYVIEW in the second view.

method WDDOMODIFYVIEW .

data:

lr_interactive_form type ref to cl_wd_interactive_form,

lr_method_handler type ref to if_wd_iactive_form_method_hndl.

lr_interactive_form ?= view->get_element( 'INTERACTIVE_FORM' ).

lr_method_handler ?= lr_interactive_form->_method_handler.

lr_method_handler->set_legacy_editing_enabled( abap_true ).

endmethod.

I have set the enable to true. But the problem is still occured. I really don't know how can I do?

Do you give me some hint? Thanks .

Thanks again.

Thanks & Regards,

Tao

Former Member
0 Kudos

I have sent you a mail. Check it please.

Former Member
0 Kudos

Hi Shishir Agarwal,

Can u Please tell me how you solved this problem. Iam now facing the same issue.

Regards

Sarath

Answers (0)