la génération des rapports au niveau de SAP de Fait via la transaction SFP
elle se base sur deux notions:
1- les interfaces : c'est la ou on va créer les types d'entrées , et ou on va intier le code
2- les formulaires : c'est la ou va définir les templates , un formulaire doit faire appel à une interface , plusieurs formulaires peuvent faire appel à la même interface
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.
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.





Aucun commentaire:
Enregistrer un commentaire