You are on page 1of 21

Create Customized Table

VBAK SALES ORDER(HEADER DATA) Key


VBELN Sales Document X
ERDAT Date on Which Record Was Created
ERNAM Name of Person who created the object
AUDAT Document Date (Date Received/Sent)
VBTYP SD document category
LIFSK Delivery block (document header)
NETWR Net Value of the Sales Order in Document Currency
WAERK SD Document Currency
VKORG Sales Organization
KUNNR Sold-to party

LIKP SD Document: Delivery Header Data


VBELN Delivery Number X
ERDAT Date on Which Record Was Created
VSTEL Shipping Point/Receiving Point
VKORG sales organization
LFART delivery type
LFDAT Delivery Date
KUNNR Ship-to party
KUNAG Sold-to party

LIPS SD document: Delivery: Item data


VBELN Delivery X
POSNR Delivery Item X
PSTYV Delivery item category
ERDAT Date on Which Record Was Created
MATNR Material Number
WERKS Plant
VGBEL Document number of the reference document
[NOTE:VGBEL,is the salesorder no in VBAK here]
Create 3 Custom Z Tables and Upload Records using TMG

VBAK
mandt VBELN ERDAT ERNAM
800 4969 02.01.2018 TRAINEE01
800 4970 11.02.2018 TRAINEE01
800 4971 22.04.2018 TRAINEE01
800 4972 22.04.2018 TRAINEE01
800 4973 23.06.2018 TRAINEE01

LIKP
mandt VBELN(delivry no) ERDAT VSTEL
800 80003370 02.01.2018 1000
800 80003371 11.02.2018 1200
800 80003372 22.04.2018 1000
800 80003373 22.04.2018 1200
800 80003374 23.06.2018 1900
800 80003375 23.06.2018 1900
800 80003376 23.06.2018 1900

LIPS
mandt VBELN POSNR PSTYV
800 80003370 10 TAN
800 80003370 20 TAN
800 80003370 30 TAN
800 80003371 10 DLN

800 80003371 20 DLN


800 80003371 30 DLN
800 80003371 40 DLN
800 80003371 50 DLN
800 80003375 10 TAN
800 80003375 20 TAN
800 80003375 30 TAN
80003375 40 TAN
AUDAT VBTYP NETWR VKORG KUNNR
02.01.2018 C 5.500,00 1000 1390 [NOTE: please refer to those Sales Orders which you have c
11.02.2018 C 19.719,00 1000 1175
22.04.2018 C 15.076,00 1000 1001
22.04.2018 C 7.294,00 1000 2200
23.06.2018 C 7.284,00 1000 1390

P
VKORG LFART LFDAT KUNNR KUBAG
1000 LF 07.01.2018 1390 1390
1000 LF 22.02.2018 1175 1175
1000 LF 01.05.2018 1001 1001
1001 LF 27.04.2018 2200 2200
1000 LF 29.06.2018 1390 1390
1000 LF 29.06.2018 1001 1001
1000 LF 29.06.2018 1001 1001

ERDAT MATNR WERKS VGBEL


02.01.2018 P-109 1000 4969
02.01.2018 P-110 1000 4969
02.01.2018 P-10 1000 4969
11.02.2018 M-02 1200 4970

11.02.2018 M-02 1200 4970


11.02.2018 M-04 1200 4970
11.02.2018 M-05 1200 4970
11.02.2018 M-09 1200 4970
23.06.2018 HT-1000 1000 4971
23.06.2018 X-009 1000 4971
23.06.2018 X-0100 1000 4971
23.06.2018 HT-900 1000 4971
es Orders which you have created earlier]
Selection screen
1
2
3
Logic for OOALV
4
5
6

Logic for Smartforms and CDS Views


Accept a range of SALES ORDER NUMBERs from the user
When user clicks on OOALV, display the OOALV Report. Output Design is shown in the next tab.
When user clicks on SmartForm, display the smartForm . Output Design is shown in the next tabs.

Fetch related data from table VBAK,LIKP, LIPs for the range of Sales order entered by the User.
Display the records using OOALV. Refer the Output Design shown in the next tab.
On clicking back button , return to main Selection Screen

How to retrieve data from Three Tables?

To display data from 2 tables, use inner join based on KUNNR(VBAK-KUNNR = LIKP-
KUNNR).
To display data from 3 tables, use multiple inner join with key field on KUNNR(VBAK-
KUNNR = LIKP-KUNNR) and VBAK-VBELN = LIPS-VGBEL).
OR
Make use of FOR ALL ENTRIES.
Selection Criteria
VBAK-VBELN
VBAK-KUNNR
Button to display OOALV
Button to call AdobeForm

OUTPUT will be as follows.

Generate an OOALV Report by using OOALV Containers .Enhance the report by implementing below features
1)Apply Field catalogs.
2) List Header should be displayed as DELIVERY DETAILS on the top of the ALV Report as shown.
3)The records in the table must be alternately shaded.

