Converting column header and a single record into rows
Lets suppose the table with only one record
col1 col2 col3-----Column Header
d1 d2 d3
i want it in following manner
column_name Column_data----Column Header
col1 d1
col2 d2
col3 d3
for this i have written the query as
select column_name,column_data from (select * from XXX where col1=123)
MODEL RETURN UPDATED ROWS
dimension by(col1)
measures (col1,0 column_name,0 column_data )
ignore nav
rules ITERATE(167)
column_name[iteration_number]=cast( iteration_number as varchar2(3)),
column_data[iteration_number]=cast( iteration_number as int)
here i am just assigning iteration_number but i want to assign name of the column and its value;
Note:--table contains nearly 200 columns
Something like (using one of my own tables):
select column_name colname,
decode(column_name,'RUN_NO',to_char(run_no),
'SEARCH_ID',to_char(search_id),
'PROCESSING_START_DATE',to_char(processing_start_date,'DDMMYYYYHH24MISS'),
'PROCESSING_END_DATE',to_char(processing_end_date,'DDMMYYYYHH24MISS'),
'NO_OF_MATCHES',to_char(no_of_matches),
'ERROR_DETAILS',error_details,
'ADVREP_TIMESTAMP',to_char(advrep_timestamp,'DDMMYYYYHH24MISS')
) colvalue
from partial_search_history, (select rownum r, column_name
from user_tab_columns
where table_name = 'PARTIAL_SEARCH_HISTORY')
where run_no = 356You can build the decode by doing
SELECT ''''||COLUMN_NAME||''',TO_CHAR('||COLUMN_NAME||'),'
FROM user_tab_columns
where table_name = 'PARTIAL_SEARCH_HISTORY'A decode on DATA_TYPE field would allow you to add a format mask for DATE fields if necessary.
Similar Messages
-
Split and reformat single record into multiple records
Hi ,
I need to split 1 record in to 2 records with 1 new field(event)
I have one internal table in this format
No country stdate enddate
1 us 12/01/2006 10/07/2007
i need to reformat this record like ;
NO country event pldate acdate
1 us ga 12/01/2006 12/01/2006
1 us es 10/07/2007 10/07/2007
Can any one resolve this issue?Check the example.
report zrich_0001 .
data: begin of itab occurs 0,
no type i,
country(3) type c,
stdate type sy-datum,
enddate type sy-datum,
end of itab.
data: begin of itab2 occurs 0,
no type i,
country(3) type c,
event(2) type c,
stdate type sy-datum,
enddate type sy-datum,
end of itab2.
itab-no = 1.
itab-country = 'US'.
itab-stdate = '20061201'.
itab-enddate = '20071007'.
append itab.
loop at itab.
clear itab2.
move-corresponding itab to itab2.
itab2-event = 'GA'.
itab2-enddate = itab-stdate.
append itab2.
clear itab2.
move-corresponding itab to itab2.
itab2-event = 'ES'.
itab2-stdate = itab-enddate.
append itab2.
endloop.
loop at itab2.
write:/ itab2-no, itab2-country, itab2-event,
itab2-stdate, itab2-enddate.
endloop.
Regards,
Rich Heilman -
Download internal table data into excel sheet with column heading and data
Hi,
I am having one internal table with column headings and other table with data.
i want to download the data with these tables into an excel sheet.
It should ask the user for file name to save it on their own name. They should give the file name in runtime and it should be downloaded into an excel sheet.
Can anyone tell what is the right function module for downloading these two internal table data with column heading and data.
what we have to do for storing the file name in runtime.
Can anyone help me on this.
Thanks,
Rose.Hi Camila,
Try this
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = PATH2
FILETYPE = 'XLS'
TABLES
DATA_TAB = IT_DATA
FIELDNAMES = IT_HEADINGS
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22 -
Splitting the single record into multiple records based on validity
Hi Guru's,
basically i am an BI consultant with less knowledge on ABAP, can i request your help on the ABAP task.
I am working on HR module which is integrated with SAP BI, the reports will be executed based on calendar month the requirement is i should split the single record into a multiple records based on validity of the record. basically the HR data would be in data from and date to.
below is the logic
Check whether the start and end date of the record are in the same month and year.
If yes nothing changes
If no create multiple records
1st record original start date of the record u2018till end of that month
Following record 1st of the next month u2018till last day of the month
u2026
Last record 1st of the month u2018till original end date.
All fields will have the same values, only the datefrom and dateto fields change.
Can any one please provide me the same code to proceed on my task.
Thanks and Regards,
VenkatHi,
Using Rule group we can split it.
Using Rule Group in SAP-BI Part - 1
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/s-u/using%20rule%20group%20in%20sap-bi%20%20part%20-%201.pdf
Thanks
Reddy -
Can I drag and drop single photos into Events?
Hi guys. I've very recently ordered a new Mac that will have iLife 08 on it. Before I get started with it I've got a question about Events. I've been using iPhoto for the last several years, organizing my photos into albums. I've cleaned up my images to around 1,000 photos, and I plan to only use events for organization. (I don't want to use Events AND albums, don't see the point, I'm going to try using ONLY Events.) But I've got a few scenerios that I'd like to throw by you all, to see if they would work, as I'm hoping that they will...
I don't shoot photos into pre-defined "Events", I shoot photos by what I feel like shooting. "Hey, my dog is doing something funny" - There's 3 pictures, or "Wow that's a big spider!" - 1 picture, or "My little neice is doing something cute" - There's 4 pictures. I do not want 450 events, each containing 1 - 5 pictures.
Can I drag and drop single pictures into different events? For example, have an Event called "Friends" with pictures of my friends in it, that I put there? Or an event called "Concerts" with photos taken throughout the years?
I hope I've made it clear what I'm looking to get out of Events!
Thanks in advance for any help.Exactly - I think he will want to matain his existing structure -- people are making too much of the name change from rolls to events.
I have events with one photo and events with as many as 2000 photos -- I like this better than rolls but albums, folders and keywords are still the key to granular organization - events are ust the library to hold my photos
To me it is a small step forward that makes organization much easier (and it was not that hard before)
Larry Nebel
PS - now if I could just get all of my edits to save - where are TD and OT to solve that one for me? -
Changing the Column Header and Hiding the Column dynamically???
Hi friends..
I'm new to OBIEE field. I'm working in a OBIEE project that requires to dynamically change the column header, and dynamically hide the column depending on the prompt value.
I know we can dynamically change the table header using the presentation variable but I couldn't do that same thing with column header.
I searched some forums that suggest to use java script for this purpose but I'm not able to do the same also. If anyone had same issue before please help.toony, I'm not sure it's possible to do all that you want exactly the way you want, but here are some ideas you can pursue.
To dynamically change column headers without javascript, check this blog out...
http://oraclebizint.wordpress.com/2008/01/25/oracle-bi-ee-101332-dynamic-column-headers-using-presentation-variables-sets-and-conditional-formatting/
As far as dynamically hiding a column, I don't think you can do this, but since you don't provide any details on how the PV is supposed to hide a column based on the value, are you talking about hiding a column for one PV value and another (different) column for a different PV value? Or are you talking about hiding one column when a PV has certain values and displaying it when the PV has a different set of values?
I have managed to create both scenarios via a work-around, but the procedures require some writing so I don't want to put both. Please detail how you want your PV to "hide" a column or columns.
P.S. I don't think column selectors will do the trick for you. Basically column selectors work like this: Say you have a report using Sales Region ID, Region Name, and Sales. Now let's say you want the user to choose if he/she wants to see annual sales, or quarter sales or weekly sales, etc. The column selector view would allow you to put the various columns (Year Sales, Quarter Sales, Weekly Sales) as an option the user can select. Once selected, the sales figure will change for the time period selected. For an example of how this is done, check out the section in this "Oracle by Example" link.
Waited too long to publish this... Madan beat me to it, so there is some overlap here...
http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/saw/saw.html
Edited by: LC143 on Oct 27, 2008 9:21 AM -
Checkbox in header and item level records.
Hello Freinds,
I have a requirment in which I need to display checkboxes in front of header as well as item level records. I am trying to make a copy of standard transaction VL37. This transaction uses the REUSE_ALV_HIERSEQ_LIST_DISPLAY for displaying header and item level data. I debugged and found that in the alv layout there is a field with name box name. If we pass the name of header internal table to that field then we can get checkbox in front of header level records and if we pass item level internal table name then it shows the checkbox in front of item level records.
Can anyone provide some possibility of adding checkbox for both header and item level records while using the same ALV FM.Hello Harsh,
I am also kind of facing the same issue. I have used the FM REUSE_ALV_HIERSEQ_LIST_DISPLAY for ALV display. And I need to add checkbox at item level.
I have tried to add checkbox through field catalog. Following is the code I'm writing.
l_wa_fieldcat-fieldname = l_c_flag.
l_wa_fieldcat-tabname = l_c_item.
l_wa_fieldcat-checkbox = abap_true.
*l_wa_fieldcat-edit_mask = abap_f.
l_wa_fieldcat-edit = abap_true.
l_wa_fieldcat-key = abap_true.
l_wa_fieldcat-seltext_m = l_c_flag.
APPEND l_wa_fieldcat to em_it_fieldcat.
But in this case the checkbox appears in disabled form.
Can you please help? Could you be a bit elaborate on your answer i.e. the code snippet? Many thanks.
Regards,
Debapriya -
How to avoid/hide column header and ---- in sql command output
Dear Friends,
I have a script to get the list and delete datafiles
script is : (del.sql)
spool d:\del.bat
select 'rm -r '||name from v$datafile;
spool off;
script output (del.bat)
'RM-R'||NAME
rm -r C:\ORACLE10GDB\ORADATA\TEST\SYSTEM01.DBF
rm -r C:\ORACLE10GDB\ORADATA\TEST\UNDOTBS01.DBF
rm -r C:\ORACLE10GDB\ORADATA\TEST\SYSAUX01.DBF
rm -r C:\ORACLE10GDB\ORADATA\TEST\USERS01.DBF
I don't want to have the column header and ---- which is present before the rm -r commands in my output spool file (del.bat)
how can i do it?Please suggest
Regards,
DBI have a script to get the list and delete datafiles Yikes, what are you doing here?
Can you use rm on Windows? -
Transformation Routine to convert single record into multiple
All,
I need your help with ABAP Syntax. My requirement is to take a single record and convert it to multiple records into a DSO with a condition to not create a record if a KF value is 0.
R/3 Data Record:
Employee | Date | Char1 | KF1 | Char2 | KF2 | Char3 | KF3 | Char4 | KF4
Conversion Result into DSO:
Employee | Date | Char1 | KF1
Employee | Date | Char2 | KF2
Employee | Date | Char3 | KF3
Employee | Date | Char4 | KF4 (This record will not be written if no value is in KF4)
I have read about the result table in update rules, however within BI 7.0 Transformations I am unfamiliar as to where the RESULT_TABLE function applies. Has this been replaced by the Expert Routine?
Could any ABAP expert provide sample code as to how I would perform this conversion in a Transformation Routine?
Thanks,
DavidThanks Alex for your response.
I did find a solution to this as it turns out to be fairly simple, however I executed the routine as an Expert Routine instead of a Start Routine. I was advised to do the transformation here.
The basic concept is defined below:
Loop at source_package assigning -kf2.
Append result_fields to result_package.
Endif.
-- Kf3u2026 and so on
Endloop.
Basically the APPEND statement is used to create the additional records. -
I purchased Docs to GO Premium as it was suppose to work on IPAD 3. On loading a spreadsheet the columns under the header columns (ABC etc) started to blled into the next column. It does not work on IPad 3.
I swithced to Quick Office Pro HD. Absolutely fantastic App. I would love to get my money back for Docs to Go Prem (Rubbish)Send your complaints to the developer. This is not the venue for them.
-
Converting Column Header to Rows Value in SQL Query
Dear Guys,find blew the table from A1_30 to YetToDue columns. I need from A1_30 to A356 columns convert into row values and that values column head name like Abstract. A1_30 A31_60 A61_90 A91_120 A121_180A181_365A365 BalArr NoOfLoanLoanOS YetToDue
0 0 0 101 0 0 0 909 66730 909 3637
0 40 0 0 0 0 0 1818 66681 1818 3637
0 56 0 0 0 0 0 1818 70210 1818 5455
0 0 66 0 0 0 0 909 73735 909 7273
0 35 0 0 0 0 0 2727 73327 2727 7273
0 0 66 0 0 0 0 909 73353 909 7273
0 40 0 0 0 0 0 909 66778 909 3637
0 40 0 0 0 0 0 1818 66744 1818 3637
0 0 0 101 0 0 0 909 66787 909 3637
0 40 0 0 0 0 0 1818 66671 1818 3637
0 56 0 0 0 0 0 1818 70201 1818 5455
0 56 0 0 0 0 0 1818 70204 1818 5455
0 0 66 0 0 0 0 909 73331 909 7273
0 40 0 0 0 0 0 1818 66726 1818 3637
0 40 0 0 0 0 0 2727 66798 2727 3637
0 40 0 0 0 0 0 909 66676 909 3637
0 40 0 0 0 0 0 1818 66685 1818 3637
0 56 0 0 0 0 0 1818 70209 1818 5455
0 57 0 0 0 0 0 1818 70226 1818 5455
0 35 0 0 0 0 0 2727 73762 2727 7273
0 0 66 0 0 0 0 909 73333 909 7273
0 40 0 0 0 0 0 1818 66759 1818 3637
0 40 0 0 0 0 0 882 66597 882 8826
0 40 0 0 0 0 0 2727 66789 2727 3637
0 40 0 0 0 0 0 2646 66609 2646 8826
0 40 0 0 0 0 0 2646 66641 2646 8826
0 57 0 0 0 0 0 1818 70193 1818 5455
0 56 0 0 0 0 0 1818 70202 1818 5455
0 35 0 0 0 0 0 2727 73757 2727 7273
0 0 66 0 0 0 0 909 73345 909
7273
I expecting the results:
Abstract BalArr NoOfLoan LoanOS YetToDue
A0_30 0 0 0 0
A31_60 45261 1579445 45261 122852
A61_90 4545 367097 4545 36365
A91_120 1818 133517 1818 7274
A121_180 0 0 0 0
A181_365 0 0 0 0
A365 0 0 0 0
pls help I really appreciate ..Dear Partrck Hurst.I have facing struggle with my store procedure , It work very slow performance when i pass the entryPlease go through my store procedure and let me advice if i wrote the script wrongly .ALTER PROCEDURE [dbo].[MFDB_GenerateDCBCollection]
@i_BranchId INT,
@i_SHGId INT,
@p_SHGMemberId INT,
@i_LoanNumber INT,
@i_DayOpenDate DATETIME,
@o_ErrorStatus INT Output
) AS
--WITH ENCRYPTION AS
DECLARE @p_DayOpenDate AS DATETIME
DECLARE @p_BranchId AS INT
DECLARE @D_FromDate AS DATE
DECLARE @D_ToDate AS DATE
DECLARE @E_ToDate AS DATE
DECLARE @p_RecordCounter AS INT
DECLARE @p_RecordCount AS INT
DECLARE @p_TempCollectionId AS INT
DECLARE @p_TempStateId AS INT
DECLARE @p_TempRegionId AS INT
DECLARE @p_TempBranchId AS INT
DECLARE @p_TempSHGId AS INT
DECLARE @p_TempSHGName AS VARCHAR(75)
DECLARE @p_TempSHGMemberId AS INT
DECLARE @p_TempMemberId AS INT
DECLARE @p_TempMemberName AS VARCHAR(75)
DECLARE @p_TempVillageName AS VARCHAR(100)
DECLARE @p_TempPanchayatName AS VARCHAR(100)
DECLARE @p_TempPanchayatId AS INT
DECLARE @p_TempVillageId AS INT
DECLARE @p_TempInstNumber AS INT
DECLARE @p_TempLoanNumber AS INT
DECLARE @p_TempDisbursedDate AS DATE
DECLARE @p_TempStatus AS INT
DECLARE @p_TempLoanSchemeId AS INT
DECLARE @p_TempLCategoryId AS INT
DECLARE @p_TempLActivityId AS INT
DECLARE @p_TempLActSpecId AS INT
DECLARE @p_TempLoanAmount AS NUMERIC(18,2)
DECLARE @p_TempApprovalStatus AS INT
DECLARE @p_TempFundingAgencyId AS INT
DECLARE @p_TempOpenBalPrin AS NUMERIC(18,2)
DECLARE @p_TempOpenBalInt AS NUMERIC(18,2)
DECLARE @p_TempStdPrin AS NUMERIC(18,2)
DECLARE @p_TempStdInt AS NUMERIC(18,2)
DECLARE @p_TempCollPrin AS NUMERIC(18,2)
DECLARE @p_TempCollInt AS NUMERIC(18,2)
DECLARE @p_TempAdvancePrin AS NUMERIC(18,2)
DECLARE @p_TempAdvanceInt AS NUMERIC(18,2)
DECLARE @p_TempArrearPrin AS NUMERIC(18,2)
DECLARE @p_TempArrearInt AS NUMERIC(18,2)
DECLARE @p_TempBalancePrin AS NUMERIC(18,2)
DECLARE @p_TempBalanceInt AS NUMERIC(18,2)
DECLARE @p_TempDemandDate AS DATE
DECLARE @p_TempCollectionDate AS DATE
DECLARE @p_TempLStatus AS INT
DECLARE @p_TempLSourceId AS INT
DECLARE @p_TempVoucherName AS VARCHAR(75)
DECLARE @p_TempInsurance AS NUMERIC(18,2)
DECLARE @p_TempUpFrontFess AS NUMERIC(18,2)
DECLARE @p_TempDocumentFees AS NUMERIC(18,2)
DECLARE @p_TotalInterest AS NUMERIC(18,2)
DECLARE @i_Month AS INT = 1
DECLARE @p_Year AS INT = 2015
DECLARE @i_SHGMemberId AS INT
BEGIN TRANSACTION DCBGenerated
BEGIN
Set @o_ErrorStatus = 0
SELECT @D_FromDate = DATEADD(MONTH, @i_Month - 1, DATEADD(YEAR, @p_Year - 1900, 0)) --as [START DATE]
SELECT @D_ToDate = DATEADD(MONTH, @i_Month, DATEADD(YEAR, @p_Year - 1900, -1)) --as [EMD DATE]
SELECT @i_SHGMemberId = MFDB_SHGMemberId FROM MFDB_SHGMEMBER_MASTER WHERE MFDB_SHGId = @i_SHGId AND MFDB_MemberId = @p_SHGMemberId
SELECT @p_TempVillageName = MFDB_VillageName,
@p_TempVillageId = MFDB_VillageId ,
@p_TempPanchayatId = MFDB_PanchayatId ,
@p_TempPanchayatName = MFDB_PanchayatName
FROM MFDB_SHG_MASTER WHERE MFDB_SHGId = @i_SHGId
/* Drop and Create TempCollection Table. This table has all installments for a given member */
CREATE TABLE #TEMPDCBCOLLECTION
[MFDB_LedgerNumber] [int] IDENTITY(1,1) NOT NULL,
[MFDB_StateId] [int] NOT NULL,
[MFDB_RegionId] [int] NOT NULL,
[MFDB_BranchId] [int] NOT NULL,
[MFDB_SHGId] [int] NOT NULL,
[MFDB_SHGName] [varchar](75) NOT NULL,
[MFDB_ShgMemberId] [int] NOT NULL,
[MFDB_MemberName] [varchar](50) NOT NULL,
[MFDB_LoanNumber] [int] NOT NULL,
[MFDB_LoanAmount] [int] NOT NULL
) ON [PRIMARY]
/* Drop and Create TempCollection Table. This table has all installments for a given member */
;WITH CTE_1 AS
SELECT CT.MFDB_StateId AS StateId,
CT.MFDB_RegionId AS RegionId,
CT.MFDB_BranchId AS BranchId,
CT.MFDB_SHGId AS ShgId,
SM.MFDB_SHGName AS ShgName,
CT.MFDB_SHGMemberId AS SHGMemberId,
SMM.MFDB_MemberName AS MemberName,
CT.MFDB_LoanNumber AS LoanNumber,
LM.MFDB_LoanAmount AS LoanAmount
FROM dbo.MFDB_COLLECTION_TXN CT
LEFT JOIN dbo.MFDB_COLLECTION_AUDIT CA
On CT.MFDB_SHGId = CA.MFDB_SHGId
And CT.MFDB_MemberId = CA.MFDB_MemberId
And CT.MFDB_LoanNumber = CA.MFDB_LoanNumber
And CT.MFDB_CollectionId = CA.MFDB_CollectionId
And CT.MFDB_LSourceId = CA.MFDB_LSourceId
INNER JOIN dbo.MFDB_SHG_MASTER SM
On CT.MFDB_SHGId = SM.MFDB_SHGId
INNER JOIN dbo.MFDB_SHGMEMBER_MASTER SMM
On CT.MFDB_SHGId = SMM.MFDB_SHGId
And CT.MFDB_SHGMemberId = SMM.MFDB_SHGMemberId
INNER JOIN dbo.MFDB_LOANAPPLICATION_MASTER LM
ON LM.MFDB_SHGId = CT.MFDB_SHGId
AND LM.MFDB_ShgMemberId = CT.MFDB_ShgMemberId
AND LM.MFDB_LoanNumber = CT.MFDB_LoanNumber
Where DATEDIFF(DAY,MFDB_CollectionDate,@i_DayOpenDate) = 0
And CT.MFDB_CollectionAmount > 0
And CT.MFDB_CollApprovedBy IS NULL
AND CT.MFDB_BranchId = @i_BranchId
AND CT.MFDB_SHGId = @i_SHGId
AND CT.MFDB_ShgMemberId = @i_SHGMemberId
AND CT.MFDB_LoanNumber = @i_LoanNumber
CTE_2 AS
SELECT DISTINCT
StateId,
RegionId,
BranchId,
ShgId,
ShgName,
SHGMemberId,
MemberName,
LoanNumber,
LoanAmount
FROM CTE_1
INSERT INTO #TEMPDCBCOLLECTION ([MFDB_StateId],[MFDB_RegionId],[MFDB_BranchId],[MFDB_SHGId],[MFDB_SHGName],[MFDB_ShgMemberId],[MFDB_MemberName],[MFDB_LoanNumber],[MFDB_LoanAmount])
SELECT StateId,
RegionId,
BranchId,
ShgId,
ShgName,
SHGMemberId,
MemberName,
LoanNumber,
LoanAmount
FROM CTE_2
DECLARE DCBMonthCursor CURSOR FOR
SELECT [MFDB_StateId],
[MFDB_RegionId],
[MFDB_BranchId],
[MFDB_SHGId],
[MFDB_SHGName],
[MFDB_ShgMemberId],
[MFDB_MemberName],
[MFDB_LoanNumber],
[MFDB_LoanAmount]
FROM #TEMPDCBCOLLECTION
OPEN DCBMonthCursor
FETCH NEXT FROM DCBMonthCursor
INTO @p_TempStateId ,
@p_TempRegionId ,
@p_TempBranchId ,
@p_TempSHGId ,
@p_TempSHGName ,
@p_TempSHGMemberId ,
@p_TempMemberName ,
@p_TempLoanNumber ,
@p_TempLoanAmount
WHILE (@@FETCH_STATUS = 0)
BEGIN
Set @p_TotalInterest = 0
Select @p_TotalInterest = SUM(MFDB_StdInterest) From MFDB_LOAN_DISBURSEMENT Where MFDB_SHGId = @p_TempSHGId And MFDB_ShgMemberId = @p_TempSHGMemberId And MFDB_LoanNumber = @p_TempLoanNumber
;With
CTE_1 AS
SELECT LM.MFDB_StateId AS StateId ,
LM.MFDB_RegionId AS RegionId,
LM.MFDB_BranchId AS BranchId,
LM.MFDB_SHGId AS SHGId,
SM.MFDB_SHGName AS SHGName,
LM.MFDB_ShgMemberId AS SHGMemId,
LM.MFDB_MemberName AS MemberName,
SM.MFDB_VillageId AS VillageId,
LM.MFDB_LoanNumber AS LoanNo,
LM.MFDB_LoanAmount AS LoanAmount,
LM.MFDB_DisburseDate AS DisbursedDate,
ISNULL((SELECT LD.MFDB_DemandDate
FROM dbo.MFDB_LOAN_DISBURSEMENT LD
Where LD.MFDB_SHGId = LM.MFDB_SHGId
And LD.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
And LD.MFDB_LoanNumber = LM.MFDB_LoanNumber
And DATEDIFF(DAY,LD.MFDB_DemandDate,@i_DayOpenDate) = 0
And LD.MFDB_ApprovalStatus = 1 ),NULL) AS DemandDate,
ISNULL((SELECT TOP 1 CT.MFDB_CollectionDate
FROM dbo.MFDB_COLLECTION_TXN CT
Inner Join dbo.MFDB_COLLECTION_AUDIT CA
On CT.MFDB_SHGId = CA.MFDB_SHGId
And CT.MFDB_ShgMemberId = CA.MFDB_ShgMemberId
And CT.MFDB_LoanNumber = CA.MFDB_LoanNumber
And CT.MFDB_LSourceId = CA.MFDB_LSourceId
And CT.MFDB_CollectionId = CA.MFDB_CollectionId
WHERE CT.MFDB_SHGId = LM.MFDB_SHGId
AND CT.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
AND CT.MFDB_LoanNumber = LM.MFDB_LoanNumber
And DATEDIFF(DAY,CT.MFDB_CollectionDate,@i_DayOpenDate) = 0
ORDER BY CA.MFDB_CollectionId DESC),NULL) AS CollectionDate,
ISNULL((SELECT TOP 1 CA.MFDB_InstallmentNumber
FROM dbo.MFDB_COLLECTION_AUDIT CA
Inner Join dbo.MFDB_COLLECTION_TXN CT
On CT.MFDB_SHGId = CA.MFDB_SHGId
And CT.MFDB_ShgMemberId = CA.MFDB_ShgMemberId
And CT.MFDB_LoanNumber = CA.MFDB_LoanNumber
And CT.MFDB_LSourceId = CA.MFDB_LSourceId
And CT.MFDB_CollectionId = CA.MFDB_CollectionId
WHERE CA.MFDB_SHGId = LM.MFDB_SHGId
AND CA.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
AND CA.MFDB_LoanNumber = LM.MFDB_LoanNumber
And DATEDIFF(DAY,CT.MFDB_CollectionDate,@i_DayOpenDate) = 0
ORDER BY CA.MFDB_CollectionId DESC),
ISNULL((SELECT LD.MFDB_InstallmentNumber
FROM dbo.MFDB_LOAN_DISBURSEMENT LD
Where LD.MFDB_SHGId = LM.MFDB_SHGId
And LD.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
And LD.MFDB_LoanNumber = LM.MFDB_LoanNumber
And DATEDIFF(DAY,LD.MFDB_DemandDate,@i_DayOpenDate) = 0
And LD.MFDB_ApprovalStatus = 1 ),0)) AS IntallNo,
ISNULL(CAST((SELECT TOP 1 NR.MFDB_BalancePrincipal
FROM dbo.MFDB_NEW_DCB_REPORT NR
WHERE NR.MFDB_SHGId = LM.MFDB_SHGId
AND NR.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
AND NR.MFDB_LoanNumber = LM.MFDB_LoanNumber
ORDER BY NR.MFDB_LedgerNumber DESC) AS NUMERIC(18,0)),0) AS ArrPrincipal,
ISNULL(CAST((SELECT TOP 1 NR.MFDB_BalanceInterest
FROM dbo.MFDB_NEW_DCB_REPORT NR
WHERE NR.MFDB_SHGId = LM.MFDB_SHGId
AND NR.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
AND NR.MFDB_LoanNumber = LM.MFDB_LoanNumber
ORDER BY NR.MFDB_LedgerNumber DESC) AS NUMERIC(18,0)),0) AS ArrInterest,
0 AS CurrDemandPrin,
0 AS CurrDemandInt,
ISNULL((SELECT CAST(SUM(ISNULL(CA.MFDB_CollectedPrincipal,0) +
ISNULL(CA.MFDB_AdvancePrincipal,0) +
ISNULL(CA.MFDB_ArrearPrincipal,0)) AS NUMERIC(18,0))
FROM dbo.MFDB_COLLECTION_AUDIT CA
Inner Join dbo.MFDB_COLLECTION_TXN CT
On CT.MFDB_SHGId = CA.MFDB_SHGId
And CT.MFDB_ShgMemberId = CA.MFDB_ShgMemberId
And CT.MFDB_LoanNumber = CA.MFDB_LoanNumber
And CT.MFDB_LSourceId = CA.MFDB_LSourceId
And CT.MFDB_CollectionId = CA.MFDB_CollectionId
WHERE CA.MFDB_SHGId = LM.MFDB_SHGId
AND CA.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
AND CA.MFDB_LoanNumber = LM.MFDB_LoanNumber
And DATEDIFF(DAY,CT.MFDB_CollectionDate,@i_DayOpenDate) = 0
),0) AS CurrCollPri,
ISNULL((SELECT CAST(SUM(ISNULL(CA.MFDB_CollectedInterest,0) +
ISNULL(CA.MFDB_AdvanceInterest,0) +
ISNULL(CA.MFDB_ArrearInterest,0)) AS NUMERIC(18,0))
FROM dbo.MFDB_COLLECTION_AUDIT CA
Inner Join dbo.MFDB_COLLECTION_TXN CT
On CT.MFDB_SHGId = CA.MFDB_SHGId
And CT.MFDB_ShgMemberId = CA.MFDB_ShgMemberId
And CT.MFDB_LoanNumber = CA.MFDB_LoanNumber
And CT.MFDB_LSourceId = CA.MFDB_LSourceId
And CT.MFDB_CollectionId = CA.MFDB_CollectionId
WHERE CA.MFDB_SHGId = LM.MFDB_SHGId
AND CA.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
AND CA.MFDB_LoanNumber = LM.MFDB_LoanNumber
And DATEDIFF(DAY,CT.MFDB_CollectionDate,@i_DayOpenDate) = 0
),0) AS CurrCollInt,
ISNULL(CAST((SELECT TOP 1 NR.MFDB_AdvCBPrincipal
FROM dbo.MFDB_NEW_DCB_REPORT NR
WHERE NR.MFDB_SHGId = LM.MFDB_SHGId
AND NR.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
AND NR.MFDB_LoanNumber = LM.MFDB_LoanNumber
ORDER BY NR.MFDB_LedgerNumber DESC) AS NUMERIC(18,0)),0) AS AdvOBPri,
ISNULL(CAST((SELECT TOP 1 NR.MFDB_AdvCBInterest
FROM dbo.MFDB_NEW_DCB_REPORT NR
WHERE NR.MFDB_SHGId = LM.MFDB_SHGId
AND NR.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
AND NR.MFDB_LoanNumber = LM.MFDB_LoanNumber
ORDER BY NR.MFDB_LedgerNumber DESC) AS NUMERIC(18,0)),0) AS AdvOBInt,
0 AS AdvCBPri,
0 AS AdvCBInt,
0 AS BalancePri,
0 AS BalanceInt,
ISNULL((SELECT CAST(SUM(ISNULL(CA.MFDB_CollectedPrincipal,0) +
ISNULL(CA.MFDB_AdvancePrincipal,0) +
ISNULL(CA.MFDB_ArrearPrincipal,0)) AS NUMERIC(18,0))
FROM dbo.MFDB_COLLECTION_AUDIT CA
Inner Join dbo.MFDB_COLLECTION_TXN CT
On CT.MFDB_SHGId = CA.MFDB_SHGId
And CT.MFDB_ShgMemberId = CA.MFDB_ShgMemberId
And CT.MFDB_LoanNumber = CA.MFDB_LoanNumber
And CT.MFDB_LSourceId = CA.MFDB_LSourceId
And CT.MFDB_CollectionId = CA.MFDB_CollectionId
WHERE CA.MFDB_SHGId = LM.MFDB_SHGId
AND CA.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
AND CA.MFDB_LoanNumber = LM.MFDB_LoanNumber
And DATEDIFF(DAY,CT.MFDB_CollectionDate,@i_DayOpenDate) >= 0
),0) AS OS_Pri,
ISNULL((SELECT CAST(SUM(ISNULL(CA.MFDB_CollectedInterest,0) +
ISNULL(CA.MFDB_AdvanceInterest,0) +
ISNULL(CA.MFDB_ArrearInterest,0)) AS NUMERIC(18,0))
FROM dbo.MFDB_COLLECTION_AUDIT CA
Inner Join dbo.MFDB_COLLECTION_TXN CT
On CT.MFDB_SHGId = CA.MFDB_SHGId
And CT.MFDB_ShgMemberId = CA.MFDB_ShgMemberId
And CT.MFDB_LoanNumber = CA.MFDB_LoanNumber
And CT.MFDB_LSourceId = CA.MFDB_LSourceId
And CT.MFDB_CollectionId = CA.MFDB_CollectionId
WHERE CA.MFDB_SHGId = LM.MFDB_SHGId
AND CA.MFDB_ShgMemberId = LM.MFDB_ShgMemberId
AND CA.MFDB_LoanNumber = LM.MFDB_LoanNumber
And DATEDIFF(DAY,CT.MFDB_CollectionDate,@i_DayOpenDate) >= 0
),0) AS OS_Int,
0 AS RepaymentPercentage,
LM.MFDB_LoanSchemeId AS LoanProduct,
LM.MFDB_LActivityId AS LoanActivity,
LM.MFDB_LActSpecId AS LoanSubActivity,
LM.MFDB_FundingAgencyId AS FundAgencyId,
LM.MFDB_LSourceId AS SourceId
FROM dbo.MFDB_LOANAPPLICATION_MASTER LM
Left Join dbo.MFDB_SHG_MASTER SM
On SM.MFDB_ShgId = LM.MFDB_ShgId
WHERE LM.MFDB_ApprovalStatus= 3
AND LM.MFDB_DisburseDate IS NOT NULL
AND LM.MFDB_StateId = @p_TempStateId
AND LM.MFDB_RegionId = @p_TempRegionId
AND LM.MFDB_BranchId = @p_TempBranchId
AND LM.MFDB_SHGId = @p_TempSHGId
AND LM.MFDB_ShgMemberId = @p_TempSHGMemberId
AND LM.MFDB_LoanNumber = @p_TempLoanNumber
CTE_2 AS
SELECT StateId, RegionId, BranchId, SHGId, SHGName, SHGMemId, MemberName, VillageId , LoanNo, LoanAmount, DisbursedDate,DemandDate, CollectionDate, IntallNo,
ArrPrincipal,
ArrInterest,
CurrDemandPrin,
CurrDemandInt,
ISNULL(ISNULL(ArrPrincipal,0) + ISNULL(CurrDemandPrin,0),0) AS TotDemandPri,
ISNULL(ISNULL(ArrInterest,0) + ISNULL(CurrDemandInt,0),0) AS TotDemandInt,
AdvOBPri,
AdvOBInt,
CurrCollPri,
CurrCollInt,
AdvCBPri,
AdvCBInt,
BalancePri,
BalanceInt,
ISNULL(ISNULL(LoanAmount,0) - ISNULL(OS_Pri,0),0) AS OS_Pri,
ISNULL(ISNULL(@p_TotalInterest,0) - ISNULL(OS_Int,0),0) OS_Int,
CONVERT(INT,RepaymentPercentage) AS RepaymentPercentage,
LoanProduct,
LoanActivity,
LoanSubActivity,
FundAgencyId,
SourceId
FROM CTE_1
CTE_3 AS
SELECT StateId, RegionId, BranchId, SHGId, SHGName, SHGMemId, MemberName, VillageId , LoanNo, LoanAmount, DisbursedDate,DemandDate, CollectionDate, IntallNo,
ArrPrincipal,
ArrInterest,
CurrDemandPrin,
CurrDemandInt,
TotDemandPri,
TotDemandInt,
CASE WHEN AdvOBPri < 0 THEN AdvOBPri * -1 ELSE AdvOBPri END AS AdvOBPri,
CASE WHEN AdvOBInt < 0 THEN AdvOBInt * -1 ELSE AdvOBInt END AS AdvOBInt,
CurrCollPri,
CurrCollInt,
CASE WHEN ISNULL(TotDemandPri,0) = 0 THEN ISNULL((CurrCollPri + AdvOBPri),0)
WHEN ISNULL(TotDemandPri,0) > 0 AND ISNULL(CurrCollPri + AdvOBPri,0) > ISNULL(TotDemandPri,0) THEN ISNULL(ISNULL(CurrCollPri + AdvOBPri,0) - ISNULL(TotDemandPri,0),0)
WHEN ISNULL(TotDemandPri,0) > 0 AND ISNULL(CurrCollPri + AdvOBPri,0) < ISNULL(TotDemandPri,0) THEN 0
WHEN ISNULL(CurrCollPri + AdvOBPri,0) = ISNULL(TotDemandPri,0) THEN 0
ELSE 0 END AS AdvCBPri,
CASE WHEN ISNULL(TotDemandInt,0) = 0 THEN ISNULL((CurrCollInt + AdvOBInt),0)
WHEN ISNULL(TotDemandInt,0) > 0 AND ISNULL(CurrCollInt + AdvOBInt,0) > ISNULL(TotDemandInt,0) THEN ISNULL(ISNULL(CurrCollInt + AdvOBInt,0) - ISNULL(TotDemandInt,0),0)
WHEN ISNULL(TotDemandInt,0) > 0 AND ISNULL(CurrCollInt + AdvOBInt,0) < ISNULL(TotDemandInt,0) THEN 0
WHEN ISNULL(CurrCollInt + AdvOBInt,0) = ISNULL(TotDemandInt,0) THEN 0
ELSE 0 END AS AdvCBInt,
0 AS BalancePri,
0 AS BalanceInt,
OS_Pri,
OS_Int,
0 AS Repayment,
LoanProduct,
LoanActivity,
LoanSubActivity,
FundAgencyId,
SourceId,
CONVERT(CHAR(3), @i_DayOpenDate, 0) + ' - ' + RIGHT(CONVERT(CHAR(4), YEAR(@i_DayOpenDate)),2) AS Months
FROM CTE_2
INSERT INTO dbo.MFDB_NEW_DCB_REPORT
( [MFDB_TxnDate]
,[MFDB_StateId]
,[MFDB_RegionId]
,[MFDB_BranchId]
,[MFDB_SHGId]
,[MFDB_SHGName]
,[MFDB_ShgMemberId]
,[MFDB_MemberName]
,[MFDB_VillageId]
,[MFDB_LoanNumber]
,[MFDB_LoanAmount]
,[MFDB_DisbursedDate]
,[MFDB_DemandDate]
,[MFDB_CollectionDate]
,[MFDB_InstallmentNumber]
,[MFDB_ArrearPrincipal]
,[MFDB_ArrearInterest]
,[MFDB_DemandPrincipal]
,[MFDB_DemandInterest]
,[MFDB_TotDemandPrincipal]
,[MFDB_TotDemandInterest]
,[MFDB_AdvOBPrincipal]
,[MFDB_AdvOBInterest]
,[MFDB_CollectedPrincipal]
,[MFDB_CollectedInterest]
,[MFDB_AdvCBPrincipal]
,[MFDB_AdvCBInterest]
,[MFDB_BalancePrincipal]
,[MFDB_BalanceInterest]
,[MFDB_OS_Pri]
,[MFDB_OS_Int]
,[MFDB_RepaymentPercentage]
,[MFDB_LoanSchemeId]
,[MFDB_LActivityId]
,[MFDB_LActSpecId]
,[MFDB_FundAgencyId]
,[MFDB_LSourceId]
,[MFDB_Months]
,[MFDB_PanchayatId]
,[MFDB_PanchayatName]
,[MFDB_VillageName]
SELECT @i_DayOpenDate ,StateId, RegionId, BranchId, SHGId, SHGName, SHGMemId, MemberName, VillageId , LoanNo, LoanAmount, DisbursedDate,DemandDate,CollectionDate,IntallNo,
ArrPrincipal,ArrInterest,CurrDemandPrin,CurrDemandInt,TotDemandPri,TotDemandInt,AdvOBPri,AdvOBInt,CurrCollPri,CurrCollInt,
CASE WHEN AdvCBPri < 0 THEN 0 ELSE AdvCBPri END,
CASE WHEN AdvCBInt < 0 THEN 0 ELSE AdvCBInt END,
CASE WHEN ISNULL(TotDemandPri,0) = 0 THEN 0
WHEN ISNULL(TotDemandPri,0) > 0 AND ISNULL(CurrCollPri + AdvOBPri,0) > ISNULL(TotDemandPri,0) THEN 0
WHEN ISNULL(TotDemandPri,0) > 0 AND ISNULL(CurrCollPri + AdvOBPri,0) < ISNULL(TotDemandPri,0) THEN ABS(ISNULL(ISNULL(CurrCollPri + AdvOBPri,0) - ISNULL(TotDemandPri,0),0) * -1)
WHEN ISNULL(CurrCollPri + AdvOBPri,0) = ISNULL(TotDemandPri,0) THEN 0
ELSE 0 END AS BalancePri,
CASE WHEN ISNULL(TotDemandInt,0) = 0 THEN 0
WHEN ISNULL(TotDemandInt,0) > 0 AND ISNULL(CurrCollInt + AdvOBInt,0) > ISNULL(TotDemandInt,0) THEN 0
WHEN ISNULL(TotDemandInt,0) > 0 AND ISNULL(CurrCollInt + AdvOBInt,0) < ISNULL(TotDemandInt,0) THEN ABS(ISNULL(ISNULL(CurrCollInt + AdvOBInt,0) - ISNULL(TotDemandInt,0),0) * -1)
WHEN ISNULL(CurrCollInt + AdvOBInt,0) = ISNULL(TotDemandInt,0) THEN 0
ELSE 0 END AS BalanceInt,
OS_Pri,
OS_Int,
0 AS Repayment,
LoanProduct,LoanActivity,LoanSubActivity,FundAgencyId,SourceId,Months,@p_TempPanchayatId,@p_TempPanchayatName,@p_TempVillageName
FROM CTE_3
If @@Error != 0
Begin
Set @o_ErrorStatus = 1
ROLLBACK TRANSACTION DCBGenerated
RETURN
End
FETCH NEXT FROM DCBMonthCursor
INTO @p_TempStateId ,
@p_TempRegionId ,
@p_TempBranchId ,
@p_TempSHGId ,
@p_TempSHGName ,
@p_TempSHGMemberId ,
@p_TempMemberName ,
@p_TempLoanNumber ,
@p_TempLoanAmount
END
CLOSE DCBMonthCursor
DEALLOCATE DCBMonthCursor
DELETE FROM #TEMPDCBCOLLECTION
If @@Error != 0
Begin
Set @o_ErrorStatus = 1
ROLLBACK TRANSACTION DCBGenerated
RETURN
End
END
COMMIT TRANSACTION DCBGenerated -
Search for and edit single record in database
I am creating a few forms that access an Access database that will be used to enter data into the database. I am able to open records from the database and scroll through records one at a time and have added features to be able to search for and display a single record. The problem that I am having is when I load a single record and then edit that record, I am unable to save any changes made to the record, in other words, the record doesn't update on the database.
I can add new records and edit records as long as I scroll to them using .next(), .last(), .first(), and .previous() commands; however, when I load a single record I can't figure out how to save changes to that record in the database.Ok...so I think i can get it to work by doing something like:
xfa.sourceSet.DataConnection.open();
xfa.sourceSet.DataConnection.first();
var oRecordList = ???????????
var nCount = oRecordList.length;
for (var i = 0; i < nCount; i++){
if (CurrentRecord.rawValue != SearchField.rawValue){
xfa.sourceSet.DataConnection.next();
where CurrentRecord is a text field that shows the index of the current record and SearchField is the field where a user enters the record that they are searching for.
I think I just need to figure out how to count the number of records in the database. Any ideas? -
How to fix the table column header and resize the width of a table column?
Hi all,
I have the following two requirements,
1) I need to wrap the table column header into two rows. I mean the header must be displayed in two rows.
2) I need to to able to resize the width of the column. i.e The user should be able to drag the column width according to his requirement.
Is this possible. Any help would be appreciated!
Regards
KishanHi Kishan,
Refer to these links.They may ne useful for you.
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80d81237-b780-2a10-d398-cc33af6bd75c
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/ded11778-0801-0010-258f-ac3b9408a194
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30291df2-b980-2a10-0884-839c4f7f147e
Regards,
Sumangala -
Create Column Heading and Mathematical Expressions?
Is their a way to create your own column heading to use later in a Smart Playlist? Also, can mathematical (+,-,*,/...) be used in it's creation?
I'm trying to create a column heading (variable) that would display (for each song) the ratio of Play Count / Skip Count. If that ratio is >1, then it's something I tend to listen more than skip. The reverse is true if it's <1. I can use this in a Smart Playlist to filter songs going to my iPod (by checking that playlist to be downloaded to my iPod) to those that I listen to most.
Any help would be appreciated.
Message was edited by: luke1012As I said earlier, you have to use double-quotes when you create object :
SQL> create table emp( "Name" varchar2(20),"Age" number(2));
Table created.
SQL> desc emp
Name Null? Type
Name VARCHAR2(20 CHAR)
Age NUMBER(2)Once more, why wanted such thing ?
See here below the inconvenient :
SQL> select name, age from emp;
select name, age from emp
ERROR at line 1:
ORA-00904: "AGE": invalid identifier
SQL> select "Name","Age" from emp;
no rows selectedBetter to avoid it.
Nicolas. -
How to make a single recording into multiple songs garageband
I recorded my band's gig the other night using my Zoom H2 recorder. I want to take the single 1.5 hour recording (12songs) and make it into a CD with 12 individual tracks. I would like to use garageband so i can edit out the deadtime between songs but I don't know how to make a CD.
johndmalone wrote:
I want to take the single 1.5 hour recording (12songs) and make it into a CD with 12 individual tracks
http://www.bulletsandbones.com/GB/GBFAQ.html#chaptertocdtracks
(Let the page FULLY load. The link to your answer is at the top of your screen)
Maybe you are looking for
-
Is it possible to use an mSata drive as the primary drive?
Greeting everyone, I recently bought an HP ENVY Phoenix 810 whiich comes with the MS-7826 (Kaili) motherboard which has an mSata slot with a 16gb msata ssd in it, but it's only being used as a cache. So my question is, is it possible to use the mSata
-
Hi, I would like to capture my imac's screen with my macbook pro. (they both have thunderbolt connections.) I would like to record some gameplay and stream. What capture card would you recommend? And what quality would be fine recording? Specs: MacBo
-
Decoupled Infotype - Correct Buffer Access for PA30 and from BAPI?
Weu2019ve created a custom decoupled infotype and read/delete/update/insert work just fine with PA30, but the same methods supplied with the corresponding Check class do not work when called from a program. The Check class inherits from CL_HRPA_INFO
-
Illistrator will not authenticate under Windows 8.1
I have a creative Cloud Subscription. Once I use it under Mac OS no problem. But if I try to use it under a Windows 8.1 partition, on the same computer, CC will not uthenticate Illustrator, all other apps are ok and running regularly. Once I lounch A
-
Adapter deployment on remote server
I have read in one of the oracle document that Application adapters and Legacy Adapter should be deployed in the same OC4J container as that of BPEL process manager. In other words your BPEL process and adapter should be on the same server then only