‎2007 Apr 26 10:35 AM
Hi
I have one requirement to check for valid to date for BOM.If search date(Valid-from date) entered by user in selection has already passed the valid to date, then I have to get the latest valid to date in the list and display the material listing for the BOM.Currently if the valid date to date is in past, no materials are displayed.
Please advise .
Thanks
‎2007 Apr 26 10:37 AM
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
CAPID = 'PP01'
<b>DATUV = sy-datum---> here u have to pass Date enterd by the user , this is nothing but Valid Date</b>
MKTLS = 'X'
MEHRS = 'X'
MTNRV = it_matnr-matnr
STLAL = p_stlal (default is 1)
STLAN = p_stlan (default is 01)
STPST = 0
SVWVO = 'X'
WERKS = p_werks
VRSVO = 'X'
TABLES
STB = it_stb
MATCAT = it_matcat
EXCEPTIONS
ALT_NOT_FOUND = 1
CALL_INVALID = 2
MATERIAL_NOT_FOUND = 3
MISSING_AUTHORIZATION = 4
NO_BOM_FOUND = 5
NO_PLANT_DATA = 6
NO_SUITABLE_BOM_FOUND = 7
CONVERSION_ERROR = 8
OTHERS = 9.
check this FM
Regards
Prabhu