cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass the values to a FM thru WDP for ABAP....very urgent please

Former Member
0 Kudos

Hi Gurus,

I have a ADOBE form. Once the user enters the details and submit, those fields details should be passed to a function module as import parameters to FM.

for example, in the ADOBE form I have name and age fields. once these fields are entered, they should go to a function module as an import parametets to it. Please give me the code at the earliest as its very urgent.

Excellent points will be awareded, please help me.

Thanks,

David.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi David,

To pass the values to the function module, there are two steps:

1. Read the context element attribute (in your case, name and age) and store it into a local variable.

2. Call the FM by using the above variables in the importing parameter.

The code will look like:


  data lo_nd_node_name type ref to if_wd_context_node.
  data lo_el_node_name type ref to if_wd_context_element.
  data ls_node_name type wd_this->element_inputs.

  lo_nd_node_name = wd_context->get_child_node( name = wd_this->wdctx_node_name ).
  lo_el_node_name = lo_nd_node_name->get_element(  ).

    lo_el_node_name->get_attribute(
      exporting
        name =  `NAME`
      importing
        value = val_name ).

    lo_el_node_name->get_attribute(
      exporting
        name =  `AGE`
      importing
        value = val_age ).

  call function 'FM_NAME'
    exporting
      name = val_name
      age = val_age.

In the above code, replace 'node_name' with your actual node name.

Hope this helps. Post back in case of problems.

Regards,

Ram

Former Member
0 Kudos

You can also do this if the submit button is with in the form.

1. make the FM an RFC.

2. Wrap it as a WebService.

3. In the adobe designer-> data view pallette, create a new data connection with the WSDL file created in step 2.

4. Bind the import parameters from the new data connection to the respective fields in the form.

5. Drag and drop the button of this data connection in to the form.

6. Test it.

It wont take more than 15 minutes to finish this process.

If you have any queries regardind Adobe interactive forms, please post it in the SAP Interactive Forms by Adobe Forum.

Rgds,

Anto.

Former Member
0 Kudos

Hi Ram,

Excellent.. gonna give full points

Can I have your email id so that I can contact you if anything is urgent.

Thanks,

David.

Former Member
0 Kudos

Hi Antony,

Could you please explain in detail as I dont know Webservice. Pleasse give me step by step procedure how can I achieve this. I do have a submit button. Once the button is clicked, all these values should be extracted from the adobe form and should go to a FM.

Thanks,

David.

Former Member
0 Kudos

Hi David,

Glad that you are able to solve your problem! You can post to the forum anytime and I'm sure you will be gettin quality help. Posting in the forum has the following advantages over mailing me:

1. More experts can view your query and respond.

2. In future, if anyone else has the same issue, they can searche the forum and get instant solutions. This will not be possible if you mail me.

So feel free to post to the forum about any issue you may face - I'm sure you'll get quick and quality help from experts.

@Antony: I too would be glad to know about Web Services. Can you point us to a good starter document?

Regards,

Ram

Former Member
0 Kudos

Hi Ram,

In this code i'm getting the folloing error in the browser.

Function parameter "NAME" , "AGE" are unknown. Though I declared Name type char10, still am getting the same.

My next question is, How can I pass these values to an internal table, then to a FM as table. (not like exporting parameter). Please give me the code sir.

Former Member
0 Kudos

Hi David,

Please check the following:

1. Have you declared name and age as the FM's importing parameters?

2. Ensure that you use the same name while calling the FM from Webdynpro.

The following checks should give you some clarity:

In FM definition (se37):

give ip_name and ip_age as importing parameters.

Then, in webdynpro, declare two variables l_name and l_age which are of the same data type as the FM's importing parameters.

Then, call the method as follows:

call function 'SAMPLE_FM'
EXPORTING
ip_name = l_name
ip_age = l_age.

In the above code, note that the formal parameters of the FM occur on the left side.

Also, ensure that you have activated the function module.

This should solve your issue regarding the parameters. I will update you about internal tables in a while.

Regards,

Ram

Former Member
0 Kudos

Thanks a lot Ram. Now its working. Please help me in that table stuff also.

Thanks,

David.

Former Member
0 Kudos

Hi David,

Use of the 'tables' feature in FM is obsolete. Instead, you can put all your data inside an internal table and pass it as an exporting parameter. You do not lose any functionlaity by exporting an internal table.

Here is how you can create an internal table and insert values to it.

First of all, create a table type, say zuser_details, with the content you want in SE11. Choose the 'Data element' radio button and then choose 'table type'. then, enter a structure name for your table type and double click it. Then, enter the structure details - name and age. Then, save activate the structure and then activate the tabletype.

Then, in your code, you have to create an instance of the created table type as follows:

data itab type zuser_details.
data wa like line of itab.

wa-name = 'name1'.
wa-age = 10.
append wa to itab.

wa-name = 'name2'.
wa-age = 20.
append wa to itab.

wa-name = 'name2'.
wa-age = 30.
append wa to itab.

In the FM definition, specify an importing parameter of type 'zuser_details'. Then, pass itab as a parameter to the function module, just like any other parameter.

Regards,

Ram

Former Member
0 Kudos

Hi Ram,

Thanks for your quick reply. but underscore is not acceptable in WDP ABAP rt? How can we achieve this?

Former Member
0 Kudos

Hi David,

Underscore is acceptable in WD ABAP.!

Regards,

Ram

Former Member
0 Kudos

Sorry Ram,

It should have been hyphen. Underscore is acceptable but Hyphen is not acceptable in WDP Abap. Please suggest what would be the replacement for this.

Former Member
0 Kudos

Hello david, How were you able to get the PDF form fields entered values to WD ABAP fields? Can you provide some info on that? I am reading the pdf into XSTRING defined variable but do now know which method to use to get the values of form fields.

Your help is appreciated.

Regards

Prasad

Answers (0)