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 Programming - noninput screen

Former Member
0 Likes
1,081

Hi Folks,

I have a requirement where i need to have check box.When check box is checked screen fields should be enabled else it should be disabled. Please suggest me.

If the checkbox is checked fields should become mandatory.

Please suggest

1 ACCEPTED SOLUTION
Read only

h_senden2
Active Contributor
0 Likes
882

this is possible by in PBO add a module with the LOOP at screen loop.

Loop over all the screen objects and depending on checkbox you can hide the fields, make them obligatory. What ever you want.

regards,

Hans

8 REPLIES 8
Read only

h_senden2
Active Contributor
0 Likes
883

this is possible by in PBO add a module with the LOOP at screen loop.

Loop over all the screen objects and depending on checkbox you can hide the fields, make them obligatory. What ever you want.

regards,

Hans

Read only

Former Member
0 Likes
882

NO check box will not be mandatory(but it shd be in the Screen) as when user wants to change some data then only he will click the check box to(make all fields in editable form).

Hope you understand.

Amresh Panda.

Read only

satsrockford
Active Participant
0 Likes
882

hi

check this sample code

PARAMETERS : p_check AS CHECKBOX USER-COMMAND uc01.

PARAMETERS : p_bukrs TYPE bkpf-bukrs.

AT SELECTION-SCREEN OUTPUT.

IF p_check EQ 'X'.

SET CURSOR FIELD 'P_BUKRS'.

ELSE.

SET CURSOR FIELD 'P_CHECK'.

ENDIF.

regards

Satish

Read only

Former Member
0 Likes
882

Hi,

In the PBO , write these code.


module <module name>
Loop at screen
  if screen-name ne 'CHKBOX'.
    if chkbox = 'X'.
      screen-input = 0.
    else.
      screen-input = 1.
    endif.
  endif.
  modify screen.
endloop.
endmodule.

Read only

0 Likes
882

Thanks for the replies.

But iam not able to default the checkbox in module pool programming

Read only

0 Likes
882

Hi,

I dont understand what u meant for 'Default'.

Read only

Former Member
0 Likes
882

Hi Nishanth,

Understand the below logic and sort your issue.

You need when checkbox is selected then you want the fields to be enabled and when not checked disable.

give name of the checkbox in the screen as checkbox.

PBO

IF checkbox EQ 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZFORMA-qwert'. "screen name of field

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

In PAI

IF checkbox NE 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZFORMA-qwert'. "screen name of field

SCREEN-INPUT = 1.

SCREEN-ACTIVE = 1.

SCREEN-OUTPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

For making your field mandatory double click on out field opens a window in attributes of tha window select program and in the dropdown box of input field select Required that makes the field mandatory.

Cheers!!

VEnk@

Edited by: Venkat Reddy on Nov 4, 2008 3:34 PM

Read only

Former Member
0 Likes
881

PROGRAM ZSRK_025 .

DATA : F1 LIKE VBAP-VBELN,

F2 LIKE VBAP-POSNR,

F3 LIKE VBAP-NETWR.

DATA : CH1,

CH2,

CH3.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

IF CH1 EQ 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'F1'.

SCREEN-INPUT = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF SCREEN-NAME = 'F1'.

SCREEN-INPUT = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

IF CH2 EQ 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'F2'.

SCREEN-INPUT = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF SCREEN-NAME = 'F2'.

SCREEN-INPUT = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

IF CH3 EQ 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'F3'.

SCREEN-INPUT = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF SCREEN-NAME = 'F3'.

SCREEN-INPUT = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

ENDMODULE. " STATUS_0100 OUTPUT

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

*

PROCESS AFTER INPUT.

  • MODULE USER_COMMAND_0100.