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: 

How to get the correct alternative bom?

Former Member
0 Kudos

Hi friends,

I would like to retrieve the correct alternative bom to display in the report.

I was thinking to link STPO to STAS and then retrieve the alternative bom from STAS-STLAL column.

The linkage between STPO and STAS would be :-

  • STPO-STLTY = STAS-STLTY
  • STPO-STLNR = STAS-STLNR
  • STPO-STLKN = STAS-STLKN

However, i found that the above linkage is not unique enough.

Please refer to the below diagrams where STAS-STLKN = 11.

You will find that there are two entries where one alternative bom = "AA" and another is "UL".

So, may i know for this case, what would be the correct alternative bom and how to determine it?

In both STPO and STAS tables, there is a field called internal counter (STPO-STPOZ, STAS-STASZ).

May i know what are they used for?

Thanks, gk

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hI 

You would need to join mast as well......

  

INNER JOIN mast and stas  on

stas-stlal  = mast-stlal AND
    stas-stlnr  = mast-stlnr AND

INNER JOIN  stpo

  stpo-stlkn  = stas-stlkn AND
   stpo-stlnr  = stas-stlnr AND
  stpo-stlty  = stas-stlty

Better use the below FM

CS_BOM_EXPL_MAT_V2   CSAP_MAT_BOM_READ

9 REPLIES 9

Former Member
0 Kudos

hI 

You would need to join mast as well......

  

INNER JOIN mast and stas  on

stas-stlal  = mast-stlal AND
    stas-stlnr  = mast-stlnr AND

INNER JOIN  stpo

  stpo-stlkn  = stas-stlkn AND
   stpo-stlnr  = stas-stlnr AND
  stpo-stlty  = stas-stlty

Better use the below FM

CS_BOM_EXPL_MAT_V2   CSAP_MAT_BOM_READ

0 Kudos

Hi Ramachandran Rakhunathan, thanks much for your reply.

Actually, it won't made any difference linking to MAST table as it will also return those two records based on my MAST table :-

kesavadas_thekkillath
Active Contributor
0 Kudos

You can check it function CS_CL_S_BOM_ALT_PROVIDE

0 Kudos

Hi Kesavadas Thekkillath, thanks much for your reply.

Actually, my report is a BOM's change history report. It is required to display the alternative BOM as the date of changes. I did try to use FM 'CS_CL_S_BOM_ALT_PROVIDE'. For the valid-from date and valid-to date, i entered the value of CDHDR-UDATE. Unfortunately, it did not return me any result. Did i make any mistake when entering the FM parameters? Thanks.

0 Kudos

You must not pass the date from CDHDR. You must pass the validity date for example may be sy-datum or the maximum date value.

Does not the transactions CS80/ CS 81 help you ?

0 Kudos

Hi Kesavadas Thekkillath,

Kindly please help to unlock my another forum post @ http://scn.sap.com/thread/3206262 , i would like to give points to the Manjesh Kumar who provided me with some useful info on how to solve my problem. Thanks and sorry for the inconvenience.

0 Kudos

It was locked because it was a duplicate thread. Please do not do that from next time. As of now the thread remains locked.

Kesav

0 Kudos

Hi Kesav, noted with thanks. Thanks much for unlocking the thread.

Former Member
0 Kudos

HI,

Try to use table mast .

where matnr = STPO-IDNRK.

specify the value of "STLAN' not equal to '1'.. ex. 1 for production, 2 for engineering etc.

Regards,

RAvi Singh