Monday 21 November 2011

interview questions sap fico module 557

Top 10 SAP TCodes that appear most in SAP menu tree

After developing http://tcodes.ofsap.com, which is based on SAP ECC 6.0, I tried some ‘search’ activities about SAP transaction codes to kill time at my office (I hope my boss won’t read this blog).

I found some trivia that I’d like to share. As Wikipedia said, trivia is “knowledge that is nice to have but not essential”, you might think it’s silly and not important. It’s fine by me.

I found that several SAP tcodes appear at several nodes of SAP menu tree, for example FBL1N appears 4 times on SAP menu tree:

SAP Menu⇒Accounting⇒Financial Accounting⇒Accounts Payable⇒Account⇒Display/Change Line Items
SAP Menu⇒Accounting⇒Real Estate Management⇒Real estate general contract⇒Postings⇒Vendor menu⇒Account⇒Display/Change Line Items
SAP Menu⇒Accounting⇒Flexible Real Estate Management⇒Accounting⇒Reporting⇒Vendor Line Items
SAP Menu⇒Accounting⇒Flexible Real Estate Management⇒Information System⇒Accounting⇒Vendor Line Items

PA30 tcode, beside at SAP Menu⇒Human Resources⇒Personnel Management⇒Administration⇒HR Master Data⇒Maintain, also appears 34 times at other nodes of SAP menu tree.

So, I run a query on tcodes.ofsap.com database and found the top 10 SAP transaction codes that appear most in SAP menu tree as follow:

MM03 tcode appears 117 times on SAP menu tree
S_ALR_87000881 tcode appears 111 times on SAP menu tree
MM02 tcode appears 85 times on SAP menu tree
MC93 tcode appears 75 times on SAP menu tree
MC94 tcode appears 75 times on SAP menu tree
MC95 tcode appears 75 times on SAP menu tree
PC00_M99_DKON tcode appears 66 times on SAP menu tree
PU03 tcode appears 65 times on SAP menu tree
XK03 tcode appears 65 times on SAP menu tree
PC00_M99_DLGA20 tcode appears 64 times on SAP menu tree

Are you familiar with the above SAP tcodes? I am familiar only with some of them, such as MM03 and MM02, but I don’t know that they exist on that many places at SAP menu.

Do you have other SAP trivia? Please share with us, just login (register) from the menu on the left and submit it as an article. Or, if you don’t want to bother writing an article, just leave a comment on the box below.

LSMW - Create Purchase Requisition (PR)

SAP Study Materials Store
LSMW (Legacy System Migration Workbench), from its name, is a tool in SAP ERP that allows us to do the migration data from Non-SAP system to SAP system. It’s usually used in the Go-live preparation phase of SAP implementation project to create multiple records of SAP master data or transaction data (such as material master, vendor master , customer master, purchasing document, etc), without entering them one by one.

With LSMW, SAP can read an input file, for example a .txt file, which contains multiple records with some columns, and then convert them into SAP data. Of course, we had to define the format of the input file and the conversion rule first before we run the LSMW tool. The contents of the input file can be the master or transaction data form legacy system that needs to be migrated to SAP system.

LSMW can be used not only for data migration, but it also can be used in the production phase of SAP implementation for various needs, such as to create or update master data or transaction data which are not efficient if we do it one by one. Although SAP has provided “mass change” functionalities such as MM17, MEMASSRQ, MEMASSPO tcodes, with LSMW, we have more flexibility in terms of fields that can be changed.

We can use LSMW to do various SAP transactions as it has four object types and import methods, which are:

Standard batch/direct input
Batch input recording
Business Object Method (BAPI)
Intermediate Document (IDOC)


The first two methods can be run without any ABAP programming knowledge, so it can be created by anyone who understand the specific transaction well including the functional analyst, or even end-users. But, the first two methods can be enhanced, if needed, with a simple ABAP logic, because SAP has provided the functionalities. The next two methods needs ABAP programming.

In this example, I will show how to use LSMW to create Purchase Requisition (PR) documents from a set of input files. I will use the Standard batch/direct input method because it requires no ABAP programming, and unlike Batch Input Recording method, it can be used to create multiple records in a purchasing document.

With Batch input recording, which you can think like macro recording in MS office, it’s difficult to create a document with multiple records because there might be different count of the records in each document in the input files, while we must determined it in the recording process when we create the LSMW program.

In this example I will generate LSMW program for creating PR documents which can have multiples items with single account assignment “cost center”.

You can download the screenshots of step by step guide how to use LSMW to create PR documents with multiple items here. You can learn the concept behind it and apply it to your own needs. If you have any comments, opinion, or questions, you can post it in the “comment” section below.

A Guide to SAP's SME Software Products

SAP Study Materials Store
a guest post by: Chris Thorman, Senior Marketing Manager of Software Advice (www.SoftwareAdvice.com)

This post comes from Software Advice CEO Don Fornes, a web site that reviews manufacturing software systems.

Throughout its existence, SAP has been known as an enterprise-class applications vendor – one that sells only to really big companies. At the same time, SAP has attempted – through marketing, channels and development – to move “down market” into the realm of small and mid-size enterprises (SMEs). Today, that strategy has resulted in a portfolio of software solutions that might need some explaining. I’ll give it a try.

Before we dig into the SAP portfolio, it’s important to understand a few things about the SME market:

There exists a range of SMEs and one-size does not fit all. A $750 million SME has very different needs than a $10 million SME.
The smaller the SME, the less likely they are to adopt complex technology. When they do get into technology, they typically like Microsoft platforms (e.g. .Net, SQL Server).
SMEs were the first to adopt software as a service (SaaS), and that model continues to gain traction within the SME market. Any SME strategy must include a SaaS strategy.


The implications of those three points for SAP were that SAP could not just “re-package” its core SAP Business Suite – the “big company product” formerly known as R/3 – and call it an SME strategy. SAP actually tried this throughout the 1990s, but in 2002 they started on a new path toward specific solutions designed just for the SME market.


SAP products by size of business, as measured by employee count

By far the biggest differentiator between the various SAP solutions is the size of organization for which they are designed. Of course, SAP Business Suite is designed for large organizations – those with thousands or tens of thousands of employees and likely hundreds or thousands of ERP users.

All-in-One, with its preconfigured industry solutions, is able to go further down market to serve organizations in the 500+ employee range – the high-end of the SME market.

ByDesign is targeting organizations in the 100 to 500 employee range. Over time, as ByDesign matures functionally and becomes more scalable, we expect increasingly larger organizations to adopt the ByDesign SaaS model. So, in our diagram we indicate this as moving up-market.

Finally, Business One is clearly targeted at the low-end of the SME market. It’s simplicity is a fit for organizations with fewer than 100 employees, but at least ten.


SAP Products by Application Functionality

From a functional standpoint, there is a wide variation in the capabilities of the various SAP products. Business Suite, again, is extremely full-featured. So too is Business All-in-One. Business ByDesign is not as fully featured as its on-premise siblings, but SAP is investing rapidly in developing more functionality. Finally, Business One remains a fairly simple applications suite; its primary capability is core accounting, complemented by hundreds of add-on modules offered by a network of roughly 1,200 reseller partners.

SAP Products by Industry Coverage

SAP has long prided itself on offering very specific functionality for a wide range of industries. Business Suite, of course, has very deep coverage across most major industries. Business All-in-One inherits this deep industry functionality, since it shares the same code base.

Business ByDesign and Business One offer narrower coverage of industries, since they are newer solutions. SAP is still extending the core horizontal functionality of these solutions (e.g. CRM, SCM) and will, over time, extend the vertical industry functionality.

In the case of Business One, SAP offers a very robust set of developer tools, which allow third-party reseller partners to extend the solution to meet the needs of specific industries. Over time, we expect SAP to incorporate these add-on modules into the core Business One codebase. Microsoft has executed a similar strategy with its Microsoft Dynamics products.

Software Deployment Options

Traditionally, SAP solutions were installed on-premise; that is, the software was installed locally at each of a customer’s facilities. From an architectural standpoint, there is software to be installed on a server (i.e. the core application functionality and the database), as well as on the client machine (i.e. each user’s computer). Some SAP applications are web-based, meaning that all software is installed on the server, while users access the application via a web browser. Regardless, any software would be installed and maintained at the customer’s facilities.

Through a network of reseller and hosting partners, SAP began to offer hosted versions of its solutions in the late 1990s and continues to offer these solutions today. Business All-in-One, specifically, is offered in both an on-premise and hosted model. Business One, however, is only offered as an on-premise solution, meaning that all software is installed at the customer’s facility.

Business ByDesign is a clear departure from SAP’s traditional on-premise model. Business ByDesign is a pure web-based solution, offered on-demand. That is, all of the software is hosted at an SAP data center and every user accesses the system through a web browser over the Internet.

Pricing and Cost of Ownership

Pricing for Business Suite and Business-All-in-One is a traditional mix of package licenses and named-user licenses. That means that a buyer will pay a certain amount to purchase the applications they need, as well as a separate license for each user who will access the system. The later licenses will vary in price based on whether a user is a power user or an infrequent user accessing reports, etc. Finally, the buyer will have to purchase a maintenance contract (typically 15% to 20% of the original license price), which will entitle them to customer support and upgrades.

