on 2022 Mar 21 1:01 PM
Hello,
We would like to extract the Inventory Data from our S/4HANA Public Cloud via CDS View to our SAP BW/4HANA System. But we have some problems with the Data and we need some info’s on how to build the BW Content.
It is about the following S/4 App: Display Warehouse Stocks of Material

So we are extracting the Data from the following CDS-View:
CDS-View: I_GoodsMovementDocumentDEX
Extractor: IGOODSMVMTDOCDEX
Link to the CDS-View: Material Document Data Extraction - SAP Help Portal
Is this CDS-View the right one or do we have to use an other one to get the Data from the above mentioned S/4 App?
If this CDS-View is the right one. How do we build the BW Content? Is there a SAP Standard like for the Inventory Data from the ERP Systems?
In the CDS View there are no more key figures like 0ISSVS_VAL,0RECVS_VAL, etc. It seems like that the calculation are not seperated and calculated in one key figure.
Can anyone help?
Thank you and kind regards,
Marvin
Request clarification before answering.
Hi Marvin,
Thanks for your reply.
Have you considered MATERIALDOCUMENTKEY1 to 6 in your flow..?
If yes how you consider RAW type conversion to Char. If not then How Delta is taken care.
2. Please help us sharing CDS view source field mapping details again these target objects because these are used in Formula calculation under standard transformation.
0STOCKTYPE
0STOCKCAT
0STOCKRELEV
0BWAPPLNM
0PROCESSKEY
0INDSPECSTK
0CPPVLC
Please help with your expert comments and suggestions.
Thanks.
Deepak Rai.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Any solution on above issue.?
Please share the outcome of discussion with SAP.
Thanks.
Deepak Rai.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @deepak_rai12 and @MKreitlein , Did you find any way to have quantity and value using CDS views? We are implementing inventory management in datasphere but couldn't find standard CDS view for revaluation.
Please help with your findings, how inventory management can be implemented in datasphere using CDS views.
Regards,
Vivek
Hello Vivek, we built our own Custom CDS views for selecting data from BKPF, BSEG and EBEW. I can share the frame here ... just a moment ... you can include the fields you need yourself...
@AbapCatalog.sqlViewName: 'YBICDSBKPF'
@EndUserText.label: 'CDS for Exctraktion BKPF'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.dataClass: #MASTER
@ObjectModel.usageType.sizeCategory: #XL
@VDM.viewType: #BASIC
@AccessControl.authorizationCheck: #CHECK
@Metadata.ignorePropagatedAnnotations:true
@ObjectModel.supportedCapabilities: [ #SQL_DATA_SOURCE,
#CDS_MODELING_DATA_SOURCE,
#CDS_MODELING_ASSOCIATION_TARGET,
#EXTRACTION_DATA_SOURCE ]
@Analytics: {
dataExtraction: {
enabled: true,
delta.changeDataCapture: {
automatic : true
}
}
}
@ClientHandling.algorithm : #SESSION_VARIABLE
define view YBI_CDS_BKPF as select from bkpf
{ ...@AbapCatalog.sqlViewName: 'YBICDSEBEW'
@EndUserText.label: 'CDS for Extraction BSEG'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.dataClass: #MASTER
@ObjectModel.usageType.sizeCategory: #XL
@VDM.viewType: #BASIC
@AccessControl.authorizationCheck: #CHECK
@Metadata.ignorePropagatedAnnotations:true
@ObjectModel.supportedCapabilities: [ #SQL_DATA_SOURCE,
#CDS_MODELING_DATA_SOURCE,
#CDS_MODELING_ASSOCIATION_TARGET,
#EXTRACTION_DATA_SOURCE ]
@Analytics: {
dataExtraction: {
enabled: true,
delta.changeDataCapture: {
automatic : true
}
}
}
@ClientHandling.algorithm : #SESSION_VARIABLE
define view YBI_CDS_BSEG as select from bseg
{ ...@AbapCatalog.sqlViewName: 'YBI_V_EBEW'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.dataClass: #MASTER
@ObjectModel.usageType.sizeCategory: #XL
@VDM.viewType: #BASIC
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'BI: Extraction from EBEW'
@Metadata.ignorePropagatedAnnotations:true
@ObjectModel.supportedCapabilities: [ #SQL_DATA_SOURCE,
#CDS_MODELING_DATA_SOURCE,
#CDS_MODELING_ASSOCIATION_TARGET,
#EXTRACTION_DATA_SOURCE ]
@Analytics: {
dataExtraction: {
enabled: true,
delta.changeDataCapture: {
mapping:
[ { table: 'EBEW',
role: #MAIN,
viewElement: ['Product','ValuationArea','ValuationType','InventorySpecialStockType','SalesOrder','SalesOrderItem'],
tableElement: ['MATNR','BWKEY','BWTAR','SOBKZ','VBELN','POSNR'] },
{ table: 'T001K',
role: #LEFT_OUTER_TO_ONE_JOIN,
viewElement: ['ValuationArea'],
tableElement: ['BWKEY']
},
{ table: 'T001',
role: #LEFT_OUTER_TO_ONE_JOIN,
viewElement: ['CompanyCode'],
tableElement: ['BUKRS']
}
]
}
}
}
@ClientHandling.algorithm : #SESSION_VARIABLE
define view YBI_CDS_EBEW as select from ebew as e
inner join t001k on e.bwkey = t001k.bwkey
inner join t001 on t001.bukrs = t001k.bukrs
{ ...Hope it helps.
BR, Martin
Hhello marvin19,
I found this question today, since I want to use the CDS View I_GOODSMOVEMENTDOCUMENTDEX in our SAP Datasphere extraction ... we observed the 2nd time now that records are missing, which should have been transferred with the CDC mechanism.
Did you have similar findings or did the Delta extraction work always fine?
Thanks and best regards,
Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martin,
it depends on what you exactly mean. Our delta is working fine, but we have the problem that we do not get the same value or quantity from the S4 into the SAP BW system. Sometimes there are records that are stored in an other app and you can't join these data records with each other in the SAP BW. We tried everything out so far (using an other CDS view and we built a custom CDS view) but nothing worked. We already opened a ticket by the SAP but unfortunately there is currently no fix available for that.
Regards,
Marvin
Hello Marvin,
thanks for your reply... I mean a simple count on table MATDOC does return more entries than I got transferred via this CDS View into my SAP Datasphere table. The table just contains randomly less records.
When I re-initialize the extraction, the numbers of records are matching exactly.
I'm trying to figure out the root cause, but without success so far. 😞
Thanks, Martin
Hi Marvin,
thank you for the information. I am eager to read what SAP will answer on the revaluation topic.
Best regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marvin,
thank you for the link, that seems to be a starting point. Nevertheless, there are still some black holes where you possibly could shed light on the dark. If you have time to get a tiny bit more in detail, here are some questions.
[1] --- Use of Content for BW/4HANA ------------------------------------------------------------------------------------
Did you use the new content for SAP BW/4HANA, i.e. aDSO /IMO/CMMMIM01 Material Movements and adapted these according to new CDS-Extractors I_GoodsMovementSubstituteDEX and I_GoodsMovementDocDEX.
[2] --- Quantities and Amounts --------------------------------------------------------------------------------------------
In your data flow did you differentiate the aDSOs between quantities and amounts ?
[3] --- Historical data and record type ------------------------------------------------------------------------------------------
In our Hana Cloud system (DataSource) the CDS view I_GoodsMovementSubstituteDEX returns no data, so my understanding of chapter 4.5 Extracting Historical Movements with paragraph "For data retrieved directly from table MATDOC (Material Documents), there is no need to fill any setup tables. Since no initial stock balance has been loaded, the historical movements are also not yet contained in the reference point table. That’s why they
must also be booked with record type '0' into the inventory enabled DataStore object."
Conclusion:
All data from both CDS-Views need record type 0. Can you confirm that this has to be done for historical and actual data?
[4] --- REVALUATION ------------------------------------------------------------------------------------------
The document states on page 24: "Both CDS views for inventory management provide quantities and values like
GoodsMovementStkAmtInCCCrcy (Amount in Local Currency with Sign of Stock Quantity). Those
value fields contain quantities valuated with the price that is valid during material document
creation. They are not updated when material prices change. In other words, the CDS views do not
consider revaluations. Therefore, they are not able to handle stocks valuated at current prices.
How would I handle stocks valuated at current prices then?
To analyze stocks valuated at current prices, these current prices of material plant combinations
(such as moving average price) should be extracted into SAP BW/4HANA. Then, stock values at
current prices can be calculated in SAP BW/4HANA by multiplying stock quantities with current
prices.
-> Problem here: There is no information on CDS-View to be used for this! Did you develop a solution for this and if so could you provide more details on it?
Best regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Micheal,
i tried to answer your questions from our point of view:
1.) We built our own ADSO. We are working with the LSA++ method. So first of all we built our Corporate Memory Layer ADSO with the fields of the CDS View. After that we built the Enterprise Data Warehouse Layer ADSO therefore we used the InfoObject from the SAP Content and of course we did some modifications like creating some new InfoObjects.
2.) We did not seperate the Quantities and Amounts. We built a little routine for each Key Figure:
0ISSTOTSTCK:
IF source_fields-/bic/zstckquan < 0.
result = source_fields-/bic/zstckquan * -1.
else.
result = 0.
Endif.
0RECTOTSTCK
IF source_fields-/bic/zstckquan > 0.
result = source_fields-/bic/zstckquan.
else.
result = 0.
Endif.
And the same Coding for the Key Figures 0ISSVS_VAL and 0RECVS_VAL.
3.) We are not getting any Data from the I_GoodsMovementSubstituteDEX either. At the moment we just using the other CDS view - IGOODSMVMTDOCDEX. With this CDS View we get actual and historical Data.
4.) We are currently in a discussion with the SAP, because we have some problems with this, too. I will let you know as soon as i get some more information.
Regards,
Marvin
Hi Martin,
could you find a solution to your problem, we are facing the same issue!
THX,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
we took the following documentation as a basis for our logic:
SAP First Guidance, SAP BW4/HANA, Inventory Handling and Non-Cumulative Key Figures
https://www.sap.com/documents/2019/04/2cd3175e-497d-0010-87a3-c30de2ffd8ff.html
I hope it helps.
Regards,
Marvin
| User | Count |
|---|---|
| 30 | |
| 26 | |
| 21 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.