BOM Component Item Repeat check

Source: Internet
Author: User

All right, today's colleague let's make a BOM component material repeat check

There are many examples on the web that were checked at the time of the preservation, using badi:bom_update

I also tried, trouble .... Very troublesome ... Especially when repeating a check:

  METHODIf_ex_bom_update~change_at_save. DATA: Z_stpobTYPE  Line  ofCs01_stpob_tab, Z_stpob1TYPE  Line  ofCs01_stpob_tab, G_tab_bstpobTYPE TABLE  ofStpob, G_tab_astpobTYPE TABLE  ofStpob, Z_msgTYPE string, Count1TYPEI, Count2TYPEi.DATA: Lv_timeTYPEi. Count1=lines (DELTA_STASB). Count2=lines (DELTA_STPOB).*IF count2 > Count1.    LOOP  atDelta_stpob intoZ_stpob. APPENDZ_stpob toG_tab_bstpob. IFSy-tabix <=Count1. ELSE. APPENDZ_stpob toG_tab_astpob. ENDIF. Endloop. LOOP  atG_tab_astpob intoZ_stpob. CLEAR: Lv_time. LOOP  atG_tab_bstpob intoZ_stpob1WHEREIDNRK = z_stpob-IDNRK. Lv_time= Lv_time +1. Endloop. IFLv_time >1. concatenateZ_msg'Project'Z_stpob-posnr'Component Duplication/'  intoz_msg. ENDIF. Endloop. MESSAGEZ_msgTYPE 'E'. RETURN.*EXIT.  EndMethod.

Later, the debug standard program, found a very suitable place:

Function: Cs_bt_stpob_update

Add segment check logic at the beginning of the program

OK, check it out ... Each input line component, will check ... Perfect

BOM Component Item Repeat check

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.