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

Issue with function module 'CS_BOM_EXPL_MAT_V2'

0 Likes
2,818

Hi experts,

Could someone help me with FM CS_BOM_EXPL_MAT_V2? I`m calling this function with the parameters below, because i need to find lines where the stlal column is equal to 2:


CALLFUNCTION'CS_BOM_EXPL_MAT_V2'

      EXPORTING

      datuv                       = '01.01.1900'

      ehndl                       = '1'

      emeng                     = t_emeng

      mktls                       = 'X'

      mehrs                       = 'X'

      mtnrv                       = wa_mat-matnr

      stlal                       = '2'

      stlan                       ='05'

      svwvo                       = 'X'

      werks                       = ''

      vrsvo                       = 'X'

    IMPORTING

     topmat                       =  it_topmat

*    DSTST                       =

      TABLES

        stb                       = it_stb

        matcat                    = it_matcat

    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

              .

But, for some reason, the FM is populating the stb itab with lines where the stlal field is equal to 1 (1 and 2 in some cases).

STUFWEGXXBTTIDXVWEGXOJTXBBAUSFSTLANSTLALA
11M10MATERIAL AAAA 0,0051
12M10MATERIAL BBBB 0,0051

Is it the normal behavior of this FM?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,775

i dont think this will do what you want. this is a FM to show a specific BOM structure for a specific material, and the STLAL parameter is used to help select the BOm that will be displayed, not the STLAL values of the items within the returned data.

Have you considered simply reading table MAST, looking for STLAL values of 2?

4 REPLIES 4
Read only

Former Member
0 Likes
1,775

Did you try with STLAL = '02' ?
The presence of the conversion routine 'ALPHA' seems to indicate the need of the leading zeroes.

Please check this thread http://scn.sap.com/thread/3508364

Regards

Read only

0 Likes
1,775

Hi Francesco

Thank you for answer.

I think it is not applicable for "stlal" because this field has is length  1.

Anyway I did it for the field stlan,

Best Regards.

Read only

0 Likes
1,775

Ok. Thanks to you

I've checked the parameters in CS_BOM_EXPL_MAT_V2 and STLAN is CHAR 1 (data element STLAN), while STLAL is CHAR 2 (data element STALT) but maybe there is something else I don't know about the topic.

Best regards.

Read only

Former Member
0 Likes
1,776

i dont think this will do what you want. this is a FM to show a specific BOM structure for a specific material, and the STLAL parameter is used to help select the BOm that will be displayed, not the STLAL values of the items within the returned data.

Have you considered simply reading table MAST, looking for STLAL values of 2?