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

BOM

Former Member
0 Likes
1,008

Friends,

My requirement is to display all components related to a top level material. To acheive the same I have written the below code. Although the material i have given in the parameter option has components associated with it in the plant 'HP', nothing is displayed for me.

Please review the code below & help me identify the problem.

data : i_stb type standard table of STPOX,

wa_stb like line of i_stb.

parameters p_MTNRV type mara-matnr.

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

  • MEHRS = 'X'

  • mmory = '1'

MTNRV = p_mtnrv

  • auskz = ' '

  • capid = 'PP01'

  • datuv = sy-datum

  • emeng = '1.000'

  • stlan = '1'

  • stpst = '0'

werks = 'HP'

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

CONVERSION_ERROR = 8

OTHERS = 9

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID NUMBER SY-MSGNO

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

ENDIF.

loop at i_stb into wa_stb.

write 😕 wa_stb-IDNRK.

endloop.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
868

Here is how I have called it in my programs, and it works good.



  call function 'CS_BOM_EXPL_MAT_V2'
       exporting
            capid                 = 'PP01'
            mehrs                 = 'X'
            datuv                 = sy-datum
            mtnrv                 = matnr
            werks                 = werks
            emeng                 = menge
       tables
            stb                   = stpox
       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.



Regards,

Rich Heilman

6 REPLIES 6
Read only

Former Member
0 Likes
868

Hi Usha,

check out my following weblog.

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

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
869

Here is how I have called it in my programs, and it works good.



  call function 'CS_BOM_EXPL_MAT_V2'
       exporting
            capid                 = 'PP01'
            mehrs                 = 'X'
            datuv                 = sy-datum
            mtnrv                 = matnr
            werks                 = werks
            emeng                 = menge
       tables
            stb                   = stpox
       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.



Regards,

Rich Heilman

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
868

Hi,

Multi level items are exploded only if one of the Import parameters in the function module is checked. I forgot which one but you can refer to the following code for the function module which gave me multi level bom explosions.

Check this link for more information.

Read only

Former Member
0 Likes
868

Friends,

I have tried with all options suggested.

I am getting the following error

"Object Z_KM_BOM_DISP of class RE and language EN"

where Z_KM_BOM_DISP is my program name.

Regards,

Usha

Read only

0 Likes
868

Friends,

Previously I have posted the incomplete error msg,

I am getting the following error

"Object Z_KM_BOM_DISP of class RE and language EN"

does not exist

where Z_KM_BOM_DISP is my program name.

Regards,

Usha

Read only

Former Member
0 Likes
868

Friends,

The problem is now solved which was basically due to the wrong input for BOM Usage parameter.

Regards,

Usha.