Skip to Content
author's profile photo Former Member
Former Member

Dialog programming - how to set text of a box at runtime?

Hi,

I'm in a middle of visual (dialog) programming in ABAP and have few related questions.

1. I have (few) boxes on my screen and I wish to set its text (that's the one which appear in the left upper corner of the box) dynamicaly at runtime depending on what details are shown within the box.

Is it possible, and if yes - could someone share his/her knowledge here?

2. Is it possible to dynamicaly change the position of the visual element (for example, box) on the screen? I successfuly manipulate the visibility of the box, but can't manage the position of the boxes rest ot the screen. Is it possible and how?

Many thanks in advance.

Regards,

Ivaylo Mutafchiev

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Nov 22, 2005 at 03:38 PM

    Hi,

    You cannot change the position of the screen elements dyanmically at runtime..

    Abdul

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 22, 2005 at 03:23 PM

    For you first question,

    
    * This program demonstrates how to dynamically add text to
    * a box/frame at runtime.
    
    report zrich_0005 .
    
    **  Make sure that the box/frame is set as OUTPUT and the name
    **  of the box/frame is BOX_NAME.
    
    parameters: p1 radiobutton group grp1 default 'X',
                p2 radiobutton group grp1.
    
    data: box_name(30) type c.
    data: ok_code type sy-ucomm.
    
    start-of-selection.
    
      call screen 100.
    *&---------------------------------------------------------------------*
    *&      Module  STATUS_0100  OUTPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    module status_0100 output.
      set pf-status '0100'.
    *  SET TITLEBAR 'xxx'.
    
      if p1 = 'X'.
        box_name = 'P1 was pressed'.
      elseif p2 = 'X'.
        box_name = 'P2 was pressed'.
      endif.
    
    endmodule.                 " STATUS_0100  OUTPUT
    *&---------------------------------------------------------------------*
    *&      Module  USER_COMMAND_0100  INPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    module user_command_0100 input.
    
      case ok_code.
    
        when 'BACK'.
          set screen 0.
          leave screen.
      endcase.
    
    endmodule.                 " USER_COMMAND_0100  INPUT
    
    
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2005 at 04:24 PM

    Hi,

    As we don't have option to change the text at run time using the screen for Buttons.

    What can you do is create different push buttons with the corresponding texts and keep them in invisible mode.

    Depending on the scenario you can make visible one button and others can be in invisible.

    You can do this with less no. of options only.

    Regards,

    Anu.

    Add a comment
    10|10000 characters needed characters exceeded

    • You can change the text of buttons inside the dynpro.

      
      
      report zrich_0001.
      
      type-pools: icon.
      
      parameters: p_va02 radiobutton group grp1 default 'X'
                                 user-command check,
                  p_va03 radiobutton group grp1.
      selection-screen pushbutton 40(20) gocfg user-command gocfg.
      
      
      
      
      at selection-screen .
      
        case sy-ucomm.
          when 'GOCFG'.
            call transaction 'VA02'.
        endcase.
      
      start-of-selection.
      
      
      
      at selection-screen output.
      
      * Write pushbutton text
        if p_va02 = 'X'.
          write icon_CHANGE as icon to gocfg.
          concatenate gocfg 'Go to VA02' into gocfg
                      separated by space.
      
        elseif p_va03 = 'X'.
          write icon_DISPLAY as icon to gocfg.
          concatenate gocfg 'Go to VA03' into gocfg
                      separated by space.
      
        endif.
      
      

      REgards,

      Rich Heilman

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2005 at 09:40 AM

    Guys,

    Thanks to all of you for your replies.

    Rich, your posts helps me a lot.

    Abdul, I suppose I should choose another way but not dynamic move.

    Thanks again.

    Regards,

    Ivaylo

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.