Application Development 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: 

BAPI for creation of Equipment BOM

Former Member
0 Kudos

Which BAPI is used for creation of Equipment BOM?

2 REPLIES 2

Former Member
0 Kudos

HI,

'CSAI_BOM_CREATE' can be used to create the Equipment BOM, only thing is you need to pass STLTY as 'E' in structure STKOB, this will create equipment BOM,

Chk the below links you might get an idea.

/people/prakash.singh4/blog/2005/05/15/explode-boms-in-enterprise-portal-using-htmlb-tree--part-1-abap

http://help.sap.com/saphelp_erp2005/helpdata/en/d1/2e4114a61711d2b423006094b9d648/frameset.htm

Reward points for the helpful answer.

Regards,

Sudheer

Former Member
0 Kudos

Hi,

Check this Code, it works:

DATA ecsin  TYPE csin.

DATA estkob TYPE stkob .

DATA estzub TYPE stzub .

DATA astlnr TYPE stzub-stlnr .

DATA t_stpob TYPE STANDARD TABLE OF stpob WITH HEADER LINE .

PARAMETERS: pa_equnr TYPE equnr DEFAULT '1500037'. "Your Equipment.

START-OF-SELECTION.

   ecsin-equnr = pa_equnr.

   ecsin-stlty = 'E' .

   ecsin-stlan = '4' .

   ecsin-werks = 'C002'. "Your Plant.   

   ecsin-datuv = '20130101'.

   estkob-bmein 'ST'.

   estkob-bmeng = 1.

   estkob-stktx = 'TEST'.

   t_stpob-stlty = 'M' .

   t_stpob-postp = 'L' .

   t_stpob-idnrk = '000000000040002882'. "Your Component.

   t_stpob-meins = 'ST' .

   t_stpob-menge = 1 .

   t_stpob-rvrel = 'X' .

   APPEND t_stpob .

   t_stpob-menge = 2.

   t_stpob-idnrk = '000000000040002877'. "Your Component.

   APPEND t_stpob.

   CALL FUNCTION 'CSAI_BOM_CREATE'

     EXPORTING

       ecsin                    = ecsin

       estkob                   = estkob

       estzub                   = estzub

*   FL_NO_CHANGE_DOC         = ' '

*   FL_COMMIT_AND_WAIT       = ' '

*   FL_NO_COMMIT_WORK        = ' '

*   FL_ALE                   = ' '

     IMPORTING

*   FL_WARNING               =

       astlnr                   = astlnr

     TABLES

       t_stpob                  = t_stpob

     EXCEPTIONS

       error                    = 1

       OTHERS                   = 2.

   IF astlnr IS INITIAL.

****ERROR.

   ENDIF.

   IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

   ENDIF.

Regards,

Sergio.