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

[Help] Multiple Selection at Select Options.

Former Member
0 Likes
664

People, I've coded following Select Options:

DATA: g_created TYPE zapomatxref-erdat,

g_modif TYPE zapomatxref-aedat,

g_matnr TYPE zapomatxref-pr1_material.

SELECT-OPTIONS: s_creat FOR g_created,

s_modif FOR g_modif,

s_matnr FOR g_matnr OBLIGATORY.

Thing is, when I execute the program and hit the Multiple Selection, an error pops up saying "Fill in all required fields".

I know it goes through PBO validating that OBLIGATORY so I can't enter the multiple selection screen.. But is there a way to enter the multiple selection screen without changing the OBLIGATORY adition ?

Thanks in advance.

PS: This is an executable program, not module pool. Also I want to enter Mutliple Selection screen without filling s_matnr.

5 REPLIES 5
Read only

sjeevan
Active Contributor
0 Likes
636

Yes that obligatory attribute makes it annoying.

Try including this before you perform your display form.


if s_matnr[] is initial.
message I000(8Z) with 'Please enter a material number'.
endif. 

Read only

Former Member
0 Likes
636

But the OBLIGATORY addition still won't let me show the multiple selection first.. and if I remove this addition, then the information message does not stop the process if user hits execute and no matnr is entered. That's why I'm having this issue..

Read only

Former Member
0 Likes
636

Guys, solved the problem. You have to remove the OBLIGATORY addition and set the following code.

("Percentage symbol" below is the traditional percentage centessimal symbol we know, the mozilla wont let me insert it...)

TOP Include:

 
CONSTANTS: c_per002     TYPE c    VALUE '(percentage symbol)002'.

MAIN PROGRAM:

 
AT SELECTION-SCREEN ON s_matnr.

  IF sy-ucomm NE c_per002.

    IF s_matnr[] IS INITIAL.
      MESSAGE e025(ycapo).
    ENDIF.

  ENDIF.

START-OF-SELECTION.

PS: c_per002 comes to be the sy-ucomm value when hitting Multiple Selection Button at Selection Screen.. As any action validates the whole screen, you just set a clause when you don't want to validate if sy-ucomm not equals (different from) c_per002.

Read only

sjeevan
Active Contributor
0 Likes
636

What message class did you use? Or you created your own?

Read only

Former Member
0 Likes
636

sorry.. forgot to explain that..

message class ycapo , number 025: "Fill in MATNR field" or something like that.