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

Identify Phantom Assembly

Former Member
0 Likes
716

Hello,

I need to find the parent(Phantom Assembly) for a material if it belongs to one. Any ideas?

Thank you,

Joe

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
574

How about using the "where-used" function module.



************************************************************************
*  FORM WHERE_USED.
************************************************************************
form where_used tables itab
                using  matnr
                       werks.

  data: selpool like mc29s.
  data: eqpcat  like cscequi occurs 0.
  data: kndcat  like cscknd  occurs 0.
  data: matcat  like cscmat  occurs 0.
  data: prjcat  like cscprj  occurs 0.
  data: stdcat  like cscstd  occurs 0.
  data: tplcat  like csctpl  occurs 0.

  clear itab. refresh itab.
  call function 'CS_WHERE_USED_MAT'
       exporting
            datub                      = sy-datum
            datuv                      = sy-datum
            matnr                      = matnr
            postp                      = ' '
            stlan                      = ' '
            werks                      = werks
            stltp                      = ' '
       importing
            topmat                     = selpool  "Not Currently Used
       tables
            wultb                      = itab
            equicat                    = eqpcat  "Not Currently Used
            kndcat                     = kndcat  "Not Currently Used
            matcat                     = matcat  "Not Currently Used
            stdcat                     = stdcat  "Not Currently Used
            tplcat                     = tplcat  "Not Currently Used
            prjcat                     = prjcat  "Not Currently Used
       exceptions
            material_not_found         = 02
            no_where_used_rec_found    = 03
            no_where_used_rec_selected = 04
            no_where_used_rec_valid    = 05.

endform.

Regards,

Rich Heilman

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
575

How about using the "where-used" function module.



************************************************************************
*  FORM WHERE_USED.
************************************************************************
form where_used tables itab
                using  matnr
                       werks.

  data: selpool like mc29s.
  data: eqpcat  like cscequi occurs 0.
  data: kndcat  like cscknd  occurs 0.
  data: matcat  like cscmat  occurs 0.
  data: prjcat  like cscprj  occurs 0.
  data: stdcat  like cscstd  occurs 0.
  data: tplcat  like csctpl  occurs 0.

  clear itab. refresh itab.
  call function 'CS_WHERE_USED_MAT'
       exporting
            datub                      = sy-datum
            datuv                      = sy-datum
            matnr                      = matnr
            postp                      = ' '
            stlan                      = ' '
            werks                      = werks
            stltp                      = ' '
       importing
            topmat                     = selpool  "Not Currently Used
       tables
            wultb                      = itab
            equicat                    = eqpcat  "Not Currently Used
            kndcat                     = kndcat  "Not Currently Used
            matcat                     = matcat  "Not Currently Used
            stdcat                     = stdcat  "Not Currently Used
            tplcat                     = tplcat  "Not Currently Used
            prjcat                     = prjcat  "Not Currently Used
       exceptions
            material_not_found         = 02
            no_where_used_rec_found    = 03
            no_where_used_rec_selected = 04
            no_where_used_rec_valid    = 05.

endform.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
574

Thanks Rich,

This will give me a list of materials that use the material in question as a component. I need to identify the one in a particular production order. Transaction CSK207 will list the hierarchy but I can't figure out how to get back to the phantom assembly for a material.