Application Development 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: 

Input/Output Field's disablitiy and screen refreshing

Former Member
0 Kudos
642

Hi,

I have got two questions;

1. I have an input/output field named TextBoxId. I set this field's display as invisible from layout manually. But, I want to change this field's display as visible in program. How can I do?

2. I have a screen such as '0100'. I am changing one of the input/output field's text in a module. Later, I want to show changes at screen 0100. And I am calling this screen again as CALL SCREEN '0100'. This helps me, but I want to show changes without calling this screen again. Is there any command such as refresh screen?

1 ACCEPTED SOLUTION

Former Member
0 Kudos
88

Hello,

1. Try using the "invisible" field on the screen option. See example below:

***************

loop at screen.

if screen-name = 'TextBoxId'.

screen-invisible = '0'.

screen-active = '1'.

modify screen.

endif.

endloop.

***************

Use the value '0' in the invisible field to make the screen field visible again. And I just like using the active option to ensure that the field is up and ready to go...

2. It looks like you are on screen 0100 and then as you move on to other screens, the text of a field on 0100 is changed. If that is the case, then the only way to display that screen again will be to call it again. You could always have the field appear on the following screen if the text was changed as a warning to the user. You could do this by adding the same value and text fields to the next screen, but have them invisible. And if the text or value has changed, then make them visible with the example above from your first question...

Hope this helps...

5 REPLIES 5

Former Member
0 Kudos
89

Hello,

1. Try using the "invisible" field on the screen option. See example below:

***************

loop at screen.

if screen-name = 'TextBoxId'.

screen-invisible = '0'.

screen-active = '1'.

modify screen.

endif.

endloop.

***************

Use the value '0' in the invisible field to make the screen field visible again. And I just like using the active option to ensure that the field is up and ready to go...

2. It looks like you are on screen 0100 and then as you move on to other screens, the text of a field on 0100 is changed. If that is the case, then the only way to display that screen again will be to call it again. You could always have the field appear on the following screen if the text was changed as a warning to the user. You could do this by adding the same value and text fields to the next screen, but have them invisible. And if the text or value has changed, then make them visible with the example above from your first question...

Hope this helps...

0 Kudos
88

Hi,

I realized that I only need SCREEN-ACTIVE attribute not SCREEN-INVISIBLE. Then, I made as you had said. But the condition that I want is not okey. My code is;

-



*SCREEN '0200'.
PROCESS BEFORE OUTPUT.
MODULE SETACTIVITYSCREEN0200.
 
PROCESS AFTER INPUT.
MODULE INSERTCALISAN.

-



MODULE SETACTIVITYSCREEN0200 OUTPUT.
  LOOP AT SCREEN.
    IF SCREEN-NAME = 'CALISAN_ID'.
      SCREEN-ACTIVE = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
ENDMODULE.

-



MODULE INSERTCALISAN INPUT.
  ..
  ..
  ..
      CALISAN_ID = ID_NUMBER_CALISAN.
      LOOP AT SCREEN.
        IF SCREEN-NAME = 'CALISAN_ID'.
          SCREEN-ACTIVE = '1'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
ENDMODULE.

*CALISAN_ID is the name of Input/Output name.

*ID_NUMBER_CALISAN is same type of CALISAN_ID.

-


At this program CALISAN_ID is inactive all the time, I want it to be active after input.

What is the wrong that I made?

0 Kudos
88

Hi Huseyin

I think you should get more familiar with dialog (screen) programming. You can refer to standard SAP course BC410 (Dialog Programming) if available.

But more or less I can explain somethings. In dialog programming flow logic is executed. That is; first PBO of a screen is executed, after the screen is displayed and whenever the user triggers an action PAI is triggered.

User triggers an action by;

- pressing a button;

- pressing a defined function key;

- pressing enter,

- checking a checkbox or a radiobutton for which a function code is assigned,

- selecting a value from a listbox for which a function code is assigned

- etc...

So, let's interpret your program:

->At PBO, you deactivate the field.

->Screen is displayed with inactive 'CALISAN_ID' field

->You trigger an action

->PAI is executed. The field's activeness attribute is set to 1

<u>Here's the problemeatic point:</u>

when the screen PAI finishes its execution, if you do not explicitly call or leave to a new screen, it call the screen set at the attributes tab of the screen (which is generally the screen itself). That means PBO of the screen will again be executed. Let's go on tracing.

->PBO is executed and your field becomes inactive again at MODULE SETACTIVITYSCREEN0200.

->Screen is displayed with inactive 'CALISAN_ID' field

So, you should set activeness of the field at PBO considering your conditions.

<b>Summarizing; PBO is always executed before the screen is displayed and PAI block is executed whenever the user triggers an action at the screen.</b>

About your second question. ABAP screen processing is not like others. To activate/deactivate a field depending upon conditions, you should always consider the flow logic. To illustrate; you can set function codes for checkboxes, radiobuttons and input fields (of type listbox). Then whenever a checkbox is checked PAI is triggered and if no explicit call to another screen occurs PBO is triggered where you can control the checkbox value to set any attribute of a field.

*--Serdar

0 Kudos
88

Thanks,

I solved problem inserting some control conditions into PBO.

dani_mn
Active Contributor
0 Kudos
88

1. As you have set the field's property manully as invisible, Now you can't make it visible during rum time

You should set the field's property to be visible in layout, then you will be able to make field visible or invisible during program.

2. If you are on the same screen and making changes to screen fields in program then they will be automatically display in screen after PBO, but if you are on different screen and making changes to first screen then you have to call the first screen again as you are doing.

Regrads