Solution to the exercise on printing Invoices

...Previous

Step 6 :

Now go back to the transaction ‘SMARTFORMS’.  Right Click on the LOGOWIN à Create à Graphic.

 

As per the following screen shot make the changes. In the field NAME with the F4 help select the image which you have imported from SE78.

Step 7 :

Now coming to the Declarations. As required the data into the form comes from 3 tables namely,

KNA1  - For printing the Customer Details in the Customer Details Window. 

VBRK  - For printing the Billing Document Header Details in the Billing Document Details Window.

VBRP  - For printing the Item Details in the Main Window.

The Data Retrieval and printing the Form is done through a Driver Program called ZSF_PRINTINVOICE.

In the Form we need to declare some Import parameters and also define some Global Definitions.

For declaring Import parameters double click on Form Interface and include the lines as shown below :

If you have table types defined for VBRK and VBRP tables give those names in the Associated type’s column.

IM_FS_KNA1   -   The field string for Holding Customer Details.

IM_T_VBRK     -   Table to hold Billing Document Header Data.

IM_T_VBRP      -   Table to hold Billing Document Item Data.

For Global Definitions, double click on the Global Definitions and include the lines as follows :

IM_T_KNA1        -   Table to hold Customer Details.

IM_FS_VBRK     -   Field String to hold Billing Document Header Data.

IM_FS_VBRP      -   Field String to hold Billing Document Item Data.

W_TOTAL            -    Stores the Total Amount of the field NETWR.

If the above screen shot is observed we find a arrow which is placed on Currency/Quant. Fields. Open this Tab to include the following lines.

This is to refer the currency field NETWR in the table VBRP to its corresponding currency key field in the table VBRK. 

Step 8 :

Displaying the contents in BILLWIN (Billing Window).

Create a Loop under the node BILLWIN

Name the Loop as LOOP_BILL, give a description as Loop for Billing Details. In the field Operand give the details as IM_T_VBRK    INTO   IM_FS_VBRK. In the where condition give the field name as KUNAG, Select the operator as  ‘=’ and comparison value as IM_FS_KNA1-KUNNR.

 

Create Text under the Loop LOOP_BILL to display Billing Document Details

 

Give the Name for the TEXT and a Description. To display the fields click on   Field List on/off button on the application toolbar. A list with field names appear at the bottom left corner as shown in the screen shot below. Drag & Drop the fields from IM_FS_VBRK on to the editor.

 

Step 9 :

Displaying the contents in CUSTWIN (Customer Window)

Create Text under the node CUSTWIN to display the Customer Details.

 

Give the Name for the TEXT and a Description. Click on   Field List on/off button on the application toolbar. A list with field names appear at the bottom left corner as shown in the screen shot below. Drag & Drop the fields from IM_FS_KNA1 on to the editor. 

Click here to continue...

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

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image