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

fetching data

former_member820770
Discoverer
0 Likes
648

Hi Frnds,

i have one requirement

i need to fetch FERT Meterial from DDL CDS SQL View and need to pass the FERT meterial to MARA and need to get the meterial group (mara-matkl)..could you please anyone help me in this.

Thanks

1 REPLY 1
Read only

harishankar714
Participant
0 Likes
428

you can write a CDS query that combines data from both views.

@AbapCatalog.sqlViewName: 'Z_FERT_MATERIAL_GROUP'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view Z_FERT_MATERIAL_GROUP as 
select from mara
inner join (
    select matnr as FERT_MATERIAL 
    from "YOUR_DDL_CDS_SQL_VIEW_NAME"
) as ddl_cds on mara.matnr = ddl_cds.FERT_MATERIAL
{
    matnr,
    matkl as MATERIAL_GROUP
};