While Business Suite implementations are often seven-figure investments, we believe that a Business All-in-One implementation can cost as little as $350,000, including software and services. Of course, most implementations become more complex due to customization and integration, so many will cost substantially more than $350,000. Since Business All-in-One is available on a hosted basis, SAP also offers – through its partners – subscription pricing.

SAP Business One follows a similar pricing model but costs far less. Again, the cost depends on various factors, including the number of users and the type of access each user will need. We believe that Business One implementations range from $25,000 to $250,000. The variation will be driven in large part by the number of third-party add-on modules that are purchased and how much customization and integration is performed by the channel partner.

Business ByDesign offers the most unique pricing amongst the various SAP products. A pure subscription model, Business ByDesign costs $149/user/month. There is, however, a minimum licensing requirement of 25 users, which brings the total monthly minimum subscription to $3,725 per month.

To compare Business ByDesign pricing to the other SAP solutions on an apples-to-apples basis, we can compute a net present value (NPV) of $27,416 (assuming a ten-year life for software and a 6% discount rate). Of course, that is just the lowest-level price. A company with 300 users could expect to pay the equivalent of a six-figure, up-front investment (say, ~$200,000).

Business ByDesign, by design (pun intended), is not meant to be customized intensively. Therefore, buyers can expect to invest far less in customization and integration, assuming they can make the out-of-the-box version work for their business.

fico material

A few days ago, I've found a very interesting URL link. I am sure it will be very useful for SAP learners, so I would like to share it with all of you. The link will take you to an SAP IDES login page. With a certain user id and password (and they're free), you can access an SAP IDES client and can do whatever the administrator gives you the authorization for. As far as I try, I can perform transactions, maintain master data, configuration (SPRO) on that client. It really helps to learn SAP on IDES system. If you don't have your own SAP IDES system, you will like this link.

The owner of this SAP IDES system is Consolut, a consulting company. It's an SAP Services Partner which located in Germany and Switzerland. It has about 180 clients.

To get an access to the Consolut's SAP IDES system you can perform these steps:
(disclaimer: these steps are valid at the time I write this post, and may be changed by Consolut at any time they want)

If you don't have a user id, you can request one by doing these steps:
Go to http://www.ides.consolut.eu/user_request
It will redirect you to http://www.ides.consolut.eu/sap/bc/gui/sap/its/zuser_req
Fill the form on that page like the below image


The above image is © SAP AG 2010. All rights reserved
Click the "execute" button on the above form, then it will show an information window like the below image.


