Customer group report
Dear Experts,
customers are classified based on their groups
For example:
Customer group
Customer 1
customer 2
customer 3
Sales report is required based on Group.Is there any sales & dispatch std report based on customer group
Hi,
go to Logistics, sales and distribution, SIS, Standard Analysis, there are N number of reprts. search for the reports in info system one by one u may get what u are looking for. if not available here go for the development of Zreport.
regards,
sadanandam kasarla
Edited by: Sadanandam Kasarla on Feb 20, 2009 11:03 AM
Edited by: Sadanandam Kasarla on Feb 20, 2009 11:05 AM
Similar Messages
-
I have created a group in EM and have created a new report using create like in reports, copying the segments with row chaining. But it does not work.
halfdba, suggested to configure space management at least for row chaining for each database in the group, from the DB Home page in EM. However, I am unable to find such a configuration page off the DB Home page.
Can someone please suggest how to do this? I am desparateHi,
My client wants to have the following reports :
a) No of invoices overdue for payment
b) No of invoices held
c) No of debit notes issued per invoce
d) No of credit notes.
Kindly inform if we can extract such reports in EM. -
Customer group wise sales report
can somebody give me a clue as to how to take customer group wise sales report
thanksHI,
it will not get the sales report with customer group wise in standard SAP.
in standard you will get the data for the following selection :
a. Sales Office wise : MC-E
b. Sales Organization wise : MC+2
c. Material(Article) wise : MC+Q
tell me one thing, whether u need the report customer group wise or customer account group wise.
Regards,
somu. -
Dear all,
Can any one told me the Standard report with reference to Customer Group wise?
Plz send me the solution for the same.
Thanks & Regards,
PMfor list of sales docs with customer Group as a filed in the report
1. VA15 - List of Inquiries
2. VA25 - List of Quotations
3. VA05 - List of Sales Orders
Also you can create your own report by using t.code: SQVI - ABAP quick viewer by joining one or more tables.
Important Tables for SAP SD
Sales and Distribution:
Table Description
Customers KNA1 General Data
KNB1 Customer Master Co. Code Data (payment method, reconciliation acct)
KNB4 Customer Payment History
KNB5 Customer Master Dunning info
KNBK Customer Master Bank Data
KNKA Customer Master Credit Mgmt.
KNKK Customer Master Credit Control Area Data (credit limits)
KNVV Sales Area Data (terms, order probability)
KNVI Customer Master Tax Indicator
KNVP Partner Function key
KNVD Output type
KNVS Customer Master Ship Data
KLPA Customer/Vendor Link
Sales Documents
VBUK Header Status and Administrative Data
VBAK Sales Document - Header Data
VBKD Sales Document - Business Data
VBUP Item Status
VBAP Sales Document - Item Data
VBPA Partners
VBFA Document Flow
VBEP Sales Document Schedule Line
VBBE Sales Requirements: Individual Records
SD Delivery Documents
LIPS Delivery Document item data, includes referencing PO
LIKP Delivery Document Header data
Billing Document
VBRK Billing Document Header
VBRP Billing Document Item
SD Shipping Unit
VEKP Shipping Unit Item (Content)
VEPO Shipping Unit Header -
How to add customer group(KNVV-KDGRP)in the standard report?
Dear All,
My customer requirment is that Customer group (KNVV-KDGRP)wise should be run in FBL5N report AND Customer group should be shown in FBL3N report.
how to add customer group in the standard report?
thanking you,
regards,
Rupang shahHi,
This is what I did for FBL5N with a developer because additional fields configuration does include certain tables.
BTE1650 available for FBL5N and add a new field into one of those tables as an append structure and then use a BTE to populate the field for FBL5N.
Hope that this helps
Kind regards -
Custom grouping in crystal report
I have a requirement of creating a report off BEx query (BI 7.0).
I have database field which gives around 250 rows. Now with these 250 rows I need to create a custom grouping in crystal report having 2 groups and a detail.
Some info about database field: For ex: 'A', 'B' and 'C' are 3 sample rows of the database field. I want to arrange this in such a way that.
A will form Group 1 and B will form group 2 and it is sub group of Group 1. and C is part of Group 2.
A (group 1)
B (Group 2)
C.
But when I tried it it resulted in
A (group 1)
Others
Others (group1)
B(Group 2)
C.
In this method I was successful in creating report if there were only 2 levels. But when it comes to 3rd level i am facing the problem. Any solution from experts.Hi Raghavendra,
You can create the superset group i.e Group A in ur illustration by choosing Insert -> Group from the pull-down menus and specifying the field name in the panel.
Next, in order to create the subset group i.e Group B and Group C you need to create a formula in the Formula Workshop-Formula Editor like the below syntax:
If <db_field_name> = "<value B>"
OR <db_field_name> = "<value C>"
then "Group B"
This formula can be used as your second group by choosing Insert -> Group from the pull-down menus and specifying this formula name in the panel.
Thanks,
Amogh. -
Vendor aging report ,customer aging report
hi to all
can u pls what is vendor aging report . what is the purpose of it . can u pls some theoritical description
i will definitely reward points pls its urgent pls tell if there r any standard reports exists for theese . pls give some custom reports on theese with coding.
and for customer aging also
pls.................Hi,
Check the Vendor against report code:
REPORT zvender_os NO STANDARD PAGE HEADING
LINE-SIZE 132
LINE-COUNT 65.
Tables
TABLES: bsik, "open items (A/C: Secondary Index for Customers)
lfa1, "customer master
lfb1,
rf140, "temp stru (Work Fields for Corrence(SAPF140*))
bsak, "cleared items (A/c Secnd Index for Cust(Clrms))
skat.
constants and variables
TYPE-POOLS: slis.
DATA: fieldcat TYPE slis_t_fieldcat_alv,
fieldcat1 TYPE slis_t_fieldcat_alv,
fieldcat_ln TYPE slis_fieldcat_alv,
layout_in TYPE slis_layout_alv,
layout_in1 TYPE slis_layout_alv,
sortcat TYPE slis_t_sortinfo_alv,
sortcat1 TYPE slis_t_sortinfo_alv,
sortcat_ln LIKE LINE OF sortcat,
eventcat1 TYPE slis_t_event,
eventcat TYPE slis_t_event,
eventcat_ln LIKE LINE OF eventcat,
col_pos TYPE i.
DATA: targ_month(2) TYPE n, "0001
targ_year(4) TYPE n, "0001
targ_mth_abs TYPE p, "0001
doc_month(2) TYPE n, "0001
doc_year(4) TYPE n, "0001
doc_mth_abs TYPE p, "0001
mth_result TYPE p, "0001
doc_days TYPE p,
targ_days TYPE p,
addl_days TYPE p,
ext_days TYPE p,
v_days(3) TYPE c,
v_kkber LIKE knkk-kkber.
DATA:
BEGIN OF inrec OCCURS 1000, "0001
lifnr LIKE bsik-lifnr,
belnr LIKE bsik-belnr,
gjahr LIKE bsik-gjahr,
bldat LIKE bsik-bldat,
xblnr LIKE bsik-xblnr,
blart LIKE bsik-blart,
sgtxt LIKE bsik-sgtxt,
shkzg LIKE bsik-shkzg,
dmbtr LIKE bsik-dmbtr,
zfbdt LIKE bsik-zfbdt,
zbd1t LIKE bsik-zbd1t,
zbd2t LIKE bsik-zbd2t,
zbd3t LIKE bsik-zbd3t,
zuonr LIKE bsik-zuonr,
END OF inrec.
DATA:
BEGIN OF inrect OCCURS 1000, "0001
lifnr LIKE bsik-lifnr,
belnr LIKE bsik-belnr,
gjahr LIKE bsik-gjahr,
bldat LIKE bsik-bldat,
xblnr LIKE bsik-xblnr,
blart LIKE bsik-blart,
sgtxt LIKE bsik-sgtxt,
shkzg LIKE bsik-shkzg,
dmbtr LIKE bsik-dmbtr,
zfbdt LIKE bsik-zfbdt,
zbd1t LIKE bsik-zbd1t,
zbd2t LIKE bsik-zbd2t,
zbd3t LIKE bsik-zbd3t,
zuonr LIKE bsik-zuonr,
END OF inrect,
BEGIN OF t_item OCCURS 1000, " 0001
lifnr LIKE bsik-lifnr,
belnr LIKE bsik-belnr,
gjahr LIKE bsik-gjahr,
bldat LIKE bsik-bldat,
xblnr LIKE bsik-xblnr,
blart LIKE bsik-blart,
sgtxt LIKE bsik-sgtxt,
zfbdt LIKE bsik-zfbdt,
dmbtr LIKE bsik-dmbtr,
days(3) TYPE c,
zuonr LIKE bsik-zuonr,
END OF t_item,
t_line LIKE t_item OCCURS 1000 WITH HEADER LINE, " 0001
BEGIN OF itab OCCURS 1000,
lifnr LIKE lfa1-lifnr,
total LIKE bsik-dmbtr,
zfuture LIKE bsik-dmbtr,
zcurrent LIKE bsik-dmbtr,
crbal LIKE bsik-dmbtr,
30days LIKE bsik-dmbtr,
60days LIKE bsik-dmbtr,
90days LIKE bsik-dmbtr,
99days LIKE bsik-dmbtr,
120days LIKE bsik-dmbtr,
180days LIKE bsik-dmbtr,
365days LIKE bsik-dmbtr,
bzirk LIKE knvv-bzirk,
vkbur LIKE knvv-vkbur,
vwerk LIKE knvv-vwerk,
vkgrp LIKE knvv-vkgrp,
klimk LIKE knkk-klimk,
cashd LIKE knkk-cashd,
grupp LIKE knkk-grupp,
erdat LIKE lfa1-erdat,
name1 LIKE lfa1-name1,
name2 LIKE lfa1-name2,
stras LIKE lfa1-stras,
ort01 LIKE lfa1-ort01,
telf1 LIKE lfa1-telf1,
psort(10),
sperr LIKE lfa1-sperr,
totsal LIKE bsik-dmbtr,
txt50 LIKE skat-txt50,
gsber LIKE bsik-gsber,
END OF itab.
DATA: sel_tab TYPE TABLE OF rsparams WITH HEADER LINE,
p_debit(1) TYPE c,
p_credit(1) TYPE c.
DATA: t_variant LIKE disvariant OCCURS 0 WITH HEADER LINE.
parameters and select-options
SELECTION-SCREEN BEGIN OF BLOCK blck0 WITH FRAME TITLE text-002.
PARAMETERS: stida LIKE sy-datum DEFAULT sy-datum OBLIGATORY,
p_bukrs LIKE t001-bukrs DEFAULT 'PIIL' MEMORY ID buk
OBLIGATORY.
P_BUKRS LIKE T001-BUKRS DEFAULT 'CC01' OBLIGATORY. "0003
SELECT-OPTIONS: s_lifnr FOR bsik-lifnr ,
s_vkbur FOR knvv-vkbur,
s_vkgrp FOR knvv-vkgrp,
s_bzirk FOR knvv-bzirk,
s_konda FOR knvv-konda,
s_kdgrp FOR knvv-kdgrp NO-DISPLAY ,
s_kvgr2 FOR knvv-kvgr2 NO-DISPLAY ,
s_kkber FOR knkk-kkber NO-DISPLAY ,
s_grupp FOR knkk-grupp NO-DISPLAY ,
s_ctlpc FOR knkk-ctlpc,
s_akont FOR lfb1-akont,
s_gsber FOR bsik-gsber.
PARAMETERS: p_future AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK blck0.
SELECTION-SCREEN BEGIN OF BLOCK blck1 WITH FRAME TITLE text-002.
PARAMETERS: p_abs RADIOBUTTON GROUP zrad,
p_due RADIOBUTTON GROUP zrad DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK blck1.
*SELECTION-SCREEN BEGIN OF BLOCK blck2 WITH FRAME TITLE text-003.
*PARAMETERS: c_run RADIOBUTTON GROUP zrac DEFAULT 'X',
c_blk RADIOBUTTON GROUP zrac,
c_all RADIOBUTTON GROUP zrac.
*SELECTION-SCREEN END OF BLOCK blck2.
*SELECTION-SCREEN BEGIN OF BLOCK blck3 WITH FRAME TITLE text-004.
*PARAMETERS: p_debit AS CHECKBOX DEFAULT 'X' ,
p_credit AS CHECKBOX DEFAULT 'X' NO-DISPLAY,
*selection-screen end of block blck3.
start-of-selection.
START-OF-SELECTION.
PERFORM BUILD_EVENTCAT.
p_debit = 'X'.
p_credit = 'X'.
PERFORM get_customer_invoices.
filter records based on selection criteria
PERFORM filter_records.
END-OF-SELECTION.
PERFORM add_sort_field.
PERFORM modify_field.
PERFORM write_report.
*& Form FILTER_RECORDS
To collect all the required data from DB and store them in
internal table.
--> p1 text
<-- p2 text
FORM filter_records.
delete records based on selection criteria
LOOP AT itab.
SELECT vkbur vkgrp vwerk erdat konda kdgrp bzirk kvgr2
INTO (itab-vkbur, itab-vkgrp, itab-vwerk, knvv-erdat,
knvv-konda, knvv-kdgrp,itab-bzirk,knvv-kvgr2)
FROM knvv WHERE lifnr = itab-lifnr
ORDER BY erdat DESCENDING.
AKS :- Not Required for PI
CASE itab-vkbur.
WHEN 'SA1'.
itab-vkbur = 'SF25'.
WHEN 'QLD1'.
itab-vkbur = 'SF23'.
WHEN 'WA1'.
itab-vkbur = 'SF26'.
ENDCASE.
AKS.
EXIT.
ENDSELECT.
IF itab-vkbur IN s_vkbur AND
itab-vkgrp IN s_vkgrp AND
knvv-konda IN s_konda AND
knvv-kdgrp IN s_kdgrp AND
itab-bzirk IN s_bzirk AND
knvv-kvgr2 IN s_kvgr2.
ELSE.
DELETE itab.
CONTINUE.
ENDIF.
SELECT SINGLE klimk grupp cashd
INTO (itab-klimk, itab-grupp, itab-cashd)
FROM knkk WHERE lifnr = itab-lifnr
AND kkber IN s_kkber
AND ctlpc IN s_ctlpc
AND grupp IN s_grupp.
IF SY-SUBRC NE 0.
DELETE ITAB.
CONTINUE.
ENDIF.
SELECT SINGLE skat~txt50
INTO (itab-txt50)
FROM lfb1 INNER JOIN skat
ON lfb1akont EQ skatsaknr
WHERE lfb1~lifnr = itab-lifnr
AND lfb1~akont IN s_akont
AND skat~spras EQ 'EN'.
IF sy-subrc NE 0.
DELETE itab.
CONTINUE.
ENDIF.
SELECT SINGLE name1 name2 telf1 erdat stras ort01 sperr
INTO (itab-name1, itab-name2, itab-telf1,
itab-erdat, itab-stras, itab-ort01, itab-sperr )
FROM lfa1
WHERE lifnr = itab-lifnr
IF sy-subrc NE 0 .
DELETE itab.
CONTINUE.
ENDIF.
AKS For Filteration of Customer base on Block Area.
IF c_all NE 'X'.
IF c_run EQ 'X' AND itab-sperr EQ 'X'.
DELETE itab.
CONTINUE.
ELSE.
IF c_blk EQ 'X' AND itab-sperr NE 'X'.
DELETE itab.
CONTINUE.
ENDIF.
ENDIF.
ENDIF.
MODIFY itab.
ENDLOOP.
ENDFORM. " FILTER_RECORDS
*& Form GET_CUSTOMER_INVOICES
text
--> p1 text
<-- p2 text
FORM get_customer_invoices.
DATA:ztotcre LIKE bsik-dmbtr.
DATA:ztotsal LIKE bsik-dmbtr.
DATA: fsdate LIKE sy-datum.
DATA: l_perio(4) TYPE c.
MOVE stida TO rf140-stida.
MOVE rf140-stida+4(2) TO targ_month.
MOVE rf140-stida+0(4) TO targ_year.
MOVE rf140-stida+6(2) TO targ_days.
targ_mth_abs = ( targ_year * 12 ) + targ_month.
CALL FUNCTION 'ZGET_PERIOD_FROM_DATE'
EXPORTING
i_date = stida
IMPORTING
e_perio = l_perio.
CONCATENATE l_perio '0401' INTO fsdate.
select open items.
IF p_due EQ 'X'.
SELECT lifnr belnr gjahr bldat xblnr blart sgtxt " 0001
shkzg dmbtr zfbdt zbd1t zbd2t zbd3t
zuonr
FROM bsik INTO TABLE inrect
WHERE bukrs = p_bukrs
AND budat LE stida
AND lifnr IN s_lifnr
AND gsber IN s_gsber
AND umskz NE 'T'
AND umskz NE 'F'
AND umskz NE 'R'
AND umskz NE 'P'
AND umskz NE 'J'
AND umskz NE 'L'.
LOOP AT INREC.
IF INREC-SHKZG = 'H'.
INREC-DMBTR = INREC-DMBTR * -1.
ENDIF.
MOVE-CORRESPONDING INREC TO T_ITEM. " 0001
PERFORM COLLECT_INVOICE USING INREC-lifnr INREC-DMBTR
INREC-ZFBDT INREC-ZBD1T
INREC-ZBD2T INREC-ZBD3T.
APPEND T_ITEM.
CLEAR T_ITEM.
ENDLOOP.
LOOP AT inrect.
inrec-lifnr = inrect-lifnr.
inrec-belnr = inrect-belnr.
inrec-gjahr = inrect-gjahr.
inrec-bldat = inrect-bldat.
inrec-xblnr = inrect-xblnr.
inrec-blart = inrect-blart.
inrec-sgtxt = inrect-sgtxt.
inrec-shkzg = inrect-shkzg.
inrec-dmbtr = inrect-dmbtr.
CALL FUNCTION 'NJ_CAL_DATE_IN_INTERVAL'
EXPORTING
date = inrect-zfbdt
days = inrect-zbd1t
months = 00
signum = '+'
years = 00
IMPORTING
calc_date = inrec-zfbdt.
inrec-zbd1t = inrect-zbd1t.
inrec-zbd2t = inrect-zbd2t.
inrec-zbd3t = inrect-zbd3t.
inrec-zuonr = inrect-zuonr.
APPEND inrec.
CLEAR inrec.
ENDLOOP.
ELSE.
SELECT lifnr belnr gjahr bldat xblnr blart sgtxt " 0001
shkzg dmbtr zfbdt zbd1t zbd2t zbd3t
zuonr
FROM bsik INTO TABLE inrec
WHERE bukrs = p_bukrs
AND budat LE stida
AND lifnr IN s_lifnr
AND gsber IN s_gsber
AND umskz NE 'T'
AND umskz NE 'F'
AND umskz NE 'R'
AND umskz NE 'P'
AND umskz NE 'J'
AND umskz NE 'L'.
ENDIF.
SORT inrec BY lifnr shkzg zfbdt .
LOOP AT inrec.
AT NEW lifnr.
For Customers Credit Balance Transaction to be display in Report
End of Credit Balance
ztotcre = 0.
ztotsal = 0.
ENDAT.
IF inrec-shkzg = 'H'.
inrec-dmbtr = inrec-dmbtr * -1.
ztotcre = ztotcre + inrec-dmbtr.
ELSE.
IF inrec-blart = 'RV'.
IF inrec-bldat GE fsdate.
ztotsal = ztotsal + inrec-dmbtr.
ENDIF.
ENDIF.
ztotcre = ztotcre + inrec-dmbtr.
endif.
IF p_debit EQ 'X'.
IF ztotcre > 0.
MOVE-CORRESPONDING inrec TO t_item. " 0001
PERFORM collect_invoice USING inrec-lifnr ztotcre
inrec-zfbdt inrec-zbd1t
inrec-zbd2t inrec-zbd3t
ztotsal.
APPEND t_item.
CLEAR t_item.
ztotcre = 0.
ztotsal = 0.
ENDIF.
ENDIF.
ENDIF.
IF p_credit EQ 'X'.
AT END OF lifnr.
IF ztotcre < 0.
MOVE-CORRESPONDING inrec TO t_item. " 0001
PERFORM collect_invoice USING inrec-lifnr ztotcre
inrec-zfbdt inrec-zbd1t
inrec-zbd2t inrec-zbd3t
ztotsal.
APPEND t_item.
CLEAR t_item.
ztotcre = 0.
ztotsal = 0.
APPEND t_item.
CLEAR t_item.
ENDIF.
ENDAT.
ENDIF.
ENDLOOP.
select cleared items
IF p_due EQ 'X'.
REFRESH inrect. CLEAR inrect.
SELECT lifnr belnr gjahr bldat xblnr blart sgtxt
shkzg dmbtr zfbdt zbd1t zbd2t zbd3t
zuonr
FROM bsak INTO TABLE inrect
WHERE bukrs = p_bukrs
AND budat LE stida
AND augdt > stida
AND lifnr IN s_lifnr
AND gsber IN s_gsber
REFRESH inrec. CLEAR inrec.
LOOP AT inrect.
inrec-lifnr = inrect-lifnr.
inrec-belnr = inrect-belnr.
inrec-gjahr = inrect-gjahr.
inrec-bldat = inrect-bldat.
inrec-xblnr = inrect-xblnr.
inrec-blart = inrect-blart.
inrec-sgtxt = inrect-sgtxt.
inrec-shkzg = inrect-shkzg.
inrec-dmbtr = inrect-dmbtr.
CALL FUNCTION 'NJ_CAL_DATE_IN_INTERVAL'
EXPORTING
date = inrect-zfbdt
days = inrect-zbd1t
months = 00
signum = '+'
years = 00
IMPORTING
calc_date = inrec-zfbdt.
inrec-zbd1t = inrect-zbd1t.
inrec-zbd2t = inrect-zbd2t.
inrec-zbd3t = inrect-zbd3t.
inrec-zuonr = inrect-zuonr.
APPEND inrec.
CLEAR inrec.
ENDLOOP.
ELSE.
REFRESH inrec. CLEAR inrec.
SELECT lifnr belnr gjahr bldat xblnr blart sgtxt
shkzg dmbtr zfbdt zbd1t zbd2t zbd3t
zuonr
FROM bsak INTO TABLE inrec
WHERE bukrs = p_bukrs
AND budat LE stida
AND augdt > stida
AND lifnr IN s_lifnr
AND gsber IN s_gsber
ENDIF.
SORT inrec BY lifnr shkzg zfbdt .
LOOP AT inrec.
AT NEW lifnr.
ztotcre = 0.
ztotsal = 0.
ENDAT.
IF inrec-shkzg = 'H'.
inrec-dmbtr = inrec-dmbtr * -1.
ztotcre = ztotcre + inrec-dmbtr.
ELSE.
IF inrec-blart = 'RV'.
IF inrec-bldat GE fsdate.
ztotsal = ztotsal + inrec-dmbtr.
ENDIF.
ENDIF.
ztotcre = ztotcre + inrec-dmbtr.
endif.
IF p_debit EQ 'X'.
IF ztotcre > 0.
MOVE-CORRESPONDING inrec TO t_item. " 0001
PERFORM collect_invoice USING inrec-lifnr ztotcre
inrec-zfbdt inrec-zbd1t
inrec-zbd2t inrec-zbd3t
ztotsal.
APPEND t_item.
CLEAR t_item.
ztotcre = 0.
ztotsal = 0.
ENDIF.
ENDIF.
ENDIF.
IF p_credit EQ 'X'.
AT END OF lifnr.
IF ztotcre < 0.
MOVE-CORRESPONDING inrec TO t_item. " 0001
PERFORM collect_invoice USING inrec-lifnr ztotcre
inrec-zfbdt inrec-zbd1t
inrec-zbd2t inrec-zbd3t
ztotsal.
APPEND t_item.
CLEAR t_item.
ztotcre = 0.
ztotsal = 0.
APPEND t_item.
CLEAR t_item.
ENDIF.
ENDAT. " 0001
ENDIF.
ENDLOOP.
ENDFORM. " GET_CUSTOMER_INVOICES
*& Form COLLECT_INVOICE
text
-->P_bsik_lifnr text
-->P_bsik_DMBTR text
-->P_bsik_ZFBDT text
-->P_bsik_ZFBDT1 text
-->P_bsik_ZFBDT2 text
-->P_bsik_ZFBDT3 text
FORM collect_invoice USING pp_lifnr
pp_dmbtr
pp_zfbdt
pp_zbd1t
pp_zbd2t
pp_zbd3t
pp_ztotsal.
doc_month = pp_zfbdt+4(2).
doc_year = pp_zfbdt+0(4).
doc_mth_abs = ( doc_year * 12 ) + doc_month.
mth_result = ( targ_mth_abs - doc_mth_abs ).
logic given by Mr. Ashok Singhvi
doc_days = pp_zfbdt+6(2).
addl_days = ( doc_days - targ_days ).
IF addl_days <= 0.
ADD 1 TO mth_result.
ENDIF.
IF NOT pp_zbd3t IS INITIAL.
MOVE pp_zbd3t TO ext_days.
ELSEIF NOT pp_zbd2t IS INITIAL.
MOVE pp_zbd2t TO ext_days.
ELSEIF NOT pp_zbd1t IS INITIAL.
MOVE pp_zbd1t TO ext_days.
ELSE.
CLEAR ext_days.
ENDIF.
CHECK with Andrew whether this is working or not
if extended payment terms exist, subtract no of mths from mth_result
IF NOT ext_days IS INITIAL.
CASE ext_days.
WHEN 30.
SUBTRACT 1 FROM mth_result.
WHEN 60.
SUBTRACT 2 FROM mth_result.
WHEN 90.
SUBTRACT 3 FROM mth_result.
WHEN 120.
SUBTRACT 4 FROM mth_result.
ENDCASE.
ENDIF.
change to key date
IF pp_dmbtr > 0.
IF p_future = 'X'. " 0001
IF mth_result <= 0.
itab-zcurrent = pp_dmbtr.
t_item-days = 'CUR'.
ELSEIF mth_result = 1.
itab-30days = pp_dmbtr.
t_item-days = '30D'.
ELSEIF mth_result = 2.
itab-60days = pp_dmbtr.
t_item-days = '60D'.
ELSEIF mth_result = 3.
itab-90days = pp_dmbtr.
t_item-days = '90D'.
ELSEIF mth_result > 3 AND mth_result <= 4 .
itab-99days = pp_dmbtr.
t_item-days = '99D'.
ELSEIF mth_result > 4 AND mth_result <= 6 .
itab-120days = pp_dmbtr.
t_item-days = '120D'.
ELSEIF mth_result > 6 AND mth_result <= 12 .
itab-180days = pp_dmbtr.
t_item-days = '180D'.
ELSEIF mth_result > 12 .
itab-365days = pp_dmbtr.
t_item-days = '365D'.
ENDIF.
ELSE.
IF mth_result < 0.
itab-zfuture = pp_dmbtr.
t_item-days = 'FUT'.
ELSEIF mth_result = 0.
itab-zcurrent = pp_dmbtr.
t_item-days = 'CUR'.
ELSEIF mth_result = 1.
itab-30days = pp_dmbtr.
t_item-days = '30D'.
ELSEIF mth_result = 2.
itab-60days = pp_dmbtr.
t_item-days = '60D'.
ELSEIF mth_result = 3.
itab-90days = pp_dmbtr.
t_item-days = '90D'.
ELSEIF mth_result > 3 AND mth_result <= 4 .
itab-99days = pp_dmbtr.
t_item-days = '99D'.
ELSEIF mth_result > 4 AND mth_result <= 6 .
itab-120days = pp_dmbtr.
t_item-days = '120D'.
ELSEIF mth_result > 6 AND mth_result <= 12 .
itab-180days = pp_dmbtr.
t_item-days = '180D'.
ELSEIF mth_result > 12 .
itab-365days = pp_dmbtr.
t_item-days = '365D'.
ENDIF.
ENDIF. " 0001
itab-crbal = 0.
itab-total = pp_dmbtr.
ELSE.
IF p_future = 'X'. " 0001
IF mth_result <= 0.
itab-zcurrent = pp_dmbtr.
t_item-days = 'CUR'.
ELSEIF mth_result = 1.
itab-30days = pp_dmbtr.
t_item-days = '30D'.
ELSEIF mth_result = 2.
itab-60days = pp_dmbtr.
t_item-days = '60D'.
ELSEIF mth_result = 3.
itab-90days = pp_dmbtr.
t_item-days = '90D'.
ELSEIF mth_result > 3 AND mth_result <= 4 .
itab-99days = pp_dmbtr.
t_item-days = '99D'.
ELSEIF mth_result > 4 AND mth_result <= 6 .
itab-120days = pp_dmbtr.
t_item-days = '120D'.
ELSEIF mth_result > 6 AND mth_result <= 12 .
itab-180days = pp_dmbtr.
t_item-days = '180D'.
ELSEIF mth_result > 12 .
itab-365days = pp_dmbtr.
t_item-days = '365D'.
ENDIF.
ELSE.
IF mth_result < 0.
itab-zfuture = pp_dmbtr.
t_item-days = 'FUT'.
ELSEIF mth_result = 0.
itab-zcurrent = pp_dmbtr.
t_item-days = 'CUR'.
ELSEIF mth_result = 1.
itab-30days = pp_dmbtr.
t_item-days = '30D'.
ELSEIF mth_result = 2.
itab-60days = pp_dmbtr.
t_item-days = '60D'.
ELSEIF mth_result = 3.
itab-90days = pp_dmbtr.
t_item-days = '90D'.
ELSEIF mth_result > 3 AND mth_result <= 4 .
itab-99days = pp_dmbtr.
t_item-days = '99D'.
ELSEIF mth_result > 4 AND mth_result <= 6 .
itab-120days = pp_dmbtr.
t_item-days = '120D'.
ELSEIF mth_result > 6 AND mth_result <= 12 .
itab-180days = pp_dmbtr.
t_item-days = '180D'.
ELSEIF mth_result > 12 .
itab-365days = pp_dmbtr.
t_item-days = '365D'.
ENDIF.
ENDIF. " 0001
itab-total = pp_dmbtr.
itab-crbal = 0.
ENDIF.
itab-lifnr = pp_lifnr.
itab-totsal = pp_ztotsal.
COLLECT itab.
CLEAR itab.
ENDFORM. " COLLECT_INVOICE
*& Form ADD_SORT_FIELD
text
--> p1 text
<-- p2 text
FORM add_sort_field.
DATA: l_amount(9) TYPE n.
IF p_future = 'X'.
LOOP AT itab.
l_amount = 999999999.
IF itab-365days > 0.
l_amount = l_amount - itab-365days.
CONCATENATE 'A' l_amount INTO itab-psort.
ELSEIF itab-180days > 0.
l_amount = l_amount - itab-180days.
CONCATENATE 'B' l_amount INTO itab-psort.
ELSEIF itab-120days > 0.
l_amount = l_amount - itab-120days.
CONCATENATE 'C' l_amount INTO itab-psort.
ELSEIF itab-99days > 0.
l_amount = l_amount - itab-99days.
CONCATENATE 'D' l_amount INTO itab-psort.
ELSEIF itab-90days > 0.
l_amount = l_amount - itab-90days.
CONCATENATE 'E' l_amount INTO itab-psort.
ELSEIF itab-60days > 0.
l_amount = l_amount - itab-60days.
CONCATENATE 'F' l_amount INTO itab-psort.
ELSEIF itab-30days > 0.
l_amount = l_amount - itab-30days.
CONCATENATE 'G' l_amount INTO itab-psort.
ELSEIF itab-zcurrent > 0.
l_amount = l_amount - itab-zcurrent.
CONCATENATE 'H' l_amount INTO itab-psort.
ELSEif itab-zfuture > 0.
L_AMOUNT = L_AMOUNT - ITAB-zfuture.
CONCATENATE 'F' L_AMOUNT INTO ITAB-PSORT.
ELSE.
l_amount = ABS( itab-total ).
CONCATENATE 'I' l_amount INTO itab-psort.
ENDIF.
MODIFY itab.
ENDLOOP.
ELSE.
LOOP AT itab.
l_amount = 999999999.
IF itab-365days > 0.
l_amount = l_amount - itab-365days.
CONCATENATE 'A' l_amount INTO itab-psort.
ELSEIF itab-180days > 0.
l_amount = l_amount - itab-180days.
CONCATENATE 'B' l_amount INTO itab-psort.
ELSEIF itab-120days > 0.
l_amount = l_amount - itab-120days.
CONCATENATE 'C' l_amount INTO itab-psort.
ELSEIF itab-99days > 0.
l_amount = l_amount - itab-99days.
CONCATENATE 'D' l_amount INTO itab-psort.
ELSEIF itab-90days > 0.
l_amount = l_amount - itab-90days.
CONCATENATE 'E' l_amount INTO itab-psort.
ELSEIF itab-60days > 0.
l_amount = l_amount - itab-60days.
CONCATENATE 'F' l_amount INTO itab-psort.
ELSEIF itab-30days > 0.
l_amount = l_amount - itab-30days.
CONCATENATE 'G' l_amount INTO itab-psort.
ELSEIF itab-zcurrent > 0.
l_amount = l_amount - itab-zcurrent.
CONCATENATE 'H' l_amount INTO itab-psort.
ELSEIF itab-zfuture > 0.
l_amount = l_amount - itab-zfuture.
CONCATENATE 'I' l_amount INTO itab-psort.
ELSE.
l_amount = ABS( itab-total ).
CONCATENATE 'J' l_amount INTO itab-psort.
ENDIF.
MODIFY itab.
ENDLOOP.
ENDIF.
ENDFORM. " ADD_SORT_FIELD
*& Form WRITE_REPORT
text
--> p1 text
<-- p2 text
FORM write_report.
PERFORM build_fieldcat.
PERFORM build_sortcat.
PERFORM build_eventcat.
PERFORM build_layout.
PERFORM start_list_viewer.
ENDFORM. " WRITE_REPORT
*& Form BUILD_FIELDCAT
text
--> p1 text
<-- p2 text
FORM build_fieldcat.
lifnr
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'lfa1'.
fieldcat_ln-fieldname = 'LIFNR'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-emphasize = 'C41'.
APPEND fieldcat_ln TO fieldcat.
Name1
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'lfa1'.
fieldcat_ln-fieldname = 'NAME1'.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-seltext_l = 'Name'.
APPEND fieldcat_ln TO fieldcat.
City Details
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'lfa1'.
fieldcat_ln-fieldname = 'ORT01'.
fieldcat_ln-seltext_l = 'City'.
fieldcat_ln-col_pos = col_pos.
APPEND fieldcat_ln TO fieldcat.
Credit Limit
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'KNKK'.
fieldcat_ln-fieldname = 'KLIMK'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-emphasize = 'C41'.
APPEND fieldcat_ln TO fieldcat.
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'DMBTR'.
fieldcat_ln-fieldname = 'CRBAL'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-seltext_l = 'Cr. Bal.'.
fieldcat_ln-seltext_m = 'Cr. Bal.'.
fieldcat_ln-seltext_s = 'Cr. Bal.'.
APPEND fieldcat_ln TO fieldcat.
Total Amount
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = 'TOTAL'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-seltext_l = 'Out.St.Amt.'.
fieldcat_ln-seltext_m = 'Out.St.Amt.'.
fieldcat_ln-seltext_s = 'Out.St.Amt.'.
fieldcat_ln-ref_tabname = 'zbsik'.
fieldcat_ln-ref_fieldname = 'ZDMBTR'.
APPEND fieldcat_ln TO fieldcat.
IF p_future NE 'X'.
Future
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'DMBTR'.
fieldcat_ln-fieldname = 'ZFUTURE'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-seltext_l = 'Future Due'.
fieldcat_ln-seltext_m = 'Future Due'.
fieldcat_ln-seltext_s = 'Future Due'.
APPEND fieldcat_ln TO fieldcat.
ENDIF.
Current
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'DMBTR'.
fieldcat_ln-fieldname = 'ZCURRENT'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-seltext_l = 'Normal Due'.
fieldcat_ln-seltext_m = 'Normal Due'.
fieldcat_ln-seltext_s = 'Normal Due'.
APPEND fieldcat_ln TO fieldcat.
30 Days
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'DMBTR'.
fieldcat_ln-fieldname = '30DAYS'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-seltext_l = '0-30 Days'.
fieldcat_ln-seltext_m = '0-30 Days'.
fieldcat_ln-seltext_s = '0-30 Days'.
APPEND fieldcat_ln TO fieldcat.
60 Days
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'DMBTR'.
fieldcat_ln-fieldname = '60DAYS'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-seltext_l = '31-60 Days'.
fieldcat_ln-seltext_m = '31-60 Days'.
fieldcat_ln-seltext_s = '31-60 Days'.
APPEND fieldcat_ln TO fieldcat.
90 Days
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'DMBTR'.
fieldcat_ln-fieldname = '90DAYS'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-seltext_l = '61-90 Days'.
fieldcat_ln-seltext_m = '61-90 Days'.
fieldcat_ln-seltext_s = '61-90 Days'.
APPEND fieldcat_ln TO fieldcat.
99 Days
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'DMBTR'.
fieldcat_ln-fieldname = '99DAYS'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-seltext_l = '91-120 Days'.
fieldcat_ln-seltext_m = '91-120 Days'.
fieldcat_ln-seltext_s = '91-120 Days'.
APPEND fieldcat_ln TO fieldcat.
*120Days
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'DMBTR'.
fieldcat_ln-fieldname = '120DAYS'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-seltext_l = '121-180 Days'.
fieldcat_ln-seltext_m = '121-180 Days'.
fieldcat_ln-seltext_s = '121-180 Days'.
APPEND fieldcat_ln TO fieldcat.
*180 Days
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'DMBTR'.
fieldcat_ln-fieldname = '180DAYS'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-seltext_l = '181-365 Days'.
fieldcat_ln-seltext_m = '181-365 Days'.
fieldcat_ln-seltext_s = '181-365 Days'.
APPEND fieldcat_ln TO fieldcat.
*365 Days
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'DMBTR'.
fieldcat_ln-fieldname = '365DAYS'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-seltext_l = '>365 Days'.
fieldcat_ln-seltext_m = '>365 Days'.
fieldcat_ln-seltext_s = '>365 Days'.
APPEND fieldcat_ln TO fieldcat.
Last Payment Date
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'KNKK'.
fieldcat_ln-fieldname = 'CASHD'.
fieldcat_ln-col_pos = col_pos.
APPEND fieldcat_ln TO fieldcat.
Street Name
ADD 1 TO COL_POS.
CLEAR FIELDCAT_LN.
FIELDCAT_LN-REF_TABNAME = 'lfa1'.
FIELDCAT_LN-FIELDNAME = 'STRAS'.
FIELDCAT_LN-COL_POS = COL_POS.
APPEND FIELDCAT_LN TO FIELDCAT.
Telephone
ADD 1 TO COL_POS.
CLEAR FIELDCAT_LN.
FIELDCAT_LN-REF_TABNAME = 'lfa1'.
FIELDCAT_LN-FIELDNAME = 'TELF1'.
FIELDCAT_LN-COL_POS = COL_POS.
APPEND FIELDCAT_LN TO FIELDCAT.
Credit Group
ADD 1 TO COL_POS.
CLEAR FIELDCAT_LN.
FIELDCAT_LN-REF_TABNAME = 'KNKK'.
FIELDCAT_LN-FIELDNAME = 'GRUPP'.
FIELDCAT_LN-COL_POS = COL_POS.
APPEND FIELDCAT_LN TO FIELDCAT.
*Sales District
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'KNVV'.
fieldcat_ln-fieldname = 'BZIRK'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-seltext_l = 'S_Distt'.
fieldcat_ln-seltext_m = 'S_Distt'.
fieldcat_ln-seltext_s = 'S_Distt'.
APPEND fieldcat_ln TO fieldcat.
Sales Office
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'KNVV'.
fieldcat_ln-fieldname = 'VKBUR'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-seltext_l = 'S_Off'.
fieldcat_ln-seltext_m = 'S_Off'.
fieldcat_ln-seltext_s = 'S_Off'.
APPEND fieldcat_ln TO fieldcat.
Cust Creat Date
ADD 1 TO COL_POS.
CLEAR FIELDCAT_LN.
FIELDCAT_LN-REF_TABNAME = 'lfa1'.
FIELDCAT_LN-FIELDNAME = 'ERDAT'.
FIELDCAT_LN-COL_POS = COL_POS.
APPEND FIELDCAT_LN TO FIELDCAT.
Del Plant
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'KNVV'.
fieldcat_ln-fieldname = 'VWERK'.
fieldcat_ln-col_pos = col_pos.
APPEND fieldcat_ln TO fieldcat.
Sales Group
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'KNVV'.
fieldcat_ln-fieldname = 'VKGRP'.
fieldcat_ln-col_pos = col_pos.
APPEND fieldcat_ln TO fieldcat.
Sort Criteria
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'lifnr'.
fieldcat_ln-fieldname = 'PSORT'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-seltext_l = 'Sort Field'.
fieldcat_ln-seltext_m = 'Sort Field'.
fieldcat_ln-seltext_s = 'Sort Field'.
APPEND fieldcat_ln TO fieldcat.
Sales of Customer
ADD 1 TO col_pos.
CLEAR fieldcat_ln.
fieldcat_ln-ref_tabname = 'bsik'.
fieldcat_ln-ref_fieldname = 'DMBTR'.
fieldcat_ln-fieldname = 'TOTSAL'.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-do_sum = 'X'.
fieldcat_ln-hotspot = 'X'.
fieldcat_ln-emphasize = 'C41'.
fieldcat_ln-seltext_l = 'Total Sales'.
fieldcat_ln-seltext_m = 'Total Sales'.
fieldcat_ln-seltext_s = 'Total Sales'.
APPEND fieldcat_ln TO fieldcat.
ENDFORM. " BUILD_FIELDCAT
*& Form BUILD_SORTCAT
text
--> p1 text
<-- p2 text
FORM build_sortcat.
SORTCAT_LN-SPOS = '1'.
sortcat_ln-spos = '2'. " 0001
sortcat_ln-fieldname = 'PSORT'.
sortcat_ln-up = 'X'. " 0001
sortcat_ln-subtot = 'X'.
APPEND sortcat_ln TO sortcat.
CLEAR sortcat_ln.
SORTCAT_LN-SPOS = '2'.
SORTCAT_LN-FIELDNAME = 'lifnr'.
sortcat_ln-spos = '1'. " 0001
sortcat_ln-fieldname = 'NAME1'. " 0001
sortcat_ln-up = 'X'.
APPEND sortcat_ln TO sortcat.
ENDFORM. " BUILD_SORTCAT
*& Form BUILD_EVENTCAT
text
--> p1 text
<-- p2 text
FORM build_eventcat.
eventcat_ln-name = 'TOP_OF_PAGE'.
eventcat_ln-form = 'PAGE_HEADER'.
APPEND eventcat_ln TO eventcat.
ENDFORM. " BUILD_EVENTCAT
*& Form BUILD_LAYOUT
text
--> p1 text
<-- p2 text
FORM build_layout.
layout_in-colwidth_optimize = 'X'.
layout_in-no_hotspot = 'X'.
layout_in-zebra = 'X'.
layout_in-get_selinfos = 'X'.
ENDFORM. " BUILD_LAYOUT
*& Form START_LIST_VIEWER
text
--> p1 text
<-- p2 text
FORM start_list_viewer.
DATA: pgm LIKE sy-repid.
pgm = sy-repid.
if t_variant[] is initial.
t_variant-report = pgm.
t_variant-variant = '/ATB'.
t_variant-TEXT = '/ATB'.
t_variant-DEPENDVARS = 'S'.
append t_variant.
clear t_variant.
endif.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = pgm
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = fieldcat
it_sort = sortcat
is_layout = layout_in
i_save = 'A'
IS_VARIANT = t_variant
it_events = eventcat
TABLES
t_outtab = itab
EXCEPTIONS
OTHERS = 2.
ENDFORM. " START_LIST_VIEWER
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
DATA l_lifnr(10) TYPE n.
READ TABLE itab INDEX selfield-tabindex.
CHECK sy-subrc = 0.
CASE ucomm.
WHEN '&IC1'.
CASE selfield-sel_tab_field.
WHEN 'ITAB-LIFNR'.
SET PARAMETER ID 'LIF' FIELD itab-lifnr.
SET PARAMETER ID 'BUK' FIELD p_bukrs.
IF itab-lifnr CO '0123456789 '.
l_lifnr = itab-lifnr.
itab-lifnr = l_lifnr.
ENDIF.
SELECT SINGLE kkber INTO knkk-kkber
FROM knkk WHERE lifnr = itab-lifnr.
IF sy-subrc EQ 0.
v_kkber = knkk-kkber.
ELSE.
CLEAR v_kkber.
ENDIF.
REFRESH sel_tab[].
MOVE: 'lifnr' TO sel_tab-selname,
'P' TO sel_tab-kind, " PARAMETER
itab-lifnr TO sel_tab-low.
APPEND sel_tab.
CLEAR sel_tab.
MOVE: 'KKBER' TO sel_tab-selname,
'P' TO sel_tab-kind, " PARAMETER
v_kkber TO sel_tab-low.
APPEND sel_tab.
CLEAR sel_tab.
SUBMIT rfdkli41
USING SELECTION-SET 'VAR1'
WITH SELECTION-TABLE sel_tab
AND RETURN.
CALL TRANSACTION 'XK03' AND SKIP FIRST SCREEN.
WHEN 'ITAB-ZCURRENT'. " 0001
v_days = 'CUR'.
PERFORM display_line_item_level.
WHEN 'ITAB-ZFUTURE'.
v_days = 'FUT'.
PERFORM display_line_item_level.
WHEN 'ITAB-30DAYS'.
v_days = '30D'.
PERFORM display_line_item_level.
WHEN 'ITAB-60DAYS'.
v_days = '60D'.
PERFORM display_line_item_level.
WHEN 'ITAB-90DAYS'.
v_days = '90D'.
PERFORM display_line_item_level.
WHEN 'ITAB-99DAYS'.
v_days = '99D'.
PERFORM display_line_item_level.
WHEN 'ITAB-120DAYS'.
v_days = '120D'.
PERFORM display_line_item_level.
WHEN 'ITAB-180DAYS'.
v_days = '180D'.
PERFORM display_line_item_level.
WHEN 'ITAB-365DAYS'.
v_days = '365D'.
PERFORM display_line_item_level.
WHEN 'ITAB-TOTAL'.
v_days = ' '.
PERFORM display_line_item_level. " 0001
ENDCASE.
ENDCASE.
ENDFORM. "USER_COMMAND
PAGE_HEADER
FORM page_header.
WRITE:/115 'Time:', sy-timlo.
WRITE: /115 'Date:', sy-datum.
WRITE: /52 'Customer Outstanding Agewise ', "0002
115 'Page:', sy-pagno.
SKIP.
IF p_abs EQ 'X'.
WRITE: /52 'Vendor Outstanding Agewise (Absolute Aging)',
115 'Page:', sy-pagno.
ELSE.
WRITE: /52 'Vendor Outstanding Agewise (Due Date Aging)',
115 'Page:', sy-pagno.
ENDIF.
SKIP.
ULINE /(132).
WRITE: /02 'Open Items as of:', stida.
IF NOT s_vkgrp[] IS INITIAL.
IF s_vkgrp-high IS INITIAL.
WRITE: 52 'Sales Group :',s_vkgrp-low.
ELSE.
WRITE: 52 'Sales Group :',s_vkgrp-low,'to',s_vkgrp-high.
ENDIF.
ELSE.
WRITE: 52 'Sales Group : All'.
ENDIF.
IF NOT s_grupp[] IS INITIAL.
IF s_grupp-high IS INITIAL.
WRITE: 107 'Credit group :',s_grupp-low.
ELSE.
WRITE: 107 'Credit group :',s_grupp-low,' to',s_grupp-high.
ENDIF.
ELSE.
WRITE: 107 'Credit Group : All'.
ENDIF.
WRITE: /02 'Comapany Code :', p_bukrs.
IF NOT s_konda[] IS INITIAL.
IF s_konda-high IS INITIAL.
WRITE: 52 'Price group :',s_konda-low.
ELSE.
WRITE: 52 'Price group :',s_konda-low,' to',s_konda-high.
ENDIF.
ELSE.
WRITE: 52 'Price Group : All'.
ENDIF.
IF NOT s_ctlpc[] IS INITIAL.
IF s_ctlpc-high IS INITIAL.
WRITE: 107 'Risk category:',s_ctlpc-low.
ELSE.
WRITE: 107 'Risk category:',s_ctlpc-low,' to',s_ctlpc-high.
ENDIF.
ELSE.
WRITE: 107 'Risk category: All'.
ENDIF.
IF NOT s_vkbur[] IS INITIAL.
IF s_vkbur-high IS INITIAL.
WRITE:/02 'Sales Office :',s_vkbur-low.
ELSE.
WRITE:/02 'Sales Office :',s_vkbur-low,' to',s_vkbur-high.
ENDIF.
ELSE.
WRITE:/02 'Sales Office : All'.
ENDIF.
IF NOT s_kdgrp[] IS INITIAL.
IF s_kdgrp-high IS INITIAL.
WRITE: 52 'Customer group :',s_kdgrp-low.
ELSE.
WRITE: 52 'Customer group :',s_kdgrp-low,' to',s_kdgrp-high.
ENDIF.
ELSE.
WRITE: 52 'Customer group : All'.
ENDIF.
IF NOT s_ktokd[] IS INITIAL.
IF s_ktokd-high IS INITIAL.
WRITE: 107 'Account Group:',s_ktokd-low.
ELSE.
WRITE: 107 'Account Group:',s_ktokd-low,' to',s_ktokd-high.
ENDIF.
ELSE.
WRITE: 107 'Account Group: All'.
ENDIF.
IF NOT s_lifnr[] IS INITIAL.
IF s_lifnr-high IS INITIAL.
WRITE: /02 'Vendor No :',s_lifnr-low.
ELSE.
WRITE: /02 'Vendor No :',s_lifnr-low,' to',s_lifnr-high.
ENDIF.
ELSE.
WRITE: /02 'Vendor No : All'.
ENDIF.
IF NOT s_kkber[] IS INITIAL.
IF s_kkber-high IS INITIAL.
WRITE: 52 'Credit Control Area:',s_kkber-low.
ELSE.
WRITE: 52 'Credit Control Area:',s_kkber-low,' to',s_kkber-high. -
AR Customer statements report Page numbers Reset based on customer number
Hello,
In the AR Customer statements report, If I ran the report for multiple customers, page number has to be reset for each customer...
Group Started like below,
<?for-each-group:G_STATEMENT;STATEMENT_DATE?><?for-each-group:current-group();SEND_TO_ADDRESS_ID?>Hi Kittu,
I got the answer using @section command.
Below are the complete syntax in my case.
Form field --Xml Tag
If Data Found --<?choose@section:?><?when:count(G_SETUP)!=0?>
Group G_SETUP --<?for-each@section:G_SETUP?>
Group G_STATEMENT --<?for-each-group@section:G_STATEMENT;STATEMENT_DATE?><?for-each-group@section:current-group();SEND_TO_ADDRESS_ID?>
Its working for me.
Let me know if you required more information.
Regards,
Dasarath -
Custom Groups in SmartView (for users of multiple forums pardon the dupe)
It was suggested I add my inquiry out here too. Simply put, I am looking for whatever method is available in SmartView for the user to create a custom grouping - say of products - which they can name and then add to their reports, and then the report will function with that group? So if they drill on other dims - the group definition is retained? What I have found so far is that I can create a custom MDX with a group - and it works great - except my users probably cannot generate custom MDX... So what options do I have? V 9 or V 11 ideas would be great. I have had 4 people tell me they saw demo's by Oracle of someone doing exactly this - it appeared easy, slick, and they have no memory of how it was done. I appear to have missed that demo. If you are familiar with OBIEE - my users want BINS in Essbase SmartView.
I think what you are referring to is the ability to create custom hierarchies and this is not available in Smart View. Users can leverage excel to do some of this but I am not sure you will get what you are looking for.
-
Custom Oracle Report displaying records one at a time
I have a custom oracle report that i've created and what i'm trying to achieve is to get all the records for the specific job code to print on one page. Instead, it is putting one record on one page. For example, job 90822 might have 6 records associated with it. Instead of it putting all 6 on one page it is putting one on 6 separate pages. I'm attaching my statement below. Any help is appreciated!
select proj, cmocn_code, cmocn_comp_code, cmocn_job_code, cmocn_notes, cmocn_post_date, cmocn_issued_date,
cmocn_executed_date, cmocn_impact_days, budg_amt,
sum(budg_amt) over (partition by cmocn_job_code order by cmocn_job_code,cmocn_code) cumilative_budg_amt,
sum(cmocn_impact_days) over (partition by cmocn_job_code order by cmocn_job_code,cmocn_code) cumilative_days,
cc_pmownercon, cc_cmownmod, bp_name
from
select pmp_proj_code || ' - ' || pmp_proj_name || ' - ' || pmp_add_line3 || ', ' || pmp_region_code proj
, cmocn_code, cmocn_comp_code, cmocn_job_code, nvl(cmmv_name, cmocn_title) Notes
, cmocn_post_date, cmocn_issued_date, cmocn_executed_date, cmocn_impact_days
, nvl(cmmv_bill_amt, 0) budg_amt
--, sum(decode(cmocn_code, '0000', pmp_curr_cont_amt/*pmp_orig_cont_override_amt*/, nvl(cmmv_bill_amt, 0)))
--over (partition by cmocn_job_code order by cmocn_job_code,cmocn_code) cumilative_budg_amt
, cmocn_notes, cc_pmownercon, cc_cmownmod, bp_name
from da.cmownchgnum
, (select cmmv_comp_code, cmmv_job_code, cmmv_owner_chg_code, sum(cmmv_bill_amt) cmmv_bill_amt
, max(cmmv_name) cmmv_name
from da.pmmast_v
where cmmv_owner_chg_code <> '0000'
group by cmmv_comp_code, cmmv_job_code, cmmv_owner_chg_code--,cmmv_name
, da.pmproject_table
, da.cc_user_fields_vw
, da.bpartners
where cmocn_code <> '0000'
and cc_table_name (+) = 'CMOWNCO'
and cmocn_oraseq = cc_oraseq_in_table (+)
and cmocn_comp_code = cmmv_comp_code (+)
and cmocn_job_code = cmmv_job_code (+)
and cmocn_code = cmmv_owner_chg_code (+)
and cmocn_comp_code = pmp_comp_code
and cmocn_job_code = pmp_job_code
and pmp_cust_code = bp_code
union all
select pmp_proj_code || ' - ' || pmp_proj_name || ' - ' || pmp_add_line3 || ', ' || pmp_region_code proj
, '0000', pmp_comp_code, pmp_job_code, null /*nvl(cmmv_name, cmocn_title) Notes*/
/*, cmocn_post_date, cmocn_issued_date, cmocn_executed_date, cmocn_impact_days*/
, null, null, null, null
, pmp_curr_cont_amt budg_amt
--, sum(decode(cmocn_code, '0000', pmp_orig_cont_override_amt, nvl(cmmv_bill_amt, 0)))
--over (partition by cmocn_job_code order by cmocn_job_code,cmocn_code) cumilative_budg_amt
, null/*--cmocn_notes*/, cc_pmownercon, cc_cmownmod, bp_name
from da.pmproject_table
, da.cc_user_fields_vw
, da.bpartners
where cc_table_name (+) = 'PMPROJ'
and pmp_proj_oraseq = cc_oraseq_in_table (+)
and pmp_cust_code = bp_code
and pmp_cust_code = bp_code
order by cmocn_job_code, cmocn_codeHello,
What is the "Vertical Elasticity" of the enclosing frames / repeating frames ?
This problem may occur when a frame or repeating frame has a property "Vertical Elasticity" set to Fixed or contract.
In this case, change the property "Vertical Elasticity" to Expand or Variable.
Regards -
Transaction code thro' SAP Query for customer spefific report
hi experts,
how to create transaction code (using SE43-) for the sap query created on own??
I have created the following required for a customer specific report
1.Infoset thro sq02
2.user group thro sq03 and assigned it to infoset
3.query thro sq01 and saved it with text
earlier i have used logical database PNPCE ( relevant for PA and payroll modules reports)
using sq01 , go to basic list , selected required infotypes and fields and
then selected, SAP List viewer for viewing and i get the report.
Now my question is how to create a separate transaction code for this sap query which i created
should i use SE43( area menu maintenance and area class???_)
should i create a variant and go to SE43??
advice solicited
snrHello
when you excecute the query in right han side corner you can get the program name
go to se80 select program & type this name and then you can create a tcode for that prog in SE80
reward points if helpful.
the prog name will be something like : AQZZ/SAPQUERY/* " ur query name
you can search for the name also in this manner -
Servicewise customer outstanding report
Dear Experts,
I would like to know the configuration requirements which have to perform to know the service wise outstanding from each customer. I am working in a implementation project for Public sector client which renders services. As per the reporting requirement, it classifes the customer account groups into three ways. i.e Govt customer, non-govt customers and internal customers and in the balance sheet it is showing outstanding balance from each group by maintaining sundry debtors reconciliation account for each customer group seperately. This can done in standard SAP by assiging the respective Recon a/c in the respective customer master.
However, as per the reporting requirement in schedules to the balance sheet, it is also providing service wise outstainding from all customers. Here all the services are on prepaid services and there is no payment against invoice. The amount which is deposited by customer is a liability to organzation and the adjustment of this deposit will be done against any service which is availed by customer. Hence, there is no receipt from customer against the invoice.
For example Mr. "A" customer to my client and he can avail any service such as S1 (type of service), S2 or S3. Since it is a prepaid service, "A" has to deposit the amount in advance and later he has to avail the service. at the time of deposit, he won't mention for which service he is depositing the amount and he simply deposits a lumpsum amount not against any invoice. this deposit is manintained as a liability to my client until the customer avails the service and once they avail this liability has to be reduced to the extent of invoice value. If invoice value is more than the deposit, the total invoice value has to be shown as outstading in the respective service recon a/c.
Could anyone plz respond me on providng the solution to this issue?
Regards
AnilHi,
There is no standard report which will provide you with this information.
You can go for z report.
Where based on your Order Type for separate service billing you can make the report.
For that you have use SD tables and link with the FI outstanding tables.
But one issue still remain to down payment received which has not been adjusted to the invoices.
Until and unless you do the adjustment with the invoice you will not be able to make the correct outstanding report.
But you can show as non adjusted advances received from customer as lumpsum. -
Commision based on item group & customer group
Dear all,
Does anyone have an idea about how to get commission based on item group & customer group sales?
My customer wanted commission report based on item group or customer group & based on payment collection dated.
Example
Term given for customer A is 30 days.
12/3/09 Inv 1000 RM 10,000 30 days payment
20/4/09 Inv 2000 RM 5,000 60 days payment
The term given is 30 days of the invoice month.
Salesman will get commission if get the collection at May'09 for Inv 1000, & July'09 for iinv 2000 based on the invoice date month.
The salesman get commission at any date of the month May'09. More longer collection, less commission they will get.
Example:
Salesman A
Customer Group 1st of the month, 2nd of the month, 3rd of the month, 4th of the month
Normal Dealer 1.5% , 0.75%, 0.00% , -0.25%
Sub Distributor 0.5% , 0.25%, 0.00% , - 0.25%
Any idea?
Thanks in advance?
Regards,
Eric TanHi Eric
SAP does not calculate commissions, but merely provide a mechanism to report on it. The multi level calculation you require can be achived with a custom query linked to a report layout. Standard SAP will not provide this type of calculation. You will need to look at the open transactions such as invoices and link to the relevant payment transaction to get the payment date. Then compare this date to the invoice due date to determine if the terms were adhered to or not. If not payment date - due date in number of days will be needed to calculate the effective commission percentage.
Kind regards
Peter Juby -
Hi Gurus,
Kindly help me out in Customer Service Reports. As i am new to CS.
1.All 90 day Customer Service returns for a specific period.
2.All 90 day Customer Service Returns for a tech during a specific period.
3.All 90 day Customer Service Returns for each tech during a specific period, separated by tech.
4.All 90 Day Customer service returns by product group, model during a specific period.
5.repair Units received in a specific period
6.Backlog of each product or model
7.Number of units invoiced in a specific period
8.Number of units completed (PIOu2019d) in a specific period with a selection of
a) warranty
b) non-warranty
c) service contracts
d) JOB TYPES
e) Cal only
9.Daily Revenue Month to date by
a) LABOR
b) PARTS
c) FLAT RATE
d) SERVICE CONTRACTS
e) SPARES
Entire inventory of units in Service ( REPSTAT)
Need to run reports for units coming out of warranty u2013 90 days in advance.
Repair report
Calibration due report
Invoice and IR info by model / SN
View unit tracking/units due for calibration in next 60 days
View invoiced amount per product per month
thanks
Edited by: rkravi928 on Aug 23, 2009 6:18 AMRavi,
It seems that you have posted your client's all report requirements in one post and expecting Functional spec for each report.
All these reports requires lot of discussion with Core teams / Technical consultant.
Eg.
>
> 8.Number of units completed (PIOu2019d) in a specific period with a selection of
> a) warranty
> b) non-warranty
> c) service contracts
> d) JOB TYPES
> e) Cal only
>
Where you maintain warranty information?
Iis there any master warranty / Measurement document involved? .. is there any extended warranties applicable for your product?
What is your reference object - Equip / Func loc etc..?
What do you mean by JOB type and where you are capturing?
... lot of queries can be raised on your requirement.
The functional consultant and the core team members of this module can only be able to answer those queries.
Better you close this thread, and start separate queries for each report with necessary information so that peers can able to suggest.
Babu -
Using Customized group name fields in Live Office
Hello everybody,
I've created a Crystal Reports based on a BEx Query and including a costcenter hierarchy. Now I want to add this report in Excel sheet via Live Office. I did this according to the official HowTos provided by Ingo Hilgefort. Now I've following issue. When I choose the data for the selected fields in Live Office, I could manage to insert the Live Office object into my report but the display of the cost center hierarchy nodes doesn't comply with the display in Crystal Reports. There I've defined a group with a customized group name field (costcenter.medium description) Live Office seems to use only the costcenter node ID.
Crystal Report:
Marketing und Vertrieb----
63 63 63 63 0 0
Vertrieb----
54 54 54 54 0 0
Vertrieb a----
1 1 1 1 0 0
Vertrieb a----
3 3 3 3 0 0
Vertrieb a----
4 4 4 4 0 0
Vertrieb a----
2 2 2 2 0 0
Vertrieb a----
2 2 2 2 0 0
Vertrieb a----
3 3 3 3 0 0
Vertrieb a----
2 2 2 2 0 0
Marketing----
34 34 34 34 0 0
Marketing a----
3 3 3 3 0 0
Live Office:
1000H1.1000H1000.1000H1300----
63 63 63 63 0 0
1000H1.1000H1000.1000H1300.1000H1310----
54 54 54 54 0 0
1000H1.1000H1000.1000H1300.1000H1310.1000/3100-----1 1 1 1 0 0
1000H1.1000H1000.1000H1300.1000H1310.1000/3105-----3 3 3 3 0 0
1000H1.1000H1000.1000H1300.1000H1310.1000/3110-----4 4 4 4 0 0
1000H1.1000H1000.1000H1300.1000H1310.1000/3120-----2 2 2 2 0 0
1000H1.1000H1000.1000H1300.1000H1310.1000/3125-----2 2 2 2 0 0
1000H1.1000H1000.1000H1300.1000H1310.1000/3130-----3 3 3 3 0 0
1000H1.1000H1000.1000H1300.1000H1310.1000/3135-----2 2 2 2 0 0
1000H1.1000H1000.1000H1300.1000H1310.1000/3140-----34 34 34 34 0 0
1000H1.1000H1000.1000H1300.1000H1310.1000/3150-----3 3 3 3 0 0
How can I use customized group name fields in Live Office?
Thank you for helping me on my issue.
Regards,
Florianlive office uses web services to authenticate (dswsbobje) which depends on a java app server for kerberos to be enabled to login with AD. Is Infoview working with AD? This would be required. I'm not sure about your other issues.
Regards,
Tim
Maybe you are looking for
-
Limitation on number of adf components on a jsp page?
I am currently working on a page which comprises a number of af:table components with underlying af:column components for each table. The page also contains other adf components. My question is as stated above, is there a limitation on the number of
-
I have request in the report level but the same is missing in the infocube
Dear Experts, I have request in the report level but the same is missing in the compressed infocube level. What could be the cause? does the compressed infocube deletes the request ? if so, I could able to view other requests under infocube manage le
-
Canon 5D Mark II Export Issues
So, I shot some footage on the 5D and have edited them together. Every time I try to export the footage it always turns out choppy or lags. It's not as smooth as the original footage even though I set the export settings to 30 fps as is native to the
-
Using an xsl stylesheet I'm trying to transform this: <user> <streetNo v="123" /> <streetName v="Main" /> <streetType v="St." /> <aptBox v="#4" /> </user>into this: <user> <address>123 Main St. #4</address> </user>I don't think Mu
-
What are the importatnt SD tables
What are the importatnt SD tables?