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

Passing a multi-value parameter into an ABAP routine for use in a where clause

A reader hopes to pass a multi-value parameter, but it isn't working. Expert Matt Billingham offers some suggestions.

SAP 4.6C
I need to pass a multi-value parameter into an ABAP routine for use in a where clause, but I cannot get it to work. The list can get pretty long, but my example is only with two.

Working hard coded solution:

WHERE IWERK IN ('1010', '1020').

Non-working attempt:

PARAMETERS:

PARAM_2(255) TYPE C.
{PARAM_2 set many ways, but all failed}...
WHERE IWERK IN (PARAM_2).

The dynamic where clause should be defined, for example, thus:

DATA: WHERE_TAB(72) OCCURS 10 WITH HEADER LINE.

Construct your where clause by appending lines to this table. You will have to split your clause into lines no longer than 72 characters in length.

Then use ...WHERE (WHERE_TAB).

This was last published in September 2004

Dig Deeper on SAP ABAP

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