Join in s4 hana fething inner joine three table
Getting the records of the three table
************************************************************************
* Program Name : ZSELECT_HANA1 Object ID: oo01 *
* Description : hana reports *
* Create Date : 24.10.2018 *
* FO Owner : rohini kumar *
* Tech Owner : Rohini Kumar *
* Project Module : SD *
************************************************************************
* Change Log *
************************************************************************
* REQ# DATE WHO CHANGE_ID DESCR *
*-----------------------------------------------------------------------
* 001 Initial *
************************************************************************
REPORT ZSELECT_HANA1.
TYPES: BEGIN OF ty_final,
vblen type vbeln,
price TYPE NETWR_AK,
matnr type matnr,
a_matnr type matnr,
END OF ty_final.
data: gt_final type STANDARD TABLE OF ty_final,
gs_final type ty_final.
SELECT a~vbeln,a~NETWR,b~matnr,c~matnr
FROM zrkvbak AS a
INNER JOIN zrkvbap AS b
ON a~vbeln = a~vbeln
INNER JOIN zrkmara AS c
ON b~matnr = c~matnr into TABLE @gt_final
WHERE c~matnr = 'LTFA'.
IF sy-subrc eq 0.
MESSAGE 'get data success' TYPE 'I'.
ELSE.
MESSAGE 'get data not success' TYPE 'I'.
ENDIF.
************************************************************************
* Program Name : ZSELECT_HANA1 Object ID: oo01 *
* Description : hana reports *
* Create Date : 24.10.2018 *
* FO Owner : rohini kumar *
* Tech Owner : Rohini Kumar *
* Project Module : SD *
************************************************************************
* Change Log *
************************************************************************
* REQ# DATE WHO CHANGE_ID DESCR *
*-----------------------------------------------------------------------
* 001 Initial *
************************************************************************
REPORT ZSELECT_HANA1.
TABLES: vbak,vbap,mara.
TYPES: BEGIN OF ty_final,
vblen type vbeln,
matnr type matnr,
a_matnr type matnr,
END OF ty_final.
data: gt_final type STANDARD TABLE OF ty_final,
gs_final type ty_final.
SELECT A~vbeln AS Sales_Docuemnt,
B~matnr AS Materail,
C~matnr AS material_descprtion
FROM zrkvbak AS A
INNER JOIN zrkvbap AS B
ON A~vbeln = B~vbeln
INNER JOIN zrkmara AS C
ON B~matnr = C~matnr into TABLE @gt_final
WHERE C~matnr = 'LTFA'.
IF sy-subrc eq 0.
MESSAGE 'get data success' TYPE 'I'.
ELSE.
MESSAGE 'get data not success' TYPE 'I'.
ENDIF.
************************************************************************
* Program Name : ZSELECT_HANA1 Object ID: oo01 *
* Description : hana reports *
* Create Date : 24.10.2018 *
* FO Owner : rohini kumar *
* Tech Owner : Rohini Kumar *
* Project Module : SD *
************************************************************************
* Change Log *
************************************************************************
* REQ# DATE WHO CHANGE_ID DESCR *
*-----------------------------------------------------------------------
* 001 Initial *
************************************************************************
REPORT ZSELECT_HANA1.
TYPES: BEGIN OF ty_final,
vblen type vbeln,
price TYPE NETWR_AK,
matnr type matnr,
a_matnr type matnr,
END OF ty_final.
data: gt_final type STANDARD TABLE OF ty_final,
gs_final type ty_final.
SELECT a~vbeln,a~NETWR,b~matnr,c~matnr
FROM zrkvbak AS a
INNER JOIN zrkvbap AS b
ON a~vbeln = a~vbeln
INNER JOIN zrkmara AS c
ON b~matnr = c~matnr into TABLE @gt_final
WHERE c~matnr = 'LTFA'.
IF sy-subrc eq 0.
MESSAGE 'get data success' TYPE 'I'.
ELSE.
MESSAGE 'get data not success' TYPE 'I'.
ENDIF.
************************************************************************
* Program Name : ZSELECT_HANA1 Object ID: oo01 *
* Description : hana reports *
* Create Date : 24.10.2018 *
* FO Owner : rohini kumar *
* Tech Owner : Rohini Kumar *
* Project Module : SD *
************************************************************************
* Change Log *
************************************************************************
* REQ# DATE WHO CHANGE_ID DESCR *
*-----------------------------------------------------------------------
* 001 Initial *
************************************************************************
REPORT ZSELECT_HANA1.
TABLES: vbak,vbap,mara.
TYPES: BEGIN OF ty_final,
vblen type vbeln,
matnr type matnr,
a_matnr type matnr,
END OF ty_final.
data: gt_final type STANDARD TABLE OF ty_final,
gs_final type ty_final.
SELECT A~vbeln AS Sales_Docuemnt,
B~matnr AS Materail,
C~matnr AS material_descprtion
FROM zrkvbak AS A
INNER JOIN zrkvbap AS B
ON A~vbeln = B~vbeln
INNER JOIN zrkmara AS C
ON B~matnr = C~matnr into TABLE @gt_final
WHERE C~matnr = 'LTFA'.
IF sy-subrc eq 0.
MESSAGE 'get data success' TYPE 'I'.
ELSE.
MESSAGE 'get data not success' TYPE 'I'.
ENDIF.
Comments
Post a Comment