cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve Component Data

Former Member
0 Kudos

Hi All,

I have a project where I need to extract some data from SAP and have it output in a particular format, which is why I am unable to use Output Variant (although it almost gets me to what I need).

Below are steps that I have done, but coming across some issues when while trying to get the component data.

  1. Extracted the Data from CSAP_MAT_BOM_READ to get the all of the Raw materials for a Finished Product.
  2. Then I want to take those Raw materials and query ESTMJ and ESTRH to get the SUBID.
  3. Next is to pass along the SUBID to the BAPI 'BAPI_BUS1077_GETDETAIL'
  4. Once this is done, there is PROP_COMPONENTS Table in which all Component Data is displayed.
  5. Here is where the issue lies:
    1. I am unable to identify which Field I can use to retrieve Standard Composition.  Unfortunately I am not getting consistent values (internal SAP numbers)
    2. I found one Field REF_RECNVA which had five rows with exact same values (for example, 1234567), and my standard composition has five components.  I also cross checked and these are the correct entries in the PROP_COMPONENTS Table.
    3. However, when I tried to pass another SUBID to the BAPI, the REF_RECNVA numbers were not the same as the first time, although I can see that these values are coming from my Standard Composition.  I was expecting to see 1234567 (matching the same as before, stating that this number is indicative of Standard Composition).


If my thoughts were correct (which is rarely the case), it would have been the same and I could have queried that value 1234567 in REF_RECNVA for all SUBID passed to the BAPI. Since this is not the case I am back to square one.


I hope somebody has some thoughts/alternate suggestions to achieve what I need.

Hope this is clear!

Thanks in advance,

Niraj

Accepted Solutions (0)

Answers (1)

Answers (1)

christoph_bergemann
Active Contributor
0 Kudos

Dear Niraj

using output variants is in most cases on quite good option (and you can learn from them by checking how SAP has done itby analyzing the ABAP code as delivered; and some of the SAP default output variants are quite nice as "copy" functions). Check e.g:

Please answer this question:

1.) are you looking for a long erm solution which is useful for end user (or is it more on "tech" level)?

Here  a list of alternative options:

a) ALE

b.) Standard EHS export

Honestly in most cases "output variant" is the best option (if the tool/solution should be "end user" enabled). You can export the data in XLS, XML, or whatever kind of format or structure.

Using SAP approach via ALE in combination with XI/PI you will get the same results. On top you could try to use "EHS extractors" (which are available for SAP BW use) or you can generate your own extractors

Experience has shown that if you do not understand the APIs/BAPIs and EHS data model you are "lost". But you can be "happy". There are some example reports for use of BAPIs/APIs delivered by SAP. Check and references therein. As an example:

Check e.g. RC1_1077_BAPI_EXAMPLE_CHANGE EHS: Example Program Spec.BAPIs (FctGrp. 1077): Change - SAP Report - A...

C.B.