Q
Problem solve Get help with specific problems with your technologies, process and projects.

Employee details in a Smart Form

I am having a problem creating a Smart Form. I pass an internal table with a few employee numbers but I do not know how to loop this internal table from the Smart Form. FYI, this internal table has a few lines for the same employee number.

The question is: How do I make a command in the Smart Form to instruct the form to print the details only related...

to the employee? Example: The internal table has this entry:

EMPLOYEE PLAN AMOUNT
000900 B001 56.00
000900 B002 100.00
000901 B001 10.00

Now I would like the Smart Form to print details of employee 00090, followed by employee 000901, without having to loop at the first employee details. I am stuck and need your help with this.

Any ideas would be much appreciated.

There are a number of ways to do what you desire. Using your example, the answer may depend on whether you are interested in showing a separate set of details from both records related to the same employee '900' (all plan-specific info, such as each corresponding amount).

Let's assume that's your objective here. If so, one option is to add some logic to your initialization section to build a new global index table -- that is, a basic single-column table -- with a unique record for each employee.

Then create a loop in your MAIN window using that new table. Within that loop set up another sub-loop using the original table with the WHERE clause picking up the unique record(s) tied to each employee and showing the relevant sub-detail, as the sub-loop processes all plans tied to that employee. In the outer loop you could show any general info for that employee, and perform other formatting, such as page-breaks to show each employee's info on a separate page.

This was last published in March 2005

Dig Deeper on SAPscript and Smart Forms

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close