Month wise display
Hi
I have a requiement , I need to display a report which will give sales target and Actual , month wise for respective sales representative
the format is as follows
Sales Representative Jan feb upto Dec
target Actual target Actual
I have a ODS which will give the Actual Fig and I am using a flat file to upload the target values into another ODS
I will use a Infoset or multiprovider to merge it
Pl suggest how to go about it ?
I mean do I need to create 12 Target Infoobjects(Key Fig)
and how i will do mapping and compare month wise target and actual values
regrds
kisholoy
Hi kisholoy,
According to me u need not to have separate ODS for the Target figures, u can have the target data into the Actual figure ODS with different infosource arrangement for the Target figures.
I have done such thing previously and it works fine in the same situation.
Well at a reporting side u can keep Sales representative in selection so that viewer can see report for the perticular sales representative or can see for all sales representative.
For this arrangement follow the things i have mentioned hereabove.
1. create a structure for the months in a year. PS: Also put Fiscal year in Selection. (Put this fiscal year and sales representative in the Free characteristics.)
2. Show Text and key for sales representative by ticking ovet this display option in the properties.
3. Go in the Columns create strcture for actual and target figures.
Thus ur query is ready. Do some additional settings as per custemer need.
Hope it helps.
Assign the points if it works.
Similar Messages
-
Report display will be 2010,2011 year wise display and 2012 Month display
Hi,
I want to Create Report, output will be 2010,2011 year wise display, 2012,2013 month wise display and Fiscal year quarter display, all are display based on input value of Fiscal year data, please anyone guide me, How to do?
Thanks,
NandishHi,
How to assign KF to Time Characteristics,My report dsplay will be like this, For example
Input Fiscal YEAR=2010 to 2013
Material 2010 2011 APR.2012 to MARCH 2013
Quantity A1 200 300 * *
Quantity A2 300 400 * *
Also Display quarter wise display. How to do
Thanks,
Nandish -
Display schedule qty - Month wise in ALV Grid
Hi Experts,
I have a requirement to display the schedule line quantities month wise in ALV Grid. The columns sholud be dynamic columns based on the input date range. I got some idea about how to create dynamic ALV but it is not clear to implement in my requirement.
Please Guide me in achiving the same.
Example:
Jan 2011 Feb 2011 March 2011
100 2000 300
Thanks&Regards,
KarthikHi.,
Create field catalog dynamically as like this.,
select-options s_date for sy-datum.
data: n type i,
count type i,
cnt type string,
field type string,
descr type string.
DATA: m TYPE t247-mnr,
month_name type char10,
m1 type i.
n = s_date-high+4(2) - s_date-low+4(2) . " getting number of months
m1 = s_date-low+4(2).
m = m1.
n = n + 1.
DO n TIMES. " building field catalog dynamically
m = m + 1.
count = count + 1.
cnt = count.
concatenate 'FIELD' cnt into field.
CALL FUNCTION 'ISP_GET_MONTH_NAME' " FM to get month name
EXPORTING
LANGUAGE = sy-langu
MONTH_NUMBER = m
IMPORTING
* LANGU_BACK =
LONGTEXT = month_name .
concatenate month_name s_date-low+0(4) into descr separated by ''.
wa_fieldcat-col_pos = count.
wa_fieldcat-row_pos = '1'.
wa_fieldcat-fieldname = field.
wa_fieldcat-seltext_m = descr.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
ENDDO.
After this create dynamic table using,
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fldcat
IMPORTING
ep_table = t_newtable.
then loop the internal table and assign the component to final internal table,.
like .,
CONCATENATE 'FIELD' index INTO fieldvalue. " do same like fieldcatalog
ASSIGN COMPONENT fieldvalue OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = wa-fieldvalue.
hope this helps u.,
Thanks & Regards,
Kiran -
Display information on Month wise
We have one requirement and we need to display the Month wise information on the report (Sysdate - 1, sydate -2 ....etc)
for example today is 08 Sept 2011 In template level we need to display below
Sept 2011 Aug 2011 Jul 2011 Jun 2011 May 2011 Apr 2011
Please let me know if it's possible to do in RTF Template.Pull all the required date and data from DB using queries,.
-
Display total dmbtr according to mat type and month wise
hi all,
i want to display total dmbtr according to mat type and month wise. like
month mat.type total_dmbtr
jan 2008 fert xxxxxxxxxx
jan 2008 mcfe yyyyyyyy
feb 2008 fert mmmmmthis is my prog..but am gettin o/p for one month irrespective of material type..
tables : mseg, mkpf, mara, S031.
********************DECLARATION******************************************
types : begin of ty_mkpf,
budat type budat,
mblnr type mblnr,
end of ty_mkpf.
TYPES : BEGIN OF TY_S031,
WERKS TYPE werks_d,
SPMON TYPE SPMON,
matnr TYPE matnr,
END OF TY_S031.
types : begin of ty_mseg,
mblnr type mblnr,
matnr type matnr,
werks type werks_d,
menge type menge_d,
dmbtr type dmbtr,
bwart type bwart,
end of ty_mseg.
types : begin of ty_mara,
matnr type matnr,
mtart type mtart,
end of ty_mara.
data : it_mkpf type ty_mkpf occurs 0 with header line,
it_mseg type ty_mseg occurs 0 with header line,
it_mara type ty_mara occurs 0 with header line,
IT_S031 TYPE TY_S031 OCCURS 0 WITH HEADER LINE.
it_final TYPE ty_final OCCURS 0 WITH HEADER LINE.
data : flag type dmbtr,
flag1 type dmbtr ,
flag3 type dmbtr ,
flag4 type dmbtr,
flag5 type dmbtr,
flag6 type dmbtr,
flag7 type dmbtr,
f1 type i VALUE 0,
num_of_loops TYPE i VALUE 0,
flag2 TYPE spmon.
**********************************INITIALIZATION***************************
flag = 0.
flag1 = 0.
flag3 = 0.
flag4 = 0.
flag5 = 0.
flag6 = 0.
flag7 = 0.
******************selection screen*****************************************
selection-screen begin of block b1 with frame title txt_001.
select-options : plant for S031-werks,
month for S031-SPMON.
date for mkpf-budat. "+4(2).
MONTH FOR MONTH_NAMES_GET.
selection-screen end of block b1.
flag2 = month-low.
f1 = month-high - month-low.
if month-high is initial.
num_of_loops = 1.
else.
num_of_loops = f1 + 1.
endif.
start-of-selection.
perform getdata1.
*& Form get_data
text
form getdata1.
if month-high is INITIAL.
write : / 'for month ' COLOR COL_GROUP, flag2 COLOR COL_GROUP.
Select WERKS SpMON matnr from S031 into corresponding fields of table it_S031
where SpMON = flag2 AND WERKS IN PLANT.
loop at IT_S031.
at first.
write : /5 'mat_num', 20 'month', 40 'QTY',58'amt',68'movement_type', 85'mat_type'. ",105 'qty remaining'.
skip.
endat.
select single mblnr werks matnr menge dmbtr bwart from mseg into corresponding fields of it_mseg
where werks = IT_S031-werks and ( bwart = '102' or bwart = '101' or bwart = '601' or bwart = '602' )
and matnr = it_s031-matnr.
if it_mseg-bwart = '101'.
flag = flag + it_mseg-dmbtr.
elseif it_mseg-bwart = '102'.
flag1 = flag1 + it_mseg-dmbtr.
elseif it_mseg-bwart = '601' .
flag4 = flag4 + it_mseg-dmbtr.
elseif it_mseg-bwart = '602' .
flag5 = flag5 + it_mseg-dmbtr.
endif.
flag3 = flag - flag1. "101-102
flag6 = flag4 - flag5. "601-602
select SINGLE matnr mtart from mara into corresponding fields of it_mara
where matnr = it_mseg-matnr. " and mtart = 'FERT' .
loop at it_mara.
write : / it_mara-matnr,20 IT_S031-SPMON, it_mseg-menge, it_mseg-dmbtr, 70 it_mseg-bwart, 88 it_mara-mtart.
skip.
endloop.
endloop.
skip 1.
write : / 'TOTAL QTY RECVD (a = 101-102) ' , flag3.
write : / 'TOTAL QTY CONSUMED ( b = 601-602) ' , flag6.
flag7 = flag3 - flag6.
write : / 'QTY REMAINING (a-b) ' , flag7.
skip 2.
flag = 0.
flag3 = 0.
flag4 = 0.
flag5 = 0.
flag6 = 0.
flag7 = 0.
flag2 = flag2 + 1.
endif.
do num_of_loops times.
if not flag2 gt month-high.
write : / 'for month ' COLOR COL_GROUP, flag2 COLOR COL_GROUP.
Select WERKS SpMON matnr from S031 into corresponding fields of table it_S031
where SpMON = flag2 AND WERKS IN PLANT.
loop at IT_S031.
at first.
write : /5 'mat_num', 20 'month', 40 'QTY',58'amt',68'movement_type', 85'mat_type'. ",105 'qty remaining'.
skip.
endat.
select single mblnr werks matnr menge dmbtr bwart from mseg into corresponding fields of it_mseg
where werks = IT_S031-werks and ( bwart = '102' or bwart = '101' or bwart = '601' or bwart = '602' )
and matnr = it_s031-matnr.
if it_mseg-bwart = '101'.
flag = flag + it_mseg-dmbtr.
elseif it_mseg-bwart = '102'.
flag1 = flag1 + it_mseg-dmbtr.
elseif it_mseg-bwart = '601' .
flag4 = flag4 + it_mseg-dmbtr.
elseif it_mseg-bwart = '602' .
flag5 = flag5 + it_mseg-dmbtr.
endif.
flag3 = flag - flag1. "101-102
flag6 = flag4 - flag5. "601-602
select matnr mtart from mara into corresponding fields of table it_mara
where matnr = it_mseg-matnr. " and mtart = 'FERT' .
loop at it_mara.
write : / it_mara-matnr,20 IT_S031-SPMON, it_mseg-menge, it_mseg-dmbtr, 70 it_mseg-bwart, 88 it_mara-mtart.
skip.
endloop.
endloop.
skip 1.
write : / 'total recd qty (a = 101-102) ' , flag3.
write : / 'total Qty consumed ( b = 601-602) ' , flag6.
flag7 = flag3 - flag6.
write : / 'Qty remaining (a-b) ' , flag7.
skip 2.
flag = 0. flag3 = 0. flag4 = 0. flag5 = 0. flag6 = 0. flag7 = 0.
flag2 = flag2 + 1.
endif.
enddo.
endform. "getdata1 -
Hi all,
I have my data in the table as date wise. I need to sum this data in month wise.
Can anyone tell me how to do it. Is their any fm to do it or any sample pgm of this kind.
For ex my output should be like this :
field1 field2 Month1 Month2 Month3 Month4 ..
Waiting for reply,
Regards,
Priyahi priya,
First of all sort the whole set of values as per date wise into an internal table.
Sort the table as per the date .
CONCATENATE PR_MONTH '01' INTO W_FIRST_DATE.
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = W_FIRST_DATE
IMPORTING
LAST_DAY_OF_MONTH = W_LAST_DATE
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
W_DATE = W_FIRST_DATE.
With this try to determine the first and last days of the month
From where u want to start .
Capture the month field from date field into pr_month.
Set the first date of the month to 01 like 02/01/2006
Suppose u had 02/02/2006 as the first occurance of the date then
U r trying to determine the first date and last date of ur feb month for the year 2006 .
Now 02/01/2006 and 02/28/2006 are determined by this process .
Set date_low = 02/01/2006 .
Date_high = 02/28/2006.
Now into ur select statement capture the fields between 02/01/2006 and 02/28/2006 just like range .
U can use select between or range
,so this covers all the fields for feb ,
Use collect on ur final output table which will give u the final sum values.
Now next field is say 03/10/2006 , then use the same process to capture the values .
Itab say is containg date fields
Logic is
Loop at itab.
Month = itab-date+(x)
At new month.
Perform operation .
Endat.
Endloop. -
Dear All
i have new report for customer booking plan. i am display month wise.
but now i am dispay Fiscal month wise but not working
the following is my code
*& Report ZCUST_ORDER *
REPORT z_cust_balance LINE-SIZE 335.
TABLES : kna1,
vbak,
vbap,
lips,
vbuk,
t247,
zmm_style_mast,
vbep.
INCLUDE <icons>.
*DATA: t_month LIKE t247 OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF t_month OCCURS 0,
SPRAS LIKE t247-SPRAS,
MNR LIKE t247-MNR,
KTX LIKE t247-KTX,
LTX LIKE t247-LTX,
TMPMNR LIKE t247-MNR,
END OF t_month.
DATA : begin of jest1 OCCURS 0,
objnr like jest-objnr,
stat like jest-stat,
inact like jest-inact,
end of jest1.
DATA : BEGIN OF itab_month OCCURS 0,
month_val(2),
width_val(4) TYPE n,
END OF itab_month.
Data: begin of month_total occurs 0,
monthcode(2),
month(10),
tempttl type p,
qty(16) type p ,
val(16) type p ,
tmpqty type p,
tmpval type p ,
end of month_total.
*for Grand total
Data: begin of month_ttl occurs 0,
ttlqty type p ,
ttlval type p ,
end of month_ttl.
DATA: BEGIN OF it_summary OCCURS 0,
month(2),
tmpmonth(2),
kunnr LIKE vbak-kunnr,
name1 LIKE kna1-name1,
kwmeng(16) TYPE p,
tempso like vbap-vbeln,
kursk(16) TYPE p DECIMALS 2,
delqty(16) TYPE p,
matnr like vbap-matnr,
balqty(16) TYPE p,
netval(16) TYPE p DECIMALS 2,
END OF it_summary.
DATA: BEGIN OF t_list1 OCCURS 0,
kunnr LIKE vbak-kunnr,
month(2),
name1 LIKE kna1-name1,
kwmeng(16) TYPE p,
fld2 TYPE VBAK-VBELN,
kursk(16) TYPE p,
delqty(16) TYPE p,
balqty(16) TYPE p,
netval(16) TYPE p,
END OF t_list1.
DATA : t_list LIKE t_list1 OCCURS 0 WITH HEADER LINE.
*DATA : t_list1 LIKE it_summary OCCURS 0 WITH HEADER LINE.
DATA tmp_vlist LIKE it_summary OCCURS 0 WITH HEADER LINE.
DATA tmp_vlist1 LIKE it_summary OCCURS 0 WITH HEADER LINE.
data month_total1 like month_total OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF itb_vbak OCCURS 0,
kunnr LIKE vbak-kunnr,
month(2),
TMPmnr(2),
tempso like vbap-vbeln,
name1 LIKE kna1-name1,
kwmeng(16) TYPE p," LIKE vbap-kwmeng,
vbeln LIKE vbak-vbeln,
posnr LIKE vbap-posnr,
vgbel LIKE lips-vgbel,
vgpos LIKE lips-vgpos,
matnr like vbap-matnr,
waerk LIKE vbap-waerk ,
pstyv LIKE vbap-pstyv,
objnr LIKE vbap-objnr,
etenr LIKE vbep-etenr,
netwr(16) TYPE p," LIKE vbap-netwr ,
vkorg LIKE vbak-vkorg,
edatu LIKE vbep-edatu,
lfimg LIKE lips-lfimg,
vrkme LIKE vbap-vrkme,
netvl(16) TYPE p ,
style like zmm_style_mast-style,
jahr like zmm_style_mast-jahr,
cu_style like zmm_style_mast-CU_STYLE,
DECIMALS 2,
netvl LIKE vbap-netwr,
kursk(16) TYPE p DECIMALS 2,
netpr LIKE vbap-netpr,
balqty(16) TYPE p,
totdlr type p DECIMALS 2, "total dlr value
comp(1) ,
END OF itb_vbak.
DATA: BEGIN OF itb_del OCCURS 0,
vbeln LIKE lips-vbeln,
lfdat LIKE likp-lfdat,
kunnr LIKE likp-kunnr,
posnr LIKE lips-posnr,
lfimg LIKE lips-lfimg,
meins LIKE lips-meins,
vgbel LIKE lips-vgbel,
vgpos LIKE lips-vgpos,
month(2),
END OF itb_del.
DATA: BEGIN OF itb_price OCCURS 0,
vbeln LIKE vbkd-vbeln,
posnr LIKE vbkd-posnr,
kursk LIKE vbkd-kursk,
END OF itb_price.
DATA :tmp_qty(16) TYPE p ,
flag(3),
FRMyear(4),
TOyear(4),
FRMMON(2),
TOMON(2),
difyr(2),
difmo(2),
tmpvbeln like lips-vbeln.
DATA t_vbak LIKE itb_vbak OCCURS 0 WITH HEADER LINE .
DATA t_vbak1 LIKE itb_vbak OCCURS 0 WITH HEADER LINE .
DATA t_vbak2 LIKE itb_vbak OCCURS 0 WITH HEADER LINE .
DATA t_vbak3 LIKE itb_vbak OCCURS 0 WITH HEADER LINE .
DATA t_vbak4 LIKE itb_vbak OCCURS 0 WITH HEADER LINE .
DATA t_vbak5 LIKE itb_vbak OCCURS 0 WITH HEADER LINE .
DATA t_vbak6 LIKE itb_vbak OCCURS 0 WITH HEADER LINE .
DATA t_jest LIKE jest1 OCCURS 0 WITH HEADER LINE.
for perform sub total
DATA tmp_vbak LIKE t_vbak1 OCCURS 0 WITH HEADER LINE.
DATA tmp_vbak1 LIKE t_vbak1 OCCURS 0 WITH HEADER LINE.
DATA t_kunnr TYPE kunnr OCCURS 0 .
DATA : t_eindt(4),
wa_name1 LIKE kna1-name1,
conf LIKE vbep-bmeng,
t_vbeln LIKE vbak-vbeln,
t_lfimg(16) TYPE p,
t_kursk(16) TYPE p DECIMALS 2,
t_kwmeng(16) TYPE p ,
t_netval(16) TYPE p,
tmp_posnr LIKE vbap-posnr,
customer_bal_qty(16) TYPE p,
dbcnt TYPE i,
p_month(2),
TMPmnr(2),
tmpmonth(2),
tbcnt(4) TYPE n,
month_name(10) ,
result_width(4) TYPE n,
h_width(4) TYPE n,
f_width(4) TYPE n,
fld(30),
bal_tot_val(16) TYPE p ,
drilldown_cnt(1) TYPE n VALUE 0,
vbeln1 LIKE vbap-vbeln,
subtot LIKE vbep-wmeng,
eblen1 LIKE vbap-vbeln,
t_totdlr(16) type p DECIMALS 2,
t_tmpnetval(16) type p DECIMALS 2.
RANGES: salesno FOR vbak-vbeln,
fld1 FOR vbak-kunnr,
it_objnr FOR vbap-objnr.
DATA: f(12),
current_row(20),
tmp_kunnr LIKE vbak-kunnr.
DATA : balance_qty(16) TYPE p,
balance_val(16) TYPE p,
cust_bal_val(16) TYPE p,
tmp_bal_val(16) TYPE p,
tmp_bal(16) TYPE p.
SELECTION-SCREEN: BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: kunnr FOR vbak-kunnr.
SELECT-OPTIONS: p_vdatu FOR vbak-erdat OBLIGATORY.
SELECT-OPTIONS: p_vbeln FOR vbak-vbeln.
SELECT-OPTIONS: vkorg FOR vbak-vkorg OBLIGATORY.
SELECTION-SCREEN END OF BLOCK 1.
SELECTION-SCREEN: BEGIN OF BLOCK 2 WITH FRAME TITLE text-002.
PARAMETERS: qty RADIOBUTTON GROUP r1 DEFAULT 'X',
val RADIOBUTTON GROUP r1.
SELECTION-SCREEN: END OF BLOCK 2.
START-OF-SELECTION.
DATA tmp_date(6) TYPE c.
CONCATENATE '%' eindt+3(4) '%' INTO tmp_date.
FRMyear = p_vdatu+3(4).
TOyear = p_vdatu+11(4).
difyr = TOyear - FRMyear.
FRMMON = p_vdatu+7(2).
TOMON = p_vdatu+15(2).
if ( difyr = 0 ) AND ( ( FRMMON > 3 ) AND ( TOMON <= 12 ) ) .
write: 'Srini'.
elseif
( difyr = 0 ) AND ( ( FRMMON <= 3 ) AND ( TOMON <= 3 ) ).
write: 'ravi'.
elseif
endif.
difyr = 1 and ( FRMMON > 3 and TOMON <= 3 ).
write: 'Suresh'.
else.
if difyr > 1.
WRITE : 'Check Your Fiscal Date Month Year ....'.
exit.
endif.
SELECT * FROM t247 INTO TABLE t_month WHERE spras EQ 'EN'.
BMENG(Confirmed qty) changed by wMENG(Order qty)
SELECT shkunnr kname1 slWMENG sfwaerk sf~netwr
shvbeln slposnr shvkorg sledatu sf~vrkme
shnetwr vkkursk sfnetpr sletenr sf~objnr
sfpstyv sfmatnr
INTO (itb_vbak-kunnr,
itb_vbak-name1,
itb_vbak-kwmeng,
itb_vbak-waerk,
itb_vbak-netwr,
itb_vbak-vbeln,
itb_vbak-posnr,
itb_vbak-vkorg,
itb_vbak-edatu,
itb_vbak-vrkme,
itb_vbak-netvl,
itb_vbak-kursk,
itb_vbak-netpr,
itb_vbak-etenr,
itb_vbak-objnr,
itb_vbak-pstyv,
itb_vbak-matnr)
FROM vbak AS sh
INNER JOIN vbuk AS vb ON
shvbeln = vbvbeln
INNER JOIN vbap AS sf ON
shvbeln = sfvbeln
INNER JOIN vbep AS sl ON
sfvbeln = slvbeln AND
sfposnr = slposnr
INNER JOIN vbkd AS vk ON
slvbeln = vkvbeln
INNER JOIN kna1 AS k ON
shkunnr = kkunnr
WHERE
" sh~vdatu IN p_vdatu AND
vk~posnr EQ 0 AND
sh~vbeln IN p_vbeln AND
sh~kunnr IN kunnr AND
sh~vkorg IN vkorg AND
vbak-erdat
sh~erdat IN p_vdatu AND
vb~spstg EQ space AND
sl~wmeng NE 0 AND
sf~abgru EQ space
" sf~pstyv EQ 'TASS'
ORDER BY sh~kunnr.
itb_vbak-month = itb_vbak-edatu+4(2).
itb_vbak-netvl = ( itb_vbak-kwmeng - itb_vbak-lfimg ) *
*( itb_vbak-kursk * itb_vbak-netpr ).
salesno-low = itb_vbak-vbeln.
salesno-sign = 'I'.
salesno-option = 'EQ'.
it_objnr-low = itb_vbak-objnr.
it_objnr = 'I'.
it_objnr-option = 'EQ'.
APPEND it_objnr.
APPEND itb_vbak.
APPEND salesno.
*Test
select objnr stat inact INTO (t_jest-objnr, t_jest-stat, t_jest-inact) FROM jest
WHERE objnr eq itb_vbak-objnr and inact ne 'X' and ( stat = 'I0043' OR stat = 'I0045' ) .
append t_jest.
endselect.
ENDSELECT.
DELETE ADJACENT DUPLICATES FROM salesno.
CLEAR salesno.
SELECT * FROM jest INTO CORRESPONDING FIELDS OF TABLE t_jest WHERE
objnr IN it_objnr.
*test
*select objnr stat inact FROM jest INTO CORRESPONDING FIELDS OF TABLE t_jest WHERE
objnr IN it_objnr.
*loop at it_objnr.
*select objnr stat inact FROM jest INTO (t_jest-objnr, t_jest-stat, t_jest-inact) WHERE
objnr IN it_objnr and inact ne 'X' and ( stat = 'I0043' OR stat = 'I0045' ).
*append t_jest.
*endselect.
*endloop.
*t_vbak5[] = itb_vbak[].
*SORT t_vbak5 BY month.
**Test
loop at t_vbak5.
read table t_vbak6 with key month = t_month-MNR.
if sy-subrc = 0.
t_vbak6-month = t_month-tmpMNR.
modify t_vbak6 index sy-tabix.
else.
append t_vbak5 to t_vbak6.
endif.
clear : t_vbak5, t_vbak6.
endloop.
t_vbak3[] = itb_vbak[].
t_vbak3[] = t_vbak6[].
LOOP AT t_vbak3 WHERE objnr NE space .
LOOP AT t_jest WHERE objnr = t_vbak3-objnr AND
( stat = 'I0043' OR stat = 'I0045' ) AND
inact NE 'X'.
DELETE salesno WHERE low EQ t_vbak3-vbeln.
DELETE itb_vbak WHERE vbeln EQ t_vbak3-vbeln.
EXIT.
ENDLOOP.
ENDLOOP.
DELETE itb_vbak WHERE pstyv = 'TASS'.
SELECT lp~vbeln
lp~posnr
lp~lfimg
lk~lfdat
lk~kunnr
lp~meins
lp~vgbel
lp~vgpos INTO
(itb_del-vbeln,
itb_del-posnr,
itb_del-lfimg,
itb_del-lfdat,
itb_del-kunnr,
itb_del-meins,
itb_del-vgbel,
itb_del-vgpos)
FROM lips AS lp INNER JOIN likp AS lk ON
lpvbeln EQ lkvbeln INNER JOIN
vbap AS vb ON
lpvgbel EQ vbvbeln AND
lpvgpos EQ vbposnr
INNER JOIN vbuk AS vk ON
lpvbeln EQ vkvbeln
WHERE vk~wbstk EQ 'C' AND
lp~vgbel IN salesno.
itb_del-month = itb_del-lfdat+4(2).
APPEND itb_del.
ENDSELECT.
loop at itb_vbak .
tmpvbeln = itb_vbak-vbeln.
SELECT vbeln posnr kursk INTO
(itb_price-vbeln,
itb_price-posnr,
itb_price-kursk) FROM vbkd
where VBELN eq tmpvbeln .
APPEND itb_price.
ENDSELECT.
endloop.
CLEAR conf.
SORT itb_vbak BY month
kunnr
name1
kwmeng
vbeln
posnr
etenr.
REFRESH t_vbak3.
CLEAR t_vbak3.
t_vbak2[] = itb_vbak[].
SORT t_vbak2 BY kunnr month .
*Test
loop at it_vbak2.
read table t_month with key month = t_month-MNR.
if sy-subrc = 0.
it_vbak2-month = t_month-tmpMNR.
endif.
endloop
LOOP AT t_vbak2 .
tmp_kunnr = t_vbak2-kunnr.
wa_name1 = t_vbak2-name1.
t_month = t_vbak2-month.
p_month = t_vbak2-month.
t_kursk = t_vbak2-kursk.
AT NEW month.
PERFORM get_finmonth_name TABLES it_summary USING p_month.
AT NEW kursk.
PERFORM tot_qty_cust_month TABLES itb_vbak USING p_month
tmp_kunnr.
it_summary-kursk = t_kursk.
it_summary-month = p_month.
it_summary-kunnr = tmp_kunnr.
it_summary-name1 = wa_name1.
it_summary-kwmeng = t_kwmeng.
PERFORM tot_del_cust USING p_month tmp_kunnr.
it_summary-delqty = tmp_qty .
it_summary-balqty = it_summary-kwmeng - tmp_qty.
it_summary-netval = it_summary-balqty * it_summary-kursk * t_totdlr.
it_summary-netval = it_summary-kursk * t_totdlr.
it_summary-netval = t_tmpnetval.
For get month wise total qty and value
month_total-monthcode = p_month.
month_total-qty = it_summary-balqty.
month_total-val = it_summary-netval.
month_ttl-ttlqty = month_ttl-ttlqty + it_summary-balqty.
month_ttl-ttlval = month_ttl-ttlval + it_summary-netval.
ENDAT.
it_summary-netval = t_kursk.
APPEND it_summary.
append month_total.
append month_ttl.
ENDAT.
ENDLOOP.
SORT month_total BY monthcode.
DELETE it_summary WHERE balqty LE 0.
IF qty = 'X'.
write all the month's horizontaly********************************
IF sy-subrc = 0 .
SORT it_summary BY month kunnr.
loop at it_summary.
move-corresponding it_summary to t_list .
append t_list.
endloop.
SORT : t_vbak BY KUNNR month ,
t_list by kunnr MONTH.
DESCRIBE TABLE t_vbak3 LINES dbcnt .
IF it_summary IS NOT INITIAL .
h_width = 50.
WRITE: 1 sy-vline.
LOOP AT it_summary.
AT NEW month.
PERFORM get_month_name USING it_summary-month.
FORMAT COLOR 4 INTENSIFIED OFF.
WRITE AT h_width(17) sy-vline.
WRITE AT h_width(17) month_name CENTERED.
h_width = h_width - 1.
WRITE AT h_width sy-vline.
h_width = h_width + 17 .
itab_month-month_val = it_summary-month.
itab_month-width_val = h_width + 20.
APPEND itab_month.
HIDE month_name.
ENDAT.
AT LAST .
WRITE AT h_width(1) sy-vline.
h_width = h_width + 3.
WRITE: AT h_width 'Total' CENTERED.
h_width = h_width + 30.
WRITE AT h_width sy-vline.
ENDAT.
ENDLOOP.
WRITE AT h_width sy-vline.
NEW-LINE .
********Write qty horizontaly***************************
h_width = 50.
WRITE AT 1 sy-vline.
WRITE AT 1(h_width) sy-vline.
LOOP AT it_summary.
AT NEW month.
FORMAT COLOR 5 INTENSIFIED OFF.
WRITE AT h_width(16) sy-vline.
WRITE AT h_width(16) 'Order Qty' CENTERED.
h_width = h_width - 1.
WRITE AT h_width sy-vline.
h_width = h_width + 17.
WRITE AT h_width sy-vline.
ENDAT.
AT LAST .
h_width = h_width + 1.
WRITE AT h_width(16) sy-vline.
WRITE AT h_width(33) 'Order Qty' CENTERED.
h_width = h_width - 1.
WRITE AT h_width sy-vline.
h_width = h_width + 33.
WRITE AT h_width sy-vline.
ENDAT.
ENDLOOP.
******Write customer Name grouped by*************************
WRITE AT /1(h_width) sy-uline.
LOOP AT t_list.
WRITE :AT 1 sy-vline.
AT NEW kunnr.
LOOP AT it_summary WHERE kunnr EQ t_list-kunnr.
MOVE-CORRESPONDING it_summary TO t_list1.
APPEND t_list1.
ENDLOOP.
DELETE it_summary WHERE kunnr EQ t_list-kunnr.
HIDE kunnr.
ENDAT.
SORT t_list1 BY kunnr name1 month.
LOOP AT t_list1.
AT FIRST .
FORMAT COLOR 3 INTENSIFIED OFF.
NEW-LINE.
WRITE: 1 sy-vline.
WRITE:2(10) t_list-kunnr HOTSPOT ON.
WRITE: AT 12 sy-vline.
WRITE:13(37) t_list-name1 HOTSPOT ON.
WRITE: AT 49 sy-vline.
SET LEFT SCROLL-BOUNDARY.
ENDAT.
FORMAT COLOR 2 INTENSIFIED OFF.
AT NEW month.
PERFORM write_position USING t_list1-month.
f_width = result_width - 35.
SUM.
WRITE :AT f_width(15) t_list1-balqty.
f_width = f_width + 15.
ENDAT.
AT LAST.
SUM.
f_width = h_width - 32.
WRITE :AT f_width(3) icon_sum AS ICON COLOR 6 INTENSIFIED OFF.
f_width = f_width + 3.
WRITE :AT f_width(30) t_list1-balqty COLOR 6 INTENSIFIED OFF.
f_width = f_width + 30.
ENDAT.
ENDLOOP.
WRITE :AT h_width sy-vline.
REFRESH t_list1.
ENDLOOP.
WRITE :AT /1(h_width) sy-uline.
write: /' '.
write: / ' '.
WRITE :'TOTAL'.
loop at month_total.
AT NEW monthcode.
PERFORM write_position USING month_total-monthcode.
f_width = result_width - 35.
SUM.
WRITE :AT f_width(15) month_total-qty.
f_width = f_width + 15.
endat.
endloop.
WRITE :AT f_width(34) month_ttl-ttlqty COLOR 6 INTENSIFIED OFF.
f_width = f_width + 30.
ELSE.
WRITE : 'Sorry No Results found ....'.
ENDIF.
* command
value
ELSEIF val = 'X'.
write all the month's horizontaly********************************
IF sy-subrc = 0 .
SORT it_summary BY month kunnr.
loop at it_summary.
move-corresponding it_summary to t_list .
append t_list.
endloop.
SORT : t_vbak BY KUNNR month ,
t_list by kunnr MONTH.
DESCRIBE TABLE t_vbak3 LINES dbcnt .
IF it_summary IS NOT INITIAL .
h_width = 50.
WRITE: 1 sy-vline.
LOOP AT it_summary.
AT NEW month.
PERFORM get_month_name USING it_summary-month.
FORMAT COLOR 4 INTENSIFIED OFF.
WRITE AT h_width(17) sy-vline.
WRITE AT h_width(17) month_name CENTERED.
h_width = h_width - 1.
WRITE AT h_width sy-vline.
h_width = h_width + 17 .
itab_month-month_val = it_summary-month.
itab_month-width_val = h_width + 20.
APPEND itab_month.
HIDE month_name.
ENDAT.
AT LAST .
WRITE AT h_width(1) sy-vline.
h_width = h_width + 3.
WRITE: AT h_width 'Total' CENTERED.
h_width = h_width + 30.
WRITE AT h_width sy-vline.
ENDAT.
ENDLOOP.
WRITE AT h_width sy-vline.
NEW-LINE .
********Write qty horizontaly***************************
h_width = 50.
WRITE AT 1 sy-vline.
WRITE AT 1(h_width) sy-vline.
LOOP AT it_summary.
AT NEW month.
FORMAT COLOR 5 INTENSIFIED OFF.
WRITE AT h_width(16) sy-vline.
WRITE AT h_width(16) 'Order Val(INR)' CENTERED.
h_width = h_width - 1.
WRITE AT h_width sy-vline.
h_width = h_width + 17.
WRITE AT h_width sy-vline.
ENDAT.
AT LAST .
h_width = h_width + 1.
WRITE AT h_width(16) sy-vline.
WRITE AT h_width(33) 'Order Val(INR)' CENTERED.
h_width = h_width - 1.
WRITE AT h_width sy-vline.
h_width = h_width + 33.
WRITE AT h_width sy-vline.
ENDAT.
ENDLOOP.
******Write customer Name grouped by*************************
WRITE AT /1(h_width) sy-uline.
LOOP AT t_list.
WRITE :AT 1 sy-vline.
AT NEW kunnr.
LOOP AT it_summary WHERE kunnr EQ t_list-kunnr.
MOVE-CORRESPONDING it_summary TO t_list1.
APPEND t_list1.
ENDLOOP.
DELETE it_summary WHERE kunnr EQ t_list-kunnr.
HIDE kunnr.
ENDAT.
SORT t_list1 BY kunnr name1 month.
LOOP AT t_list1.
AT FIRST .
FORMAT COLOR 3 INTENSIFIED OFF.
NEW-LINE.
WRITE: 1 sy-vline.
WRITE:2(10) t_list-kunnr HOTSPOT ON.
WRITE: AT 12 sy-vline.
WRITE:13(37) t_list-name1 HOTSPOT ON.
WRITE: AT 49 sy-vline.
SET LEFT SCROLL-BOUNDARY.
ENDAT.
FORMAT COLOR 2 INTENSIFIED OFF.
AT NEW month.
PERFORM write_position USING t_list1-month.
f_width = result_width - 35.
SUM.
WRITE :AT f_width(15) t_list1-netval.
f_width = f_width + 15.
ENDAT.
AT LAST.
SUM.
f_width = h_width - 32.
WRITE :AT f_width(3) icon_sum AS ICON COLOR 6 INTENSIFIED OFF.
f_width = f_width + 3.
WRITE :AT f_width(30) t_list1-netval COLOR 6 INTENSIFIED OFF.
f_width = f_width + 30.
ENDAT.
ENDLOOP.
WRITE :AT h_width sy-vline.
REFRESH t_list1.
ENDLOOP.
WRITE :AT /1(h_width) sy-uline.
write: /' '.
write: / ' '.
WRITE :'TOTAL'.
loop at month_total.
AT NEW monthcode.
PERFORM write_position USING month_total-monthcode.
f_width = result_width - 35.
SUM.
WRITE :AT f_width(15) month_total-val.
f_width = f_width + 15.
endat.
endloop.
WRITE :AT f_width(34) month_ttl-ttlval COLOR 6 INTENSIFIED OFF.
f_width = f_width + 30.
ELSE.
WRITE : 'Sorry No Results found ....'.
ENDIF.
ENDIF.
NEW-LINE.
*********Position of the field for the corresponding month******
FORM write_position USING p_position.
LOOP AT itab_month WHERE month_val EQ p_position.
result_width = itab_month-width_val.
ENDLOOP.
ENDFORM. "Write_position
*& Form month_splitter
text
FORM get_month_name USING p_month.
CASE p_month.
WHEN '01'.
month_name = 'January'.
WHEN '02'.
month_name = 'February'.
WHEN '03'.
month_name = 'March'.
WHEN '04'.
month_name = 'April'.
WHEN '05'.
month_name = 'May'.
WHEN '06'.
month_name = 'June'.
WHEN '07'.
month_name = 'July'.
WHEN '08'.
month_name = 'August'.
WHEN '09'.
month_name = 'September'.
WHEN '10'.
month_name = 'October'.
WHEN '11'.
month_name = 'November'.
WHEN '12'.
month_name = 'December'.
*WHEN '01'.
month_name = ' April '.
WHEN '02'.
month_name = ' May '.
WHEN '03'.
month_name = ' June '.
WHEN '04'.
month_name = ' July '.
WHEN '05'.
month_name = ' August '.
WHEN '06'.
month_name = ' September '.
WHEN '07'.
month_name = ' October '.
WHEN '08'.
month_name = ' November '.
WHEN '09'.
month_name = ' December '.
WHEN '10'.
month_name = ' January '.
WHEN '11'.
month_name = ' February '.
WHEN '12'.
month_name = ' March '.
WHEN OTHERS.
month_name = 'Errror..'.
ENDCASE.
ENDFORM. "month_splitter
FORM get_finmonth_name USING p_month.
LOOP AT t_month where mnr eq p_month.
CASE t_month-mnr.
WHEN '01'.
TMPmnr = '10'.
WHEN '02'.
TMPmnr = '11'.
WHEN '03'.
TMPmnr = '12'.
WHEN '04'.
TMPmnr = '1'.
WHEN '05'.
TMPmnr = '2'.
WHEN '06'.
TMPmnr = '3'.
WHEN '07'.
TMPmnr = '4'.
WHEN '08'.
TMPmnr = '5'.
WHEN '09'.
TMPmnr = '6'.
WHEN '10'.
TMPmnr = '7'.
WHEN '11'.
TMPmnr = '8'.
WHEN '12'.
TMPmnr = '9'.
WHEN OTHERS.
TMPmnr = 'Errror..'.
ENDCASE.
ENDLOOP.
ENDFORM..
AT LINE-SELECTION.
IF sy-lsind = 1 .
READ CURRENT LINE LINE VALUE INTO f.
WRITE f+1(10) TO tmp_kunnr.
CLEAR: t_vbak.
REFRESH t_vbak1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = tmp_kunnr
IMPORTING
output = tmp_kunnr.
LOOP AT itb_vbak WHERE kunnr EQ tmp_kunnr.
MOVE-CORRESPONDING itb_vbak TO t_vbak1.
APPEND t_vbak1.
ENDLOOP.
FORMAT COLOR 5 INTENSIFIED OFF.
REFRESH t_vbak2.
CLEAR t_vbak2.
PERFORM get_balance_per_customer.
ELSEIF sy-lsind = 2 .
READ CURRENT LINE LINE VALUE INTO current_row.
READ LINE 4 LINE VALUE INTO f.
WRITE current_row+11(9) TO month_name.
WRITE f+1(10) TO tmp_kunnr.
PERFORM get_month_val USING month_name.
CLEAR: t_vbak,
t_vbak1.
REFRESH: t_vbak1.
CLEAR: t_vbak,
t_vbak1.
REFRESH: t_vbak1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = tmp_kunnr
IMPORTING
output = tmp_kunnr.
LOOP AT itb_vbak
WHERE kunnr EQ tmp_kunnr AND
month EQ p_month.
MOVE-CORRESPONDING itb_vbak TO t_vbak1.
APPEND t_vbak1.
ENDLOOP.
SORT:t_vbak1 BY KUNNR month vbeln.
REFRESH t_vbak2.
CLEAR t_vbak2.
REFRESH t_vbak.
CLEAR t_vbak.
t_vbak[] = itb_vbak[].
PERFORM get_month_namewise.
FORMAT COLOR 5 INTENSIFIED OFF.
ELSEIF sy-lsind = 3.
IF sy-cucol > 1 AND sy-cucol < 13.
GET CURSOR FIELD fld VALUE fld.
SET PARAMETER ID 'AUN' FIELD fld.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
endif.
ENDIF.
PERFORM write_item .
*& Form write_item
text
FORM write_item .
READ TABLE t_vbak2 INDEX 1.
IF t_vbak2 IS NOT INITIAL.
WRITE : 1(70) sy-uline.
WRITE : /1 sy-vline.
WRITE : 2(36) 'Customer' COLOR 1 INTENSIFIED ON.
WRITE : 38(22) 'Quantity' COLOR 1 INTENSIFIED ON.
WRITE : 58(12) 'Value in INR' COLOR 1 INTENSIFIED ON.
WRITE : 70 sy-vline.
WRITE : /1(70) sy-uline.
WRITE : /1 sy-vline.
FORMAT COLOR 2 INTENSIFIED OFF.
WRITE : 2(10) t_vbak2-kunnr COLOR 1 INTENSIFIED OFF.
WRITE : 12(58) t_vbak2-name1 COLOR 1 INTENSIFIED OFF.
WRITE 70 sy-vline.
IF sy-lsind = 2.
FORMAT COLOR 1 INTENSIFIED OFF.
WRITE :/1 sy-vline,
2(15) 'Sales Document',
17(10) 'Delivery Date',
28(10) 'Quantity ',
39(7) 'Uom',
47(15) 'Value in INR' RIGHT-JUSTIFIED,
65(20) 'Style'.
WRITE :/1 sy-vline,
2(15) 'Sales Document',
17(20) 'Style',
27(10) 'Delivery Date',
38(10) 'Quantity ',
49(7) 'Uom',
55(15) 'Value in INR' RIGHT-JUSTIFIED.
ENDIF.
WRITE 70 sy-vline.
DELETE t_vbak2 WHERE balqty <= 0.
LOOP AT t_vbak2.
AT NEW month.
PERFORM get_month_name USING t_vbak2-month.
WRITE /1(70) sy-uline.
WRITE /1 sy-vline.
WRITE :2(10) 'Month of' COLOR 3 INTENSIFIED ON ,
12(26) month_name COLOR 3 INTENSIFIED OFF.
HIDE month_name.
SUM.
PERFORM sum_balance TABLES t_vbak2 USING t_vbak2-month.
WRITE : 35(23) balance_qty COLOR 3 INTENSIFIED OFF CENTERED,
58(12) t_vbak2-netvl COLOR 3 INTENSIFIED OFF CENTERED.
*TEST
WRITE : 70 sy-vline.
ENDAT.
IF sy-lsind = 2.
FORMAT COLOR 4 INTENSIFIED OFF.
WRITE :/1 sy-vline.
WRITE : 2(15) t_vbak2-vbeln,
17(10) t_vbak2-edatu,
28(10) t_vbak2-balqty,
39(5) t_vbak2-vrkme HOTSPOT ON,
50(12) t_vbak2-netvl,
65(20) t_vbak2-cu_style.
WRITE 62 sy-vline.
WRITE :/1 sy-vline.
WRITE : 2(15) t_vbak2-vbeln,
17(20) t_vbak2-cu_style,
28(10) t_vbak2-edatu,
39(10) t_vbak2-balqty,
49(5) t_vbak2-vrkme HOTSPOT ON,
55(12) t_vbak2-netvl.
WRITE 70 sy-vline.
HIDE: t_vbak1-vbeln.
ENDIF.
AT LAST.
WRITE /1(70) sy-uline.
ENDAT.
ENDLOOP.
ENDIF.
ENDFORM. "writeat_item
**& Form get_month_val
text
-->MONTH_NAME text
FORM get_month_val USING month_name.
LOOP AT t_month WHERE ltx EQ month_name.
p_month = t_month-mnr.
p_month = t_month-TMPmnr.
ENDLOOP.
ENDFORM. "Write_position
*& Form sum_balance
text
-->P_MONTH text
FORM sum_balance TABLES p_table USING p_month .
CLEAR : tmp_vbak,
balance_qty.
REFRESH tmp_vbak.
tmp_vbak[] = p_table[].
LOOP AT tmp_vbak WHERE month EQ p_month AND kwmeng NE 0.
balance_qty = balance_qty + tmp_vbak-balqty .
"( tmp_vbak-kwmeng - tmp_vbak-lfimg ).
ENDLOOP.
ENDFORM. "sum_balance
*& Form sum_tot_balance
text
FORM sum_cust_tot_balance USING p_customer .
CLEAR : tmp_vbak1,
customer_bal_qty.
REFRESH tmp_vbak1.
tmp_vbak1[] = t_vbak[].
LOOP AT tmp_vbak1 WHERE kwmeng NE 0 AND
kunnr EQ p_customer .
customer_bal_qty = customer_bal_qty + tmp_vbak1-balqty .
"( tmp_vbak1-kwmeng - tmp_vbak1-lfimg ).
ENDLOOP.
ENDFORM. "sum_balance
*& Form sum_tot_balance
text
FORM sum_tot_balance .
CLEAR : tmp_vbak1,
balance_qty.
REFRESH tmp_vbak1.
tmp_vbak1[] = t_vbak[].
LOOP AT tmp_vbak1 WHERE kwmeng NE 0 .
balance_qty = balance_qty + tmp_vbak1-balqty .
"( tmp_vbak1-kwmeng - tmp_vbak1-lfimg ).
ENDLOOP.
ENDFORM. "sum_balance
*& Form sum_bal_val
text
-->P_TABLE text
-->P_MONTH text
FORM sum_bal_val TABLES p_table USING p_month .
CLEAR : tmp_vbak,
balance_val.
REFRESH tmp_vbak.
tmp_vbak[] = p_table[].
LOOP AT tmp_vbak WHERE month EQ p_month AND kwmeng NE 0.
balance_val = balance_val + tmp_vbak-netvl .
"( tmp_vbak-kwmeng - tmp_vbak-lfimg ).
ENDLOOP.
ENDFORM. "sum_balance
*& Form sum_cust_tot_bal_val
text
-->P_CUSTOMER text
FORM sum_cust_tot_bal_val USING p_customer.
CLEAR : tmp_vbak1,
cust_bal_val.
REFRESH tmp_vbak1.
tmp_vbak1[] = t_vbak[].
LOOP AT tmp_vbak1 WHERE kwmeng NE 0 AND
kunnr EQ p_customer.
cust_bal_val = cust_bal_val + tmp_vbak1-netvl .
"( tmp_vbak1-kwmeng - tmp_vbak1-lfimg ).
ENDLOOP.
ENDFORM. "sum_balance
*& Form sum_tot_bal_val
text
FORM sum_tot_bal_val .
CLEAR : tmp_vbak1,
bal_tot_val.
REFRESH tmp_vbak1.
tmp_vbak1[] = t_vbak[].
LOOP AT tmp_vbak1 WHERE kwmeng NE 0 .
bal_tot_val = bal_tot_val + tmp_vbak1-netvl .
*bal_tot_val = bal_tot_val + tmp_vbak1-totdlr .
t_totdlr
"( tmp_vbak1-kwmeng - tmp_vbak1-lfimg ).
ENDLOOP.
ENDFORM. "sum_balance test
*& Form sum_tot_delivery
text
FORM sum_tot_delivery USING p_saleno p_item.
LOOP AT itb_del WHERE vgbel EQ p_saleno AND
vgpos EQ p_item.
tmp_qty = tmp_qty + itb_del-lfimg.
ENDLOOP.
ENDFORM. "sum_tot_delivery
*& Form tot_del_cust
text
-->P_MONTH text
-->P_KUNNR text
FORM tot_del_cust USING p_month p_kunnr.
CLEAR tmp_qty.
LOOP AT itb_del WHERE month EQ p_month AND
kunnr EQ p_kunnr.
tmp_qty = tmp_qty + itb_del-lfimg.
ENDLOOP.
ENDFORM. "sum_tot_delivery
&----Hi,
We can do it using 2LIS_02_ITM and 2LIS_02_SCL with 0PUR_C01 InfoCubes. So check it, I have done using the same combinations.
https://wiki.sdn.sap.com/wiki/display/BI/BWSDMMFIDATASOURCES
Else you also check 0IC_C03 with 2LIS_03_ * DataSources.
Thanks
Reddy -
How to get database growth month wise
Hi All,
Can any one help me getting the growth of production database month wise for the current year.
I mean I need a script which will display the growth of my database month wise for the year 2010.
Regards,hi,
try something along the lines of this
--Run the following create table to create segment info.
create table stats$segment_info as
select
sysdate snap_time,owner, segment_name,segment_type , tablespace_name,sum(bytes) bytes from dba_segments group by owner,segment_type, segment_name,tablespace_name /
-- Run the following once a calendar month via dba_jobs.
insert into stats$segment_info
select
sysdate snap_time,owner, segment_name,segment_type , tablespace_name,sum(bytes) bytes from dba_segments group by owner,segment_type, segment_name,tablespace_name / commit;
-- run the following report to get tablesapace growth
column this_mon new_value this_mon
column last_mon new_value last_mon
column prev_mon new_value prev_mon
select to_char(sysdate,'MON YYYY') This_mon
, To_char(add_months(sysdate,-1),'MON YYYY') Last_mon
, to_char(add_months(sysdate,-2),'MON YYYY') prev_mon from dual;
column mins format 99999
column size_mb heading '&&this_mon' format 99999 column size_mb2 heading '&&prev_mon' format 99999 column size_mb1 heading '&&last_mon' format 99999
column growth heading 'Growth(%)| in |last month' format 9999.99
select tablespace_name,
-- to_char(snap_time,'MON YYYY') Month
max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-2),'MON'),size_m,0)) size_mb2
,max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-1),'MON'),size_m,0)) size_mb1
,max(decode(trunc(snap_time,'MON'),trunc(sysdate,'MON'),size_m,0)) size_mb
,100*(max(decode(trunc(snap_time,'MON'),trunc(sysdate,'MON'),size_m,0))
- max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-1),'MON'),size_m,0)))
/max(decode(trunc(snap_time,'MON'),trunc(add_months(sysdate,-1),'MON'),size_m,1)) growth from (select tablespace_name, snap_time
,sum(bytes)/1024/1024 size_M
from stats$segment_info
where snap_time > trunc(add_months(sysdate,-2),'MON')-2
group by tablespace_name,snap_time) a
group by tablespace_name
order by tablespace_name
/as far as I am aware this is database independent.
regards
Alan -
Dear All
Any Standared Report Available Customer month wise sales available?
Thanks and Regards
SureshHi,
To determine which info blocks should be displayed in the sales summary and how they should be combined in views, see the IMG under Sales and Distribution - Sales Support (CAS) - Sales Summary.
If you want the sales summary to appear differently to specific users, you can assign views to users in this Customizing step.
If you do not do this, the system displays the standard reporting view.
regards,
Siddharth. -
Sales voluem monthly wise report
Hi BW expert,
I need a repor like apr09,may09,june09 Q1, apr08,may08,june08 Q1 LY. but i restricted apr, may june on posting period its displaying only q1 . i need monthly wise like apr08,may08,june08.i searced this forum as per requirement its not displaying plz any one idea on this how to get montly wise .
Regards
ramakrishnaHi
Yes, it is possible to compare the sales for two different periods (be it date, month, quarter, half-year, full year, etc.). I used the fields "Calendar Year /Month period 1" and "Calendar Year /Month period 2" and also added a formula to show the growth in terms of percentages. And it is working well in my company.
In fact I designed the query in the following way:-
1. Month - (single month - say Sept. 2009)
2. Month - (single month - say Sept. 2008)
3. Months - (Jan/Sept. 2009)
4. Months - (Jan/Sept. 2008).
In the query I have made a comparison of sales, ie. sales of Sept. 2009 compared to Sept. 2008 and Sales of Jan/Sept. 2009 compared to Jan/Sept. 2008.
All the above done in a single query.
Regards
Jayan
Bangalore, India -
Stock report with value and qauntity for given date not month wise
Hi gems,
can any body give me the standard report for Stock value and qauntity for given date not month wise at storage location levelHi
check the report S_P00_07000139 with the option inventory and raw material report- detail and selection date (from, to date same). List will give opening & closing balances with goods movment and their values.
Thanks -
Is there a way to default the monthly calendar display
so that the current day always shows on top? ie, I want to always be able to see what's in the future 3-4 weeks, not what's in the past 3-4 weeks. The default monthly display is archaic--only allows you to see through the last day of the month. Suddenly today
is Oct. 30th, and I have a ton of projects lined up in November, but because I haven't been scrolling down every day, I haven't been aware of them every day. I realize there are other tools in Microsoft to help me stay on task, such as reminders and such,
but it would be helpful if I could always have the current day display on top of the monthly view so I can quickly scan what's coming up in the next few weeks.Thank you!
Right, I already have it in Month view. My question is a little more specific--I'd like for the current day to always display at the top. For example, today is Oct. 31st, so the current day is at the bottom of the calendar since it is the last day of the month.
I can view everything in October that I've already completed. What I can't see are the future weeks because we haven't hit November yet. I'd like for the current day to always display at the top of my calendar so I can always see what's coming in the following
three - four weeks (whether they're a part of that month or not). I've been to other forums trying to find the answer, and have come across the same exact question from frustrated users--but there seemed to be no solution. So I'm posing the question myself
in this forum. Do you know if this is possible? What I found from other forums is that Outlook defaults to a physical 'desk' type calendar format--so just as I'd use a paper calendar at my desk, I wouldn't be able to see the following weeks unless I either
flip the page to that month or I come to the first day of the next month, thereby tearing the the old month off and now only able to see the current month. That format is just so...paper...and archaic! Essentially I want the calendars to loop so it doesn't
even really matter what month it is--I just always want to see what lies ahead without having to scroll down. With our being in the Technology Age, I'd assume this is a logical expectation, but we may be stuck with the replica version of the paper-desk-calendar
format until Outlook programmers add this Technology Age feature in newer versions.
See, this month kind of messed me up because I have so many projects for November that start tomorrow and next week, but I haven't seen them until this week. I would have been better quipped--at least expecting them--had I been able to see all of those projects
since last week or the week prior.
If there is no solution to this answer, would you know how I can contact Outlook to provide feedback? I'm guessing a newer version is on its way...
Thanks again in advance! -
Month name displayed in month calendar view for previous month
In iPad IOS 7.04 iCal month view the month name displayed at the top of the window is incorrect. The previous month name show when viewing a calendar month. Test by selecting year view and the any month from the year. The month view will be for the selected month, but the month name will be for the preceding month. The incorrect month name in month vie is also displayed if the month view is scrolled to new months.
I observe this on my iPad II.
Ha s anyone seen this error? Does anyone know if Apple has seen this and has a plan to correct it?Imhave the same exact problem on my iPad2. It was not fixed in the recent iOS 7.1 release, even though modifications were made to the calendar app. Very frustrating, since this is such an easily observable problem.
-
Hi,
I have a requirement as follows :-
The user will submit the start date and end date. Based on the date parameters, the customized procedure should do some calculations month-wise.
For eg : start date - 01-Dec-2012 to end date - 31-Mar-2013
I want the break up as
Start date End date
01-dec-2012 31-dec-2012
01-jan-2013 31-jan-2013
01-feb-2013 28-feb-2013
01-mar-2013 31-mar-2013
How can i achieve this month-wise break ?
Regards,Hi,
There are no DATE bind variables, at least not in SQL*Plus.
You can use VARCHAR2s to pass the start and end dates, like this:
VARIABLE start_date VARCHAR2 (11)
VARIABLE end_date VARCHAR2 (11)
EXEC :start_date := '02-Dec-2012';
EXEC :end_date := '31-Mar-2013';
WITH got_months AS
SELECT TRUNC ( TO_DATE (:start_date, 'DD-Mon-YYYY')
, 'MONTH'
) AS first_month
, TRUNC ( TO_DATE (:end_date, 'DD-Mon-YYYY')
, 'MONTH'
) AS last_month
FROM dual
SELECT ADD_MONTHS (first_month, LEVEL - 1) AS month_start
, ADD_MONTHS (first_month, LEVEL ) - 1 AS month_end
FROM got_months
CONNECT BY LEVEL <= 1 + MONTHS_BETWEEN ( last_month
, first_month
;Output:
MONTH_START MONTH_END
01-Dec-2012 31-Dec-2012
01-Jan-2013 31-Jan-2013
01-Feb-2013 28-Feb-2013
01-Mar-2013 31-Mar-2013 -
hai,
i m working on sales report where in i need to get month wise sales of the products and the related cost incured to company by the sales in the matrix form as shown below can u help me in which way can i get this monthly report
march april may june july......feb
mtrl 25 30 0 19 23 ........(mtrl quantity)
cost 30000 15000 0 45000 ..........(amt in rs)
where in the above i m able to get yearly sales in one column (i.e i m able to show for one particular customer total sales in one column) but i m unable to split sales monthly and unable to show in a report so how can i able to sow in this matrix formDear Raj,
Please find the code for monthly wise report in PA0001 Table for calculation of Administrator time Recording.
http://scn.sap.com/message/14216250#14216250
Maybe you are looking for
-
Error in uploading a file in server
Hi, We are working in a application whose technologies are Flex 4.0 and .Net 2010. We are using .Net WCF Service for interacting with backend from the Flex front end. In our application, we have requirement to upload a file from the client into a ser
-
Unable to see options in reporting services with admin account
I have sysadmin access to the sql server but i am unable to access the reports which i am using earlier. recently i have updated the server sp4 on current sql sever 2005. how to re-enable the access to the reporting server. please help me.
-
How do I change Apple ID to a backup email?
How do I change my Apple ID to my backup email? I deleted my primary email account with the provider, and so need to make the change to the backup. I have tried removing the backup, and then adding it as the Apple ID, but I get an error message tha
-
MB51 : add field not included in MKPF or MSEG table
Dear. I need to show a new field in MB51. This field isnu2019t included in MKPF or MSEG table. I cannot add it in Customizing , do you know an exit for doing this ? Thanks.
-
How can I make several videos play from one player much like Presentation widget
Is there a way to have several videos, in thumbnails, play through one player similar to the manner which Presentation dosplays selections from image thumbnails? Greg