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

Module pool : How to make an Input field enable disable

Former Member
0 Likes
7,811

Hi Experts,

I have an Input field in the screen which will be disable for input at first display but at click of a button I want to make that field enable for input how to do it ?

I made the field disable for input through screen painter now tell me how to make it enable through the program

Regards

Bikas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,849

Hi,

Use this code to enable to take input.

LOOP AT SCREEN.

IF screen-name eq <filedname>.

screen-input = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Regards.

Jagadeesh

Hi Experts,

I have an Input field in the screen which will be disable for input at first display but at click of a button I want to make that field enable for input how to do it ?

I made the field disable for input through screen painter now tell me how to make it enable through the program

Regards

Bikas

11 REPLIES 11
Read only

Former Member
0 Likes
3,849

hiii

use like below code

CASE sy-ucomm.
when 'BUTTON'.
    LOOP AT SCREEN.
       IF screen-name CS 'P_INPUT'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF. 
   ENDLOOP.                          
 ENDCASE.

regards

twinkal

Read only

Former Member
0 Likes
3,849

Hi Bikas,

You can try this using event AT SELECTION-SCREEN OUTPUT.

Please check this code

PARAMETERS: p_ebeln TYPE ekko-ebeln,
           p_check TYPE c AS CHECKBOX USER-COMMAND us.

AT SELECTION-SCREEN OUTPUT.
  IF p_check IS INITIAL.
    LOOP AT SCREEN.
      IF screen-name = 'P_EBELN'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.

    ENDLOOP.
  ENDIF.

Best regards,

raam

Read only

Former Member
0 Likes
3,849

Hi,

The modify screen statement enables you to make modifications on the screen like display/hide...

Syntax

MODIFY SCREEN FROM wa.

Effect

This statement can be used in the statement block after LOOP AT SCREEN only and makes sense only during PBO processing. If FROM is not specified, MODIFY SCREEN modifies the attributes of the current screen element with the values from the predefined screen work area. If a wa work area is specified, its contents are used for the modification.

The wa work area must have the same data type as screen. The name component must contain the name of the current screen element, otherwise the statement is not executed. nweisung nicht ausgeführt. Up to the group1 to group4 and length components, all remaining components of screen and wa must contain either the value 0 or 1. The value 0 deactivates the corresponding field attribute, and 1 activates it.

If MODIFY SCREEN is executed during PBO processing, the modified attributes for the display of the screen affect the current dynpro after PBO processing. The attributes of the screen element of the dynpro are reset to their static attributes at the start of each PBO processing, so that the execution of MODIFY SCREEN during PAI processing does not effect the display of the following screen.

The active component

The active component is used to set the input, output and invisible components at once. At the start of PBO processing, the active component always has the value 1. If active is set to 0 with MODIFY SCREEN, input and output are automatically set to 0 and invisible is set to 1. Other values in input, output and invisible are ignored. Conversely, setting input and output to 0 and invisible to 1 automatically sets active to 0 and a different value in active is ignored.

Modifications in Table Controls and Step Loops

During processing of a table control or a step loop, the changes affect the current line of the table control or the current step loop group. Before the processing of a table control, the change to the attributes of a screen element that is part of a line in the table control does not effect the table control, since the values are transferred from the structure created using CONTROLS. Before a step loop is processed, the change to the attributes of a screen elements that is part of a step loop group affects all groups in the step loop.

Modifications to Tabstrip Controls

If the active component for a tab title of a tabstrip control is set to 0, the whole tabstrip page is hidden.

Example

In the following PBO module, an input field called val is made mandatory and converted to display in the foreground.

MODULE modify_0100 OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'VAL'.

screen-required = '1'.

screen-intensified = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDMODULE.

In your case use screen-active = 1.

Regards,

Subash.

Read only

Former Member
0 Likes
3,850

Hi,

Use this code to enable to take input.

LOOP AT SCREEN.

IF screen-name eq <filedname>.

screen-input = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Regards.

Jagadeesh

Read only

naveen_inuganti2
Active Contributor
0 Likes
3,849

Hi....

You dont make that button disable from screen painter level....

Better to use both disable and anable logics in program itself, With that MODIFY and LOOP AT SCREEN statements.

Thanks,

Naveen Inuganti.

Read only

Former Member
0 Likes
3,849

Hi Do as below in

At Selection-screen.

LOOP AT SCREEN.

IF screen-name eq 's_belnr'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP

Regards

Rajesh

Read only

Former Member
0 Likes
3,849

Hi,

DEMO_DYNPRO_MODIFY_SIMPLE see this standard demo program.

hope it will help...

Read only

Former Member
0 Likes
3,849

Hi,

As you have already made the input field input disabled, so in the PBO module write the below code for input Enable.



Case sy-ucomm.
 when 'BUTTON'. " Function code for the button in capital
  Loop at screen.
    if screen-name CS 'FIELDNAME'.  " Field name in Capital 
  Screen-input = 1.
Modify screen.
Endif.
Endloop.
Endcase.

Regards,

Sujit

Read only

Former Member
0 Likes
3,849

hi,

in field attribues give tick only to the output field. ( it will display the disable field)

oce u click on the buuton write the below code.

in PBO.

LOOP AT SCREEN.

IF SCREEN-NAME = 'FIELDNAME'.

SCREEN-INPUT = '1'.

SCREEN-ACTIVE = '1'.

SCREEN-OUTPUT = '1'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Read only

Former Member
0 Likes
3,849

Hi Bikas.

I would like to suggest a reference,

[SDN - Reference - Box in module pool layout - ENABLE/DISABLE functions|;

Hope that's usefull.

Good Luck & Regards.

Harsh Dave

Read only

Former Member
0 Likes
3,849

Hi,

  • First set the input field property as a disable (I mean remove the mark from the Attributes --> Program --> Input field ).

  • Write the following code in PAI

PROCESS AFTER INPUT.

MODULE ip_enable.

  • Write the following code in report

MODULE ip_enable INPUT.

Case sy-ucomm.

when 'BUTN'.

Loop at screen.

If screen-name = 'INPUT1'.

screen-input = 1. // It enables the input field

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDCASE.

ENDMODULE.

I hope this work...

Regards,

Harish