11-05-2007 6:52 PM
Hi Guys,
Can anybody tell me how to provide a Selection option Field with combined Period and Year in MM/YYYY Format?
Thanks,
Gopi.
11-05-2007 7:12 PM
11-05-2007 7:15 PM
Hi
Use the S031-SPMON or S021-SPTAG field for this
check the fields correctly in the S031 and SO21
Regards
Anji
11-05-2007 7:15 PM
11-05-2007 7:23 PM
11-05-2007 8:10 PM
Hi Rich,
when i had done Validation for s_spbup ,i was not able to find any values in the structure even after entering the data in it?
Can u tell me how to solve this one?
here is the code.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) TEXT-003 for field s_BUDAT.
SELECT-OPTIONS : s_BUDAT for MKPF-BUDAT .
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) TEXT-004 for field s_SPBUP.
SELECT-OPTIONS : s_SPBUP for OIAQB-spbup .
SELECTION-SCREEN: END OF LINE.
At Selection-Screen on s_BUDAT.
Perform Validate_GRDATE.
Form Validate_GRDATE.
If ( s_BUDAT[] is Initial ) and ( s_SPBUP[] is Initial ).
MESSAGE e999 WITH
'Either GR Date or GR Period must be Entered'(058).
Endif.
EndForm.
I am filling the data in the selection option s_SPBUP even after filling when i kept the code in Debug mode i was not able to see the data in the selectio option s_SPBUP.
Thanks,
Gopi.
11-05-2007 8:12 PM
Hi Gopi,
Change your below code and see the result
At Selection-Screen on s_BUDAT.
to
<b>At Selection-Screen.</b>
Regards,
Atish
11-05-2007 8:12 PM
You need to put
<b>At Selection-Screen .</b>
instead of the
<b>
At Selection-Screen on s_BUDAT.
</b>
Regards,
Naimesh Patel
11-05-2007 8:22 PM
Hi Atish,
Can u tell me How to validate this Selection-Option field s_SPBUP?
Thanks,
Gopi.
11-05-2007 8:25 PM
Hi Gopi,
Do you want to validate it against some table or want to validate for some value?
Regards,
Atish
11-05-2007 8:30 PM
Hi Atish,
I have to Validate with respect to MKPF-BUDAT field .
Thanks,
Gopi.
11-05-2007 8:37 PM
Hi Gopi,
In real life scenarios you generally don't validate all the entries in the select options. Even SAP don't validate them. Either you check it for initial value or you validate any one entry. As in your case it is a period which can be any period . For eg material has there master table MARA. For period you don't have such table. It can be any period.
So I don't think you need to validate it. If you still want to validate, validate for the values that any one entry should be valid period, that to if SAP is not taking care of the same.
Regards,
Atish
11-05-2007 8:37 PM
You can do like this
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) TEXT-003 for field s_BUDAT.
SELECT-OPTIONS : s_BUDAT for MKPF-BUDAT .
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) TEXT-004 for field s_SPBUP.
SELECT-OPTIONS : s_SPBUP for OIAQB-spbup .
SELECTION-SCREEN: END OF LINE.
* At Selection-Screen on s_BUDAT. " << Commented
AT SELECTION-SCREEN. " << ADDED
Perform Validate_GRDATE.
Form Validate_GRDATE.
If ( s_BUDAT[] is Initial ) and ( s_SPBUP[] is Initial ).
MESSAGE e999 WITH
'Either GR Date or GR Period must be Entered'(058).
Endif.
EndForm.
Regards,
Naimesh Patel
11-05-2007 8:40 PM
Hi Satish,
Can u tell me atleast how to Validate The Period and Year of this field
S_SPBUP .somebody may enter invlalid Period and Invalid Year then i have to validate so in this type of cases how to cvalidate?
Thanks,
Gopi.
11-05-2007 7:16 PM
I found something similar..
REPORT ZTEST_NP.
parameters: p_mon type AD01PERIOD.
write: p_mon.
Internally P_MON holds like 2007011 current period.
and prints like 011/2007.
May it will helpful to you..!!
Regards,
Naimesh Patel