‎2009 Feb 17 6:43 AM
Hi all,
I am using CS03 transaction to display the material BOM. Here i can see the valid from and valid to dates for each item. But in table STPO i can only see the valid from date and vlid to date is not present in this STPO table. From where can i get the valid to date for each BOM item . Is there any function module for this or any table where this gets stored.
Regards,
Sowmya.
‎2009 Feb 17 6:45 AM
‎2009 Feb 17 6:47 AM
Hi Sowmya,
Use this FM CSAP_MAT_BOM_READ it has the VALID_FROM & VALID_TO
CALL FUNCTION 'CSAP_MAT_BOM_READ'
EXPORTING
material = wa_mast-matnr
plant = wa_mast-werks
bom_usage = wa_mast-stlan
VALID_FROM = v_date1
VALID_TO = V_date2
TABLES
t_stpo = t_stpo
t_stko = t_stko
EXCEPTIONS
error = 1
OTHERS = 2.
IF sy-subrc <> 0.
‎2009 Feb 17 7:25 AM
I am using this function module and i get all the BOM items for that material in T_STPO internal table and i am getting one entry in T_STKO internal table which is the material which is expired that is the valid to date is less than that i have given as input valid to for the function module. So will i always get the expired material item details in T_STKO.
Regards,
Sowmya.
‎2009 Feb 20 1:14 PM
‎2009 Feb 17 6:48 AM
Use FM CS_BOM_EXPLOSION_MAT and give Validity date as current date
***BOM explosion
CALL FUNCTION 'CS_BOM_EXPLOSION_MAT'
EXPORTING
CAPID = 'PP01'
DATUV = SY-DATUM
MEHRS = 'X'
MTNRV = WA_MSEG-MATNR
WERKS = WA_MSEG-WERKS
TABLES
STB = I_STB
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
OTHERS = 8.
IF SY-SUBRC <> 0.
ENDIF.
‎2009 Feb 17 6:49 AM
HI,
Try this functional module,
CSAP_MAT_BOM_READ
Sample Code:
data: begin of tstk2 occurs 0.
include structure stko_api02.
data: end of tstk2.
data: begin of tstp2 occurs 0.
include structure stpo_api02.
data: end of tstp2.
data: begin of tdep_data occurs 0.
include structure csdep_data.
data: end of tdep_data.
data: begin of tdep_descr occurs 0.
include structure csdep_descr.
data: end of tdep_descr.
data: begin of tdep_source occurs 0.
include structure csdep_source.
data: end of tdep_source.
data: begin of tdep_order occurs 0.
include structure csdep_order.
data: end of tdep_order.
data: begin of tdep_doc occurs 0.
include structure csdep_doc.
data: end of tdep_doc.
data: flg_warning like capiflag-flwarning.
call function 'CSAP_MAT_BOM_READ'
exporting
material = 'MAT100'
plant = '0001'
bom_usage = '1'
valid_from = '20.12.1996'
valid_to
importing
fl_warning = flg_warning
tables
t_stko = tstk2
t_stpo = tstp2
t_dep_data = tdep_data
t_dep_descr = tdep_descr
t_dep_source = tdep_source
t_dep_order = tdep_order
t_dep_doc = tdep_doc
exceptions
error = 1.
Hope it helps u...
‎2009 Feb 17 6:51 AM
Hi,
Check this table
PLPLAN_PARAM and the field DATUB
thanks\
Mahesh
‎2009 Feb 17 7:09 AM
Hi,
Use this FM,It can help u...
This will be very useful to u r problem....
FU CSAP_MAT_BOM_READ
Regards
Kiran