When do I need to incorporate Dispose into my code?
I'm trying to understand (a) if I ever need to implement Dispose in my classes and (b) if I do, when do I?
Part of the reason for asking is because I have implemented Dispose in some of my classes, because I wanted to ensure that collections of items were being correctly cleaned up when I didn't need them any longer, but navigating away from pages that results
in a lot of items being disposed is causing the app to "lock up" for some time.
What is the best practice guidance and advice, please? From what I've read, it looks like Store apps *don't* generally need to Dispose, even though they are built on top of .NET and .NET *does* need Dispose.
Thanks.
I need to drill into the whole "do I need to unhook from events" a bit more because I'm getting very confused as to when I need to and when I don't. Here are a couple of examples:
1. I have a class called RHObjectFile and it defines the following:
publicstaticeventEventHandlerFileChangedEvent;
and some other classes (e.g. RHIndividualRecord) where the constructor includes:
RHObjectFile.FileChangedEvent += HandleFileChangeEvent;
So, given that arrangement, do I need to unhook from FileChangedEvent in order for GC to realise that an instance of RHIndividualRecord is no longer in use? If GC gets rid of an instance of RHIndividualRecord, does it automatically (magically) unhook from
event handlers?
2. Pages typically have something like the following in their constructor:
this.navigationHelper =
newNavigationHelper(this);
this.navigationHelper.LoadState +=
navigationHelper_LoadState;this.navigationHelper.SaveState
+= navigationHelper_SaveState;
Again, do I need to unhook from LoadState/SaveState in order to allow GC to clean up the Page instance when it isn't in use any more?
Thanks.
Similar Messages
-
Need to incorporate RoboHelp into WordPress site
I have a WordPress site that I want to incorporate my RoboHelp application into. Is this something that can be done? Or, do I need to do the reverse and create the RoboHelp site then add the blog content?
Sorry, but that would be a direct violation of the license agreement, no?
Why would you want folks to use RoboHelp via a web site?
Or did you mean to say that you wanted to create a RoboHelp output such as WebHelp and use it? If so, that's probably possible, but would require some work. I don't know if Wordpress offers an ability to upload a folder structure.
Cheers... Rick -
I need help with color pallette in iPhoto 11. I have created a book and would like to use a different color background than those given in "background." I have found the color palettes but can't seem to incorporate them into my backgrounds palette.
That is not a feature of iPhoto - suggest to Apple - iPhoto Menu ==> provide iPhoto feedback.
Additionally I have no idea what you are saying here
I have found the color palettes but can't seem to incorporate them into my backgrounds palette.
And it always helps for you to dientify the version of iPhoto that you are using
LN -
when I try to sync my Ipad into my Itunes on my PC (first time I have done this) , I get the message on my PC "The Ipad cannot be used because the APple Mobile Device service is not started". What do I need to do to get it started? I went into my account and there is no obvious way to get it started.
See Here
AMDS for Windows
http://support.apple.com/kb/TS1567 -
i have got an iphone 3g and when i got it it was jailbroken so i went to restore it but it failed now it says i need to plug it into itunes all the time. what do i do?
Kidcomeleon wrote:
i have got an iphone 3g and when i got it it was jailbroken so i went to restore it but it failed now it says i need to plug it into itunes all the time. what do i do?
Plug it into iTunes. -
My phone stopped working this morning, it tells me that activation is requires and that I need to plug it into ITunes. However when I try to plug it into my computer nothing happens, it will only show the apple symbol when I plug it into an outlet. Does anyone know what I can do to get it to plug into itunes or activate it again?
Please plug the iPhone with the original doch-connector & USB cable into a USB plug in the computer (directly into the computer) and restart iTunes. It should register. Please do not stop the registration!!! You may need to press power on iPhone.
Is the iPhone jailbroken? -
when I import a Quick Time movie into the timeline using Final Cut Express, why does it need rendering?
Because your clip properties do not match your sequence settings.
It will help a lot if you provide details ...
FCE Easy Setup
Sequence settings (vid rate, frame size, compressor)
Source of your clips (camcorder make/model, etc)
Clip properties (vid rate, frame size, compressor) -
I updated my computer from Snow Leopard to Lion. The problem is none of my pictures go to my IPad or iPhone. When I checked my settings, I go into ICloud and photo Stream, and it tells me that I need to buy a update. Any help would be appreciated.
Then maybe you need to buy an update.
-
Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error - I don't know what this means or how to fix it, I get it when I try to enter a ticket into one of our custom data bases in Access
Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error - I don't know what this means or how to fix it, I get it when I try to enter a ticket into one of our custom data bases in Access
-
Need to convert values into coma separated
Need to convert values into coma separated
I have a string value that stores data like 'NYK,IND,SGP,GER'
FOR EXAMPLE
V_CITY_CODE = 'NYK,IND,SGP,GER'
When I query
select * from city where city_code = V_CITY_CODE;I get no rows, this is because V_CITY_CODE has all city code as single code.
I need a function to search , and replace with ','.
I tried using instr and replace but was unable to convert it.
could some one pls assist me.
thanks in advance
SazLooking for this?
SQL> select * from emp
2 /
EMPNO DEPTNO ENAME SAL DOJ JOB
1 1 Karthick 80 03-DEC-11
2 1 Karthick_1 90 23-NOV-11
3 2 Ram 80 03-DEC-11
4 2 Ram_1 90 23-NOV-11
SQL> var v_ename varchar2(1000)
SQL> exec :v_ename := 'Karthick,Karthick_1'
PL/SQL procedure successfully completed.
SQL> select *
2 from emp
3 where ename in (
4 select regexp_substr(val, '[^,]+', 1, level)
5 from (select :v_ename val from dual)
6 connect by level <= length(val) - length(replace(val, ','))+1
7 )
8 /
EMPNO DEPTNO ENAME SAL DOJ JOB
1 1 Karthick 80 03-DEC-11
2 1 Karthick_1 90 23-NOV-11 -
When ever i plug my iphone 4 into my computer it always tells me to restore iphone.
As the Question sugests i am being told to restore my iphone 4 almost everytime i plug it in to my computer, I might get one time that it doesn't tell me to straght after the restore. After that i try to sync it and it just comes up with an un expected error occoured and then it all starts again that i have to restore it, All my apps work just my music dissapears. Can this be fixed or do i need to take it somewhere, It has the latest software.
Cheers.
M01RHM9CC5ANWhen ever i plug my iphone 4 into my computer it always asks me to restore it even if i did it the day before. it just comes up with itunes can not read the contents of iphone please restore, this is really annoying me that i cant listen to my music.When ever i plug my iphone 4 into my computer it always asks me to restore it even if i did it the day before. it just comes up with itunes can not read the contents of iphone please restore, this is really annoying me that i cant listen to my music.When ever i plug my iphone 4 into my computer it always asks me to restore it even if i did it the day before. it just comes up with itunes can not read the contents of iphone please restore, this is really annoying me that i cant listen to my music.ne please restore, this is really annoying me that i cant listen to my musicas the SIf no change after restoring your iPhone with iTunes as a new iPhone or not from the iPhone's backup, your iPhone has a problem. Call AppleCare or make an appointment at an Apple store if available.
-
I have tried re-setting Firefox and working in Safe Mode, but the problem still recurs. I use Fastmail as my webmail server and never had this problem on Windows XP or Windows 7. When I reply to a message, the original message is turned into html code. The same happens when I forward a message.
My JavaScript is up to date, in case that's relevant. The Fastmail support team suggested the problem would be Firefox-related.
The other function of my Fastmail account that isn't working properly in Firefox 17.0.1. is the search function.
Do I need to get new plugins or something? I don't know where the HTML editor is in Firefox or if that's what's wrong.
Regards,
RachelThanks for your reply, cor-el. Norton 360 came pre-installed on the laptop as part of the package I bought. I haven't changed the pre-set firewall or anti-virus settings. Should I change something?
I will try rebooting in Windows Safe mode as you say and report if that makes any difference.
Rachel -
Need to import .swf into Flash 8 project
I'm working on a project that requires me to use an already
made .swf file in it. I'm creating the whole project (which is a
presentation) strictly in Flash 8. This project requires a user to
be able to navigate through various menus and categories to see
what's in them. Most of the categories have a slide-show of images
that are accompanied by a voice over sound track that explains to
them what they're watching; however, for other categories I already
have a previously created .swf file that I need to import into
Flash 8. The issue that I've noticed when I just import the .swf
file into Flash is that the file plays at about 100x the original
speed. I think that it is because Flash looks at this file as one
frame and tried to play everything all at once. I also looked into
the possibility of trying to the loadMovie() function, but that is
not that convenient for me because this requires me to decompile
the .swf file into .fla and edit it so that a user has a way of
coming back to the main menu of the presentation from that movie,
unless there is a function parameter of loadMovie() similar to
HTML's "_blank" where a new window opens so that the user can close
this window without having to worry about restarting the
presentation. I hope that what I'm doing is clear, and I'm very
much open to any suggestions about what I should do about it or any
other ways of doing what I'm trying to achieve, which is to be able
to play already-made .swf files in my Flash project. To give more
details on these .swf files, they were originally created in Adobe
Captivate and exported into .swf. They play perfectly when you play
them, but it's just that there is an issue when I try to play them
from my Flash project. Thank you in advance for your help.Hi Braulio
a good tutorial site can be found at
http://www.kirupa.com
and also, look in your Flash Docs, for loadClip() and
loavMovie() methods. They should get you started on some ideas to
import external content. -
I have a normal report , i need to make it into ALV,
Hi,
i have a normal report and i need to make it into ALV Report in ECC5.0version. when i making it into ALV its giving blank.
can any one help me out to make below code in to ALV report.
REPORT ZSAMPLE line-size 260
line-count 65
no standard page heading.
====================================================================
TABLES *********************************
====================================================================
tables : bseg,
bkpf,
kna1,
bsid,
bsad,
knb1.
data : begin of customer_tab occurs 0,
kunnr like kna1-kunnr,
name1 like kna1-name1,
flag(1) type c,
end of customer_tab.
data : begin of customerdoc_tab occurs 0,
kunnr like kna1-kunnr,
belnr like bkpf-belnr,
gjahr like bkpf-gjahr,
monat like bkpf-monat,
end of customerdoc_tab.
data : begin of doc_tab occurs 0,
belnr like bkpf-belnr,
gjahr like bkpf-gjahr,
monat like bkpf-monat,
end of doc_tab.
DATA: BEGIN OF BSID_TAB OCCURS 0,
BUKRS LIKE BSID-BUKRS,
PRCTR LIKE BSID-PRCTR,
KUNNR LIKE BSID-KUNNR,
FLAG(1),
UMSKZ LIKE BSID-UMSKZ,
BLART LIKE BSID-BLART,
BELNR LIKE BSID-BELNR,
BUZEI LIKE BSID-BUZEI,
NETDT LIKE BSID-ZFBDT,
ZFBDT LIKE BSID-ZFBDT,
BUDAT LIKE BSID-BUDAT,
BLDAT LIKE BSID-BLDAT,
BSCHL LIKE BSID-BSCHL,
DMBTR LIKE BSID-DMBTR,
SHKZG LIKE BSID-SHKZG,
ZBD1T LIKE BSID-ZBD1T,
ZBD2T LIKE BSID-ZBD2T,
ZBD3T LIKE BSID-ZBD3T,
REBZG LIKE BSID-REBZG,
REBZT LIKE BSID-REBZT,
KOART LIKE BSEG-KOART,
SK1DT LIKE FAEDE-SK1DT,
SK2DT LIKE FAEDE-SK2DT,
DAYSD LIKE SY-TABIX,
END OF BSID_TAB.
ranges : r_bukrs for bsid-bukrs,
r_kunnr for kna1-kunnr.
===================================================================
VARIABLES *******************************
===================================================================
data : v_belnr like bseg-belnr,
v_gjahr like bkpf-gjahr,
v_monat like bkpf-monat,
v_ttlc type p,
v_flag(1) type c,
V_COUNT1(4) TYPE N,
V_COUNT2(4) TYPE N,
V_COUNT3(4) TYPE N,
V_COUNT4(4) TYPE N,
V_COUNT5(4) TYPE N,
V_COUNT6(4) TYPE N,
V_COUNT7(4) TYPE N,
V_COUNT8(4) TYPE N,
V_COUNT9(4) TYPE N,
V_COUNT10(4) TYPE N,
V_NET1 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 1
V_NET2 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 2
V_NET3 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 3
V_NET4 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 4
V_NET5 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 5
V_NET6 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 6
V_NET7 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 7
V_NET8 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 8
V_NET9 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 9
V_NET10 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 10
V_NET11 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 11
V_NET LIKE BSID-DMBTR, "Total Balance of Customer
V_ttlNET1 LIKE BSID-DMBTR,
V_ttlNET2 LIKE BSID-DMBTR,
V_ttlNET3 LIKE BSID-DMBTR,
V_ttlNET4 LIKE BSID-DMBTR,
V_ttlNET5 LIKE BSID-DMBTR,
V_ttlNET6 LIKE BSID-DMBTR,
V_ttlNET7 LIKE BSID-DMBTR,
V_ttlNET8 LIKE BSID-DMBTR,
V_ttlNET9 LIKE BSID-DMBTR,
V_ttlNET10 LIKE BSID-DMBTR,
V_ttlNET11 LIKE BSID-DMBTR,
V_ttlNET LIKE BSID-DMBTR,
v_kunnr like bseg-kunnr,
V_BUTXT like t001-butxt.
===================================================================
SELECTION SCREEN ****************************
===================================================================
selection-screen begin of block b1 with frame title text-001.
parameters : p_bukrs like bseg-bukrs obligatory.
select-options : s_kunnr for kna1-kunnr,
s_BRSCH for kna1-BRSCH,
s_REGIO for kna1-REGIO,
s_KTOKD for kna1-KTOKD,
s_BUSAB for knb1-BUSAB.
selection-screen: end of block b1.
selection-screen begin of block b2 with frame title text-003.
PARAMETERS: DAT LIKE SY-DATUM DEFAULT SY-DATUM.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(30) TEXT-002.
SELECTION-SCREEN POSITION POS_LOW.
*PARAMETERS: RASTBIS1 LIKE RFPDO1-ALLGROGR DEFAULT '000'.
*PARAMETERS: RASTBIS2 LIKE RFPDO1-ALLGROGR DEFAULT '030'.
*PARAMETERS: RASTBIS3 LIKE RFPDO1-ALLGROGR DEFAULT '060'.
*PARAMETERS: RASTBIS4 LIKE RFPDO1-ALLGROGR DEFAULT '090'.
*PARAMETERS: RASTBIS5 LIKE RFPDO1-ALLGROGR DEFAULT '120'.
PARAMETERS: RASTBIS1(4) type n DEFAULT '0000'.
PARAMETERS: RASTBIS2(4) type n DEFAULT '0030'.
PARAMETERS: RASTBIS3(4) type n DEFAULT '0060'.
PARAMETERS: RASTBIS4(4) type n DEFAULT '0090'.
PARAMETERS: RASTBIS5(4) type n DEFAULT '0120'.
PARAMETERS: RASTBIS6(4) type n DEFAULT '0150'.
PARAMETERS: RASTBIS7(4) type n DEFAULT '0180'.
PARAMETERS: RASTBIS8(4) type n DEFAULT '0210'.
PARAMETERS: RASTBIS9(4) type n DEFAULT '0240'.
PARAMETERS: RASTBIS0(4) type n DEFAULT '0270'.
SELECTION-SCREEN END OF LINE.
Noted item removed as per FI instruction
PARAMETERS: P_STAND AS CHECKBOX default 'X',
P_NOTED AS CHECKBOX ,
P_SPCAL AS CHECKBOX .
selection-screen: end of block b2.
selection-screen begin of block b3 with frame.
PARAMETERS: allgline like RFPDO1-allgline .
Parameters : p_balyes type c radiobutton group grp9 default 'X',
p_balno type c radiobutton group grp9.
selection-screen: end of block b3.
Check for the Select option
AT SELECTION-SCREEN.
IF P_STAND = '' AND P_SPCAL = '' .
MESSAGE E398(00) WITH 'PLEASE CHOOSE AT LEAST ONE G/L INDICATOR!'.
ENDIF.
Check for Company code Authorization
authority-check object 'F_BKPF_BUK'
ID 'BUKRS' FIELD p_bukrs
ID 'ACTVT' FIELD '03'.
if sy-subrc ne 0.
message e398(00) with 'You are not Authorized for CC ' p_bukrs.
Endif.
===================================================================
START-OF-SELECTION ****************************
===================================================================
START-OF-SELECTION.
V_COUNT1 = RASTBIS1 + 1.
V_COUNT2 = RASTBIS2 + 1.
V_COUNT3 = RASTBIS3 + 1.
V_COUNT4 = RASTBIS4 + 1.
V_COUNT5 = RASTBIS5 + 1.
V_COUNT6 = RASTBIS6 + 1.
V_COUNT7 = RASTBIS7 + 1.
V_COUNT8 = RASTBIS8 + 1.
V_COUNT9 = RASTBIS9 + 1.
V_COUNT10 = RASTBIS0 + 1.
perform extract_data.
===================================================================
At line Selection *****************************
===================================================================
at line-selection.
if sy-lilli >= 9 .
refresh r_bukrs.
move p_bukrs to r_bukrs-low.
move 'I' to r_bukrs-sign.
move 'EQ' to r_bukrs-option.
append r_bukrs.
refresh r_kunnr.
move customer_tab-kunnr to r_kunnr-low.
move 'I' to r_kunnr-sign.
move 'EQ' to r_kunnr-option.
append r_kunnr.
submit ZFARVR0040 and return
with p_bukrs = p_bukrs
with dat = dat
with p_stand = p_stand
with p_spcal = P_SPCAL
with s_kunnr in r_kunnr.
endif.
===================================================================
Top of Page *******************************
===================================================================
TOP-OF-PAGE.
SELECT SINGLE BUTXT FROM T001 INTO V_BUTXT
WHERE BUKRS = p_BUKRS .
WRITE:/73'Customers Aging Analysis',140'PAGE NO.',
SY-PAGNO.
WRITE:/002 'COMPANY',
011 P_BUKRS,
017 V_BUTXT,
055 allgline centered,
140 'DATE :',
150 sy-datum .
write:/002 'User',
011 sy-UNAME,
140 'Time :',
150 sy-UZEIT.
SKIP.
format color col_heading intensified off.
WRITE:/ SY-ULINE,
SY-VLINE,002 'Customer',
012 SY-VLINE,013 'Name',
043 SY-VLINE,048 'CURRENT',
061 SY-VLINE,065 'FROM ',V_COUNT1,
079 SY-VLINE,083 'FROM ',V_COUNT2,
097 SY-VLINE,101 'FROM ',V_COUNT3,
115 SY-VLINE,119 'FROM ',V_COUNT4,
133 SY-VLINE,137 'FROM ',V_COUNT5,
151 SY-VLINE,155 'FROM ',V_COUNT6,
169 SY-VLINE,173 'FROM ',V_COUNT7,
187 SY-VLINE,191 'FROM ',V_COUNT8,
205 SY-VLINE,209 'FROM ',V_COUNT9,
223 SY-VLINE,228 'FROM ',V_COUNT10,
243 SY-VLINE,248 'TOTAL',
268 SY-VLINE.
WRITE:/ SY-VLINE,002 'Number',
12 SY-VLINE,
43 SY-VLINE,
061 SY-VLINE,065 'TO ',RASTBIS2,
079 SY-VLINE,083 'TO ',RASTBIS3,
097 SY-VLINE,101 'TO ',RASTBIS4,
115 SY-VLINE,119 'TO ',RASTBIS5,
133 SY-VLINE,137 'FROM ',RASTBIS6,
151 SY-VLINE,155 'FROM ',RASTBIS7,
169 SY-VLINE,173 'FROM ',RASTBIS8,
187 SY-VLINE,191 'FROM ',RASTBIS9,
205 SY-VLINE,209 'FROM ',RASTBIS0,
223 SY-VLINE,
243 SY-VLINE,
268 SY-VLINE,
SY-ULINE.
format color off.
===================================================================
END-OF-SELECTION ***************************
===================================================================
end-of-selection.
===================================================================
Form : Extract_Data *
===================================================================
form extract_data.
Select the Customers
Select t1~kunnr t2~name1
into corresponding fields of table customer_tab
from knb1 as t1 inner join kna1 as t2
on t2~kunnr = t1~kunnr
where t1~bukrs = p_bukrs
and t1~kunnr in s_kunnr
and t1~BUSAB in s_busab
and t2~regio in s_regio
and t2~BRSCH in s_BRSCH
and t2~KTOKD in s_KTOKD.
if sy-subrc <> 0.
message e398(00) with 'No Customers Selected'.
endif.
sort customer_tab.
describe table customer_tab lines v_ttlc.
v_ttlc = v_ttlc + 10.
loop at customer_tab.
v_net1 = 0.
v_net2 = 0.
v_net3 = 0.
v_net4 = 0.
v_net5 = 0.
v_net6 = 0.
v_net7 = 0.
v_net8 = 0.
v_net9 = 0.
v_net10 = 0.
v_net11 = 0.
v_net = 0.
perform calculate_ageing
using
p_bukrs
customer_tab-kunnr
dat
RASTBIS1
RASTBIS2
RASTBIS3
RASTBIS4
RASTBIS5
RASTBIS6
RASTBIS7
RASTBIS8
RASTBIS9
RASTBIS0
P_STAND
' ' "noted item
P_SPCAL
changing
v_net1
v_net2
v_net3
v_net4
v_net5
v_net6
v_net7
v_net8
v_net9
v_net10
v_net11
v_net.
if p_balyes = 'X' or v_net > 0.
format color col_total.
write:/ sy-vline,
002 customer_tab-kunnr,
012 SY-VLINE,013(30) customer_tab-name1,
043 SY-VLINE,044(16) v_net1,
061 SY-VLINE,062(16) v_net2,
079 SY-VLINE,080(16) v_net3,
097 SY-VLINE,098(16) v_net4,
115 SY-VLINE,116(16) v_net5,
133 SY-VLINE,134(16) v_net6,
151 SY-VLINE,152(16) v_net7,
169 SY-VLINE,170(16) v_net8,
187 SY-VLINE,188(16) v_net9,
205 SY-VLINE,206(16) v_net10,
223 SY-VLINE,224(16) v_net11,
239 SY-VLINE,240(16) v_net,
258 SY-VLINE.
format color off.
hide : customer_tab-kunnr.
v_ttlnet1 = v_ttlnet1 + v_net1.
v_ttlnet2 = v_ttlnet2 + v_net2.
v_ttlnet3 = v_ttlnet3 + v_net3.
v_ttlnet4 = v_ttlnet4 + v_net4.
v_ttlnet5 = v_ttlnet5 + v_net5.
v_ttlnet6 = v_ttlnet6 + v_net6.
v_ttlnet7 = v_ttlnet7 + v_net7.
v_ttlnet8 = v_ttlnet8 + v_net8.
v_ttlnet9 = v_ttlnet9 + v_net9.
v_ttlnet10 = v_ttlnet10 + v_net10.
v_ttlnet11 = v_ttlnet11 + v_net11.
v_ttlnet = v_ttlnet + v_net.
endif.
endloop.
ULINE.
format color col_total.
write:/ sy-vline,
012 SY-VLINE,012(30) ' T O T A L',
043 SY-VLINE,044(16) v_ttlnet1,
061 SY-VLINE,062(16) v_ttlnet2,
079 SY-VLINE,080(16) v_ttlnet3,
097 SY-VLINE,098(16) v_ttlnet4,
115 SY-VLINE,116(16) v_ttlnet5,
133 SY-VLINE,134(16) v_ttlnet6,
151 SY-VLINE,152(16) v_ttlnet7,
169 SY-VLINE,170(16) v_ttlnet8,
187 SY-VLINE,188(16) v_ttlnet9,
205 SY-VLINE,206(16) v_ttlnet10,
223 SY-VLINE,224(16) v_ttlnet11,
239 SY-VLINE,240(16) v_ttlnet,
258 SY-VLINE.
format color off.
ULINE.
endform.
Function to Calculate Aging.
Form calculate_ageing using
bukrs
kunnr
dat
RASTBIS1
RASTBIS2
RASTBIS3
RASTBIS4
RASTBIS5
RASTBIS6
RASTBIS7
RASTBIS8
RASTBIS9
RASTBIS0
P_STAND
P_NOTED
P_SPCAL
changing
v_net1
v_net2
v_net3
v_net4
v_net5
v_net6
v_net7
v_net8
v_net9
v_net10
v_net11
v_net.
DATA: BEGIN OF BSID_TAB1 OCCURS 0,
BUKRS LIKE BSID-BUKRS,
PRCTR LIKE BSID-PRCTR,
KUNNR LIKE BSID-KUNNR,
FLAG(1),
UMSKZ LIKE BSID-UMSKZ,
BLART LIKE BSID-BLART,
BELNR LIKE BSID-BELNR,
BUZEI LIKE BSID-BUZEI,
NETDT LIKE BSID-ZFBDT,
ZFBDT LIKE BSID-ZFBDT,
BUDAT LIKE BSID-BUDAT,
BLDAT LIKE BSID-BLDAT,
BSCHL LIKE BSID-BSCHL,
DMBTR LIKE BSID-DMBTR,
SHKZG LIKE BSID-SHKZG,
ZBD1T LIKE BSID-ZBD1T,
ZBD2T LIKE BSID-ZBD2T,
ZBD3T LIKE BSID-ZBD3T,
REBZG LIKE BSID-REBZG,
REBZT LIKE BSID-REBZT,
KOART LIKE BSEG-KOART,
SK1DT LIKE FAEDE-SK1DT,
SK2DT LIKE FAEDE-SK2DT,
DAYSD LIKE SY-TABIX,
END OF BSID_TAB1.
RANGES: R_UMSKZ FOR BSID-UMSKZ.
Data : V_ZFBDT Like bsid-ZFBDT,
V_ZBD1T Like bsid-ZBD1T,
V_ZBD2T Like bsid-ZBD2T,
V_ZBD3T Like bsid-ZBD3T,
V_LINES(8) TYPE n.
IF P_NOTED = 'X'. "CHECK NOTED ITEMS
R_UMSKZ-SIGN = 'I'.
R_UMSKZ-OPTION = 'EQ'.
R_UMSKZ-LOW = 'D'.
APPEND R_UMSKZ.
R_UMSKZ-SIGN = 'I'.
R_UMSKZ-OPTION = 'EQ'.
R_UMSKZ-LOW = 'L'.
APPEND R_UMSKZ.
ENDIF.
IF P_STAND = 'X'. "CHECK STANDARD ITEMS
R_UMSKZ-SIGN = 'I'.
R_UMSKZ-OPTION = 'EQ'.
R_UMSKZ-LOW = ' '.
APPEND R_UMSKZ.
ENDIF.
IF P_SPCAL = 'X'. "CHECK SPECIAL G/L TRANSACTION
R_UMSKZ-SIGN = 'I'.
R_UMSKZ-OPTION = 'EQ'.
R_UMSKZ-LOW = 'A'.
APPEND R_UMSKZ.
R_UMSKZ-SIGN = 'I'.
R_UMSKZ-OPTION = 'EQ'.
R_UMSKZ-LOW = 'B'.
APPEND R_UMSKZ.
ENDIF.
SELECT * FROM BSID INTO CORRESPONDING FIELDS OF TABLE BSID_TAB
WHERE BUKRS = BUKRS AND
budat <= dat AND
KUNNR = KUNNR AND
UMSKZ in R_UMSKZ.
SELECT * FROM BSAD appending CORRESPONDING FIELDS OF TABLE BSID_TAB
WHERE BUKRS = BUKRS AND
budat <= dat AND
augdt >= dat AND
KUNNR = KUNNR AND
UMSKZ in R_UMSKZ.
DESCRIBE TABLE BSID_TAB LINES V_LINES.
LOOP AT BSID_TAB.
if bsid_tab-BLART = 'DZ'.
Select single ZFBDT ZBD1T ZBD2T ZBD3T
into (V_ZFBDT,V_ZBD1T,V_ZBD2T,V_ZBD3T)
from bsid where BUKRS = BUKRS
and kunnr = bsid_tab-kunnr
and BELNR = bsid_tab-REBZG.
if sy-subrc = 0.
bsid_tab-ZFBDT = V_ZFBDT.
bsid_tab-ZBD1T = V_ZBD1T.
bsid_tab-ZBD2T = V_ZBD2T.
bsid_tab-ZBD3T = V_ZBD3T.
else.
Select single ZFBDT ZBD1T ZBD2T ZBD3T
into (V_ZFBDT,V_ZBD1T,V_ZBD2T,V_ZBD3T)
from bsad where BUKRS = BUKRS
and kunnr = bsid_tab-kunnr
and BELNR = bsid_tab-REBZG.
if sy-subrc <> 0.
bsid_tab-ZFBDT = V_ZFBDT.
bsid_tab-ZBD1T = V_ZBD1T.
bsid_tab-ZBD2T = V_ZBD2T.
bsid_tab-ZBD3T = V_ZBD3T.
endif.
endif.
endif.
IF BSID_TAB-SHKZG = 'H'.
BSID_TAB-DMBTR = BSID_TAB-DMBTR * ( - 1 ).
ENDIF.
bsid_tab-netdt = bsid_tab-ZFBDT.
bsid_tab-netdt = bsid_tab-budat.
bsid_tab-koart = 'D'.
MODIFY BSID_TAB.
PERFORM CALC_DUE_DATE USING BSID_TAB.
BSID_TAB-DAYSD = DAT - BSID_TAB-NETDT.
IF BSID_TAB-DAYSD <= RASTBIS1.
V_NET1 = V_NET1 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS2.
V_NET2 = V_NET2 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS3.
V_NET3 = V_NET3 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS4.
V_NET4 = V_NET4 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS5.
V_NET5 = V_NET5 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS6.
V_NET6 = V_NET6 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS7.
V_NET7 = V_NET7 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS5.
V_NET8 = V_NET8 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS9.
V_NET9 = V_NET9 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS0.
V_NET10 = V_NET10 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD > RASTBIS0.
V_NET11 = V_NET11 + BSID_TAB-DMBTR.
ENDIF.
V_NET = V_NET + BSID_TAB-DMBTR.
MODIFY BSID_TAB.
ENDLOOP.
endform.
Calculate Due Date
FORM CALC_DUE_DATE USING P_BSID_TAB STRUCTURE BSID_TAB.
DATA : REFE TYPE P.
IF P_BSID_TAB-KOART = 'K' OR P_BSID_TAB-KOART = 'D'.
IF P_BSID_TAB-ZFBDT IS INITIAL.
P_BSID_TAB-ZFBDT = P_BSID_TAB-BLDAT.
ENDIF.
*Nettofälligkeit bestimmen--
IF NOT P_BSID_TAB-ZBD3T IS INITIAL.
REFE = P_BSID_TAB-ZBD3T.
ELSE.
IF NOT P_BSID_TAB-ZBD2T IS INITIAL.
REFE = P_BSID_TAB-ZBD2T.
ELSE.
REFE = P_BSID_TAB-ZBD1T.
ENDIF.
ENDIF.
*Nichtrechnungsbezogene Gutschriften sind sofort fällig--
IF P_BSID_TAB-KOART = 'D' AND P_BSID_TAB-SHKZG = 'H'
OR P_BSID_TAB-KOART = 'K' AND P_BSID_TAB-SHKZG = 'S'.
IF P_BSID_TAB-REBZG IS INITIAL.
REFE = 0.
ENDIF.
ENDIF.
P_BSID_TAB-NETDT = P_BSID_TAB-ZFBDT + REFE.
*Skontofälligkeiten bestimmen--
IF NOT P_BSID_TAB-ZBD2T IS INITIAL.
P_BSID_TAB-SK2DT = P_BSID_TAB-ZFBDT + P_BSID_TAB-ZBD2T.
ELSE.
P_BSID_TAB-SK2DT = P_BSID_TAB-NETDT.
ENDIF.
IF NOT P_BSID_TAB-ZBD1T IS INITIAL
OR NOT P_BSID_TAB-ZBD2T IS INITIAL.
P_BSID_TAB-SK1DT = P_BSID_TAB-ZFBDT + P_BSID_TAB-ZBD1T.
ELSE.
P_BSID_TAB-SK1DT = P_BSID_TAB-NETDT.
ENDIF.
*Nichtrechnungsbezogene Gutschriften sind sofort fällig--
IF P_BSID_TAB-KOART = 'D' AND P_BSID_TAB-SHKZG = 'H'
OR P_BSID_TAB-KOART = 'K' AND P_BSID_TAB-SHKZG = 'S'.
IF P_BSID_TAB-REBZG IS INITIAL.
P_BSID_TAB-SK2DT = P_BSID_TAB-NETDT.
P_BSID_TAB-SK1DT = P_BSID_TAB-NETDT.
ENDIF.
ENDIF.
ELSE.
MESSAGE E122 RAISING ACCOUNT_TYPE_NOT_SUPPORTED.
ENDIF.
E_FAEDE = FAEDE.
ENDFORM.Hi,
As vijay said...
1.Declare One final Internal table which you want to show the data
2 . populate the fieldcatalog using the FM or Manually using the itab in step1
3. Collect the Data into final internal table which you created in Step 1.
4. pass the fieldcat and Internal table to ALV FM.
chk out the prg below i have created your program but i donn knw wht are the output fields... chk your prg
*REPORT ZALVTEST .
REPORT ZSAMPLE line-size 260
line-count 65
no standard page heading.
TYPE-POOLS: SLIS.
====================================================================
TABLES *********************************
====================================================================
tables : bseg,
bkpf,
kna1,
bsid,
bsad,
knb1.
data : begin of customer_tab occurs 0,
kunnr like kna1-kunnr,
name1 like kna1-name1,
flag(1) type c,
end of customer_tab.
data : begin of customerdoc_tab occurs 0,
kunnr like kna1-kunnr,
belnr like bkpf-belnr,
gjahr like bkpf-gjahr,
monat like bkpf-monat,
end of customerdoc_tab.
data : begin of doc_tab occurs 0,
belnr like bkpf-belnr,
gjahr like bkpf-gjahr,
monat like bkpf-monat,
end of doc_tab.
DATA: BEGIN OF BSID_TAB OCCURS 0,
BUKRS LIKE BSID-BUKRS,
PRCTR LIKE BSID-PRCTR,
KUNNR LIKE BSID-KUNNR,
FLAG(1),
UMSKZ LIKE BSID-UMSKZ,
BLART LIKE BSID-BLART,
BELNR LIKE BSID-BELNR,
BUZEI LIKE BSID-BUZEI,
NETDT LIKE BSID-ZFBDT,
ZFBDT LIKE BSID-ZFBDT,
BUDAT LIKE BSID-BUDAT,
BLDAT LIKE BSID-BLDAT,
BSCHL LIKE BSID-BSCHL,
DMBTR LIKE BSID-DMBTR,
SHKZG LIKE BSID-SHKZG,
ZBD1T LIKE BSID-ZBD1T,
ZBD2T LIKE BSID-ZBD2T,
ZBD3T LIKE BSID-ZBD3T,
REBZG LIKE BSID-REBZG,
REBZT LIKE BSID-REBZT,
KOART LIKE BSEG-KOART,
SK1DT LIKE FAEDE-SK1DT,
SK2DT LIKE FAEDE-SK2DT,
DAYSD LIKE SY-TABIX,
END OF BSID_TAB.
ranges : r_bukrs for bsid-bukrs,
r_kunnr for kna1-kunnr.
===================================================================
VARIABLES *******************************
===================================================================
data : v_belnr like bseg-belnr,
v_gjahr like bkpf-gjahr,
v_monat like bkpf-monat,
v_ttlc type p,
v_flag(1) type c,
V_COUNT1(4) TYPE N,
V_COUNT2(4) TYPE N,
V_COUNT3(4) TYPE N,
V_COUNT4(4) TYPE N,
V_COUNT5(4) TYPE N,
V_COUNT6(4) TYPE N,
V_COUNT7(4) TYPE N,
V_COUNT8(4) TYPE N,
V_COUNT9(4) TYPE N,
V_COUNT10(4) TYPE N,
V_NET1 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 1
V_NET2 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 2
V_NET3 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 3
V_NET4 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 4
V_NET5 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 5
V_NET6 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 6
V_NET7 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 7
V_NET8 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 8
V_NET9 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 9
V_NET10 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 10
V_NET11 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 11
V_NET LIKE BSID-DMBTR, "Total Balance of Customer
V_ttlNET1 LIKE BSID-DMBTR,
V_ttlNET2 LIKE BSID-DMBTR,
V_ttlNET3 LIKE BSID-DMBTR,
V_ttlNET4 LIKE BSID-DMBTR,
V_ttlNET5 LIKE BSID-DMBTR,
V_ttlNET6 LIKE BSID-DMBTR,
V_ttlNET7 LIKE BSID-DMBTR,
V_ttlNET8 LIKE BSID-DMBTR,
V_ttlNET9 LIKE BSID-DMBTR,
V_ttlNET10 LIKE BSID-DMBTR,
V_ttlNET11 LIKE BSID-DMBTR,
V_ttlNET LIKE BSID-DMBTR,
v_kunnr like bseg-kunnr,
V_BUTXT like t001-butxt.
********Declare Data Areas for List Viewer ***********
DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT_LN LIKE LINE OF FIELDCAT,
FIELD TYPE SLIS_FIELDNAME,
COL_POS TYPE I ,
PGM LIKE SY-REPID,
FIELD_VALUE(20),
TABLE_NAME(10).
===================================================================
SELECTION SCREEN ****************************
===================================================================
selection-screen begin of block b1 with frame title text-001.
parameters : p_bukrs like bseg-bukrs obligatory.
select-options : s_kunnr for kna1-kunnr,
s_BRSCH for kna1-BRSCH,
s_REGIO for kna1-REGIO,
s_KTOKD for kna1-KTOKD,
s_BUSAB for knb1-BUSAB.
selection-screen: end of block b1.
selection-screen begin of block b2 with frame title text-003.
PARAMETERS: DAT LIKE SY-DATUM DEFAULT SY-DATUM.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(30) TEXT-002.
SELECTION-SCREEN POSITION POS_LOW.
*PARAMETERS: RASTBIS1 LIKE RFPDO1-ALLGROGR DEFAULT '000'.
*PARAMETERS: RASTBIS2 LIKE RFPDO1-ALLGROGR DEFAULT '030'.
*PARAMETERS: RASTBIS3 LIKE RFPDO1-ALLGROGR DEFAULT '060'.
*PARAMETERS: RASTBIS4 LIKE RFPDO1-ALLGROGR DEFAULT '090'.
*PARAMETERS: RASTBIS5 LIKE RFPDO1-ALLGROGR DEFAULT '120'.
PARAMETERS: RASTBIS1(4) type n DEFAULT '0000'.
PARAMETERS: RASTBIS2(4) type n DEFAULT '0030'.
PARAMETERS: RASTBIS3(4) type n DEFAULT '0060'.
PARAMETERS: RASTBIS4(4) type n DEFAULT '0090'.
PARAMETERS: RASTBIS5(4) type n DEFAULT '0120'.
PARAMETERS: RASTBIS6(4) type n DEFAULT '0150'.
PARAMETERS: RASTBIS7(4) type n DEFAULT '0180'.
PARAMETERS: RASTBIS8(4) type n DEFAULT '0210'.
PARAMETERS: RASTBIS9(4) type n DEFAULT '0240'.
PARAMETERS: RASTBIS0(4) type n DEFAULT '0270'.
SELECTION-SCREEN END OF LINE.
Noted item removed as per FI instruction
PARAMETERS: P_STAND AS CHECKBOX default 'X',
P_NOTED AS CHECKBOX ,
P_SPCAL AS CHECKBOX .
selection-screen: end of block b2.
selection-screen begin of block b3 with frame.
PARAMETERS: allgline like RFPDO1-allgline .
Parameters : p_balyes type c radiobutton group grp9 default 'X',
p_balno type c radiobutton group grp9.
selection-screen: end of block b3.
Check for the Select option
AT SELECTION-SCREEN.
IF P_STAND = '' AND P_SPCAL = '' .
MESSAGE E398(00) WITH 'PLEASE CHOOSE AT LEAST ONE G/L INDICATOR!'.
ENDIF.
Check for Company code Authorization
authority-check object 'F_BKPF_BUK'
ID 'BUKRS' FIELD p_bukrs
ID 'ACTVT' FIELD '03'.
if sy-subrc ne 0.
message e398(00) with 'You are not Authorized for CC ' p_bukrs.
Endif.
===================================================================
START-OF-SELECTION ****************************
===================================================================
START-OF-SELECTION.
V_COUNT1 = RASTBIS1 + 1.
V_COUNT2 = RASTBIS2 + 1.
V_COUNT3 = RASTBIS3 + 1.
V_COUNT4 = RASTBIS4 + 1.
V_COUNT5 = RASTBIS5 + 1.
V_COUNT6 = RASTBIS6 + 1.
V_COUNT7 = RASTBIS7 + 1.
V_COUNT8 = RASTBIS8 + 1.
V_COUNT9 = RASTBIS9 + 1.
V_COUNT10 = RASTBIS0 + 1.
perform extract_data.
Build Field Catalogs **************************
PERFORM BUILD_FIELDCAT.
*******Start List Viewer *******************************
PERFORM START_LIST_VIEWER.
===================================================================
At line Selection *****************************
===================================================================
at line-selection.
if sy-lilli >= 9 .
refresh r_bukrs.
move p_bukrs to r_bukrs-low.
move 'I' to r_bukrs-sign.
move 'EQ' to r_bukrs-option.
append r_bukrs.
refresh r_kunnr.
move customer_tab-kunnr to r_kunnr-low.
move 'I' to r_kunnr-sign.
move 'EQ' to r_kunnr-option.
append r_kunnr.
submit ZFARVR0040 and return
with p_bukrs = p_bukrs
with dat = dat
with p_stand = p_stand
with p_spcal = P_SPCAL
with s_kunnr in r_kunnr.
endif.
===================================================================
Top of Page *******************************
===================================================================
TOP-OF-PAGE.
SELECT SINGLE BUTXT FROM T001 INTO V_BUTXT
WHERE BUKRS = p_BUKRS .
WRITE:/73'Customers Aging Analysis',140'PAGE NO.',
SY-PAGNO.
WRITE:/002 'COMPANY',
011 P_BUKRS,
017 V_BUTXT,
055 allgline centered,
140 'DATE :',
150 sy-datum .
write:/002 'User',
011 sy-UNAME,
140 'Time :',
150 sy-UZEIT.
SKIP.
format color col_heading intensified off.
WRITE:/ SY-ULINE,
SY-VLINE,002 'Customer',
012 SY-VLINE,013 'Name',
043 SY-VLINE,048 'CURRENT',
061 SY-VLINE,065 'FROM ',V_COUNT1,
079 SY-VLINE,083 'FROM ',V_COUNT2,
097 SY-VLINE,101 'FROM ',V_COUNT3,
115 SY-VLINE,119 'FROM ',V_COUNT4,
133 SY-VLINE,137 'FROM ',V_COUNT5,
151 SY-VLINE,155 'FROM ',V_COUNT6,
169 SY-VLINE,173 'FROM ',V_COUNT7,
187 SY-VLINE,191 'FROM ',V_COUNT8,
205 SY-VLINE,209 'FROM ',V_COUNT9,
223 SY-VLINE,228 'FROM ',V_COUNT10,
243 SY-VLINE,248 'TOTAL',
268 SY-VLINE.
WRITE:/ SY-VLINE,002 'Number',
12 SY-VLINE,
43 SY-VLINE,
061 SY-VLINE,065 'TO ',RASTBIS2,
079 SY-VLINE,083 'TO ',RASTBIS3,
097 SY-VLINE,101 'TO ',RASTBIS4,
115 SY-VLINE,119 'TO ',RASTBIS5,
133 SY-VLINE,137 'FROM ',RASTBIS6,
151 SY-VLINE,155 'FROM ',RASTBIS7,
169 SY-VLINE,173 'FROM ',RASTBIS8,
187 SY-VLINE,191 'FROM ',RASTBIS9,
205 SY-VLINE,209 'FROM ',RASTBIS0,
223 SY-VLINE,
243 SY-VLINE,
268 SY-VLINE,
SY-ULINE.
format color off.
===================================================================
END-OF-SELECTION ***************************
===================================================================
end-of-selection.
===================================================================
Form : Extract_Data *
===================================================================
form extract_data.
Select the Customers
Select t1~kunnr t2~name1
into corresponding fields of table customer_tab
from knb1 as t1 inner join kna1 as t2
on t2~kunnr = t1~kunnr
where t1~bukrs = p_bukrs
and t1~kunnr in s_kunnr
and t1~BUSAB in s_busab
and t2~regio in s_regio
and t2~BRSCH in s_BRSCH
and t2~KTOKD in s_KTOKD.
if sy-subrc <> 0.
message e398(00) with 'No Customers Selected'.
endif.
sort customer_tab.
describe table customer_tab lines v_ttlc.
v_ttlc = v_ttlc + 10.
loop at customer_tab.
v_net1 = 0.
v_net2 = 0.
v_net3 = 0.
v_net4 = 0.
v_net5 = 0.
v_net6 = 0.
v_net7 = 0.
v_net8 = 0.
v_net9 = 0.
v_net10 = 0.
v_net11 = 0.
v_net = 0.
perform calculate_ageing
using
p_bukrs
customer_tab-kunnr
dat
RASTBIS1
RASTBIS2
RASTBIS3
RASTBIS4
RASTBIS5
RASTBIS6
RASTBIS7
RASTBIS8
RASTBIS9
RASTBIS0
P_STAND
' ' "noted item
P_SPCAL
changing
v_net1
v_net2
v_net3
v_net4
v_net5
v_net6
v_net7
v_net8
v_net9
v_net10
v_net11
v_net.
if p_balyes = 'X' or v_net > 0.
format color col_total.
write:/ sy-vline,
002 customer_tab-kunnr,
012 SY-VLINE,013(30) customer_tab-name1,
043 SY-VLINE,044(16) v_net1,
061 SY-VLINE,062(16) v_net2,
079 SY-VLINE,080(16) v_net3,
097 SY-VLINE,098(16) v_net4,
115 SY-VLINE,116(16) v_net5,
133 SY-VLINE,134(16) v_net6,
151 SY-VLINE,152(16) v_net7,
169 SY-VLINE,170(16) v_net8,
187 SY-VLINE,188(16) v_net9,
205 SY-VLINE,206(16) v_net10,
223 SY-VLINE,224(16) v_net11,
239 SY-VLINE,240(16) v_net,
258 SY-VLINE.
format color off.
hide : customer_tab-kunnr.
v_ttlnet1 = v_ttlnet1 + v_net1.
v_ttlnet2 = v_ttlnet2 + v_net2.
v_ttlnet3 = v_ttlnet3 + v_net3.
v_ttlnet4 = v_ttlnet4 + v_net4.
v_ttlnet5 = v_ttlnet5 + v_net5.
v_ttlnet6 = v_ttlnet6 + v_net6.
v_ttlnet7 = v_ttlnet7 + v_net7.
v_ttlnet8 = v_ttlnet8 + v_net8.
v_ttlnet9 = v_ttlnet9 + v_net9.
v_ttlnet10 = v_ttlnet10 + v_net10.
v_ttlnet11 = v_ttlnet11 + v_net11.
v_ttlnet = v_ttlnet + v_net.
endif.
endloop.
ULINE.
format color col_total.
write:/ sy-vline,
012 SY-VLINE,012(30) ' T O T A L',
043 SY-VLINE,044(16) v_ttlnet1,
061 SY-VLINE,062(16) v_ttlnet2,
079 SY-VLINE,080(16) v_ttlnet3,
097 SY-VLINE,098(16) v_ttlnet4,
115 SY-VLINE,116(16) v_ttlnet5,
133 SY-VLINE,134(16) v_ttlnet6,
151 SY-VLINE,152(16) v_ttlnet7,
169 SY-VLINE,170(16) v_ttlnet8,
187 SY-VLINE,188(16) v_ttlnet9,
205 SY-VLINE,206(16) v_ttlnet10,
223 SY-VLINE,224(16) v_ttlnet11,
239 SY-VLINE,240(16) v_ttlnet,
258 SY-VLINE.
format color off.
ULINE.
endform.
Function to Calculate Aging.
Form calculate_ageing using
bukrs
kunnr
dat
RASTBIS1
RASTBIS2
RASTBIS3
RASTBIS4
RASTBIS5
RASTBIS6
RASTBIS7
RASTBIS8
RASTBIS9
RASTBIS0
P_STAND
P_NOTED
P_SPCAL
changing
v_net1
v_net2
v_net3
v_net4
v_net5
v_net6
v_net7
v_net8
v_net9
v_net10
v_net11
v_net.
DATA: BEGIN OF BSID_TAB1 OCCURS 0,
BUKRS LIKE BSID-BUKRS,
PRCTR LIKE BSID-PRCTR,
KUNNR LIKE BSID-KUNNR,
FLAG(1),
UMSKZ LIKE BSID-UMSKZ,
BLART LIKE BSID-BLART,
BELNR LIKE BSID-BELNR,
BUZEI LIKE BSID-BUZEI,
NETDT LIKE BSID-ZFBDT,
ZFBDT LIKE BSID-ZFBDT,
BUDAT LIKE BSID-BUDAT,
BLDAT LIKE BSID-BLDAT,
BSCHL LIKE BSID-BSCHL,
DMBTR LIKE BSID-DMBTR,
SHKZG LIKE BSID-SHKZG,
ZBD1T LIKE BSID-ZBD1T,
ZBD2T LIKE BSID-ZBD2T,
ZBD3T LIKE BSID-ZBD3T,
REBZG LIKE BSID-REBZG,
REBZT LIKE BSID-REBZT,
KOART LIKE BSEG-KOART,
SK1DT LIKE FAEDE-SK1DT,
SK2DT LIKE FAEDE-SK2DT,
DAYSD LIKE SY-TABIX,
END OF BSID_TAB1.
RANGES: R_UMSKZ FOR BSID-UMSKZ.
Data : V_ZFBDT Like bsid-ZFBDT,
V_ZBD1T Like bsid-ZBD1T,
V_ZBD2T Like bsid-ZBD2T,
V_ZBD3T Like bsid-ZBD3T,
V_LINES(8) TYPE n.
IF P_NOTED = 'X'. "CHECK NOTED ITEMS
R_UMSKZ-SIGN = 'I'.
R_UMSKZ-OPTION = 'EQ'.
R_UMSKZ-LOW = 'D'.
APPEND R_UMSKZ.
R_UMSKZ-SIGN = 'I'.
R_UMSKZ-OPTION = 'EQ'.
R_UMSKZ-LOW = 'L'.
APPEND R_UMSKZ.
ENDIF.
IF P_STAND = 'X'. "CHECK STANDARD ITEMS
R_UMSKZ-SIGN = 'I'.
R_UMSKZ-OPTION = 'EQ'.
R_UMSKZ-LOW = ' '.
APPEND R_UMSKZ.
ENDIF.
IF P_SPCAL = 'X'. "CHECK SPECIAL G/L TRANSACTION
R_UMSKZ-SIGN = 'I'.
R_UMSKZ-OPTION = 'EQ'.
R_UMSKZ-LOW = 'A'.
APPEND R_UMSKZ.
R_UMSKZ-SIGN = 'I'.
R_UMSKZ-OPTION = 'EQ'.
R_UMSKZ-LOW = 'B'.
APPEND R_UMSKZ.
ENDIF.
SELECT * FROM BSID INTO CORRESPONDING FIELDS OF TABLE BSID_TAB
WHERE BUKRS = BUKRS AND
budat <= dat AND
KUNNR = KUNNR AND
UMSKZ in R_UMSKZ.
SELECT * FROM BSAD appending CORRESPONDING FIELDS OF TABLE BSID_TAB
WHERE BUKRS = BUKRS AND
budat <= dat AND
augdt >= dat AND
KUNNR = KUNNR AND
UMSKZ in R_UMSKZ.
DESCRIBE TABLE BSID_TAB LINES V_LINES.
LOOP AT BSID_TAB.
if bsid_tab-BLART = 'DZ'.
Select single ZFBDT ZBD1T ZBD2T ZBD3T
into (V_ZFBDT,V_ZBD1T,V_ZBD2T,V_ZBD3T)
from bsid where BUKRS = BUKRS
and kunnr = bsid_tab-kunnr
and BELNR = bsid_tab-REBZG.
if sy-subrc = 0.
bsid_tab-ZFBDT = V_ZFBDT.
bsid_tab-ZBD1T = V_ZBD1T.
bsid_tab-ZBD2T = V_ZBD2T.
bsid_tab-ZBD3T = V_ZBD3T.
else.
Select single ZFBDT ZBD1T ZBD2T ZBD3T
into (V_ZFBDT,V_ZBD1T,V_ZBD2T,V_ZBD3T)
from bsad where BUKRS = BUKRS
and kunnr = bsid_tab-kunnr
and BELNR = bsid_tab-REBZG.
if sy-subrc <> 0.
bsid_tab-ZFBDT = V_ZFBDT.
bsid_tab-ZBD1T = V_ZBD1T.
bsid_tab-ZBD2T = V_ZBD2T.
bsid_tab-ZBD3T = V_ZBD3T.
endif.
endif.
endif.
IF BSID_TAB-SHKZG = 'H'.
BSID_TAB-DMBTR = BSID_TAB-DMBTR * ( - 1 ).
ENDIF.
bsid_tab-netdt = bsid_tab-ZFBDT.
bsid_tab-netdt = bsid_tab-budat.
bsid_tab-koart = 'D'.
MODIFY BSID_TAB.
PERFORM CALC_DUE_DATE USING BSID_TAB.
BSID_TAB-DAYSD = DAT - BSID_TAB-NETDT.
IF BSID_TAB-DAYSD <= RASTBIS1.
V_NET1 = V_NET1 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS2.
V_NET2 = V_NET2 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS3.
V_NET3 = V_NET3 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS4.
V_NET4 = V_NET4 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS5.
V_NET5 = V_NET5 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS6.
V_NET6 = V_NET6 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS7.
V_NET7 = V_NET7 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS5.
V_NET8 = V_NET8 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS9.
V_NET9 = V_NET9 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD <= RASTBIS0.
V_NET10 = V_NET10 + BSID_TAB-DMBTR.
ELSEIF BSID_TAB-DAYSD > RASTBIS0.
V_NET11 = V_NET11 + BSID_TAB-DMBTR.
ENDIF.
V_NET = V_NET + BSID_TAB-DMBTR.
MODIFY BSID_TAB.
ENDLOOP.
endform.
Calculate Due Date
FORM CALC_DUE_DATE USING P_BSID_TAB STRUCTURE BSID_TAB.
DATA : REFE TYPE P.
IF P_BSID_TAB-KOART = 'K' OR P_BSID_TAB-KOART = 'D'.
IF P_BSID_TAB-ZFBDT IS INITIAL.
P_BSID_TAB-ZFBDT = P_BSID_TAB-BLDAT.
ENDIF.
*Nettofälligkeit bestimmen--
IF NOT P_BSID_TAB-ZBD3T IS INITIAL.
REFE = P_BSID_TAB-ZBD3T.
ELSE.
IF NOT P_BSID_TAB-ZBD2T IS INITIAL.
REFE = P_BSID_TAB-ZBD2T.
ELSE.
REFE = P_BSID_TAB-ZBD1T.
ENDIF.
ENDIF.
*Nichtrechnungsbezogene Gutschriften sind sofort fällig--
IF P_BSID_TAB-KOART = 'D' AND P_BSID_TAB-SHKZG = 'H'
OR P_BSID_TAB-KOART = 'K' AND P_BSID_TAB-SHKZG = 'S'.
IF P_BSID_TAB-REBZG IS INITIAL.
REFE = 0.
ENDIF.
ENDIF.
P_BSID_TAB-NETDT = P_BSID_TAB-ZFBDT + REFE.
*Skontofälligkeiten bestimmen--
IF NOT P_BSID_TAB-ZBD2T IS INITIAL.
P_BSID_TAB-SK2DT = P_BSID_TAB-ZFBDT + P_BSID_TAB-ZBD2T.
ELSE.
P_BSID_TAB-SK2DT = P_BSID_TAB-NETDT.
ENDIF.
IF NOT P_BSID_TAB-ZBD1T IS INITIAL
OR NOT P_BSID_TAB-ZBD2T IS INITIAL.
P_BSID_TAB-SK1DT = P_BSID_TAB-ZFBDT + P_BSID_TAB-ZBD1T.
ELSE.
P_BSID_TAB-SK1DT = P_BSID_TAB-NETDT.
ENDIF.
*Nichtrechnungsbezogene Gutschriften sind sofort fällig--
IF P_BSID_TAB-KOART = 'D' AND P_BSID_TAB-SHKZG = 'H'
OR P_BSID_TAB-KOART = 'K' AND P_BSID_TAB-SHKZG = 'S'.
IF P_BSID_TAB-REBZG IS INITIAL.
P_BSID_TAB-SK2DT = P_BSID_TAB-NETDT.
P_BSID_TAB-SK1DT = P_BSID_TAB-NETDT.
ENDIF.
ENDIF.
ELSE.
MESSAGE E122 RAISING ACCOUNT_TYPE_NOT_SUPPORTED.
ENDIF.
E_FAEDE = FAEDE.
ENDFORM.
*& Form BUILD_FIELDCAT
FORM BUILD_FIELDCAT .
PGM = SY-REPID.
FIELD = 'give field name'.
TABLE_NAME = 'give table name'.
PERFORM FIELDCAT_FILL USING FIELD.
and so on for the no. of fields you want to display
ENDFORM. " BUILD_FIELDCAT
*& Form START_LIST_VIEWER
FORM START_LIST_VIEWER.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = PGM
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = FINAL TAB(OUTPUT STATEMENTS TABLE)
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM. " START_LIST_VIEWER
*& Form FIELDCAT_FILL
text
FORM FIELDCAT_FILL USING FIELD_VALUE.
ADD 1 TO COL_POS.
FIELDCAT_LN-REF_TABNAME = TABLE_NAME.
FIELDCAT_LN-FIELDNAME = FIELD_VALUE.
FIELDCAT_LN-KEY = SPACE.
FIELDCAT_LN-DO_SUM = SPACE.
FIELDCAT_LN-COL_POS = COL_POS.
FIELDCAT_LN-NO_OUT = SPACE.
FIELDCAT_LN-QFIELDNAME = SPACE.
FIELDCAT_LN-HOTSPOT = SPACE.
APPEND FIELDCAT_LN TO FIELDCAT.
ENDFORM. " FIELDCAT_FILL
Reward points if you find this helpful
Regards,
Harini -
Hello, I would like to know if any one could tell me how to fix my daughters ipod touch or if I need to take it into an apple store. One of the kids on her school bus stole it out of her backpack. My daughter got it back today at school but went to turn it on and the kid that stole it I guess tried to many times to get into so now when you turn it on it says "DISABLED". Can anyone please help!!!! Thank you, Julie
Wipe it clean and restore it. You should then be able to rename the iPod and set up an account with iTunes. I hope this helps!
Maybe you are looking for
-
I Have read a lot of tutorials or whatever but Im not able to view the editing tools from imovie in the photos app. I have tried the trimmer thing and the yellow outline does appear but the only options available are "play, trim or cancel". I really
-
Can i install windows 8.1 on my mac using an oem disk ?
I just bought a windows 8.1 SL OEM disk, i want to install it on my MAC, someone please help me with it
-
Can I move scratch files to an external hard drive.
I am completing a project in which I am making DVDs of the interviews of 50 people. I saved the FCE project file into which I uploaded their interview for each person onto a external hard drive, but the scratch disk for these files is in my Documents
-
Exchange 2010\Outlook Mail issues
Hi, I am having some issues with mail disappearing and outlook not updating. The issues are: When sending an email from Outlook it appears in the sent items for 30 seconds in Outlook and then disappears. It never shows up in OWA The email does send t
-
Hi We are new to Windows azure and are developing a web application. In the beginning of the project , we have deployed complete code using Sitefinity Thunder to different environments which actually publish complete code. But now as we are in the mi