2013 Jan 31 4:49 PM
Hi everyone.
I have this in my code :
1)
...
PARAMETERS: pa_monat TYPE monat OBLIGATORY,
pa_mon2 TYPE monat,
pa_gjahr TYPE gjahr OBLIGATORY.
...
and i want to put the field pa_mon2 lock for user's written and fill that field with value pa_mon2 = pa_monat + 3 after fill field pa_monat and press enter or F8. Any ideas?
Thanks in advance.
Moderator Message - Basic ABAP question. Read the available documentation.
Message was edited by: Suhas Saha
2013 Jan 31 5:10 PM
Hi Nuno,
You can search the documentation for event AT SELECTION SCREEN.
Always try to search on google/SCN before creating a thread.
http://help.sap.com/saphelp_40b/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/content.htm
2013 Jan 31 5:31 PM
AT SELECTION SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN_NAME = 'pa_mon2'.
SCREEN-INPUT = 0.
pa_mon2 = pa_monat + 3.
MODIFY SCREEN.
ENDLOOP.
Reward points if useful.
Thanks and regards,
Bharathi
2013 Jan 31 5:59 PM
Hi Nuno,
Plz try the below code. Revert in case of issues:
tables screen.
PARAMETERS: pa_monat TYPE monat OBLIGATORY,
pa_mon2 TYPE monat modif id 1,
pa_gjahr TYPE gjahr OBLIGATORY.
at selection-screen output.
IF pa_monat is initial.
LOOP AT screen.
if screen-group1 = '1'.
screen-input = '0'.
endif.
modify screen.
ENDLOOP.
ENDIF.
at selection-screen.
pa_mon2 = pa_monat + 3.
Thanks
Vivek
2013 Jan 31 8:28 PM
Hi Nuno,
use the following code.
*initialization event block
INITIALIZATION. "event block start
LOOP AT SCREEN. "loop at screen table till u get field name pa_mon2
IF SCREEN-NAME = 'pa_mon2'.
SCREEN-INPUT = '0'. "change input attribute to 0 making it non-editable by user
MODIFY SCREEN. "update changes to screen table
EXIT. "exit loop
ENDIF.
ENDLOOP.
""""""""""""""""""""""""""
*at selection-screen event block
AT SELECTION-SCREEN. "event block starting
IF pa_monat IS NOT INITIAL. "check if pa_monat is filled with any data
pa_mon2 = pa_monat + 3. "change value of pa_mon2
ENDIF.
*press F8 for the processing after this
2013 Jan 31 9:53 PM
There is NO-DISPLAY option for PARAMETERS. But if the field is just calculated, why does it have to be a parameter at all? Doesn't make sense...
Overall I agree that is is a basic question. Please read ABAP Help and do some research before posting.