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

Dynamic input screen

Former Member
0 Likes
1,283

Hi gurus,

I have made a screen with field structure and field data.

Field structure will be filled with the name of a structure and data will be the data that corresponds with this structure(not delimited but filled up with spaces),

When double clicking it or with keypress I show a popup with the data from the data line in the corresponding structure with FM POPUP_GET_VALUES.

This works perfectly only when I have a nested structure subroutine 'prepare_and_check' gives back an error when executing FM 'DDIF_FIELDINFO_GET'. When we set marker ALL_TYPES to 'X' it works but that's not really an option.

Does anybody knnow how I can show a nested structure on screen as a popup with input fields?

kind regards,

Wim van Erp

10 REPLIES 10
Read only

Clemenss
Active Contributor
0 Likes
1,164

Hi Wim,

please explain: You pass tabname and fieldname pairs in FIELDS. If the fieldname is itself an include structure, you will have to resolve the fields of this structure. How do you create the FIELDS table?

RTTS classes

CL_ABAP_STRUCTDESCR

CL_ABAP_TABLEDESCR

CL_ABAP_TYPEDESCR

may be helpful here.

Regards,

Clemens

Read only

Former Member
0 Likes
1,164

When passing it through like:

CALL FUNCTION 'DDIF_NAMETAB_GET'

EXPORTING

tabname = lv_tabname

all_types = 'X'

TABLES

dfies_tab = lit_dfies

EXCEPTIONS

not_found = 1

OTHERS = 2.

then lit_dfies got all fields of the structure.

regards,

Wim

Read only

Former Member
0 Likes
1,164

So....where is the problem?

Max

Read only

Former Member
0 Likes
1,164

The problem is that when I try to show it inputable on screen with FM POPUP_GET_VALUES it doesnt work.

How do I show these collected values on screen?

Read only

MarcinPciak
Active Contributor
0 Likes
1,164

Try using fm DD_DICTIONARY_TO_NAMETAB to get field details (i.e names) for strucutre even nested one. Then move those ro FIELDS tab in POPUP_GET_VALUES.

This should help.

Regards

Marcin

Read only

0 Likes
1,164

Thanks for all the input but that is not the problem

I have a structure I want to post only it is a structure with a nested table in it.

When trying to post it with POPUP_GET_VALUES it does not work.

Try running structure SHLP_DESCR through it.

Read only

0 Likes
1,164

Hi

So you have have a structure having a field is a type table?

Max

Read only

0 Likes
1,164

Wim,

I tried and found out that POPUP_GET_VALUES just does not work as expected if you have nested structures. Even if you pass only simple type fields, the function fails. I could not find an OSS note on this, as there are too many for this function.

No solution now, sorry.

Regards,

Clemens

Read only

0 Likes
1,164

Wim, SAP does not really allow complex dynamic screens (possible for simple ones, ugly view for complex ones like the SE37 test data parameters input tool). If you really want to develop a tool for creating dynamic "beautiful" screens, you'll spend much much time, I don't advise it (and SAP neither, as they say EXPORT DYNPRO abap statement is reserved internally)

Are you really using an infinite number of structures? If it's a little number, can't you create the screens manually?

Read only

0 Likes
1,164

... so if you really want full dynamic, you can use an ALV grid object. I created something for generic input using string type for the fields and then using

CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'
      EXPORTING
        called_for_tab   = lv_tabname
        called_for_field = lv_fieldname

for F1 handling,

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
      tabname    = lv_tabname
      fieldname  = lv_fieldname

for F4,

CALL FUNCTION 'RS_CONV_EX_2_IN'
    EXPORTING
      input_external                     = <output>
      table_field                        = ls_tabfield
*   CURRENCY                           = CURRENCY
    IMPORTING
      output_internal                    = <inputt>

for input conversion

METHOD convert_output.
  DATA:
    lr_data       TYPE REF TO data,
    lv_type       TYPE char01,
    lv_length_out TYPE sytleng.
  FIELD-SYMBOLS:
    <any>         TYPE ANY.
  DESCRIBE FIELD  iv_input OUTPUT-LENGTH lv_length_out TYPE lv_type.
  CREATE DATA lr_data TYPE c LENGTH lv_length_out.
  ASSIGN lr_data->* TO <any>.
  IF iv_input IS NOT INITIAL AND iv_input <> space OR lv_type <> 'T'.
    WRITE iv_input TO <any>.
  ENDIF.
  rv_output = <any>.
ENDMETHOD.

for output conversion.

In reality, a bit more complicated with styles and events, but works nicely.

Regards,

Clemens