简体   繁体   English

在 SELECT 语句中获取格式化的值

[英]Get formatted value in SELECT statement

Is there a way to get the "Value" field from a Select statement?有没有办法从 Select 语句中获取“值”字段? When using the SELECT in ABAP, I get the value like in "Value Unconverted".在 ABAP 中使用SELECT时,我得到的值类似于“未转换的值”。

Is there a special FM that I have to use to get the "Value" field?我必须使用特殊的 FM 来获取“值”字段吗?

在此处输入图片说明

From the SELECT statement directly is not possible, you need to convert the value.直接从 SELECT 语句是不可能的,需要转换值。

Go to SE11, enter the table name PROJ .转到 SE11,输入表名PROJ Double click the data element PS_INTNR , double click the domain PS_PSPNR .双击数据元素PS_INTNR ,双击域PS_PSPNR There is a field 'Routine', here you should find the value KONPD .有一个字段 'Routine',在这里您应该找到值KONPD This is the conversion exit used for converting between input (unconverted, ie what are stored in DB) and output values (converted, ie what are shown on the screen).这是用于在输入(未转换,即存储在 DB 中的内容)和输出值(已转换,即屏幕上显示的内容)之间进行转换的转换出口。

If you double click this field, it will give you the function modules you can use for converting:如果双击此字段,它将为您提供可用于转换的功能模块:

  • CONVERSION_EXIT_KONPD_INPUT
  • CONVERSION_EXIT_KONPD_OUTPUT

The bad news you have to convert each value separately, so if the data is in an internal table LOOP/ENDLOOP and call the FM.坏消息是您必须分别转换每个值,因此如果数据在内部表LOOP/ENDLOOP并调用 FM。

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

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