Sei sulla pagina 1di 3

SAPTechnical.

COM - Solution to the exercise on printing Invoices

1 sur 3

http://www.saptechnical.com/Tutorials/Smartforms/Exercises/Solution...

invoice list

Home Tr ain ings Quiz T ips Tutor ials F unc tiona l Cer t Q' s In ter v ie w Q' s Job s Te stimo nia ls Ad ve r tis e Con tac t Us

SAP Virtual/Onsite
Trainings
Document Categories:

Solution to the exercise on printing Invoices


...Previous

Step 11 :
Displaying contents in BOTTOMWIN (Footer Details)

ABAPTM
Adobe Forms
ABAP-HR
ALE & IDocs
ALV
BAPI
BASIS
BSP
Business Objects
Business Workflow
CRM NEW
LSMW
SAP Script/Smart Forms
BI/BW
eXchange Infrastructure (XI)
Enterprise Portals (EP)
eCATT
Object Oriented Programming
SAP Query
Userexits/BADIs
WebDynpro for Java/ABAPTM
Others

Create a TEXT under the Node BOTTOMWIN to display the Footer Information.

What's New?
ABAP Test Cockpit HOT
SAP ABAP Pragmas
Understanding SE32 (ABAP Text
Element Maintenance)
Creating an IDoc File on SAP
Application Server
Understanding Advance with
dialog option of SAP Workflow
SAP Workflow Scenario:
Maintenance Notification Approval
Enhancements to a standard class
Working with Floating Field in
Adobe Forms
Inserting data from Internal Table
into the step Send Mail
Display GL Account long text
using enhancement framework
Differences between
polymorphism in JAVA and ABAP
Passing multiline parameters from
an ABAP Class event to a
Workflow container
Concept of Re-evaluate agents for
active work items in SAP
Workflow
Dynamic creation of component
usage in ABAP WebDynpro
Adobe Forms: Display symbols
like copyright and others
Deactivate Hold functionality in
Purchase order (ME21N)
Quiz on OOABAP
Add fields in FBL5N using BADIs
Tutorial on Wide casting
Defining a Range in Module Pool
Program
Copy fields from one
structure/table into another
structure/table
Side Panel Usage in NWBC

Give the Name for the TEXT and a Description an Enter the Text you want to Display in the window. So
your screen looks something like this:

Step 12 :
Finally

Save and

Activate the Form.

As we know, when we Activate the Smart Form it generates a Function Module automatically. To view
the Function Module generated for this Smart Form, Go to Environment Function Module Name.

Contribute?
Sample Specs

By Clicking on the Function Module Name, a pop up appears which gives the name of the Function
Module.

What's Hot?
Web Dynpro for ABAP Tutorials

24/11/2014 20:13

SAPTechnical.COM - Solution to the exercise on printing Invoices

2 sur 3

http://www.saptechnical.com/Tutorials/Smartforms/Exercises/Solution...

Join the Mailing List


Enter name and email address below:
Name:
Email:

Subscribe

Unsubscribe

Note down the Function Module name.


Step 13 :
Driver program to Execute the form ZSF_INVOICE
Go to Transaction SE38 from the SAP Easy Access Screen and create an Executable Program with
some name say ZSF_PRINTINVOICE.

As in the following program, declare the Selection screen elements, Work variables, Internal Tables
etc and call the Functions 'SSF_FUNCTION_MODULE_NAME' and /1BCDWB/SF00000201 (The one
which we got in Smart form by going to Environment Function Module Name). After calling the Function
/1BCDWB/SF00000201 just replace it by FM_NAME as shown in the code below:
REPORT

zsf_printinvoice.

*"Table Declarations...................................................
TABLES:
kna1,
vbrk,
vbrp.
*"Select Screen Elements...............................................
PARAMETERS :
p_kunnr LIKE vbrk-kunag,
p_vbeln LIKE vbrk-vbeln.
*"Data Declarations....................................................
*"--------------------------------------------------------------------*
* Work Variables
*"--------------------------------------------------------------------*
DATA :
fm_name TYPE rs38l_fnam.
" Name of the Function Module

*"--------------------------------------------------------------------*
* Internal Table to Hold Billing Document Header Details *
*"--------------------------------------------------------------------*
DATA :
t_vbrk LIKE
STANDARD TABLE
OF vbrk.
*"--------------------------------------------------------------------*
* Internal Table to Hold Billing Document Item Details
*
*"--------------------------------------------------------------------*
DATA:
t_vbrp LIKE
STANDARD TABLE
OF vbrp.
DATA :
fs_kna1 TYPE kna1,
fs_vbrk LIKE LINE OF t_vbrk,
fs_vbrp LIKE LINE OF t_vbrp.

" Holds Customer Details


" Holds BillingDoc Header Details
" Holds BillingDoc Item Details

*"--------------------------------------------------------------------*
*
START-OF-SELECTION EVENT
*
*"--------------------------------------------------------------------*
START-OF-SELECTION.
SELECT SINGLE
FROM
INTO
WHERE
SELECT
FROM
INTO
WHERE
AND

*
kna1
fs_kna1
kunnr EQ p_kunnr.

*
vbrk
TABLE t_vbrk
kunag EQ p_kunnr
vbeln EQ p_vbeln.

24/11/2014 20:13

SAPTechnical.COM - Solution to the exercise on printing Invoices

3 sur 3

SELECT
FROM
INTO
FOR
WHERE

http://www.saptechnical.com/Tutorials/Smartforms/Exercises/Solution...

*
vbrp
TABLE t_vbrp
ALL ENTRIES IN t_vbrk
vbeln = t_vbrk-vbeln.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'


EXPORTING
formname
= 'ZSF_INVOICE'
IMPORTING
fm_name
= fm_name
EXCEPTIONS
no_form
= 1
no_function_module = 2
OTHERS
= 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION fm_name
EXPORTING
im_fs_kna1
= fs_kna1
im_t_vbrk
= t_vbrk
im_t_vbrp
= t_vbrp
EXCEPTIONS
formatting_error = 1
internal_error
= 2
send_error
= 3
user_canceled
= 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.

When the Above Program is Executed the final output would be:

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM


Home Contribute About Us Privacy Terms Of Use Disclaimer Safe Companies: Advertise on SAPTechnical.COM | Post Job Contact Us
2006-2007 SAPTechnical.COM. All rights reserved.
All product names are trademarks of their respective companies. SAPTechnical.COM is in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver, and and any other SAP trademarks are registered trademarks of SAP AG in Germany and in several other countries.
Every effort is made to ensure content integrity. Use information on this site at your own risk.

Graphic Design by Round the Bend Wizards

24/11/2014 20:13

Potrebbero piacerti anche