Application Development 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: 

Problem in clearing the fields

Former Member
0 Kudos

Hello all,

I am having a screen in my module pool program. There are some mandatory fields in that screen. I have a button 'clear'. but when I am trying to clear those fields its asking me to fill all the details. But I want it to be done even if some fields are not filled.

waiting for the help.

Bhaskar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Give the button Function code as Exit function.

Regards

Karthik D

11 REPLIES 11

Former Member
0 Kudos

Give the button Function code as Exit function.

Regards

Karthik D

0 Kudos

Thanks for the suggestion. I have already done that. Still not working

0 Kudos

Hi,

Remove the mandatory functionality. Check the fields for initial values using code.

Thanks,

Sri.

0 Kudos

@sri and ragavendra

I have tried it. But still giving the custom message which I have written when I am trying to clear. Is ther any other way ?

0 Kudos

Hi,

Create a module AT EXIT-COMMAND.

MODULE clear AT EXIT-COMMAND.

Now in F01 write the code for clearing there.

CASE sy-ucomm.
 WHEN 'F_CLEAR'.
 CLEAR : field1,
               field2,
               field3.
ENDCASE.

Hope it helps.

Thanks,

Sri.

0 Kudos

Thank U. Its working

Former Member
0 Kudos

Hi

Remove the Mandorty option for the field and use the recommanded options.for validation implement the code.

Regards,

raghu

MarcinPciak
Active Contributor
0 Kudos

Instead of making them mandatory you can make them recommended . It will provide this tick mark in field, suggesting the user that he/she should enter value there but will allow to leave them unfilled.

To do that go to field attributes -> tab Progam -> dropdown Input -> choose recommened

I have tried it. But still giving the custom message which I have written when I am trying to clear. Is ther any other way ?

Where did you place your custom message? Can you show us your code both in program na screen flow?

Regards

Marcin

0 Kudos

Marcin,

I have written the code for clearing the fields in PAI like

case sy-ucomm.

when 'fcsave'

" save the data.

when 'fcclear'.

clear : zlogin-userid,

zlogin-pswd.

endcase.

Thank u very much for the answer.

0 Kudos

No problem, but I think 10 points in this case should go to Sri , as he gave you the answer you needed, right?

I will be still satisfied with 6 though

Regards

Marcin

0 Kudos

Thats the spirit

reassigned