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

F1 Function (technical information) at runtime for a parameter

Former Member
0 Likes
1,537

Hi,

I have created a program which generates a selection screen dynamically and then runs it via submit.

I would like to get the technical information of a parameter at runtime in the called program.

For exapmle: The technical information I want for P_123 is SPFLI-CONNID.

I do not want the RTTI method describe_by_data solution, as it returns only the absolute_name, type_kind (C), length(16), decimals(0), which is not useful to me. I need smth like the F1 help, TABLENAME-FIELD.

Is there any function to do this? Or some FIND FIRST OCCURRENCE OF p_123 IN (top_include instead of table)?

Thank you guys!

BR,

Matei

1 ACCEPTED SOLUTION
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
1,392

Hello,

At runtime your P_123 has the type S_CONN_ID (data element from the ABAP Dictionary) and that is returned by the RTTI.

Why do you need to know more? Normally, it is not relevant how the type was defined, but what the type is.

If you really need to know how it was defined, let' say by "TYPE spfli-connid" or by "TYPE s_conn_id" or ..., I'm afraid you have in fact to do some static code analysis, something like

READ REPORT top_include INTO prog.

CONCATENATE LINES OF prog INTO str.

CONDENSE str.

FIND REGEX 'p_123 TYPE (...)' IN str IGNORING CASE SUBMATCHES ...

or use the SCAN command or ...

Horst

8 REPLIES 8
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
1,393

Hello,

At runtime your P_123 has the type S_CONN_ID (data element from the ABAP Dictionary) and that is returned by the RTTI.

Why do you need to know more? Normally, it is not relevant how the type was defined, but what the type is.

If you really need to know how it was defined, let' say by "TYPE spfli-connid" or by "TYPE s_conn_id" or ..., I'm afraid you have in fact to do some static code analysis, something like

READ REPORT top_include INTO prog.

CONCATENATE LINES OF prog INTO str.

CONDENSE str.

FIND REGEX 'p_123 TYPE (...)' IN str IGNORING CASE SUBMATCHES ...

or use the SCAN command or ...

Horst

Read only

0 Likes
1,392

Thank you for your quick answer Horst,

I already started debugging to see what happens at F1 help Was also useful

I need to know the tablename and the field of the parameter as they are in the F1 help, because I need to save them in a database which contains a rsparams kind of structure.

For example: I EQ MARA MATNR 1000036

                    I EQ MARC WERKS 1000 ...

These will be used later in order to update those fields.

I will test your solution in a few moments.

Thank you again!

Read only

0 Likes
1,392

I also started debugging F1 and also played with CALL FUNCTION 'DYNPRO_FIELD_GET' ....

In fact, somewhere there must be a function module that fills the structure that is used for the technical information after F1. Some more debugging should find it. In the end, I guess better than my above "solution".

Above I forgot that it is about Dynpro-Fields, where the relevant information is in fact stored somewhere. This is different to pure ABAP fields, where you don't have the information.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,392

There are a few function modules (not released) to retrieve selection screen parameters and their "ddic type". For instance, RS_REPORTSELECTSCREEN_INFO, SELOPTS_AND_PARAMS. RTTI does not retain the table/structure and component, only the underlying type (data element S_CONN_ID in your case)

Read only

0 Likes
1,392

Thank you Sandra!

Read only

Former Member
0 Likes
1,392

You may use the secret help-id statement:

DATA: lv_help_id TYPE string.

DESCRIBE FIELD p_123 HELP-ID lv_help_id.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
1,392

Yes, that should do it.

And not secret. There's even an example under DESCRIBE FIELD.

I thought that would return the name of the DE too, but no it doesn't.

Give the points to Shai, no wait, I'm close to diamond ...

Read only

0 Likes
1,392

Horst Keller wrote:

I thought that would return the name of the DE too, but no it doesn't.

That's the reason it's secret...