Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

A very basic sample call a form create using SFP and called by a report program.

Create an interface:

Add a few import parms to the interface:

Create a form which will use the interface and drag the interface import fields over to the Context of the form:


Change layout Type to “ZCI Layout”


Start Adobe LiveCycle and choose the "Layout" tab page and then "Utilities" -> "Insert Web Dynpro Script".


Add three “ISR Text Edit” fields to the layout:


    From the Data View, drag over and bind each input field from the interface to one of the input fields on the layout of the form.



Activate the form.


Pressing F8 will execute the form as a function module.  Input values for the 3 interface parameters and then make note of the function name (/1BCDWB/SM00000205).  Do a print preview to verify it looks ok.



Abap Code for Report Program to call the form:

Code to call from a standard abap report:

report ytest_sfp_form.

start-of-selection.

data :fp_outputparams   type sfpoutputparams.

fp_outputparams
-nodialog = 'X'.
fp_outputparams
-preview  = 'X'.
*  fp_docparams-FILLABLE    = 'N'.
fp_outputparams
-device   = 'PRINTER'.
fp_outputparams
-connection = 'ADS'.
fp_outputparams
-bumode = '-'.
fp_outputparams
-dest = 'LPDF'.
fp_outputparams
-dataset = 'PBFORM'.
fp_outputparams
-pdltype= 'pdf'.
fp_outputparams
-xdcname = 'acrobat6.xdc'.

call function 'FP_JOB_OPEN'
changing
ie_outputparams
= fp_outputparams
exceptions
cancel         
= 1
usage_error    
= 2
system_error   
= 3
internal_error 
= 4
others          = 5.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.

data: lv_char50_1 type char50, lv_char50_2 type char50, lv_char50_3 type char50.

lv_char50_1
= 'Test Parm 1'.
lv_char50_2
= 'Test Parm 2'.
lv_char50_3
= 'Test Parm 3'.

call function '/1BCDWB/SM00000205'
exporting
lv_char50_1
= lv_char50_1
lv_char50_2
= lv_char50_2
lv_char50_3
= lv_char50_3.

if sy-subrc <> 0.
*   Implement suitable error handling here
endif.

call function 'FP_JOB_CLOSE'
exceptions
usage_error   
= 1
system_error  
= 2
internal_error
= 3
others         = 4.
if sy-subrc <> 0.
*   Implement suitable error handling here
endif.

Labels in this area