-1

I am in a ABAP report and want to display a Message (information message). By using the addition of 'WITH' and &1, &2 I can include variables and so on. But how is it with field names or field labels. Some users have set their SAP Gui to displaying the names, some labels. How can I display field name/field label depending on the users setting?

Code:

Message-No.: 123 
This is the message called &1 and here comes my field name or label &2 .

MESSAGE i123 WITH 'MessageTest' **'fieldname' or 'fieldlabel'**

I am not sure about the part in between ** **. Depending on the users setting (Utilities --> Settings --> Data Browser --> Keyword) either fieldname is shown or fieldlabel.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
FirstProg1
  • 11
  • 3
  • 2
    I don't understand. Could you post a [complete, minimal and reproducible code](https://stackoverflow.com/help/minimal-reproducible-example) of what you tried? And eventually an example or screenshot. Thank you. – Sandra Rossi Feb 11 '20 at 13:27
  • These settings are reserved to `SE16` which is to browse table contents, and is usually reserved to technical people. You have two questions, how to read this setting, and how to get the label of a table column. The second one is already answered [here](https://stackoverflow.com/questions/31547643/abap-data-dictionary-field-description). Remains the first question. – Sandra Rossi Feb 11 '20 at 19:13
  • give samples of what you get and what you want to get (as-is -> to be) – Suncatcher Feb 12 '20 at 07:48
  • May my field name is called d_exmp1 and its field label is called Example 1. Sooo if the user has set 'fieldname should be shown', I want to implement it variable depending on the settings – FirstProg1 Feb 12 '20 at 08:05
  • I see 3 distinct questions here: retrieving the setting (I wouldn't advise using it), retrieving field labels and actually placing field labels in a message. Which one are you having trouble with? – Zero Feb 13 '20 at 10:40

1 Answers1

1

(Utilities --> Settings --> Data Browser --> Keyword)

This setting should work in Data Browser (mostly ALV grids/tables) and not everywhere. Only superusers (people who know how to check what those fields are) should be using that setting to see fieldnames instead of labels. It is wasteful feature to implement. I can't imagine a normal user operating a program with technical names like BWSCL and then having trouble understanding a message with a label.

Anyways, if you decide to do it, you need table field RSEUMOD-TBMODE (select by username):

  • 'X' - technical names
  • ' ' - labels

Based on your question, I assume you know how to get the labels and put them into a message.

Zero
  • 1,562
  • 1
  • 13
  • 29