Main Course Index

Welcome! This site offer's free training on ABAP Programming as the cost is really high in which only a few can afford making the author think in providing this site. Below are the three main topics in which you can learn here:

1. ABAP Fundamentals

2. ABAP Programming I
    2.1 - Defining Data with the ABAP Editor
    2.2 - Performing Operations in ABAP
    2.3 - Using ABAP Statements
    2.4 - Creating an ABAP Program
    2.5 - Working with Internal Tables
    2.6 - Classical Reporting in ABAP
    2.7 - Interactive Reporting in ABAP
    2.8 - Creating an Interactive Report Program
    2.9 - ABAP Classes
    2.10 - Properties of ABAP Objects
    2.11 - Using Classes in ABAP
3. ABAP Programming II
    3.1 - Introducing Dialog Programming in ABAP
    3.2 - Creating Screens and GUI Status in ABAP
    3.3 - Defining Flow Logic with ABAP
    3.4 - Creating a Dialog program in ABAP
    3.5 - Creating SAPScript Forms
    3.6 - Using Smart forms in ABAP
    3.7 - Formatting and Printing in ABAP

Formatting and Printing in ABAP

Learning Objective:

After completing this topic, you should be able to format and print a form in a given scenario.

Exercise overview

In this exercise, you're required to format and print a form using SAPscript and Smart Forms in a given scenario.

This involves the following tasks:
    • Formatting SAPscript forms
    • Creating a print program and printing the form
    • Formatting a Smart Form using Smart Styles
    • Printing the form using Smart Forms

Suppose you are an ABAP developer working in Brocadero – a company dealing in electronic products, such as refrigerators and televisions. Brocadero buys raw material from different vendors.

Initially Brocadero followed a manual process of creating purchase and sales orders.

The company has recently implemented SAP R/3 to manage its processes.
The management wants you to create forms for the automatic generation of purchase and sales orders.

You have already created a form "ZBROCADERO_PO" for purchase orders using SAPscript, and a form "ZBROCADERO_SALES" for sales orders using Smart Forms. In addition, you have set the page layout of both the forms.

Now you need to set the preferred alignment, the font type, and the font size.

After creating all the relevant formats with the required settings, you need to print the forms.

Task 1: Formatting SAPScript forms

Using SAPscript, you want to create a paragraph format for all the windows in the "ZBROCADERO_PO" form that are placed across the width of the form, such as the window displaying the terms and conditions of a purchase order.

Step 1 of 2

The Form: Change: Header Painter: ZBROCADERO_PO screen is opened for you.
What actions should you perform to do this?

Options:

1. Click Paragraph Formats, type P1 in the Paragraph text box in the Standard Attributes section, press Enter, and then select BLOCK from the Alignment list box.

2. Click Paragraph Formats, type P1 in the Paragraph column in the Paragraph
Formats section, and then select Justified in the Alignment column.

Result

You click Paragraph Formats, you type P1 in the Paragraph text box in the Standard Attributes section, press Enter, you select BLOCK from the Alignment list box, and then you click Cont.

Step 2 of 2

After creating the paragraph format P1, you want to apply it to the heading in the Terms and Conditions window in the "ZBROCADERO_PO" form. The PC editor of this window "Window TC" is opened for you, and the heading text is selected for you.
What actions should you perform to do this?

Options:

1. Select P1 Block Aligned from the Parag.Formats drop-down list box
2. Click Formats, and select P1 Block Aligned from the Parag.Formats drop-down list box

Result

You select P1 Block Aligned from the Parag.Formats drop-down list box.

Task 2: Creating a print program and printing the form
After creating the paragraph format "P1" for the "ZBROCADERO_PO" form, you need to print the form.

Step 1 of 1

You want to create a print program "ZPO_PRINT_PRG" for the "ZBROCADERO_PO" form. Using this print program, you want to retrieve information related to all purchase orders issued by Brocadero from the database table "broc_po" into the internal table "itab_broc_po."

What actions would you perform to initiate printing?

Options:

1. Use the OPEN_FORM function module and pass the form name ZBROCADERO_PO to it to initiate printing

2. Use the SSF_FUNCTION_MODULE_NAME function module to retrieve the name of the function module associated with the form ZBROCADERO_PO, and then execute the function module of the form to initiate printing

Result

You use the OPEN_FORM function module and pass the form name ZBROCADERO_PO to it to initiate printing.

Task 3: Formatting a Smart Form using Smart Styles
After printing the "ZBROCADERO_PO" form, you decide to create a character format for texts used as notes in the sales form "ZBROCADERO_SALES" using Smart Styles.

Step 1 of 2

You want to create a character format "C1" with font family "Courier," and font size "12." The initial screen "Change Mode: Style ZSALES_STYLE" of the corresponding Smart Style "ZSALES_STYLE" is opened for you.

What actions should you perform to do this?

Options:

1. Double-click Character Formats, click Edit - Create Node, type C1 in the Character Format text box, click Enter, click the Font tab, select Courier from the Font Family drop-down list box, and then type 12 in the Font Size text box

2. Select Character Formats, click Edit - Create Node, type C1 in the Character Format text box, click Enter, click the Font tab, select Courier from the Font Family drop-down list box, and then type 12 in the Font Size text box

Result

You double-click Character Formats, you click Edit - Create Node, you type C1 in the Character Format text box, you click Enter, you click the Font tab, you select Courier from the Font Family drop-down list box, you type 12 in the Font Size text box, and then you press Enter.

Step 2 of 2

After creating the character format "C1," you want to apply the format to the notes text in the "ZBROCADERO_SALES" form. The style "ZSALES_STYLE" has been associated with the form. The General Attributes tabbed page for the note element is opened for you and the text in the Note text element is selected for you.

What actions should you perform to do this?

Options:

1. Select C1 Courier from the Character Formats list box
2. Click Formats, and then select C1 Courier

Result

You select C1 Courier from the Character Formats list box.

Task 4: Printing the form using Smart Forms

After applying the character format C1 to the "ZBROCADERO_SALES" form, you want to use the form in a report program to print it.

Step 1 of 1

You want to create a report program "ZSales_Order" for the "ZBROCADERO_SALES" form to print the form.

Complete the report program code to retrieve the name of the function module of the "ZBROCADERO_SALES" form.

call function SSF_FUNCTION_MODULE_NAME
exporting
formname = 'MISSING CODE'
importing
m_name = fm_name .


Result

You use the "SSF_FUNCTION_MODULE_NAME" function module and pass the name of the form "ZBROCADERO_SALES" to the function module to retrieve the name of the function module of the form.

Using SAPscript, you formatted a paragraph on the form "ZBROCADERO_PO" using the P1 paragraph format.

Then you created a print program "ZPO_PRINT_PRG" to print the form. Next you created a character formatting C1 in the Smart Style "ZSALES_STYLE," and then applied the format to the Smart Form "ZBROCADERO_SALES."

Finally, you created a print program ZSales_Order to print the Smart Form.

No comments:

Post a Comment