cis-Check BOM (expand BOM, CS12) and inverse check BOM (check upper material, CS15)

Source: Internet
Author: User

1. Check BOM

Call FUNCTION ' Cs_bom_expl_mat_v2 '
Exporting
Capid = pm_capid "application is generally PP01
DATUV = Pm_datuv "is usually the current date of the system
MTNRV = PM_MTNRV "item to expand BOM
mehrs = ' x ' x indicates a multilayer expansion,space means only the first layer is expanded
Werks = Pm_werks "is typically 1000
Importing
Topmat = Selpool
DSTST = DSTST_FLG
TABLES
STB = STB "The expanded BOM is stored in the inner table
Matcat = Matcat "The material containing the component below is stored in the inner table

2. Inverse Check BOM

DATA:IT_WULTB like Stpov occurs 0 with HEADER line,
It_equicat like Cscequi occurs 0 with HEADER line,
It_kndcat like cscknd occurs 0 with HEADER line,
It_matcat like Cscmat occurs 0 with HEADER line,
It_stdcat like cscstd occurs 0 with HEADER line,
It_tplcat like CSCTPL occurs 0 with HEADER line,
It_prjcat like cscprj occurs 0 with HEADER line.

Clear:it_wultb,it_wultb[].
Call FUNCTION ' Cs_where_used_mat '
Exporting
Datub = Sy-datum
DATUV = Sy-datum
MATNR = P_c_matnr
* POSTP = "
* Retcode_only = "
* Stlan = "
MCLMT = ' 00000000 '
Werks = S2_werks
* Importing
* Topmat =
TABLES
WULTB = IT_WULTB
Equicat = It_equicat
Kndcat = It_kndcat
Matcat = It_matcat
Stdcat = It_stdcat
Tplcat = It_tplcat
EXCEPTIONS
Call_invalid = 1
Material_not_found = 2
No_where_used_rec_found = 3
no_where_used_rec_selected = 4
No_where_used_rec_valid = 5
OTHERS = 6.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

cis-Check BOM (expand BOM, CS12) and inverse check BOM (check upper material, CS15)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.