简体   繁体   English

如何将 f4 帮助字段中的所有可能值获取到 ABAP 中的内部表中?

[英]How to get all possible values from the f4 help fields into an internal table in ABAP?

so my goal is to generate some data with certain fields.所以我的目标是生成一些具有某些字段的数据。 My idea was to get all possible values from the field and then randomly picking values for my data.我的想法是从字段中获取所有可能的值,然后为我的数据随机选择值。

So I want for example the possible values of a currency field:所以我想要例如货币字段的可能值: 在此处输入图像描述

I need to access all the values from the first column我需要访问第一列中的所有值

在此处输入图像描述

So i can move them to an internal table and randomly pick.所以我可以将它们移动到内部表并随机选择。

How can i move the possible values of a filed into an internal table?如何将字段的可能值移动到内部表中?

I will need to do this multiple times from different tables, so a unified method would be great.我需要从不同的表中多次执行此操作,因此统一的方法会很棒。

You can use F4IF_FIELD_VALUE_REQUEST function module for getting search help values.您可以使用 F4IF_FIELD_VALUE_REQUEST function 模块获取搜索帮助值。 You can use this function for currency like below:您可以将此 function 用于如下货币:

call function 'F4IF_FIELD_VALUE_REQUEST'
exporting
  tabname = 'T001'
  fieldname = 'WAERS'
  suppress_recordlist = abap_true
tables
  return_tab = it_return
exceptions
  field_not_found = 1
  no_help_for_field = 2
  inconsistent_help = 3
  no_values_found = 4
  others = 5.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM