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

Parameters

Former Member
0 Likes
665

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

5 REPLIES 5
Read only

former_member491621
Contributor
0 Likes
614

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

Read only

Former Member
0 Likes
614

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

Read only

Former Member
0 Likes
614

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

Read only

Former Member
0 Likes
614

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

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
614

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.