Skip to Content

Scenario: Fetching the Material Description for a Material in Adobe Form using Web Service.

Consider a Scenario User enters a Material Number in a Adobe Form and the Material Description has

to be fetched from the Material master table , for this we use web service to fetch the description.

I. Create a Web Service:

  Step 1: we need to create a Remote enable function module


Step 2 : Define one Import parameter material number(MATNR) and Two Export parameter material Description (MAKTX) and BAPIRETURN (Mandatory)



  Step 3: Write the code for to fetch the material description in source code.


Then activate and check the function module

Step 4: Goto the Utilities->More utilities->Create web service->From the function module


Step 5: A Web Service Wizard  will be displayed

Give the Service name and Description

Press continue

Press continue

Press continue

Check local object or package name

Press continue

Press complete


Step 6: Now goto Transaction SOAMANAGER

The browser will start

Goto Tab Business Administration ->Web Service Administration

To find your webservice type your Service name in the Search  Pattern and then select your service then click

Step 7: Click Open WSDL Document for selected binding

A Browser Window opens with XML code

Copy the URL, This URL is the generated WSDL Link.


II . Create Adobe Forms

Step 1 : Then goto the transaction SFP and create a empty interface then create a form

Goto the layout tab

Edit ->New data connections


Enter a New Data Connection Name

Select WSDL File and click next


  Paste your URL and press next


Step 2 : Select your web service and press finish

The web service is added to the form .

Step 3 : In layout to create a new button and change it’s control type to Execute


In execute tab select your Data connection name


Step 4: Drag and drop the MATNR and MAKTX fields to the Form.

  activate the form

Step 5 : Create a print program for the form.

In the ‘####’ place  paste your form name

data: ie_outputparams type sfpoutputparams.

data: i_name type fpname,

i_funcname type funcname.

data: fp_docparams type sfpdocparams.

data: fp_formoutput type fpformoutput.

data: data_tab type SOLIX_TAB.

ie_outputparams-getpdf = ‘X’.

ie_outputparams-nodialog = ‘X’. ” suppress printer dialog popup

call function ‘FP_JOB_OPEN’


ie_outputparams = ie_outputparams.


i_name = ‘######################’.                                 “Your Form Name



i_name = i_name


e_funcname = i_funcname.

catch cx_fp_api_repository.

catch cx_fp_api_usage.

catch cx_fp_api_internal.


fp_docparams-langu = ‘E’.

fp_docparams-country = ‘US’.

fp_docparams-FILLABLE = ‘X’.

call function i_funcname


/1bcdwb/docparams = fp_docparams


/1bcdwb/formoutput = fp_formoutput


usage_error = 1

system_error = 2

internal_error = 3.

call function ‘FP_JOB_CLOSE’


usage_error = 1

system_error = 2

internal_error = 3

others = 4.

data: filename type string,

path type string,

fullpath type string,

default_extension type string value ‘PDF’.



default_extension = default_extension


filename = filename

path = path

fullpath = fullpath ).

check fullpath is not initial.

call function ‘SCMS_XSTRING_TO_BINARY’


buffer = fp_formoutput-pdf


binary_tab = data_tab.



filename = filename

filetype = ‘BIN’


data_tab = data_tab ).



document = filename ).

Output :

Step 6 : Run the print program and then save the pdf form in your drive or desktop , then open the form  using the Adobe Reader (7.0 or above) .

Give the material number and press description Button , then it fetches the description of the Material entered.


Please let me know if anyone face any issue while developing or testing it.

Thanks & Regrads,


Arunkumar Chandrasekar,

Senior Consultant – SAP Practice @Kaavian Systems Pvt. Ltd.

To report this post you need to login first.


You must be Logged on to comment or reply to a post.

  1. Former Member

    Hello Arunkumar,

    Well described blog!!!

    Is it possible to show exceptions(generated in FM) on adobe form if something goes wrong in back end?

    1. Arunkumar Chandrasekar Post author

      Hi Gopichand,

      Thanks for your feedback.

      We can able to validate in the FM code and give the proper error message in the return parameter.

      Sorry for the delayed response.

      Thanks & Regards,

  2. Saurabh Tiwari

    Hello Arunkumar,

    I tried to do this, but when I click the submit button in the form, nothing is getting fetched.

    Could you please look into this.



Leave a Reply