Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Two fields in one select options

Former Member
0 Likes
2,855

Hey Gurus,

I am having requirement in which I need to create select option having two different fields (Material/Batch) combinations for input.

I think it's possible to add through table control but how to display it as select option.

Any pointers in this regard will be appreciated.

Hey Gurus,

I am having requirement in which I need to create select option having two different fields (Material/Batch) combinations for input.

I think it's possible to add through table control but how to display it as select option.

Any pointers in this regard will be appreciated.

5 REPLIES 5
Read only

lenastodal
Product and Topic Expert
Product and Topic Expert
0 Likes
2,252

Hi and welcome to the SAP Community!

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself withhttps://community.sap.com/resources/questions-and-answers(if you haven't already), as it provides tips for preparing questions that draw responses from our members. For example, you can outline what steps you took to find answers (and why they weren't helpful) and share screenshots of what you've seen/done. The more details you provide, the more likely it is that members will be able to assist you.

Should you wish, you can revise your question by selecting Actions, then Edit (although once someone answers your question, you'll lose the ability to edit the question -- but if that happens, you can leave more details in a comment).

Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it:https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS. By personalizing your profile with a photo of you, you encourage readers to respond.

Best,
Lena
SAP Community Moderator


Join or subscribe to SAP Community Groups to stay up-to-date, including SAP TechEd Group.
Read only

RaymondGiuseppi
Active Contributor
2,252

You could create a select-options on a technical field built from concatenation of material and batch number with a separator (a character not used in both fields!) but you would have also to handle

  • manage F4 on this field to navigate to a batch search help which returns both material and batch number, concatenate those back with separator
  • Optional : checking validity of concatenated value
  • converting the select-options into an internal table with the 2 fields and use this itab in a FOR ALL ENTRIES

Warning: Beware of collateral effects due to FOR ALL ENTRIES: don't use if empty, insure that no duplicates are wrongly removed by adding primary key of from table in the selected fields.

Read only

0 Likes
2,252

NB: You could also use FM SELECT_OPTIONS_RESTRICT to prevent user using pattern or exclusion (Suggestion: allow only I/EQ to be consistent with a FOR ALL ENTRIES selection)

Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
2,252

Hello lazydeveloper

If you go with raymond.giuseppi proposal, you'd need to make sure that you don't use ranges or patterns in your selection criteria. Otherwise it's not possible to separate material number and batch from the select options.

I'd rather recommend to use two separate select-options for material and batch respectively.

Best regards

Dominik Tylczynski

Read only

2,252

Using two separate select-options works for me