1

In a SAP database there are values formatted as PxDTyH where x is the number of days and y is the number of hours. A value like P2DT0H is 2 days + 0 hours. I can see that via SE16:

Data in database, screenshot from SE16

Unfortunately, this is exactly displayed like that to the user, "3" corresponds to the index in the database (not seen in the screenshot above). Time displayed to user

I'd like to see it displayed

  • without the index (changing the options "show keys within drop-down lists" did not have an effect)
  • instead of the technical name P2DT0H I'd like to see "2 days and 0 hours" (or similar)

Is there a way to process the data before it gets displayed in the combo box? The developers can't change the format in the database because it would change the API.

FYI: I'm just a tester, I don't know how to code in ABAP, but from knowledge of other programming languages, I'd say that the data can be converted before it's displayed. I don't need a fully-fledged answer, just a pointer to a SAP hook or event which enables writing a conversion function.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
  • Is this an SAP standard table or a custom one (usually with Y or Z at the beginning of its name)? If it is a standard table, could you provide the name of it? – Jagger Sep 30 '16 at 12:40
  • @Jagger: the table is /OURNAMESPACE/TABLENAME, so it's not a SAP standard table. – Thomas Weller Sep 30 '16 at 12:41
  • Your desired output is 'P2DT0H' without the leading '3'? – futu Sep 30 '16 at 15:15
  • 2
    The short answer is: 'Yes'. More information is needed to give you a possible solution. It might be an option to add a text table to generate the descriptions in the drop down or it might be necessary to create logic to fill the dropdown programmatically. The complete data model and description of the the screen the field is used in (e.g. standard/custom) would help. – Gert Beukema Sep 30 '16 at 17:56
  • @Thomas Then if it is a custom table then the program that displays this data has also to be a custom one. Ergo, one can easily change the way this data is displayed in the combo box. – Jagger Oct 01 '16 at 12:00

1 Answers1

1

Probably, conversion routines can be an option for you. What you should do is to:

  1. Take your domain (which is used for PxDTyH values) or create new one specially for this.
  2. Create FM with name CONVERSION_EXIT_%NAME%_OUTPUT, and put conversion logic in there. Mandatory parameters INPUT and OUTPUT should exist.
  3. Enter the %NAME% into Convers.routine field in domain properties.
  4. Enable Check conversion exits checkbox in user parameters.

More info is here.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
  • This sounds great. Unfortunately I'll leave the company and it won't be implemented while I'm here, so I can't judge whether this will have fixed the issue. – Thomas Weller Oct 20 '16 at 09:29