‎2009 May 08 6:12 AM
Hello Gurus,
I have the below scenario:
In my Z report I am having a select-options for material selection(s_matnr) on selection screen and that is a mandatory field.
But when the user tries to enter the multiple single values by pressing the arrow icon present near the select-option it gives an error message " Fill in all the required entries "
So the problem is I cannot enter the multiple single values in select-options until and unless I fill s_matnr-low. Once I fill s_matnr low then its allowing to enter multiple standard values.
And as per the requirement the user must be able to enter the multiple single values in s_matnr even if s_matnr-low is not populated.
Is this the standard functionality of SAP or there is some way out of it?
<removed_by_moderator>
Thanks in advance.
Edited by: Julius Bussche on May 8, 2009 7:59 AM
‎2009 May 08 6:25 AM
Even I faced the same problem . I was told that it is a standard functionality . Because when you run the program in debugging mode and click on multiple selection you get an error . And we are not even able to catch the sy-ucomm value . I found it to be a standard functionality .
‎2009 May 08 6:19 AM
‎2009 May 08 6:22 AM
Hi,
You can handle it exclusively.
select-options: b for vbak-erdat." OBLIGATORY." a for vbak-vbeln,.
start-of-selection.
if b is initial.
message e000(ooo) with 'error'.
endif.
‎2009 May 08 6:25 AM
Hello Dande,
Thanks for your suggestion .
But as per the usr requirement we need the mandatory field indicator (tick mark) in that select option.
So I cannot remove it from being an obligatory field.
Any other solution would be welcome.
Thanks in advance.
‎2009 May 08 6:59 AM
Hi,
at SELECTION-SCREEN OUTPUT.
loop at screen.
screen-required = '2'.
MODIFY SCREEN.
endloop.
this code will show the mandatory field symbol
‎2009 May 08 6:25 AM
Even I faced the same problem . I was told that it is a standard functionality . Because when you run the program in debugging mode and click on multiple selection you get an error . And we are not even able to catch the sy-ucomm value . I found it to be a standard functionality .
‎2009 May 08 6:31 AM
Hello Nibha,
Thanks for your reply but in order to convince the user that this is the standard functionality can anyone please suggest any standard transaction which is having the select-options field as mandatory and same problem occurs in standard transaction also.
Thanks for your help.
‎2009 May 08 7:17 AM
Hi,
When you make the field as obligatory then user need's input the value before performing any action(Like entering the values in the extension part) as it is the standard functionality. To want to over come you can remove the OBLIGATORY statement from the declaration. And use the event AT SELECTION-SCREEN ON <FIELD>.
AT SELECTION-SCREEN ON S_MATNR.
IF S_MATNR[] IS INITIAL.
MESSAGE e016(pn) WITH 'Enter Material Number'.
ENDIF.
‎2009 May 08 7:21 AM
Hello Avinash,
Thanks for your suggestion. But as mentioned by me above it is not possible to remove the field from being mandatory.Any other alternate solution would be welcome.
Thanks for the help.
‎2009 May 08 7:33 AM
Hi Sachin,
Remove the obligatory addition from the declaration of the select-option....
see the example code below .... it will help you resolve your issue for sure.....
TABLES : scarr, sscrfields. " Tables sscrfields is a must to be declared in your code...
SELECT-OPTIONS : carrid FOR scarr-carrid.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name CS 'CARRID'.
screen-required = 2. " though obligatory is not mentioned it will give you tick mark
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'ONLI'.
IF carrid IS INITIAL.
CLEAR sscrfields.
MESSAGE 'Fill in all required entries' TYPE 'E'. " once the user press F8 then only this error
" message will be displayed
ENDIF.
ENDIF.Regards,
Siddarth
‎2009 May 08 7:40 AM
Hi,
No...there is no option.
Sorry i missed to add oner check in above post ...
AT SELECTION-SCREEN ON S_MATNR.
IF S_MATNR[] IS INITIAL AND SY-COMM NE '%226'. --> Function code extension Button you need to check in debug mode
MESSAGE e016(pn) WITH 'Enter Material Number'.
ENDIF.
‎2009 May 08 7:09 AM
Hi Sachin,
I Seen many Tcodes with many fields as Select options, But never seen any with mandatory field.
Lets try to convince the user in this way,
SAY user it is not possible, if user says anything then ask him to show any reference in SAP.
he need to drop his hopes by seaarching all the time. If he shows then we will have a reference,,,
If not, then also no problem.
Thanks & regards,
Dileep .C
‎2009 May 08 7:40 AM
Hi sachin,
Below is the sample code for ur requirement,
report ztest.
TABLES mara.
DATA l_tab_mara TYPE TABLE OF mara.
SELECT-OPTIONS s_mat FOR mara-matnr OBLIGATORY.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
screen-required = '2'.
MODIFY SCREEN.
ENDLOOP.
START-OF-SELECTION.
IF NOT s_emp IS INITIAL.
SELECT *
FROM
mara
INTO TABLE
l_tab_mara
WHERE
matnr IN s_mat.
ELSE.
MESSAGE 'Fill In All Required Entry Fields' TYPE 'I'.
EXIT.
ENDIF.
Thanks and Regards,
seshu.