2009 Nov 13 6:41 AM
Hi all.
In module pool programming, I have a field which has default value. when I click on clear push button the value in the field shoul d get cleared & it should get enabled , so that user can enter value in it. Pls let me know how to do this.
cheers,
sami.
Hi,
Lets say that the FCODE of the clear button is CLEAR and let the name of the field be t_clear
And let the field group of t_clear be 'A'.
IN PAI write the below code.
IF SY-UCOMM = 'CLEAR'. "checking whether the clear button is clicked.
t_clear = ' '. "clearing the field
LOOP AT SCREEN.
IF GROUP1 = 'A'. "checking the group of the field
screen-input = 1. "making the field editable
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
2009 Nov 13 6:47 AM
AT SELECTION SCREEN.
IF ( ur condition)
LOOP AT SCREEN.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
u can clear it with in the condition
2009 Nov 13 7:21 AM
Hi,
try this..
If sy-ucomm = 'Fcode for clear button'
clear the field.
loop at screen.
if screen-name = field name.
screen-input = 1.
modify screen.
endif.
endloop.
endif.
2009 Nov 13 7:26 AM
Hi,
Please assign FCODE to the button say DISA
In PAI
If gv_okcode eq 'DISA'.
Clear Field.
Loop at screen
if screen-name eq 'FIELD_NAME'.
screen-input = 0.
Modify Screen.
endif.
endloop.
endif.
Regards,
Nabheet
2009 Nov 13 9:36 AM
Hi Sami,
<li>Lets say you have one field .That is Date field. Field name for date is PA0001-BEGDA.
<li>Screen flow logic.
<li>Program code which contains PBO and PAI Modules code.
PROCESS BEFORE OUTPUT.
MODULE init_1001.
FIELD pa0001-begda.
PROCESS AFTER INPUT.
FIELD pa0001-begda.
MODULE user_command_1001.
Thanks
Venkat.O
REPORT sapmztest_notepad.
TABLES:pa0001.
DATA:ok_code TYPE sy-ucomm.
DATA:flag.
*&---------------------------------------------------------------------*
*& Module INIT_1001 OUTPUT
*&---------------------------------------------------------------------*
MODULE init_1001 OUTPUT.
IF flag IS INITIAL.
pa0001-begda = sy-datum. "Default date to system date
ENDIF.
IF pa0001-begda IS INITIAL.
LOOP AT SCREEN.
IF screen-name = 'PA0001-BEGDA'.
screen-input = '1'. "It makes screen field in display mode
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-name = 'PA0001-BEGDA'.
screen-input = '0'."It makes screen field in change mode
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. " INIT_1001 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_1001 INPUT
*&---------------------------------------------------------------------*
MODULE user_command_1001 INPUT.
CLEAR ok_code.
ok_code = sy-ucomm.
IF ok_code = 'CLEAR'.
CLEAR pa0001-begda. "Clear date value when you click on Clear button
flag = 'X'.
ENDIF.
ENDMODULE. " USER_COMMAND_1001 INPUT
2009 Nov 13 10:29 AM
Hi,
Lets say that the FCODE of the clear button is CLEAR and let the name of the field be t_clear
And let the field group of t_clear be 'A'.
IN PAI write the below code.
IF SY-UCOMM = 'CLEAR'. "checking whether the clear button is clicked.
t_clear = ' '. "clearing the field
LOOP AT SCREEN.
IF GROUP1 = 'A'. "checking the group of the field
screen-input = 1. "making the field editable
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
2009 Nov 13 2:36 PM
Moderator message - Please do not ask or answer basic questions or questions that could be solved by simply searching - thread locked
Rob
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |