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

Material BOM

Former Member
0 Likes
1,396

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.

8 REPLIES 8
Read only

Former Member
0 Likes
1,256

Hi Soumya,

U may use the FM 'CS_BOM_EXPL_MAT_V2'

Read only

Former Member
0 Likes
1,256

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.

Read only

0 Likes
1,256

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.

Read only

0 Likes
1,256

hi can anyone tell me how to find the expired items in BOM.

Read only

Former Member
0 Likes
1,256

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.

Read only

Former Member
0 Likes
1,256

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...

Read only

former_member222860
Active Contributor
0 Likes
1,256

Hi,

Check this table

PLPLAN_PARAM and the field DATUB

thanks\

Mahesh

Read only

Former Member
0 Likes
1,256

Hi,

Use this FM,It can help u...

This will be very useful to u r problem....

FU CSAP_MAT_BOM_READ

Regards

Kiran