The above image is © SAP AG 2010. All rights reserved
Click the OK button. You will receive an email that tells you that your request will be processed within 2 business days. But, from my experience, they will process it on the same day.
After the registering process, you will receive an email that tells your User ID. You need to request the password daily, because they will change it every day at 00:01 AM CET (I think it's not a big deal for the free access they give us).
If you've already had a user ID, you need to request the password daily by doing these following steps:
Go to http://www.ides.consolut.eu/user
It will redirect you to http://www.ides.consolut.eu/sap/bc/gui/sap/its/zwebgui
Fill the form on that page like the below image.


The above image is © SAP AG 2010. All rights reserved
You will receive an email that inform the password which can be used until 12:00 PM CET.
Go to http://www.ides.consolut.eu/
It will redirect you to http://www.ides.consolut.eu/sap/bc/gui/sap/its/webgui
Fill your user ID and password on the below form.


The above image is © SAP AG 2010. All rights reserved
Click "Log On" button. Then you can do whatever you want on the SAP IDES system. Be responsible there, we don't want they close the free access because someone messes up with their system.

If you have any other links that provide free online SAP IDES access please share them with us.
Please also share your experience in using those services.
Have a nice learning process.

interview questions sap fico module 556

What is SAP ERP?

What’s SAP?

SAP AG is a German software company which is known as the market leader in Enterprise Resources Planning (ERP) software products. Its global market share in ERP software products was estimated as 27.5 percent in 2007, far surpassing the second-ranked competitor (Oracle) at 13.9 percent. Approximately, SAP has 75,000 customers which are various companies that spread in 120 countries.

It’s the largest software company in Europe and the third largest software company in the world after Microsoft and Oracle. Microsoft and Oracle have various software products other than ERP application that SAP don’t.

SAP History

SAP was founded in 1972 in Mannheim, Baden-W’rttemberg by five former IBM engineers: Dietmar Hopp, Hans-Werner Hector, Hasso Plattner, Klaus Tschira, and Claus Wellenreuther. Originally, SAP means Systemanalyse und Programmentwicklung (in english: Systems analysis and program development). Then they changed the acronym to Systeme, Anwendungen und Produkte in der Datenverarbeitung (in english: Systems, Applications and Products in Data Processing).

In 1976, the company became a GmbH (Gesellschaft mit beschr’nkter Haftung) company (in USA known as limited liability company, LLC). In 1977, its headquarter was moved to Walldorf. In August 1988, it became an AG (Aktiengesellschaft) company (in USA known as public company).

The first SAP software was known as R/1. It was launched in 1972. ‘R’ means ‘Real-time Data Processing’. R/1 was a financial accounting system. In 1979, it was replaced by R/2. SAP R/2 was a mainframe based business application software suite. On July 6, 1992, SAP launched R/3. It was a client-server version software that was manageable on multiple platforms and operating systems, such as Microsoft Windows or UNIX.

’3′ in R/3 means ’3-tiered’ as it is a client/server based application. It utilizes a 3-tiered model:

Presentation layer, or client, which interfaces with the user.
Application layer which houses all the business-specific logic.
Database layer which records and stores all the information about the system, including transactional and configuration data.

SAP R/3 is has some functional modules that can be applied in almost all departments in a company. The most widely used modules are Financials and Controlling (FICO), Human Resources (HR), Materials Management (MM), Sales & Distribution (SD), Production Planning (PP), Plant Maintenance (PM), etc. The overview of each module will be explained in the next article. Each module is used for specific business processes in a company and can be linked if applicable as they are stored in the same database.

FI Configuration-07: Posting Periods

SAP Study Materials Store
In the previous article we have defined fiscal year variant that determines the beginning and end of fiscal year; the number of "normal" and “special” posting periods; and the posting period length. For every company code, we must assign a fiscal year variant to it.

Now, we will explain about the posting period. What exactly is posting period? Posting period is a period within a fiscal year, such as a particular month, for which SAP transaction figures are updated. Every SAP transaction that is posted is assigned to a particular posting period. The transaction figures are then updated for this period.

By dividing a fiscal year into some posting periods, we can restrict that at a point of time we can only post to a certain periods, so we can do the closing process. After performing a closing procedure at the end of a certain period, we can then restrict that we can not post to the previous period, so (as usually required by management and law) the figure of our financial statement at the end of that period stays the same, does not change since then.

Usually we will open the current posting period (such as the current month) and will close all other periods. At the beginning of the next month, we need to close the previous posting period and open the current month as allowed posting period.

We open a period by entering a range into the posting period variant which includes this period. We can have as many periods open as we desired, depends on our accounting requirement. To make posting periods maintenance easier, SAP uses the variant concept. We can make a posting periods variant that can be used by several company codes, so we only have to open and close the posting periods once for all the company codes that use the same posting periods variant.

We can do this in SAP configuration at the following menu path on SPRO t-code: Accounting - Financial accounting - General ledger - Environment - Current settings - Open and close posting periods (for SAP 4.7.c version), or the following menu path: Financial Accounting (New) – Financial Accounting Global Setting (New) – Ledger – Fiscal Year and Posting Periods – Posting Periods – Open and Close Posting Periods (for SAP ECC 6.0 version).

The above image is © SAP AG 2010. All rights reserved
Because usually the procedure of financial closing takes some times to make sure all the financial information is accurate or to make adjustments, during that time we need some special periods (as defined in fiscal year variant) may also be opened. By doing so, we still can post to those special periods although the normal period has been closed and the next normal period has been opened. We can restrict that only certain group of users that can post to the special periods (usually the accountants).

We can do it because SAP gives two period ranges that can be opened at the same time and an authorization group that can be assigned to the first range. Only users that belong to this authorization group can post to the periods in the first range.

The users must have the authorization for the authorization object F_BKPF_BUP (accounting document: authorization for posting periods) with the same value in the field “authorization group” as in the posting period table. This object can be added to a user by SAP basis administrator in a company.

We can set that posting periods for different account types are handled differently. For example, we can allow postings on customer account (“D”) while postings on vendor accounts (“K”) / Asset accounts (“A”) / G/L account (“S”) are not allowed for a certain period.

The account type “+” is the minimum entry in the posting period variant. In the posting periods variant configuration, the account type “+” must be opened for all periods which are supposed to be opened for any other account type. SAP checks this first every accounting document. If the posting date of the document (at the header level) is out of the open posting periods for this “+” account type in the configuration then the document can’t be posted.

At the line item level of documents, SAP checks the account type of the posting key to verify that the period is open for the assigned account type.

The account range always contains G/L accounts. By entering certain reconciliation accounts behind sub ledger account types, these sub ledger accounts can be treated differently than accounts which have a different reconciliation account.

SAP determines the posting periods and fiscal year based on the posting date entered in the accounting documents.

You can download video training of How to Define Variants for Open Posting Periods, Assign Variants to Company Code, and Open and Close Posting Periods.

sap

SAP Enterprise Structure - A Case Study (part 10): Assign Plant to Company Code

This is the part 10 of the series of articles about SAP Enterprise Structure - A Case Study. Read part 1 here.

Assign Plant to Company Code
For the business scenario we've explained before on part 1, we will assign:

A001 and A002 plant to ABCD company code
E001 plant to EFGH company code.

We assign plant to company code with OX18 t-code or from the following menu path of “SPRO” t-code: IMG - Enterprise Structure - Assignment - Logistics-General - Assign plant to company code.

.. Read More ..
Posted by Rizki at 13.4.11 1 comments
Labels: Enterprise-Structure
8.3.11
SAP Enterprise Structure - A Case Study (part 9): Define Division

This is the part 9 of the series of articles about SAP Enterprise Structure - A Case Study. Read part 1 here.

Define Division
For the business scenario we will define two divisions:

A1 for starter pack product.
A2 for handset product.


We define division from the following menu path of “SPRO” t-code: IMG - Enterprise Structure - Definition - Logistics - General - Define, copy, delete, check division.

.. Read More ..
Posted by Rizki at 8.3.11 4 comments
Labels: Enterprise-Structure
14.2.11
SAP Enterprise Structure - A Case Study (part 8): Define Valuation Level

This is the part 8 of the series of articles about SAP Enterprise Structure - A Case Study. Read part 1 here.

Define Valuation Level
We define valuation level with OX14 t-code or form the following menu path of “SPRO” t-code: IMG - Enterprise Structure - Definition - Logistics - General - Define Valuation Level.


If we’ve never defined this before, the “Valuation Level” screen will be editable, but in this example it is not editable because it has been defined before. Defining the valuation level in Configuring is a fundamental setting, and is very difficult to reverse.

In the next article, I will explain about how to Define Division.

Notes:
You can read the full contents of the SAP enterprise structure - a case study as soon as you buy the e-book at: SAP Study Materials Store

.. Read More ..
Posted by Rizki at 14.2.11 0 comments
Labels: Enterprise-Structure
4.1.11
SAP Enterprise Structure - A Case Study (part 7): Define Plant

This is the part 7 of the series of articles about SAP Enterprise Structure - A Case Study. Read part 1 here.

Define Plant

For the business scenario, we will create the following plants:

A001 for the west region of the ABCD company
A002 for the east region of the ABCD company
E001 for the office and warehouse of the EFGH company


There are two options to create company code:

Copy from other plant (or from SAP standard plant)
Create from the scratch


The advantage of copying from existing plant is SAP will also copy the existing plant-specific parameters, such as Consumption-Based Planning plant parameters, which include purchasing processing time, MRP Controller, etc. Then we can change certain data in the relevant application if necessary. This is much less time-consuming than creating a new plant.

But in this book we will create plant from the scratch so we have to define other parameters need in other relevant configuration process manually.

.. Read More ..
Posted by Rizki at 4.1.11 0 comments
Labels: Enterprise-Structure
15.11.10
SAP Enterprise Structure - A Case Study (part 6): Enterprise Structure concept in Logistics

This is the part 6 of the series of articles about SAP Enterprise Structure - A Case Study. Read part 1 here.

Enterprise Structure concept in Logistics

Plant

A plant is the place of production, or branch of a company, or simply a collection of several locations of material stocks in close physical proximity.

A plant is represented by a client-unique 4-digit alpha-numeric.

A plant is assigned to one company code.

One company code can have more than one plant.

SAP recommends that to get complete functionality of the SAP ERP system, the country of plant is the same with the country of the company code. We should create a company code for each country where the plant is located.

Plant is used in Material Management (MM), Production Planning (PP), Sales and Distribution (SD), and Plant Maintenance (PM) module.

Division

Division is a way to group materials or services. A wide range of materials or services can be divided into divisions.
Division is a field in the material master data (it can be input/edited on “Basic Data 1” view by MM01/MM02 t-code). That’s why a certain material can be assigned to one division only. Usually, for sales material, we set the division field as a mandatory field in the material master data. A certain material can also not be assigned to any division, for example a non-sales material that we don’t need to categorized into a specific division.
In Sales and Distribution module, division combined with other organization units (sales organization and distribution channel) will define the sales area. We can have sales area specific master data, such as material, customer, and pricing master data.
Division is used in determining business area from logistics transaction in MM and SD module. We will explain this on Assign Business Area to Plant/Valuation Area and Division section.

Valuation Level
Valuation level is the organizational level at which material is valuated. The value of valuated materials in SAP ERP is recorded in company code’s General Ledger account, usually under the inventory account.

In a client, there are two possible organizational level at which material is valuated:

Plant.
When stock is valuated at plant level, we can valuate a certain material in different plants at different prices. Valuation must be at this level in the following cases:
If we want to use the application component Production Planning (PP) or Costing
If our system is a SAP Retail system
Company Code.
When stock is valuated at company code level, the valuation price of a certain material is the same in all of a company's plants (that is, in a company code).

SAP recommends that we set material valuation at Plant level. Defining the valuation level in Configuring is a fundamental setting, and is very difficult to reverse.



.. Read More ..
Posted by Rizki at 15.11.10 1 comments
Labels: Enterprise-Structure
20.9.10
SAP Enterprise Structure - A Case Study (part 5): Assign Company Code to Company and Define Business Area

This is the part 5 of the series of articles about SAP Enterprise Structure - A Case Study. Read part 1 here.

Enterprise Structure concept in Financial Accounting

Assign Company Code to Company

After creating company and company codes, we need to assign the company codes to the company.
For our business scenario, we need to assign ABCD and EFGH company codes to ABCD company.
We can do it from the following menu path of “SPRO” t-code: IMG - Enterprise Structure - Assignment - Financial Accounting - Assign Company Code to Company.

.. Read More ..
Posted by Rizki at 20.9.10 1 comments
Labels: Enterprise-Structure
6.9.10
SAP Enterprise Structure - A Case Study (part 4): Define Company Code

This is the part 4 of the series of articles about SAP Enterprise Structure - A Case Study. Read part 1 here.

Enterprise Structure concept in Financial Accounting

Define Company Code
There are two options to create company code:

Copy from other company code (or from SAP standard company code)
Create from the scratch


SAP recommends that we copy a company code from an existing company code. The advantage is SAP will also copy the existing company code-specific parameters. Then we can change certain data in the relevant application if necessary. This is much less time-consuming than creating a new company code.
But in this book we will create company code from the scratch so we have to define other parameters need in other relevant configuration process manually.
For our business scenario, we need to define two company codes:

ABCD for ABCD Telecommunication company
EFGH for EFGH Telecommunication company

The information that we need to maintain the company are:

Company code
Name
Address, including country
Language key
Local currency


We create company code from the following menu path of “SPRO” t-code: IMG - Enterprise Structure - Definition - Financial Accounting - Edit, Copy, Delete, Check Company Code.

.. Read More ..
Posted by Rizki at 6.9.10 3 comments
Labels: Enterprise-Structure
23.8.10
SAP Enterprise Structure - A Case Study (Part 3): Define Company

This is the part 3 of the series of articles about SAP Enterprise Structure - A Case Study. Read part 1 here.

Enterprise Structure concept in Financial Accounting

Define Company
All company codes for a company must work with the same operational chart of accounts and fiscal year. The currencies used can be different.
The information that we need to maintain the company are:

Company ID
Name
Address, including country
Language key
Local currency

For our scenario, we will create one company (ABCD). We can create company from the following menu path of SPRO t-code:
IMG - Enterprise Structure - Definition - Financial Accounting - Define Company

.. Read More ..
Posted by Rizki at 23.8.10 1 comments
Labels: Enterprise-Structure
2.8.10
SAP Enterprise Structure - A Case Study (Part 2): Enterprise Structure Concept in FICO

This is the part 2 of the series of articles about SAP Enterprise Structure - A Case Study. Read part 1 here.

Enterprise Structure concept in Financial Accounting

Company Code
A Company Code is an organizational unit that represents an independent and legal accounting entity, for example, a company within a corporate group. Financial reports such as Balance sheets and Profit and Loss statements, required by law, are created at company code level.

In SAP, a company code is represented by a unique 4-digit alpha-numeric for a specific client. It is the central organizational element of Financial Accounting. At least there is one company code in a client. We can set up several company codes in one client in order to manage various separate legal entities simultaneously, each with their own balanced set of financial books.
With SAP FI module, we can generate the financial reports of a company code. A company code's financial reports can be used for external purpose, such as for external auditors, shareholders/stock exchange commission, tax office, etc.

.. Read More ..
Posted by Rizki at 2.8.10 1 comments
Labels: Enterprise-Structure
16.7.10
SAP Enterprise Structure - A Case Study (part 1)

This post is the first one of a series of articles that I am planning to write about SAP Enterprise Structure in the Material Management (MM) module's point of view. Due to its integration with other modules, I will also explain about some Enterprise Structure organizational units in Financial Accounting (FI) and Sales & Distribution (SD) modules.

Actually, I have published this series of posts as an e-book that is sold at SAP Study Materials Store. From now on, I am planning to write the e-book contents on this blog so you can read them for free. But I will write them in a series of post on this blog (could be 20 posts). If you haven't registered to our feed, you can do it now, so you'll be notified every time I post the new article on this blog:
In a reader
or, please enter your email address:


Alternatively, you can read the full contents as soon as you buy the e-book at:

SAP Study Materials Store, or
Amazon Kindle Store


Case Study Business Scenario
ABCD is a telecommunication company. It sells intangible telecommunication services, such as voices, sms, and data usage to the end-customers. The services can be consumed by the end-customers through the handset and starter pack (RUIM/sim card) inserted in it. The ABCD company has two branches: west region (which also the Head Office/HO) and east region.

.. Read More ..
Posted by Rizki at 16.7.10 6 comments
Labels: Enterprise-Structure
17.5.10
SAP Enterprise Structure - Purchasing Organization Concept

Purchasing Organization is an organizational unit in Purchasing of MM module.

Purchasing Organization is an organization unit that has responsibility to company’s purchasing activities, such as create Request For Quotations (RFQ), Contract, Purchase Order (PO), etc. aIt negotiates purchasing conditions (price, discount, term of payment, etc) with vendors. A Purchasing Organization is represented by a client-unique 4-digit alpha-numeric.

A purchasing organization must be assigned to one (in the case of plant-specific purchasing) or more plants.

One plant can have one or more Purchasing Organizations.

A purchasing organization can be assigned to one company code (in the case of company-specific purchasing).

A purchasing organization can’t be assigned to more than one company code. If we want the purchasing organization serves more than one company code, we must not assign the purchasing organization to any company code. But, we assign the purchasing organization to plants that it’s responsible for. Since each plant is assigned to a company code, SAP system will determine the company code from the plant. Since the company code is on the header level of the purchasing documents and the plant is on item level, we need to input the company code for each purchasing document.

A company code can have one or more purchasing organizations.

.. Read More ..
Posted by Rizki at 17.5.10 0 comments
Labels: Enterprise-Structure, MM, MM--Purchasing
5.4.10
E-Book: SAP Enterprise Structure Concept and Configuration Guide

E-book: SAP Enterprise Structure (MM and related modules such as FI, Logistics, and SD) Concept and Configuration Guide
SAP enterprise structure is organizational structure that represents an enterprise in SAP R/3 system. It consists of some organizational units which, for legal reasons or for other specific business-related reasons or purposes, are grouped together. Organizational units include legal company entities, sales offices, profit centers, etc. Organizational units handle specific business functions.

Organizational units may be assigned to a single module (such as a sales organization assigned to Sales and Distribution (SD) module, or to several modules (such as a plant assigned to Materials Management (MM) and Production Planning (PP) module).

SAP ERP system can represent a complex enterprise structure. Its flexibility can integrate the structure of an enterprise by linking its organizational unit. Enterprise structure design is a fundamental process in a SAP implementation project. The design is mainly determined by the business scenarios performed in an enterprise. Once the design is determined, it will affect many things such as how to perform a transaction and generate reports on SAP system. Although it’s possible, it requires great effort to change the enterprise structure. So , we must ensure that the enterprise structure designed in the SAP implementation project can accommodate all business scenarios and enterprise’s requirements for current and future situation.

The SAP Enterprise Structure is a fundamental setting and needs a comprehensive understanding of the business processes and their integration. We have to work with other departments and SAP modules, such as Accounting department (FI module), and Sales department (Sales and Distribution module).

I have written a pdf e-book that explains in details about the SAP Enterprise Structure (MM and related modules such as FI, Logistics, and SD) Concept and Configuration Guide. Just like other articles on my SAP Study Materials blog, I wrote the e-book in a simple-to-understand way, so you can learn it easily. You don't need to have extensive SAP knowledge and experience to be able to configure the SAP Enterprise Structure, as the e-book start explaining each step with the basic concept behind it. After understanding the concept, the e-book will show the step-by-step configuration with the screen shots.

You can buy the e-book for USD 25.00 19.95 at: Buy Now

.. Read More ..
Posted by Rizki at 5.4.10 0 comments
Labels: Enterprise-Structure, SAP-Books
7.9.09
SAP SD Enterprise Structure & Master Data

SAP SD Enterprise Structure

Enterprise structure or Organizational structure in SAP is a structure of SAP organizational units that reflects the structure of the business in the real world. There are various SAP organizational units that can be mapped to business structure based on the real world business requirements such as: Client, Company Code, Plant, Storage Location, Sales Organization, Distribution Channel, Division, Sales Office, Sales Group, Sales Person, Shipping Point, Loading Point, etc.

We must set the enterprise structure correctly in the first place. The change of it usually requires a great effort and very time consuming. To set it up correctly we must have a comprehensive knowledge about the business processes and how to map it to SAP configuration.

A specific organizational unit is defined by a specific function or module in SAP. Company code is defined by FI module. Plant is defined by Logistics function. Storage Location and Purchasing Organization are defined by MM module.
In SD module we have to define Sales Organization, Distribution Channel, and Division. We have an option whether to use Sales Office, Sales Group, and Sales Person or not.













.. Read More ..
Posted by Rizki at 7.9.09 2 comments
Labels: Enterprise-Structure, SD
10.1.08
MM Configuration: Assign Purchasing Organization to Company Code and Plants

Step by step SAP Material Management (MM) Configuration: Assign Purchasing Organization to Company Code and Plant

Purchasing Organization is an organization unit that has responsibility to company’s purchasing requirements. It negotiates purchasing conditions (price, discount, and other things) with vendors.

We can assign Purchasing Organization to a company code if we want a Company-specific purchasing. The purchasing organization may procure only for this company code. Then, we assign only plants of the company code concerned to the purchasing organization.

You can read our previous post to understand more about Purchasing Organization in SAP Enterprise Structure.

In this example we will assign “GC00” Purchasing Organization to “GC00” company code and to “GC01” plant. We can do this in a SAP R/3 client with T-code: SPRO. SAP step-by-step Screen shots of How to assign a Purchasing Organization to company code and plants are:

.. Read More ..
Posted by Rizki at 10.1.08 1 comments
Labels: Enterprise-Structure, MM, MM--Purchasing
30.12.07
MM Configuration: Maintain Purchasing Organization

Step by step SAP Material Management (MM) Configuration: Maintain Purchasing Organization

Purchasing Organization is an organization unit that has responsibility to company’s purchasing requirements. It negotiates purchasing conditions (price, discount, and other things) with vendors. You can read our previous post to understand more about Purchasing Organization in SAP Enterprise Structure.

We can define Purchasing Organization in a SAP R/3 client with T-code: SPRO.
SAP step-by-step Screen shots of How to maintain a Purchasing Organization are:

.. Read More ..
Posted by Rizki at 30.12.07 0 comments
Labels: Enterprise-Structure, MM, MM--Purchasing
MM Configuration: Maintain Storage Location

Step by step SAP Material Management (MM) Configuration: Maintain Storage Location
A Storage Location is a storage area comprising warehouses in close proximity.

A Storage Location is represented by a plant-unique 4-digit alpha-numeric.

Material stocks can be differentiated, on a quantity basis, within one plant according to storage location.

Storage locations are always created for a plant.

It is possible to store material data specific to a storage location, such as storage bin.

Physical inventories are carried out at storage location level.

.. Read More ..

Sunday 20 November 2011

fico material

Getting started with Smart Forms (Building a simple application)
By Sunitha
Go to transaction “Smartforms”.

Enter a name for the form and click on Create.
Enter a short description for the form.

In this example, we will print a simple text using our form. To create a text, expand “Pages and Windows” à New Page. Select Main Window and Right click on that. Select Create à Text

Give a name to the text and short description.
Also enter the text you want to see on the form.

SAVE and Activate the Smart form.
To know the function module that is generated upon activation of this smart form, click on Environment à Function module name.

Following popup with the function module would appear.

Test the smart form by clicking on Test. You would be navigated to the function builder with the function module defaulting to the one that is generated earlier.

Click on execute.

Since we do not have any parameters to pass on, click on Execute.

Printing Address using Smart Forms
By Sunitha
Go to transaction “Smartforms”.

Enter a name for the form and click on Create.
Enter a short description for the form.

Expand “Pages and Windows” and click on “%PAGE1”. Rename the page to your needs and add a short description to the same.

To display the address on the form, right click on “Main Window”, select Create à Address

Following screen appears.

Enter a name to the Address and add a short description for the same.
You all might be aware that Addresses are stored in the table ADRC. Now pick an address number from that table, add provide the same in the “Address Number” as shown below:

Save and Activate the form.
Now execute the Smart form. The output would be similar as shown below:

Calling Smart Form using Driver Program
By Sunitha
Let us prepare a driver program for the Smart Form that displays the address (Click here to for the demo on ADDRESS). This is a simple demo and doesn’t contain any parameter passing in this example.
Check the function module that is generated when the Smart Form is activated by clicking on Environment à Function Module Name.

A pop up would appear displaying the function module name.

We would use this function module in our driver program to call this function module.
Let us create a driver program with a simple call to the above generated function module:
REPORT Zcall_smartform.
* To call a smart form, we would need to call the function module that
* is generated.
* Calling the generated function module directly is not an efficient
* method. For efficient method, click here.
CALL FUNCTION '/1BCDWB/SF00000359'
* EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
* 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.
Execute the program for the output.

Displaying Graphics using Smart Forms
Go to transaction SE78 (Administration of Form Graphics).

Double-click on “GRAPHICS” node and click on “Import (F5)” to import the image.

Select the file name by using the F4 functionality available. Name your graphic and enter a short description. If you have color image, select the radio button “Color Bitmap image”. Click on tick mark to proceed.

The graphic is imported and is stored in “Business Document Server”.
You can test this by selecting print preview:


Now go to transaction SMARTFORM.
Create a new form and give a short description for the same.

To display an image, right click on Main Window à Create à Graphic


Use F4 help to fill the fields.

Save and activate the workflow.
Test run the smart form, to check the appearance of the graphic.
Passing data to the Smart Forms
Scenario: Let us take a simple scenario of passing Material Number and Material description from Driver program to the Smart Form.
Go to transaction SMARTFORMS and create a Smart Form.
To pass the values from the driver program to Smart Form, we need to define the form interface with the parameters to be passed on.
Click on Global Settings à Form Interface.


Now define the import parameters for MATNR and MAKTX (From table MAKT)

Now create a Text in the Main window to display the above two parameters.

To add a field, we need to click on “Insert Field”.

Enter the field names between the ‘&’ (Ampersand) as shown below:


Similarly create for Description.

Save and Activate the Smart Form. Test run the Smart Form by clicking on Execute.

Enter the values as shown below and click on execute.

Working with Global Definitions and Program Lines
Scenario: To calculate the total seats available using the values “Maximum seats available” and the “Occupied seats”. In this case, we would be defining Maximum Seats and Occupied Seats in the form interface and Seats Available in the Global definitions. We would write some code to calculate Seats available and then print the same.
Procedure: Create a new smart form and, in the Form Interface, define the following two fields: (To know about Form Interface, click here. )

Now click on “Global definitions” :

Now define a variable, SEATS_AVAIL

Now to calculate Seats Available, select Main Window à Create à Flow Logic à Program Lines

Now mention the input parameters as SEATS_MAX and SEATS_OCC and the output parameter as SEATS_AVAIL. Write the code to calculate SEATS_AVAIL.

Now to print these values on the layout, create a text by selecting Main Window à Create à Text:

Save and do the syntax check. Activate the Smart Form.
Test the smart form by clicking on F8. Enter some values for max_seats and avail_seats

Execute the function module.


Working with Secondary Window
Create a Smart Form using the transaction SMARTFORMS.
To create a Secondary Window,
Right click on Page à Create à Window (as shown below)

A secondary window is created.

To position the secondary window to meet our needs, click on Form Painter.

Following screen appears:

The highlighted window in the above screenshot is the secondary window.
Move the secondary window (and even stretch) according to your needs.

To close the above page design, click on Form Painter again.
Now let us write some content in these areas.
Now select the Page à Secondary Window
Right click on Secondary Window à Create à Text

Write some text inside.

Similarly, create some text in the Main window as well.

Save and activate the Smart Form. Test run the Smart Form; you would get the following output:


Demo on Copies Window (Real time scenario)
Scenario: To print three copies of a particular document and the first copy should mention as Customer copy, second one as Bank copy and the third one say College copy.
Create a Smart Form using the transaction SMARTFORMS.
In this demo, we would print in the Copies window whether it is bank copy, company copy or others.
Create a secondary window as shown below:

Select Window type as “Copies Window” as shown below:

Also name your window and give it a proper description. Do not change any other settings.

Adjust the window size using the Form Painter available on the application toolbar.

The variable SFSY-COPYCOUNT would provide us count of the copy whether it is a first copy, second copy and others. We would use this field to print the owner of the copy.
We would define a string, which would hold the name of the copy (bank copy and others) depending on the value of SFSY-COPYCOUNT. Define a variable in the global definition as shown below:

Now select your Copies window, right click – Select Create à Flow Logic à Program Lines

Enter the following code:

Do not forget to enter the variable TEXT in the output parameters.
Now create a text by selecting the Copies window, right click Create à Text.
In this, just enter the field name as shown below by selecting insert field.

Now include a text in the Main window as well with some content.

Save and activate. Test your Smart Form.
In the print preview screen, enter the number of copies as 3

Check the output:


Scenario: In this demo, we would create a small text as shown below with outline numbering as shown below

Go to transaction “SmartStyles”

Enter a style name and click on Create.
Following screen appears:

To create a paragraph, click on folder “Paragraph Formats” and click on Create (as shown in the above screenshot).
Following pop-up appears: Enter a paragraph format name.

Enter a suitable description for your graph and enter the left margin value as 2 CH.

Now select the tab “Numbering and Outline”:
Enter the Top Outline Paragraph as the current paragraph name and select “1,2,3..” from the list for the Numbering Type.

Now create another paragraph format P2 as per the above method.
In the tab “Numbering and Outline” of P2, do the following:
Select the “Top Outline Paragraph” as “P1” and put the left delimiter as “.”. If the left delimiter is not mentioned, the values would be displayed as “11, 12, 13...” instead of “1.1, 1.2, 1.3…”

Also, in the same window, check the “Number Chaining” Box. If this is selected, the parent value would be displayed (like 1.1, 1.2, 2.1,2.2..). If this is not checked, only numbering would appear like 1, 2,3 without the parent number prefixing.
Save and activate your Smart Style.
Now go to transaction “SmartForms”.
Create a Smart Form and create a text in the Main Window:

Select the tab “Output Options” to mention the Smart Style to be used.

Now go to tab “General Attributes”.
Select the icon “Txt Editor” (Though the text could be written directly on this screen, we are avoiding this method for easy understanding to the consultants who are used with SAP Script editor)

Now to change the editor, Click on “Goto” -> Change Editor

Here enter the desired text:

Return to the main screen of the Text. The screen would appear as follows:

Save and activate the Smart Form. Test run the Smart Form. Following would be the output:

Smart Forms - Working with Loop
By Venkat
Step1: Provide the name of the smart form is YDEMO_LOOP on the initial screen of the smart form and meaningful description.
Step2: Now go to Global definitions where we can define the Global data, Types, Initialization and etc.
Define Structure using Types Parameter as shown below. In Types parameters we usually define user defined data types.

Step3: Now define the internal table and work area in Global Data parameter.

Step4: In Initialization parameter, we can write a code as shown below. We have to mention the output result in the output parameter so that we can use it further. Here in this case we are outputting IT_TAB and we are going to use this IT_TAB further in the LOOP in the Flow Logic.

Step5: Create a LOOP statement as shown below.

Step6: Now Loop the internal table.

Step7: To create the character, paragraph formats and Tabs, we use the smart style. The transaction for create smart style is SMARTSTYLE or we can be created the initial screen of SMARTFORMS. Here SMART STYLE is created to define Tab positions for the columns.

Step8: Create a node for PARAGRAPH FORMAT as shown below.

The following screen appears.

Step9: Now define the Tabs as shown below.

Step10: Now Import SMART STYLE in to the SMART FORM as shown below.

Step11: Now create a text element for the loop statement.

Step12: Save and activate the smart form. The output is as shown below.

Designing Tables in Smart Forms
By Venkat
Step1: T-code for smart forms is “SMARTFORMS”. Provide the name of the smart form.

And provide the short text for this smart form “YDEMO_TABLE”.
Step2: Now go to Global definitions where we can define the Global data, Types, Initialization and etc.
Define Structure using Types Parameter as shown below. In Types parameters we usually define user defined data types.

Step3: Now define the internal table and work area in Global Data parameter.

Step4: In Initialization parameter, we can write a code as shown below. We have to mention the output result in the output parameter so that we can use it further. Here in this case we are outputting IT_TAB and we are going to use this IT_TAB further in the Table painter.

Step5: Now we create a Table painter as shown below.


Step6: Now we define number of table columns in %LTYPE1. Here, %LTYPE1 is renamed as LINE as shown below.

Here, in this scenario we have to divide the LINE area into 4 columns as we have to display 5 columns. To draw a line we have to select Draw lines and columns button as shown above.
Step7: Now we have to create Table line for Header and Main area of Table painter as shown below.

Here we have to provide line type. Here, the line type is LINE.
Step8: Provide the text for all columns.

Step9: Repeat the same process to the Main Area too.
Step10: Now Loop the internal table data as shown below.

Step11: Save and activate the smart form. Execute the smart form now. The output is as shown below.


Using Text Modules in Smart Forms
By Jaya Vani B, YASH Technologies
Step1: Go to transaction smart forms.

Step 2: Click on create. The following screen appears:

Step 3: Enter the required text and save.
Now this text can be included in our smart form.
Go back to smart forms initial screen, and create a smart form.

Step 4: In the Main window create a text box.

Step 5:In the text box general attributes TAB select Text module from the drop down list

Step 6: Give the name of the Text Module created and click on COPY button.

Step 7: The text in the text Module will be copied into the Text Editor.

Step 9: Save and activate. Execute and check the print preview.

Using MS Word as Editor in SAP Script and Smart Forms
By Surekha
This document details the procedure in using Microsoft Word as editor in SAP Script / Smart Forms.
In normal case, when you try opening the editor in Smart Forms, the following editor would appear:

Click on the editor button. The following editor appears:

Now to change the above editor to MS Word, do the following:
Go to transaction I18N (Internationalization).
Click on I18N Menu à I18N Customizing à I18N System Configuration (as shown in the screenshot below)

The following screen appears:

If you would like to use MS Word Editor in both Script and Smartforms, then check the both checkboxes as shown below:

Click on Activate.
The following popup appears (related to SAPScript Editor):

Click on Yes. Now the following popup appears (related to Smartforms Editor):

Click on Yes to proceed.
Now the MS Word editor is available for both SAP Script and Smartforms.
Result: In the SmartForms:

In SAP Script:

You can anytime revert to old editor by deactivation MS Word editor option using the transaction I18N.
Achieving control-break statements functionality in Smart Forms
By Phani Diwakar, YASH Technologies
Step1: T-code for smart forms is “SMARTFORMS”. Provide the name of the smart form.

Step2: we can define user-defined structure in TYPES tab in the Global Definitions.

Step3: Define the field string, internal table and global variables in Global Data tab.

Step4: In the Initialization tab,

Step5: In main window, create the loop as shown below.

Step6: Now Loop the internal table.

Create text element in this loop as show below.

Step7: Execute the smart form, the output would be
Step8: suppose, if we want to know the item details sales document wise. To achieve this, we have to write the events in the loop as shown below.

And in the event on sort begin,

In the text element,

Step9: Now execute the smart form, the output would be

Step10: Now the requirement is to sum the net price of all items of sales document. To achieve this,

And in the program lines, we have to add the net price.

In the event on sort end,

In program lines,

Step11: Now execute the smart form, the output would be


Assigning a transport request for the translations related to the text in Smart Forms
By Phani Diwakar Marepalli
Scenario: To assign a transport request for the translations related to the text in Smart Forms.
Procedure: For our demo purpose, let us create a Smart Form with a simple text as shown below:

Now let us maintain a translation for the above text in French. To do the same, go to translation SE63.
Click on Translation -> ABAP Objects -> Other Long Texts

Select Smart Forms from the list, as shown below:

In the following screen, enter the name of the Smart Form created earlier. Also provide the source language and Target Language to be maintained:

Enter the translation for the text in French.

Now to assign a transport request for the above transaction, execute the program RS_LXE_RECORD_TORDER.
Enter the target language, Short Description for the transport request, object type as SSF.

Click on Execute.

As shown in the above screen shot, a transport request is created for the required translations. To check the same, go to transaction SE09 and provide the transport request number:
Converting SMART FORMS output to PDF format
REPORT zsuresh_test.

* Variable declarations
DATA:
w_form_name TYPE tdsfname VALUE 'ZSURESH_TEST',
w_fmodule TYPE rs38l_fnam,
w_cparam TYPE ssfctrlop,
w_outoptions TYPE ssfcompop,
W_bin_filesize TYPE i, " Binary File Size
w_FILE_NAME type string,
w_File_path type string,
w_FULL_PATH type string.

* Internal tables declaration

* Internal table to hold the OTF data
DATA:
t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,

* Internal table to hold OTF data recd from the SMARTFORM
t_otf_from_fm TYPE ssfcrescl,

* Internal table to hold the data from the FM CONVERT_OTF
T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.


* This function module call is used to retrieve the name of the Function
* module generated when the SMARTFORM is activated

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = w_form_name
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = w_fmodule
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.

* Calling the SMARTFORM using the function module retrieved above
* GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
* format of the output

w_cparam-no_dialog = 'X'.
w_cparam-preview = space. " Suppressing the dialog box
" for print preview
w_cparam-getotf = 'X'.

* Printer name to be used is provided in the export parameter
* OUTPUT_OPTIONS
w_outoptions-tddest = 'LP01'.

CALL FUNCTION w_fmodule
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
control_parameters = w_cparam
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
output_options = w_outoptions
* USER_SETTINGS = 'X'
IMPORTING
* DOCUMENT_OUTPUT_INFO =
job_output_info = t_otf_from_fm
* JOB_OUTPUT_OPTIONS =
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.

t_otf[] = t_otf_from_fm-otfdata[].

* Function Module CONVERT_OTF is used to convert the OTF format to PDF

CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
* ARCHIVE_INDEX = ' '
* COPYNUMBER = 0
* ASCII_BIDI_VIS2LOG = ' '
* PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = W_bin_filesize
* BIN_FILE =
TABLES
otf = T_OTF
lines = T_pdf_tab
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 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.

* To display File SAVE dialog window
CALL METHOD cl_gui_frontend_services=>file_save_dialog
* EXPORTING
* WINDOW_TITLE =
* DEFAULT_EXTENSION =
* DEFAULT_FILE_NAME =
* FILE_FILTER =
* INITIAL_DIRECTORY =
* WITH_ENCODING =
* PROMPT_ON_OVERWRITE = 'X'
CHANGING
filename = w_FILE_NAME
path = w_FILE_PATH
fullpath = w_FULL_PATH
* USER_ACTION =
* FILE_ENCODING =
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


* Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
* presentation server

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_bin_filesize
filename = w_FULL_PATH
FILETYPE = 'BIN'
* APPEND = ' '
* WRITE_FIELD_SEPARATOR = ' '
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* IMPORTING
* FILELENGTH =
tables
data_tab = T_pdf_tab
* FIELDNAMES =
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* OTHERS = 22
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Passing Select-Options to Smart Forms
By Venkat
Step1: Create a Structure ZSELECTION in SE11 with following fields.

This structure is similar to the selection-option internal table.
Step2: In smart form ‘ZSELECT_FORM’, create an entry in to TABLES in the Form Interface.

Step3: Define Structures in TYPES tabs in GLOBAL DEFINITIONS.

Step4: In Global Data,

Step5: In program line, write the following code.

Step6: The PERNRS given in the select-option in the driver program is captured in T_SELECT. In program lines, T_SELECT is input to SELECT query and the results are captured in internal table T_0002. We have to mention resulted internal table T_0002 in output parameters for further use.

Step7: Now, loop the internal table T_0002 as shown below.

Step8: Create driver program ‘ZSELECT_FORM_REP’. Write the following code in report.

Step9: Execute the driver program.

Displaying a Smart form as PDF in Enterprise portal using WebDynpro for Java
By Nagaraju Donikena
I have seen many questions on how a smart form should be displayed in portal. To answer this question a person should have both Portal and ABAP knowledge. By giving this basic information I want to make sure that displaying a smart form as PDF is a simple task.
Let me start from R/3 side
Create a smart form. Here I have created a simple smart form which displays “Welcome to SAP Smart forms”.

Now create a function module with the following export parameter:

Place the following code in the function module
data :
lv_fnam type RS38L_FNAM,
gs_control TYPE ssfctrlop,
gs_output_options TYPE ssfcompop,
gs_otfdata TYPE itcoo,
gs_job_output_info TYPE ssfcrescl,
gt_otfdata TYPE STANDARD TABLE OF itcoo INITIAL SIZE 0.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'YNAG_TEST_PDF'
IMPORTING
FM_NAME = lv_fnam
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.
CLEAR gs_job_output_info.
CLEAR gs_job_output_info-otfdata.
MOVE :
'X' TO gs_control-no_dialog,
'X' TO gs_control-getotf,
'LOCL'(047) TO GS_OUTPUT_OPTIONS-TDDEST.
CALL FUNCTION lv_fnam
EXPORTING
CONTROL_PARAMETERS = gs_control
OUTPUT_OPTIONS = gs_output_options
USER_SETTINGS = space
IMPORTING
JOB_OUTPUT_INFO = gs_job_output_info
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.
*Populate OTF data table
LOOP AT gs_job_output_info-otfdata INTO gs_otfdata.
APPEND gs_otfdata TO gt_otfdata.
CLEAR gs_otfdata.
ENDLOOP. " LOOP AT t_outtab-otfdata
DATA: lv_bytes TYPE p,
lv_bin_file type xstring,
gt_pdfdata TYPE STANDARD TABLE
OF tline
INITIAL SIZE 0.
* Convert OTF into PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 255
IMPORTING
bin_filesize = lv_bytes
BIN_FILE = bin_file
TABLES
otf = gt_otfdata
lines = gt_pdfdata
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
Make sure that the function module is marked remote enabled.

With this we are done on the R/3 side.
Continued...
Label printing using Smart forms
By Sushil Choudhary, Tata Consultancy Services
It is believed that SAP has not provided any functionary to create labels in Smart form and this is considered as one of its disadvantage. In this document we will learn how to create labels using Smart form.
To understand this document you should have fair idea about how Smart form works. Also this document will not explain the programming part required to fetch the data which is used to create labels.
Below is the kind of output we expect form this label printing form.

Step1:-
Suppose we have all the data used to create labels available in our Smart form in table IT_FINAL which is exported thorough driver program to Smart form.
Now our requirement is to print the labels in the manner shown below.
Label1 Label2
Label3 Label4
Label5 Label6
i.e. odd labels on left side and even on right. Your requirement might vary from this one and you need to do the changes in layout and logic accordingly.
To implement this requirement cerate 5 secondary window and a main window all of the size of label box, in 1st page of Smart form as shown below.
Last window which print the last label on the page should be the main window, so that the next page will be triggered if more labels needs to be printed.

Step2:-
In the Global Dataà Initialization section of the smart form
Every row in the table IT_FINAL represents 1 label.
As per the current requirement every 6th row will cerate last label on the page and any further row if exist will trigger the next page.
Move every 6th row from IT_FINAL to IT_MAIN and delete the same from IT_FINAL.

Now we have IT_FINAL which contain data to be printed in 5 secondary windows and IT_MAIN which contain data for main window.
Step3:-
Create 5 work areas wa_1, wa_2, wa_3, wa_4, wa_5 of the type of line of IT_FINAL in the global declaration area.
Write code to move 1st 5 rows from IT_FINAL to the above declared work areas and then delete those 5 rows form internal; table as shown in the below screen-shot.

Step 4:-
Now create a text node in every window and pass the label data from wa_1 to text node of 1st secondary window and so on.

Every Node has a condition that it will execute only if the corresponding work area value is not initial.
And instead of window for every node tick the checkbox to draw frame lines, so that frame is printed only if the text node has data to print.

Step 5:-
Now in the Main window create a table node in the table painter create a line type with one row whose width is equal to the width of label to be printed.

Under the data tab pass IT_MAIN.
.
Step 6:-
Now in the Main WindowàMain Area of table create a row with line type created above and in the cell create a text node and pass the corresponding data which needs to be printed in the label.

Step 7:-
Create a command line after table node which will call page1 itself
On the condition that IT_FINAL is not initial.

The reason why command line is used is suppose we have 15 labels to be printed then it will be like Page1->6 Page2-> 6 and Page3->3 labels respectively.
Initially IT_FINAL will have 13 and IT_MAIN will have 2 rows which are for 6th and 12th label. After 12th label is printed main table will not have any more data to print. The command line will check if any more labels are yet to be printed by checking entries in IT_FINAL table. If yes it will trigger 3rd page which print the last three labels.
Output Page1:- Output Page2:-
Output Page3:-

Step-by-step approach in creating a PO Layout using Smart Forms
By Nageshwar, Satyam Computers
Smart Forms:
Transaction Code for Create Smart Forms: SMARTFORMS
Transaction Code for Create Styles (Paragraph Formats, Character Formats, etc.,) Used in Smart Forms: SMARTSTYLES
Steps to be followed while creating Smart Forms:
1. Enter the Form Name (e.x. ZEKKO_EKPO) and Press Create Button.
2. Enter Form Description and Select the “Output options” Tab à Enter the Page Format (e.x. DINA4) and Style (e.x.SF_STYLE_01).
3. Double click the Form interface Left Sub-tree.
4. Enter the Import Parameters (The values that passed from the Print Program into the Form) (e.x. Company Code)
Parameter name Type assignment Reference type Default value Pass value
COMPANY_CODE TYPE EKKO-BUKRS R

5. Double click the Global definitions from the Left Sub-tree.
Assume that we are using two tables EKKO and EKPO in this example:
6. Click the “Types” Tab.
7. Enter the Code as following:

8. Click the “Global data” Tab.
Declare the Internal Tables and Work Areas as follows:

9. Double click the “%PAGE1 New Page” in the Left Sub-tree.

10. Change the %PAGE1 to “FIRST” or any name and Enter the Description (e.x. First Page).
11. Select the Next Page as “FIRST”

12. Select the “Output options” Tab and select the format of the page (Portrait or Landscape) and all other print attributes.

13. Select the “Background Picture” Tab, and Enter the Name, Object and Id of the image file. (Before this step, go to SE78 and import the image first) for the Image which has to be appeared in the Background of the Script.
14. If you want to add any LOGO in the First Page of the Script then right click the “FIRST New Page” in the Left Sub-tree from the Menu option “Create” à select the “Graphic”.

15. Double click the “%Graphic1 New Graphic 1” in the Left Sub-tree.
16. Give the Name and Description (e.x. Graphic = “COMP_LOGO” and Description = “LOGO WINDOW”)for the New Graphic Inserted.
17. Enter Name, Object and ID for the Graphic image and Select the Color grid screen (BCOL) option button in the “General attributes” Tab.

Click - Output options Tab. Set Left and Upper Margins as given:

18. Right click the “FIRST New Page” in the Left Sub-tree and from the Menu option “Create” à select the “Window”.

Double click the “%WINDOW1 New Window1” in the Left Sub-tree and enter the Window name and Description (e.x. Window = “ADD_WIN” and Description = “Address Window”)

Set the Left and Upper margins for the ADD_WIN as follows:

19. Right click “ADD_WIN Address Window” in Left Sub-tree and from the Menu option “Create” à select the “Program Lines”.

20. Enter the Program Lines name and description (e.x. Program Lines = “ADD_FETCH” and Description = “FETCHING COMPANY ADDRESS”)

21. Enter the Input Parameter as COMPANY_CODE and Export Parameter as V_ADRNR in the “General attributes” Tab and write the select query as following:
SELECT SINGLE ADRNR INTO V_ADRNR
FROM T001 WHERE BUKRS EQ COMPANY_CODE.
(Note: Before writing the select query first declare the Variable V_ADRNR in the Global definitions area as follows:
V_ADRNR TYPE T001-ADRNR.

22. Right click the “ADD_WIN Address Window” in the Left Sub-tree and from the Menu option “Create” à select the “Address”.

23. Double click the “%ADDRESS1 New address1” and change the Address name and description (e.x. Address = COMP_ADD and Description = “COMPANY ADDRESS”).

24. Select the Type of the address in the “General attributes” Tab. (Since we are retrieving the Organization address, we selected the first radio button) and in the Address number text box pass the V_ADRNR Variable as &V_ADRNR&.
25. Set the Main window attributes like this: (Setting of window co-ordinates)

26. Right click the “MAIN Main Window” in the Left Sub-tree and from the Menu option “Create” à select the “Program Lines”.

27. Enter the name and description (e.x. Program Lines = “SELECT_RECORD” and Description = “SELECTING RECORDS”).


28. Enter the Input Parameter as COMPANY_CODE and Output Parameter as I_EKKO and I_EKPO in the “General attributes” Tab and write the select query as following:
SELECT EBELN BUKRS
INTO TABLE I_EKKO
FROM EKKO
UP TO 10 ROWS
WHERE BUKRS EQ COMPANY_CODE.
IF SY-SUBRC EQ 0.
SORT I_EKKO BY EBELN.
SELECT EBELN EBELP MENGE NETPR
INTO TABLE I_EKPO
FROM EKPO
FOR ALL ENTRIES IN I_EKKO
WHERE EBELN EQ I_EKKO-EBELN.
IF SY-SUBRC EQ 0.
SORT I_EKPO BY EBELN EBELP.
ENDIF.
ENDIF.
29. Right click “MAIN Main Window” in the Left Sub-tree and from the Menu option “Create” à select the “Complex Section”.

30. Enter the Section name and description (e.x. Section = “PO_LOOP” and Description = “PURCHASE ORDER NUMBER LOOP”) and check the “Repeat processing” check box and select the “Output type” as Unstructured (i.e. select the Unstructured radio button) in the “General attributes” Tab.

31. Select the “Data” Tab.
32. Enter the Internal Table Name as I_EKKO and Work area name as WA_EKKO and sort by the BUKRS and EBELN fields.

33. Right click “PO_LOOP PURCHASE ORDER NUMBER LOOP” in Left Sub-tree and from the Menu option “Create” à select the “Text”.

34. Enter the Text name and description (e.x. Text = “PO_NO_DISPLAY” and Description = “PURCHASE ORDER NUMBER DISPLAY”) and enter the values as in the screen shot

Click the Text Editor

Display the values of Company Code and Purchase Order Number as shown below:

Press Back Button, then Press Save and Check Buttons

35. Right click the “PO_LOOP PURCHASE ORDER NUMBER LOOP” in the Left Sub-tree and from the Menu option “Create” à select the “Template”.

36. Double click on “%TEMPLATE1 New template” and enter the Template name and description (e.x. Template Name = “OI_HEAD” and Description = “ORDER ITEM HEADER”).

Before press save or enter click the “Table Painter Button” which will take you to following screen.
To avoid the “cross line” in the Editor click the “Settings Button”

which will result in the following popup, in which you un-check the “Cross” Check Box and press enter.

37. Split the Cell into Four or into any number of columns you want to display in the script by right clicking the “%C1”.
and press “Back” Button.

38. Select the cv cv of the table to be displayed in the script by the clicking “Select pattern” Button


Selected table pattern
39. Inorder to Display the “Column Text“ for the table columns, insert the Text as shown below:
40. Right click the “OI_HEAD ORDER ITEM HEADER” and from the Menu path “Create” à Select the “Text” .

41. Enter the Text name and description (e.x. Text = “HEAD1” and Description = “COLUMN1”) and enter the values as in the screen shot (i.e. as explained in the point no 34).

42. In order to match the Template Column with the inserted Text “HEAD1 COLUMN1”, select the “Output options” Tab and Enter the Line Number and Column Number in which the above Text has to be printed in the form

Repeat Step No.40 & 41 for all the remaining column headings.


43. The Form is ready with all data upto Table Header. Inorder to populate data under each column header, insert a table.
44. Insert the Table under “PO_LOOP PURCHASE ORDER NUMBER LOOP” by right clicking the same.

45. Enter Table Name and Description (e.x. Table Name = “OI_DISPLAY” and Description = “ORDER ITEM DISPLAY”)

46. Match the column width with the “OI_HEAD ORDER ITEM HEADER” Template (refer step no 38 screet shot no 2) and Select the “Default” radio button and “No page break” check box. Click the “Select pattern” push button to select the table pattern to be displayed.
47. Click the “Data” and populate the Item details by looping the Internal Table I_EKPO into the Work Area WA_EKPO sorted by EBELN and EBELP as shown in the following screen shot

48. Inorder to Display the values for each column, we have to Insert Separate Text for each column under the Table “OI_DISPLAY ORDER ITEM DISPLAY” by Right clicking the same. Enter the Name and Description for the Each Text Inserted under the Table.

Column 1 for Line Item of each Purchase Order – Populate the values for each column as explained in the step no 34.

Inorder to Match the Item values with the Template Header, In the Inserted Text “ORD_ITM_COL COLUMN1” Click the “Output options” and Select the “New line” Check box and Select the “Line type” as “Detail” and also check the “New cell” Check box.


49. Similarly add one Text for the remaining columns.


For the Third Column Text also You need only to select the “New cell” Check box.

50. Before Inserting the 4th Text for the 4th Column, we have to calculate the Amount by Multiplying the Quantity and Unit Price and for the same we have to insert “Program Lines” by Right clicking “OI_DISPLAY ORDER ITEM DISPLAY”

51. Similarly calculate the subtotal by adding the totals and calculate the grand total by adding the subtotals.
Before doing the calculations, declare variables for total, subtotal and grand total in Global definitions.

InputParameters: WA_EKPO-MENGE,WA_EKPO-NETPR & OutputParameters: V_TOTAL,V_SUBTOTAL, V_GRDTOTAL.

52. Now add the 4th Text to display the 4th column in the Form.

For the Fourth Column Text also You need only to select the “New cell” Check box.

53. In order to display the Subtotals (which has been created earlier i.e. refer to step no 52) of all the Line Items for each Purchase Order, we have to Insert a separate Text Under the Table OI_DISPLAY ORDER ITEM DISPLAY” by right clicking the same.

54. Enter the Name and Description for the Inserted Text (e.x. Text = “SUB_TOTAL_DISPLAY” and Description = “SUB_TOTAL_DISPLAY” and populated the value for subtotal.

55. After each purchase order, the Variable V_SUBTOTAL has to be refreshed, In order the clear the subtotal variable we have to insert “Program Lines” by right clicking the “OI_DISPLAY ORDER ITEM DISPLAY”.


56. Enter Name and Description for the Program Lines (%CODE1 New program lines 1) Inserted (e.x. Program lines = “CLR_VAR” and Description = “CLEAR SUBTOTAL VARIABLE”. Input parameters = “V_SUBTOTAL”. Clear the variable as shown below:

57. Now, we have to display the Grand Total (i.e. summation of all the subtotals). Insert “Text” under the “PO_LOOP PURCHASE ORDER NUMBER LOOP” by right clicking the same.

Text “%TEXT1 New text1” gets inserted. Now enter the name and description for the same and also populated the value for grand total

Text = “GRD_TOT_DISP”, Description = “GRAND TOTAL DISPLAY” and Variable V_GRDTOTAL has been populated to display the grand total in the form.





58. Inorder to display the Current Page Number and Total Number of pages in the form we need a separate window and to obtain the same right click the “FIRST First Page” and the insert window.

Window “%WINDOW1 New window 1” get inserted under the first page.

59. Enter the Window name and description (e.x. Window = “PG_WIN” and Description “PAGE NUMBER WINDOW”)

Set the window co-ordinates for page number window “PG_WIN” as given below:

60. In order to display the page numbers we have to insert a “Text” by right clicking the “PG_WIN PAGE NUMBER WINDOW”.

Text “%TEXT1 New text 1” gets inserted and now enter the text name and description.

Text = “PG_DISP”, Description = “PAGE NUMBER DISPLAY” and Page Number gets displayed from the Transparent Table “SFSY”.

61. General Screen Shot of Entire Left Sub-tree:

62. Form output:

63. SOME MORE FURTHER MODIFICATIONS / ADDITIONAL OPTIONS IN THE ABOVE CREATED FORM:
Condition-1: Create second page and company logo should get printed only in the first page and not in the second page. Similarly, company address window should get printed only in the last page and not in other pages.
To create the second page right click the “FIRST First Page” in the left sub-tree.

64. Another page gets inserted with name “%PAGE1 New page 1”.

65. Enter Page name and description for the inserted new page (e.x. Page = “SECOND” and Description = “Second Page”) and set the next page as inserted second page and select the mode as increase counter as shown below:

66. Now change the “FIRST First Page”s Next page as “SECOND” and change the mode as Initialize counter.

67. Now copy the Main, Company Address, Page No windows from “FIRST First Page “ to “SECOND Second Page”.
68. Arrange all the windows under the Main window in both first and second page. In order to restrict the company logo to be printed only in the first page, go to the first page and double click the “LOGO_WIN LOGO WINDOW” and select the “Conditions” tab and Check the “only on first page” Check Box.

69. Output showing the main window got printed only in the first page and not in the second page and so on ….
First Page: With LOGO

Second Page: Without LOGO

70. In order to restrict the Company address to be printed only in the last page and not in the remaining pages, double click the “ADD_WIN ADDRESS WINDOW” in the first page and Check the “only after end of main window” Check Box. Repeat the same process for the second page also.

71. Output showing the address window got printed only in the last page and not in the first page and so on ….
First Page: without company address

Last page (second page): with company address window


72. Condition-2: Purchase order’s whose value is more than 5000 only should get displayed / printed.
Inorder to achieve the same, right click the “PO_LOOP PURCHASE ORDER NUMBER LOOP” and select the “Loop”.

73. “%LOOP1 New loop 1” gets inserted

74. Enter Loop name and description.

75. Select the “Data” Tab Loop the Internal I_EKPO as shown below:

76. In order to check the subtotal value for each purchase order (i.e. purchase order value should be more than 5000), Insert a program lines under the new loop inserted.

77. “%CODE1 New program lines 1” gets inserted

78. Enter the name and description for Program lines. Before calculating the subtotal declare two variables one for total and another for subtotal in Global definitions. Calculate the Subtotal as shown below:

Input parameters: “WA_EKPO-MENGE, WA_EKPO-NETPR, V_TOT”; Output Parameters: “V_VALUE”.

79. Now we calculated the subtotal for each purchase order. Inorder to restrict the display of purchase orders whose values are more than 5000, we need to insert “Alternate” and for the same right click the “PO_LOOP PURCHASE ORDER NUMBER LOOP” and from the menu path create à select the “Alternate”.

80. “%CONDITION1 New alternate 1” gets inserted.

81. Enter Alternate name and description. Select the “General attributes” Tab and Enter the condition of subtotal > 5000 as shown:

82. Now, move “PO_NO_DISPLAY PURCHASE ORDER NUMBER DISPLAY, OI_HEAD ORDER ITEM HEADER, OI_DISPLAY ORDER ITEM DISPLAY, SUB_TOTAL_DISPLAY DISPLAY SUBTOTAL and CLR_VAR New program lines” under the “TRUE” part.

83. In the “FALSE” part (i.e. If subtotal value is less than 5000, then clear the variable), insert program lines and code as shown:

84. Only those purchase order whose value is more than 5000 gets displayed – First Page.

Only those purchase order whose value is more than 5000 gets displayed – Second Page.

85. Condition-3 Each Purchase Order should get printed in a new page. Logo should get printed in the first page along with the first purchase order and similarly, Grand total should get printed in the last page with the last purchase order.
86. Inorder to achieve this, when the first successful purchase order whose value is more than 5000 is found then increase one counter variable by 1 (this is required because the “New page command” should not get triggered in the first page itself”) and for the same we have to insert a “Program lines” under the “TRUE” part of “CHK_COND SUBTOTAL CONDITION”.
Before increasing the counter variable first declare the counter variable in the “Global definitions” part.


Output parameters: V_COUNTER.

87. Inorder to avoid triggering “New page command” in the first page, we have to insert “Command” in the “TRUE” part of “CHK_COND SUBTOTAL CONDITION” by right clicking the same as shown below:

88. “%COMMAND1 New command 1” gets inserted.

89. Enter name and description for the inserted Alternative. Select “General attributes” Tab and check whether for the counter variable is more than 1.

90. If the counter variable is more than 1 means, we got the second successful purchase order whose value is more than 5000. Hence, we can trigger new page command here and for the same right click the “TRUE” part in “NEW_PG NEW PAGE COMMAND” as shown:

“%COMMAND1 New command 1” gets inserted

91. Enter the name and description for Command and select the “General attributes” Tab and Check the “Go to new page” and select the page as “SECOND” as shown below:

92. The following is the output: First Page with company logo and without company address window, first purchase order whose value is more than 5000.

Second page: without company logo and with company address window for the last purchase order whose value is more than 5000.

93. The new PROBLEM we faced when we create the smart form is page number. Total Page Number got displayed as “*” as shown:

94. In order to solve the above problem Double Click the “PG_DISP PAGE NUMBER DISPLAY” and Click the Text Editor.

Upon clicking the text editor it will take you to the following screen:

Go to the menu path Insert à Symbols à New as shown

Which will result you in the following popup and fill the popup as shown.

95. It will takes you to the following screen.

96. Now replace &SFSY-FORMPAGES+4(4CZ)& as &SFSY-FORMPAGES+0(4CZ)&

97. Press back and then check, activate and execute – You can observe that the problem has resolved.