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

Screen, dynamic fields

Former Member
0 Likes
2,783

Hello!

I'm developing a screen and I would like to display several radio buttons, according to some selection parameters from the database! The idea is to query the tables that I need and then display several options to the user! I don't know the number of lines that will be return, it deepens on the content of the tables! So the only way is to dynamically add the radio buttons!

Is it possible to add radio buttons on the fly to a screen (se51)? If yes can any one help me?

Best Regards

1 ACCEPTED SOLUTION
Read only

gerd_rother
Active Participant
0 Likes
1,906

Hi,

Unfortunately you cannot add radio-buttons on the fly.

What you can do is to use a table control (or a step-loop). You define an internal table containing, say, radio-button flag and a text which you display in that table control. By inserting/deleting lines in that table you can add/remove radio-buttons.

Regards,

Gerd Rother

8 REPLIES 8
Read only

gerd_rother
Active Participant
0 Likes
1,907

Hi,

Unfortunately you cannot add radio-buttons on the fly.

What you can do is to use a table control (or a step-loop). You define an internal table containing, say, radio-button flag and a text which you display in that table control. By inserting/deleting lines in that table you can add/remove radio-buttons.

Regards,

Gerd Rother

Read only

0 Likes
1,906

hi,

you can generate a dynamic selection-screens by creating a report at runtime. its quite complicated depending on your goals, you have to "concatenate" the sourcecode of the report into a text variable and then use the command "insert report".

greetings,

dsp

Read only

0 Likes
1,906

Hello! And push buttons? cant I change the text of the text button only assigning a variable (for example) to the name of the text button, and change it at run time?

The idea is to pass a iTable to a function and fill the push buttons text with the text contained in one of the fields of the iTab

I would like to replicate the behavior of the transaction LM01, where they are able to pass the button name to the button at run time! I tried to fiend the code that they use but with no success.

Can any one help me?

Best Regards

Read only

gerd_rother
Active Participant
0 Likes
1,906

Hi,

You can modify the pushbutton text if you define the pushbutton as an output field (in the screen field attributes). Then the text in the screen painter will become some underscores instead of a static text.

Just refer to the screen painter documentation.

Regards, Gerd Rother

Read only

Former Member
0 Likes
1,906

Hi,

here a short code:


TABLES: MARA, EKKO.
* Material
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: COMMENT 06(23) T_MARA.
PARAMETERS:       X_MARA RADIOBUTTON GROUP PRI1 DEFAULT 'X'
                  USER-COMMAND DUMMY.
SELECTION-SCREEN: COMMENT 35(15) T_MATNR.
SELECT-OPTIONS    S_MATNR FOR MARA-MATNR MODIF ID DS0.
SELECTION-SCREEN: END   OF LINE.
*
* Bestellung
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: COMMENT 06(23) T_EKKO.
PARAMETERS:       X_EKKO RADIOBUTTON GROUP PRI1.
SELECTION-SCREEN: COMMENT 35(15) T_EBELN.
SELECT-OPTIONS    S_EBELN FOR EKKO-EBELN MODIF ID DS1.
SELECTION-SCREEN: END   OF LINE.
*
AT SELECTION-SCREEN OUTPUT.
*
  CLEAR: T_MATNR, T_EBELN.
*
  IF X_MARA = 'X'.
    T_MATNR = 'Materialnummer'.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 EQ 'DS0'.
        SCREEN-INPUT     = '1'.
        SCREEN-INVISIBLE = '0'.
        MODIFY SCREEN.
      ENDIF.
      IF SCREEN-GROUP1 EQ 'DS1'.
        SCREEN-INPUT     = '0'.
        SCREEN-INVISIBLE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
*
  IF X_EKKO = 'X'.
    T_EBELN = 'Bestellnummer'.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 EQ 'DS0'.
        SCREEN-INPUT     = '0'.
        SCREEN-INVISIBLE = '1'.
        MODIFY SCREEN.
      ENDIF.
      IF SCREEN-GROUP1 EQ 'DS1'.
        SCREEN-INPUT     = '1'.
        SCREEN-INVISIBLE = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
*
INITIALIZATION.
*
  T_MARA  = 'Materialien?'.
  T_EKKO  = 'Bestellungen?'.
*
START-OF-SELECTION.
*
*
END-OF-SELECTION.

hope it helps.

regards, Dieter

Read only

0 Likes
1,906

Thank you Gerd Rother ! You solved my problem!

Just one final question to end this topic!

In my report I have to hide and show several fields in order to display only th required information! The problem is that when I hide one field (for example one button), and if that element is the only one in that line, all the line is removed, rising all the screen one line up!

This behavior is very anoint in my RF screen! Is there any way to avoid this behavior?

Best Regards

Read only

0 Likes
1,906

Hi,

In the screen attributes just switch on flag 'Switch off runtime compress'.

Regards, Gerd Rother

Read only

0 Likes
1,906

Solved!

Tks!

Best Regards