Additional features
4)Add Capgemin Logo
Sales order number mandatory Multiple Selection OR
Customer number optional Multiple Selection

BACK BUTTON

DELIVERY DETAILS REPORT


VBAK-VBELN VBAK-ERDAT LIKP-VBELN LIKP-LFDAT
LIKP-KUNNR LIPS-VGBEL LIPS-POSNR LIPS-MATNR LIPS-WERKS
SAP Logo

VBAK-VBELN VBAK-ERDAT VBAK-VBTYP VBAK-LIFSK VBAK-NETWR

VBAK General data

LIKP-VBELN LIKP-ERDAT LIKP-VSTEL LIKP-LFART LIKP-KUNNR

LIKP : DELIVERY HEADER DATA AND LIPS DELIVERY ITEM DATA

Terms and conditions


Goods must be returned within 10 days of purchase.
Sales Description

VBAK-VKORG VBAK-KUNNR

K General data

LIPS-POSNR LIPS-ERDAT LIPS-MATNR

DATA AND LIPS DELIVERY ITEM DATA

Page No : 1 of 10
1)     Input: Take in a range of Sales order no from the user .
2)     Data should flow to multiple pages.
3)     Main window: Display Sales details for the accepted range of Sales Document No. For Sales details refe
4)     Footer window: Make use of text modules to display Terms and Conditions
5)     Logo should appear only on first page
6)     Footer window only on last page
7)     Title and Page nos must be printed on all the pages.
8)     Data Fetch logic should be in the driver program. Internal table should be passed from driver program to
1.Create CDS View to view the below fields Field
Output
VBAK-KUNNR
VBAK-VBELN
VBAK-ERDAT
VBAK-ERNAM
VBAK-AUDAT
VBAK-LIFSK
VBAK-NETWR
VBAK-WAERK
LIKP-LFART
LIKP-LFDAT
LIPS-POSNR
LIPS-MATNR
LIPS-WERKS

Hint It’s Inner join across the 3 tables VBAK.VBELN and LIKP.VBELN and LIPS.V
Calculations Priority has to be calculated based Order price(VBAK-NETWR)

WHEN NETWR is between 1 and 5000 the 'LOW'


when it is between 5001 and 10000 then 'MEDIUM'
when above 10000 , it's 'HIGH'

2.Create 2nd CDS View on the above


1st CDS View
to add the below additional Fields
VBAK.VKORG Sales Organization
LIKP.VSTEL Shipping Point/Receiving Point
LIPS.VGBEL Document number of the reference document
ELN and LIKP.VBELN and LIPS.VBELN
price(VBAK-NETWR)

'LOW'
MEDIUM'

the reference document


Same Input for Both Programs S_VBELN Mulitple SELECT OPTIONS Refer VBAK.VBELN
1 write a Program to Display the result of CDS1 in ALV using IDA and and

2 write a Program to Display the result of CDS2 in ALV using IDA and and
using IDA and and for the Given Input S_VBELN(SELECT OPTIONS)

using IDA and and for the Given Input S_VBELN(SELECT OPTIONS)
write a program display the Below Ouput using ADBC for HANA_SQL

VBAK-KUNNR
VBAK-VBELN
VBAK-ERDAT
VBAK-ERNAM
VBAK-AUDAT
VBAK-LIFSK
VBAK-NETWR
VBAK-WAERK
LIKP-LFART
LIKP-LFDAT
LIPS-POSNR
LIPS-MATNR
LIPS-WERKS

Hint Priority
It’s Innerhas
jointoacross
be calculated based
the 3 tables Order price(VBAK-NETWR)
VBAK.VBELN and LIKP.VBELN and LIPS.VBELN
CalculationERNAM Should be in upper case
WHEN NETWR is between 1 and 5000 the 'LOW'
when it is between 5001 and 10000 then 'MEDIUM'
when above 10000 , it's 'HIGH'
Q1 Create a HANA Procedure using AMDP
importing SalesDocs TYPE STRING
Exporting it_res (Internal Table) TYPE TABLE TYPE With all the Below Fields

VBAK-KUNNR
VBAK-VBELN
VBAK-ERDAT
VBAK-ERNAM
VBAK-AUDAT
VBAK-LIFSK
VBAK-NETWR
VBAK-WAERK
LIKP-LFART
LIKP-LFDAT
LIPS-POSNR
LIPS-MATNR
LIPS-WERKS

Hint Priority
It’s Innerhas
jointoacross
be calculated based
the 3 tables Order price(VBAK-NETWR)
VBAK.VBELN and LIKP.VBELN and LIPS.VBELN
Calculations ERNAM Should be in upper case
WHEN NETWR is between 1 and 5000 the 'LOW'
when it is between 5001 and 10000 then 'MEDIUM'
when above 10000 , it's 'HIGH'

Q2 Write a Program to call the above AMDP Method for the Given S_VBELN and Display the result
INPUT S_VBELN SELECT-OPTIONS Refer VBAK.VBELN
E With all the Below Fields

R)and LIPS.VBELN

play the result

You might also like