How to add the condition dynamically???

Dear All,
Here is procedure
CREATE OR REPLACE PROCEDURE pp1 (mstring in varchar2)
IS
-- vyearqtr NUMBER := myearqtr;
-- vyearnum NUMBER := myearnum;
vstring VARCHAR2(1000) := mstring;
vnum VARCHAR2(10);
CURSOR c1 is
SELECT TO_CHAR(a.COLUMN_VALUE) num
FROM TABLE(CAST(split(vstring,',')as split_tbl)) a;
BEGIN
OPEN c1;
LOOP
FETCH c1 INTO vnum;
exit when c1%notfound;
INSERT INTO ibs_cbs_temp
select a.YearQtr,a.cgs_name Groupname,a.Code,a.Name1,
Round((nvl(bSum1, 0) + nvl(cSum1, 0) + nvl(dSum1, 0) +
nvl(eSum1, 0) + nvl(fSum1, 0)) / 1000000) as TOTAL,
Round((nvl(bSum1, 0)) / 1000000) as MaturityCode1,
Round((nvl(cSum1, 0)) / 1000000) as MaturityCode2,
Round((nvl(dSum1, 0)) / 1000000) as MaturityCode3,
Round((nvl(eSum1, 0)) / 1000000) as MaturityCode4,
Round((nvl(fSum1, 0)) / 1000000) as MaturityCode5,
Round((nvl(gBank, 0)) / 1000000) as sBank,
Round((nvl(hBank, 0)) / 1000000) as SPrivate,
Round((nvl(iBank, 0)) / 1000000) as SPublic,
Round((nvl(i1Bank, 0)) / 1000000) as SUnallocated
from (Select distinct
cg.cgs_name,aq.CTY_Code as Code,aq.CTY_Name as Name1,ibs_work_bankdata.bd_yrqtr as yearqtr
from Ibs_Countrygroups cg
INNER JOIN IBS_CountryMaster aq on cg.cgs_id=aq.cty_ctygrpid and cg.cgs_active=1 and aq.cty_active=1
INNER JOIN ibs_work_bankdata ON aq.CTY_Code =ibs_work_bankdata.bd_councd
INNER JOIN ibs_bankmaster bk on ibs_work_bankdata.bd_bkcode = bk.bnk_code
INNER JOIN ibs_countrymaster cm on bk.bnk_countryofinc = cm.cty_id
INNER JOIN IBS_ALCategory ON ibs_work_bankdata.bd_alcd = IBS_ALCategory.Alc_Code
where ibs_work_bankdata.bd_yrqtr = vnum -- VARIABLE ASSIGNED vnum
group by cg.cgs_name,aq.CTY_Name,aq.CTY_Code,ibs_work_bankdata.bd_yrqtr)a
left join
(select sum((case
when ibs_work_bankdata.bd_matcd = 1 AND
-- start
((CTY_Code = 'IN' and
(((bd_forcd = 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN' and bd_sectcd <> '11') or
(bd_forcd <> 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')))) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'Y') and
ALC_Code in ('11', '21', '31') and
bd_councd = CTY_Code) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'N') and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN'))
-- end
then
getvalueinusd(Abs(ibs_work_bankdata.bd_fc_bal) +
Abs(ibs_work_bankdata.bd_fc_int),
(select ibs_currencymaster.cur_id
from ibs_currencymaster
where ibs_work_bankdata.bd_curcd =
ibs_currencymaster.cur_code),
ibs_work_bankdata.bd_yrqtr)
else
0
end)) as bSum1,
sum((case
when ibs_work_bankdata.bd_matcd = 2 AND
--start
((CTY_Code = 'IN' and
(((bd_forcd = 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN' and bd_sectcd <> '11') or
(bd_forcd <> 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')))) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'Y') and
ALC_Code in ('11', '21', '31') and
bd_councd = CTY_Code) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'N') and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN'))
--end
then
getvalueinusd(Abs(ibs_work_bankdata.bd_fc_bal) +
Abs(ibs_work_bankdata.bd_fc_int),
(select ibs_currencymaster.cur_id
from ibs_currencymaster
where ibs_work_bankdata.bd_curcd =
ibs_currencymaster.cur_code),
ibs_work_bankdata.bd_yrqtr)
else
0
end)) as cSum1,
sum((case when
ibs_work_bankdata.bd_matcd = 3 AND
((CTY_Code = 'IN' and
(((bd_forcd = 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN' and bd_sectcd <> '11') or
(bd_forcd <> 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')))) or
((CTY_Code <> 'IN' and CTY_BIS_REPORTING_CBS = 'Y') and
ALC_Code in ('11', '21', '31') and
bd_councd = CTY_Code) or
((CTY_Code <> 'IN' and CTY_BIS_REPORTING_CBS = 'N') and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')) then
getvalueinusd(Abs(ibs_work_bankdata.bd_fc_bal) +
Abs(ibs_work_bankdata.bd_fc_int),
(select ibs_currencymaster.cur_id
from ibs_currencymaster
where ibs_work_bankdata.bd_curcd =
ibs_currencymaster.cur_code),
ibs_work_bankdata.bd_yrqtr) else 0 end)) as dSum1,
sum((case
when ibs_work_bankdata.bd_matcd = 4 AND
((CTY_Code = 'IN' and
(((bd_forcd = 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN' and bd_sectcd <> '11') or
(bd_forcd <> 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')))) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'Y') and
ALC_Code in ('11', '21', '31') and
bd_councd = CTY_Code) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'N') and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')) then
getvalueinusd(Abs(ibs_work_bankdata.bd_fc_bal) +
Abs(ibs_work_bankdata.bd_fc_int),
(select ibs_currencymaster.cur_id
from ibs_currencymaster
where ibs_work_bankdata.bd_curcd =
ibs_currencymaster.cur_code),
ibs_work_bankdata.bd_yrqtr)
else
0
end)) as eSum1,
sum((case
when ibs_work_bankdata.bd_matcd = 5 AND
((CTY_Code = 'IN' and
(((bd_forcd = 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN' and bd_sectcd <> '11') or
(bd_forcd <> 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')))) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'Y') and
ALC_Code in ('11', '21', '31') and
bd_councd = CTY_Code) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'N') and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')) then
getvalueinusd(Abs(ibs_work_bankdata.bd_fc_bal) +
Abs(ibs_work_bankdata.bd_fc_int),
(select ibs_currencymaster.cur_id
from ibs_currencymaster
where ibs_work_bankdata.bd_curcd =
ibs_currencymaster.cur_code),
ibs_work_bankdata.bd_yrqtr)
else
0
end)) as fSum1,
sum((case
when IBS_Sector.SEC_Parent = 0 AND
((CTY_Code = 'IN' and
(((bd_forcd = 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN' and bd_sectcd <> '11') or
(bd_forcd <> 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')))) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'Y') and
ALC_Code in ('11', '21', '31') and
bd_councd = CTY_Code) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'N') and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')) then
getvalueinusd(Abs(ibs_work_bankdata.bd_fc_bal) +
Abs(ibs_work_bankdata.bd_fc_int),
(select ibs_currencymaster.cur_id
from ibs_currencymaster
where ibs_work_bankdata.bd_curcd =
ibs_currencymaster.cur_code),
ibs_work_bankdata.bd_yrqtr)
else
0
end)) as gBank,
sum((case
when IBS_Sector.SEC_Parent = 1 AND
((CTY_Code = 'IN' and
(((bd_forcd = 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN' and bd_sectcd <> '11') or
(bd_forcd <> 'IN' and ALC_Code in ('11', '21', '31
') and bd_councd <> 'IN')))) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'Y') and
ALC_Code in ('11', '21', '31') and
bd_councd = CTY_Code) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'N') and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')) then
getvalueinusd(Abs(ibs_work_bankdata.bd_fc_bal) +
Abs(ibs_work_bankdata.bd_fc_int),
(select ibs_currencymaster.cur_id
from ibs_currencymaster
where ibs_work_bankdata.bd_curcd =
ibs_currencymaster.cur_code),
ibs_work_bankdata.bd_yrqtr)
else
0
end)) as hBank,
sum((case
when IBS_Sector.SEC_Parent = 2 AND
((CTY_Code = 'IN' and
(((bd_forcd = 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN' and bd_sectcd <> '11') or
(bd_forcd <> 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')))) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'Y') and
ALC_Code in ('11', '21', '31') and
bd_councd = CTY_Code) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'N') and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')) then
getvalueinusd(Abs(ibs_work_bankdata.bd_fc_bal) +
Abs(ibs_work_bankdata.bd_fc_int),
(select ibs_currencymaster.cur_id
from ibs_currencymaster
where ibs_work_bankdata.bd_curcd =
ibs_currencymaster.cur_code),
ibs_work_bankdata.bd_yrqtr)
else
0
end)) as iBank,
sum((case
when IBS_Sector.SEC_Parent = 3 AND
((CTY_Code = 'IN' and
(((bd_forcd = 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN' and bd_sectcd <> '11') or
(bd_forcd <> 'IN' and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')))) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'Y') and
ALC_Code in ('11', '21', '31') and
bd_councd = CTY_Code) or
((CTY_Code <> 'IN' and
CTY_BIS_REPORTING_CBS = 'N') and
ALC_Code in ('11', '21', '31') and
bd_councd <> 'IN')) then
getvalueinusd(Abs(ibs_work_bankdata.bd_fc_bal) +
Abs(ibs_work_bankdata.bd_fc_int),
(select ibs_currencymaster.cur_id
from ibs_currencymaster
where ibs_work_bankdata.bd_curcd =
ibs_currencymaster.cur_code),
ibs_work_bankdata.bd_yrqtr)
else
0
end)) as i1Bank,
ibs_work_bankdata.bd_councd as Cty_Id
FROM IBS_CountryMaster aq
INNER JOIN ibs_work_bankdata ON aq.CTY_Code =ibs_work_bankdata.bd_councd
inner join ibs_bankmaster bk on ibs_work_bankdata.bd_bkcode =bk.bnk_code
inner join ibs_countrymaster cm on bk.bnk_countryofinc = cm.cty_id
INNER JOIN IBS_Sector ON ibs_work_bankdata.bd_sectcd =IBS_Sector.Sec_Code
INNER JOIN IBS_ALCategory ON ibs_work_bankdata.bd_alcd =IBS_ALCategory.Alc_Code
INNER JOIN IBS_ALTypes ON ibs_work_bankdata.bd_typecd =IBS_ALTypes.Act_Code
INNER JOIN IBS_MaturityCodeMaster ON ibs_work_bankdata.bd_matcd =IBS_MaturityCodeMaster.MCM_Code
where
ibs_work_bankdata.bd_yrqtr = vnum -- VARIABLE ASSIGNED vnum
group by ibs_work_bankdata.bd_councd) l on a.Code = l.CTY_Id
order by total desc;
END LOOP;
Close C1;
END;
The condition between -- start and --end Here I want to pass this condition dynamically.
Any one please give me soluion.
I am in very tense.
Thanks in advance.

Hi,
I used dynamic sql but I got missing right parenthesis error.
Here is my procedure;
CREATE OR REPLACE PROCEDURE PRAT(mstring in varchar2, mconditions in varchar2)
IS
-- vyearqtr NUMBER := myearqtr;
-- vyearnum NUMBER := myearnum;
vstring VARCHAR2(1000) := mstring;
vnum     VARCHAR2(10);
vconditions VARCHAR2(4000) := mconditions;
v_strvar varchar2(32767);
CURSOR c1 is
SELECT TO_CHAR(a.COLUMN_VALUE) num
FROM TABLE(CAST(split(vstring,',')as split_tbl)) a;
BEGIN
OPEN c1;
LOOP
FETCH c1 INTO vnum;
exit when c1%notfound;
-- EXECUTE IMMEDIATE
v_strvar:= 'INSERT INTO ibs_cbs_temp3';
v_strvar:= v_strvar ||' select a.YearQtr,a.cgs_name Groupname,a.Code,a.Name1,';
v_strvar:= v_strvar ||' Round((nvl(bSum1, 0) + nvl(cSum1, 0) + nvl(dSum1, 0) +';
v_strvar:= v_strvar ||' nvl(eSum1, 0) + nvl(fSum1, 0)) / 10000000) as TOTAL,';
v_strvar:= v_strvar ||' Round((nvl(bSum1, 0)) / 10000000) as MaturityCode1,';
v_strvar:= v_strvar ||' Round((nvl(cSum1, 0)) / 10000000) as MaturityCode2,';
v_strvar:= v_strvar ||' Round((nvl(dSum1, 0)) / 10000000) as MaturityCode3,';
v_strvar:= v_strvar ||' Round((nvl(eSum1, 0)) / 10000000) as MaturityCode4,';
v_strvar:= v_strvar ||' Round((nvl(fSum1, 0)) / 10000000) as MaturityCode5,';
v_strvar:= v_strvar ||' Round((nvl(gBank, 0)) / 10000000) as sBank,';
v_strvar:= v_strvar ||' Round((nvl(hBank, 0)) / 10000000) as SPrivate,';
v_strvar:= v_strvar ||' Round((nvl(iBank, 0)) / 10000000) as SPublic,';
v_strvar:= v_strvar ||' Round((nvl(i1Bank, 0)) / 10000000) as SUnallocated';
v_strvar:= v_strvar ||' from    (Select  distinct';
v_strvar:= v_strvar ||' cg.cgs_name,aq.CTY_Code as Code,aq.CTY_Name as Name1,';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_yrqtr as yearqtr';
v_strvar:= v_strvar ||' from Ibs_Countrygroups cg';
v_strvar:= v_strvar ||' INNER JOIN IBS_CountryMaster aq ';
v_strvar:= v_strvar ||' on cg.cgs_id=aq.cty_ctygrpid and cg.cgs_active=1 ';
v_strvar:= v_strvar ||' and aq.cty_active=1';
v_strvar:= v_strvar ||' INNER JOIN ibs_org_bankdata ';
v_strvar:= v_strvar ||' ON aq.CTY_Code =ibs_org_bankdata.bd_councd';
v_strvar:= v_strvar ||' INNER JOIN ibs_bankmaster bk ';
v_strvar:= v_strvar ||' on ibs_org_bankdata.bd_bkcode = bk.bnk_code';
v_strvar:= v_strvar ||' INNER JOIN ibs_countrymaster cm ';
v_strvar:= v_strvar ||' on bk.bnk_countryofinc = cm.cty_id';
v_strvar:= v_strvar ||' INNER JOIN IBS_ALCategory ';
v_strvar:= v_strvar ||' ON ibs_org_bankdata.bd_alcd = IBS_ALCategory.Alc_Code';
v_strvar:= v_strvar ||' where ibs_org_bankdata.bd_yrqtr = '|| vnum ;
v_strvar:= v_strvar ||' group by cg.cgs_name,aq.CTY_Name,';
v_strvar:= v_strvar ||' aq.CTY_Code,ibs_org_bankdata.bd_yrqtr)a';
v_strvar:= v_strvar ||' left join';
v_strvar:= v_strvar ||' (select sum((case';
v_strvar:= v_strvar ||' when ibs_org_bankdata.bd_matcd = 1 AND '||vconditions ;
v_strvar:= v_strvar ||' then';
v_strvar:= v_strvar ||' getvalueininr(Abs(ibs_org_bankdata.bd_fc_bal) +';
v_strvar:= v_strvar ||' Abs(ibs_org_bankdata.bd_fc_int),';
v_strvar:= v_strvar ||' (select ibs_currencymaster.cur_id';
v_strvar:= v_strvar ||' from ibs_currencymaster';
v_strvar:= v_strvar ||' where ibs_org_bankdata.bd_curcd =';
v_strvar:= v_strvar ||' ibs_currencymaster.cur_code),';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_yrqtr)';
v_strvar:= v_strvar ||' else';
v_strvar:= v_strvar ||' 0';
v_strvar:= v_strvar ||' end)) as bSum1,';
v_strvar:= v_strvar ||' sum((case';
v_strvar:= v_strvar ||' when ibs_org_bankdata.bd_matcd = 2 AND '||vconditions ;
v_strvar:= v_strvar ||' then';
v_strvar:= v_strvar ||' getvalueininr(Abs(ibs_org_bankdata.bd_fc_bal) +';
v_strvar:= v_strvar ||' Abs(ibs_org_bankdata.bd_fc_int),';
v_strvar:= v_strvar ||' (select ibs_currencymaster.cur_id';
v_strvar:= v_strvar ||' from ibs_currencymaster';
v_strvar:= v_strvar ||' where ibs_org_bankdata.bd_curcd =';
v_strvar:= v_strvar ||' ibs_currencymaster.cur_code),';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_yrqtr)';
v_strvar:= v_strvar ||' else';
v_strvar:= v_strvar ||' 0';
v_strvar:= v_strvar ||' end)) as cSum1,';
v_strvar:= v_strvar ||' sum((case when';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_matcd = 3 AND '||vconditions;
v_strvar:= v_strvar ||' then';
v_strvar:= v_strvar ||' getvalueininr(Abs(ibs_org_bankdata.bd_fc_bal) +';
v_strvar:= v_strvar ||' Abs(ibs_org_bankdata.bd_fc_int),';
v_strvar:= v_strvar ||' (select ibs_currencymaster.cur_id';
v_strvar:= v_strvar ||' from ibs_currencymaster';
v_strvar:= v_strvar ||' where ibs_org_bankdata.bd_curcd =';
v_strvar:= v_strvar ||' ibs_currencymaster.cur_code),';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_yrqtr) else 0 end)) as dSum1,';
v_strvar:= v_strvar ||' sum((case';
v_strvar:= v_strvar ||' when ibs_org_bankdata.bd_matcd = 4 AND '||vconditions ;
v_strvar:= v_strvar ||' then';
v_strvar:= v_strvar ||' getvalueininr(Abs(ibs_org_bankdata.bd_fc_bal) +';
v_strvar:= v_strvar ||' Abs(ibs_org_bankdata.bd_fc_int),';
v_strvar:= v_strvar ||' (select ibs_currencymaster.cur_id';
v_strvar:= v_strvar ||' from ibs_currencymaster';
v_strvar:= v_strvar ||' where ibs_org_bankdata.bd_curcd =';
v_strvar:= v_strvar ||' ibs_currencymaster.cur_code),';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_yrqtr)';
v_strvar:= v_strvar ||' else';
v_strvar:= v_strvar ||' 0';
v_strvar:= v_strvar ||' end)) as eSum1,';
v_strvar:= v_strvar ||' sum((case';
v_strvar:= v_strvar ||' when ibs_org_bankdata.bd_matcd = 5 AND '||vconditions;
v_strvar:= v_strvar ||' then';
v_strvar:= v_strvar ||' getvalueininr(Abs(ibs_org_bankdata.bd_fc_bal) +';
v_strvar:= v_strvar ||' Abs(ibs_org_bankdata.bd_fc_int),';
v_strvar:= v_strvar ||' (select ibs_currencymaster.cur_id';
v_strvar:= v_strvar ||' from ibs_currencymaster';
v_strvar:= v_strvar ||' where ibs_org_bankdata.bd_curcd =';
v_strvar:= v_strvar ||' ibs_currencymaster.cur_code),';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_yrqtr)';
v_strvar:= v_strvar ||' else';
v_strvar:= v_strvar ||' 0';
v_strvar:= v_strvar ||' end)) as fSum1,';
v_strvar:= v_strvar ||' sum((case';
v_strvar:= v_strvar ||' when IBS_Sector.SEC_Parent = 0 AND '||vconditions ;
v_strvar:= v_strvar ||' then';
v_strvar:= v_strvar ||' getvalueininr(Abs(ibs_org_bankdata.bd_fc_bal) +';
v_strvar:= v_strvar ||' Abs(ibs_org_bankdata.bd_fc_int),';
v_strvar:= v_strvar ||' (select ibs_currencymaster.cur_id';
v_strvar:= v_strvar ||' from ibs_currencymaster';
v_strvar:= v_strvar ||' where ibs_org_bankdata.bd_curcd =';
v_strvar:= v_strvar ||' ibs_currencymaster.cur_code),';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_yrqtr)';
v_strvar:= v_strvar ||' else';
v_strvar:= v_strvar ||' 0';
v_strvar:= v_strvar ||' end)) as gBank,';
v_strvar:= v_strvar ||' sum((case';
v_strvar:= v_strvar ||' when IBS_Sector.SEC_Parent = 1 AND '||vconditions ;
v_strvar:= v_strvar ||' then';
v_strvar:= v_strvar ||' getvalueininr(Abs(ibs_org_bankdata.bd_fc_bal) +';
v_strvar:= v_strvar ||' Abs(ibs_org_bankdata.bd_fc_int),';
v_strvar:= v_strvar ||' (select ibs_currencymaster.cur_id';
v_strvar:= v_strvar ||' from ibs_currencymaster';
v_strvar:= v_strvar ||' where ibs_org_bankdata.bd_curcd =';
v_strvar:= v_strvar ||' ibs_currencymaster.cur_code),';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_yrqtr)';
v_strvar:= v_strvar ||' else';
v_strvar:= v_strvar ||' 0';
v_strvar:= v_strvar ||' end)) as hBank,';
v_strvar:= v_strvar ||' sum((case';
v_strvar:= v_strvar ||' when IBS_Sector.SEC_Parent = 2 AND '||vconditions ;
v_strvar:= v_strvar ||' then';
v_strvar:= v_strvar ||' getvalueininr(Abs(ibs_org_bankdata.bd_fc_bal) +';
v_strvar:= v_strvar ||' Abs(ibs_org_bankdata.bd_fc_int),';
v_strvar:= v_strvar ||' (select ibs_currencymaster.cur_id';
v_strvar:= v_strvar ||' from ibs_currencymaster';
v_strvar:= v_strvar ||' where ibs_org_bankdata.bd_curcd =';
v_strvar:= v_strvar ||' ibs_currencymaster.cur_code),';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_yrqtr)';
v_strvar:= v_strvar ||' else';
v_strvar:= v_strvar ||' 0';
v_strvar:= v_strvar ||' end)) as iBank,';
v_strvar:= v_strvar ||' sum((case';
v_strvar:= v_strvar ||' when IBS_Sector.SEC_Parent = 3 AND '||vconditions ;
v_strvar:= v_strvar ||' then';
v_strvar:= v_strvar ||' getvalueininr(Abs(ibs_org_bankdata.bd_fc_bal) +';
v_strvar:= v_strvar ||' Abs(ibs_org_bankdata.bd_fc_int),';
v_strvar:= v_strvar ||' (select ibs_currencymaster.cur_id';
v_strvar:= v_strvar ||' from ibs_currencymaster';
v_strvar:= v_strvar ||' where ibs_org_bankdata.bd_curcd =';
v_strvar:= v_strvar ||' ibs_currencymaster.cur_code),';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_yrqtr)';
v_strvar:= v_strvar ||' else';
v_strvar:= v_strvar ||' 0';
v_strvar:= v_strvar ||' end)) as i1Bank,';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_councd as Cty_Id';
v_strvar:= v_strvar ||' FROM IBS_CountryMaster aq';
v_strvar:= v_strvar ||' INNER JOIN ibs_org_bankdata ';
v_strvar:= v_strvar ||' ON aq.CTY_Code =ibs_org_bankdata.bd_councd';
v_strvar:= v_strvar ||' inner join ibs_bankmaster bk ';
v_strvar:= v_strvar ||' on ibs_org_bankdata.bd_bkcode =bk.bnk_code';
v_strvar:= v_strvar ||' inner join ibs_countrymaster cm ';
v_strvar:= v_strvar ||' on bk.bnk_countryofinc = cm.cty_id';
v_strvar:= v_strvar ||' INNER JOIN IBS_Sector ';
v_strvar:= v_strvar ||' ON ibs_org_bankdata.bd_sectcd =IBS_Sector.Sec_Code';
v_strvar:= v_strvar ||' INNER JOIN IBS_ALCategory ';
v_strvar:= v_strvar ||' ON ibs_org_bankdata.bd_alcd =IBS_ALCategory.Alc_Code';
v_strvar:= v_strvar ||' INNER JOIN IBS_ALTypes ';
v_strvar:= v_strvar ||' ON ibs_org_bankdata.bd_typecd =IBS_ALTypes.Act_Code';
v_strvar:= v_strvar ||' INNER JOIN IBS_MaturityCodeMaster ';
v_strvar:= v_strvar ||' ON ibs_org_bankdata.bd_matcd =IBS_MaturityCodeMaster.MCM_Code';
v_strvar:= v_strvar ||' where';
v_strvar:= v_strvar ||' ibs_org_bankdata.bd_yrqtr = '||vnum ;
v_strvar:= v_strvar ||' group by ibs_org_bankdata.bd_councd) ';
v_strvar:= v_strvar ||' l on a.Code = l.CTY_Id';
v_strvar:= v_strvar ||' order by total desc';
EXECUTE IMMEDIATE v_strvar;
END LOOP;
CLOSE C1;
COMMIT;
END;
/please help.

Similar Messages

  • How to add the data dynamically in data grid

    Hi,
    I got a stuck up in using JSF as I am trying to retrieve a value of a text box on clicking a button in the datagrid.
    Please suggest me a solution for his

    Please consider filing bugs in Jira at [http://javafx-jira.kenai.com|http://javafx-jira.kenai.com/]. Without your bugs being filed there is no guarantee we'll know to fix them! File them against 'runtime', for the 'control' component, and they'll turn up in my inbox.
    Thanks,
    Jonathan

  • How to add a frame dynamically in a jsp page.

    Hai all,
    In my application, in a particular jsp page i had the 3 links namely add.edit and delete. When click on add button, it is pointing to another jsp page where i can enter user details. But what i want now is when i click add button, the form in which we fill the user details should be added to the current page itself dynamically i.e., it should not go to another page when i click add button and that form should be displayed in the current page in a new frame dynamically.
    The same should happen when i click n edit or delete options. everything should be diaplayed in the same page in different frames.
    Can anyone suggest me about how to add a frame dynamically.

    You create a frameset with two frames. One frame you give 100% of the rows and run the JSP in this frame. The other frame you give 0% of the row so that it is hidden. In the JSP you use a JavaScript funtion to submit the form. This function will call the parent frameset to reset the row values to 50%/50% which will make the bottom frame visible and then submit the form request with the bottom frame as teh target.
    It is not so much as creating frames as using JavaScript to hide and display frames.

  • How to change the images dynamically in a table.

    Hai,
                     How to change the images dynamically in a table based on the condition in webdynpro abap.
    Edited by: Ravi.Seela on Oct 13, 2011 2:17 PM

    This has been much discussed earlier. Do search posts.
    For your scenario i would do the following.
    inside your node which is binded to the table, i create a new node image with cardinality 1 ..1 and a attribute called path of type string.
    create a  supply function for the node image .
    Supply method now has a Element (Parent element ) and node.
    Based on your record in element, set the right image source to path attribute and bind the node.
    This will make sure that the framework calls the image supply function for every row in a table.

  • How to pass the arguments dynamically to a Oracle procedure.

    Hi all..
    How to pass the arguments dynamically to a procedure.
    Thanks in Advance.

    I have a concurremt program which has 5 parameters right now. The user can add more parameters from front end as per their requirement.
    So that time.. the 6th parameter has to add to my procedure dynamically.
    Thanks.

  • How to change the image dynamically depend upon the input parameter

    Hi All
    I have one report running depend upon the Organization specific, I have 15 operating unit and 15 different logo for each operating unit.
    How to change the Logo dynamically depend upon the input passed by the user.
    If I have three or four logo i can add in my layout using if else statement and its works fine but i have more that 10 logos so its no possible to keep these in My RTF Template.
    Is it possible to change the logo according to the input without keeping this in Template.
    I have seen this link but its not working fine
    http://erpschools.com/articles/display-and-change-images-dynamically-in-xml-publisher
    Regards
    Srikkanth.M

    Hi,
    I have not completed fully,so sorry i cant able to share the files, could you please give me some tips and steps to do.
    Without having the logo in RTF if it possible to bring the logo depends on the user input (Ie Operating unit).
    Regards
    Srikkanth

  • How to add join conditions in ABAP Query.

    Hi,
    I need a help on "ABAP Query".
    How to add join conditions in ABAP Query.
    Thanks in advance.
    Thanks & Regards,
    Ramana

    Hi,
    See below code,
    *& Report  ZRNP_ALV_SO
    REPORT  zrnp_alv_so MESSAGE-ID z7rnp .
    INCLUDE zrnp_include .
    *SELECTION SCREEN                                                      *
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-004 .
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln ,
                    s_auart FOR v_auart ,
                    s_vkorg FOR v_vkorg ,
                    s_spart FOR v_spart ,
                    s_kunnr FOR v_kunnr ,
                    s_matnr FOR v_matnr .
    SELECTION-SCREEN END OF BLOCK blk1 .
    *AT SELECTION SCREEN                                                   *
    AT SELECTION-SCREEN.
      SELECT SINGLE vbeln
                     FROM vbak INTO vbak-vbeln
                     WHERE vbeln IN s_vbeln.
      IF sy-subrc <> 0.
        MESSAGE e202.
      ENDIF.
    *START OF SELECTION                                                    *
    START-OF-SELECTION .
      PERFORM data_select.
      PERFORM t_sort USING i_sort .
      PERFORM event_cat USING i_event .
      PERFORM fld_cat USING i_fldcat[] .
      PERFORM t_layout USING i_layout .
      PERFORM fld_cat2 USING i_fldcat2[] .
      PERFORM call_alv.
    * DATA SELECT                                                          *
    *&      Form  DATA_SELECT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM data_select .
      REFRESH: it_vbfa, it_so1, it_del_ful ,it_del1 .
      BREAK-POINT.
      *SELECT*
            *a~vbeln*
            *a~auart*
            *a~vkorg*
            *a~spart*
            *a~kunnr*
            *b~posnr*
            *b~matnr*
            *c~maktx*
            *b~kwmeng*
            *b~vrkme*
            *INTO TABLE it_so1 FROM vbak AS a*
                  *INNER JOIN vbap AS b ON b~vbeln = a~vbeln*
                  *INNER JOIN makt AS c ON c~matnr = b~matnr*
                  *AND c~spras = sy-langu*
                  *WHERE a~vbeln IN s_vbeln .*
      IF sy-subrc = 0.
        SORT it_so1 BY vbeln.
        DELETE ADJACENT DUPLICATES FROM it_so1.
      ENDIF.
    * COLURING DISPLAY                                                     *
      DATA: ld_color(1) TYPE  c .
    *  LOOP AT it_so1 INTO wa_so.
    * Populate color variable with colour properties
    * Char 1 = C (This is a color property)
    * Char 2 = 3 (Color codes: 1 - 7)
    * Char 3 = Intensified on/off ( 1 or 0 )
    * Char 4 = Inverse display on/off ( 1 or 0 )
    *           i.e. wa_ekko-line_color = 'C410'
    *    ld_color = ld_color + 1.
    * Only 7 colours so need to reset color value
    *    IF ld_color = 8.
    *      ld_color = 1.
    *    ENDIF.
    *    CONCATENATE 'C' ld_color '10' INTO wa_so-line_color.
    **  wa_ekko-line_color = 'C410'.
    *    MODIFY it_so1 FROM wa_so.
    *  ENDLOOP .
    *  IF sy-subrc = 0.
      IF NOT it_so1[] IS INITIAL.
        SELECT vbelv
               posnv
               vbeln
               posnn
               vbtyp_n
               INTO TABLE it_vbfa
               FROM vbfa
               FOR ALL ENTRIES IN it_so1
               WHERE vbelv = it_so1-vbeln
               AND   posnn = it_so1-posnr
               AND vbtyp_n ='J' .
        IF sy-subrc = 0.
          SELECT vbeln
                 posnr
                 matnr
                 werks
                 lgort
                 charg
                 lfimg
                 vrkme
                 FROM lips INTO TABLE it_del_ful
                 FOR ALL ENTRIES IN it_vbfa
                 WHERE vbeln = it_vbfa-vbeln
                 AND   posnr = it_vbfa-posnn.
        ENDIF.
      ENDIF.
    ENDFORM.                    " DATA_SELECT
    **************** EVENT CATALOG ****************************************
    *&      Form  EVENT_CAT
    *       text
    *      -->P_I_EVENT  text
    FORM event_cat  USING    p_i_event TYPE slis_t_event .
      REFRESH p_i_event .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    * EXPORTING
    *   I_LIST_TYPE           = 0
       IMPORTING
          et_events             = p_i_event
    * EXCEPTIONS
    *   LIST_TYPE_WRONG       = 1
    *   OTHERS                = 2
    *  IF sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
      READ TABLE p_i_event WITH KEY name = slis_ev_top_of_page INTO t_event.
      IF sy-subrc = 0.
        MOVE 'TOP_OF_PAGE' TO t_event-form.
        MODIFY p_i_event FROM t_event INDEX sy-tabix TRANSPORTING form.
      ENDIF.
      CLEAR t_event .
    ENDFORM.                    " EVENT_CAT
    **********FORM FOR EVENT TOP_OF_PAGE**********************************
    FORM top_of_page .
      REFRESH i_listheader.
      DATA: t_header TYPE slis_listheader.
      DATA: v_text(50).
      WRITE sy-datum TO v_text.
      CLEAR t_header.
      t_header-typ = 'S'.
      t_header-key = "Date".
      t_header-info = v_text.
      APPEND t_header TO i_listheader.
      CLEAR t_header.
      CLEAR v_text.
      WRITE:  'SALES ORDER & DELIVERY DETAILS REPORT  ' TO v_text .
      t_header-typ = 'S'.
      t_header-key = 'TITLE'.
      t_header-info = v_text.
      APPEND t_header TO i_listheader.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_listheader.
    *      I_LOGO             = 'ALV_BACKGROUND'.
    *   I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    ********  FIRST ALV GRID DISPLAY ***************************************
    FORM call_alv .
    * FORM TO MAKE THE CELL CONTENTS INVISIBLE.
    * PERFORM INVISIBLE_CELL_CONTENTS. *
    *EXCLUDE-DECLARATION.
      CLEAR wa_exclude.
      wa_exclude-fcode = '&VEXCEL'.
      APPEND wa_exclude TO i_exclude.
    *&      Form  CALL_ALV
    *       text
    *  -->  p1        text
    *  <--  p2        text
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = sy-repid
    *    I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
         i_callback_user_command           = 'USER_COMMAND1'
         i_callback_top_of_page            = 'TOP_OF_PAGE'
         i_background_id                   = 'ALV_BACKGROUND'
         is_layout                         = i_layout
         it_fieldcat                       = i_fldcat[]
         it_excluding                      = i_exclude
         it_sort                           = i_sort
         it_events                         = i_event
        TABLES
         t_outtab                          = it_so1
    *  IF sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
    ENDFORM.                    " CALL_ALV
    ************** FIRST FIELDCATALOG *************************************
    *&      Form  FLD_CAT
    *       text
    *      -->P_I_FLDCAT[]  text
    FORM fld_cat  USING    p_i_fldcat TYPE slis_t_fieldcat_alv.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'VBELN'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'."TABLE NAME
      i_fldcat-seltext_m   = 'SALES ORDER NO.'.
      i_fldcat-col_pos     = 1.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-hotspot     = 'X'.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'AUART'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'."TABLE NAME
      i_fldcat-seltext_m   = 'SALES DOC. TYPE'.
      i_fldcat-col_pos     = 2.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 15.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'VKORG'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'SALES ORG.'.
      i_fldcat-col_pos     = 3.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 12.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'SPART'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'DIVISION'.
      i_fldcat-col_pos     = 4.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 10.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'KUNNR'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'SOLD TO PARTY'.
      i_fldcat-col_pos     = 5.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 15.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'POSNR'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'SALES DOC. ITEM'.
      i_fldcat-col_pos     = 6.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 17.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'MATNR'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'MATERIAL NO.'.
      i_fldcat-col_pos     = 7.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'MAKTX'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'DESCRIPTION'.
      i_fldcat-col_pos     = 8.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'KWMENG'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'QUANTITY'.
      i_fldcat-col_pos     = 9.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 15.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-do_sum    = 'X'.        " For doing "SUM"
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'VRKME'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'SALES UNIT'.
      i_fldcat-col_pos     = 10.       " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 10.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
    ENDFORM.                    " FLD_CAT
    ****************** ALV SORTING  ***************************************
    *&      Form  SORT
    *       text
    *      -->P_I_SORT  text
    FORM t_sort  USING    p_i_sort TYPE slis_t_sortinfo_alv .
      DATA: i_sort TYPE slis_sortinfo_alv .
      REFRESH p_i_sort .
      CLEAR i_sort.
      i_sort-spos = 1.
      i_sort-tabname = 'IT_SO1'.
      i_sort-fieldname = 'VBELN'.
      i_sort-up = 'X'.
      i_sort-subtot = 'X'.
      i_sort-group = '*'.
      APPEND i_sort TO p_i_sort.
    ENDFORM.                    " SORT
    *FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.
    *  SET PF-STATUS 'ZSTANDARD'.
    *ENDFORM. "Set_pf_status
    ***********FORM FOR EVENT USER_COMMAND1********************************
    FORM user_command1 USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
    *CASE R_UCOMM .
    *    WHEN '&IC1' .
    *    IF rs_selfield-FIELDNAME = 'VBELN' .
    *    ENDIF .
    * WHEN OTHERS .
    * ENDCASE .
      CLEAR wa_so.
      REFRESH: it_del1 .
      IF r_ucomm = '&IC1' AND rs_selfield-fieldname = 'VBELN' AND
      rs_selfield-value IS NOT INITIAL.
        READ TABLE it_so1 INTO wa_so INDEX rs_selfield-tabindex.
        IF sy-subrc = 0.
          LOOP AT it_vbfa INTO wa_vbfa WHERE vbelv = wa_so-vbeln
                                       AND   posnv = wa_so-posnr.
            READ TABLE it_del_ful INTO wa_it_del_ful
                 WITH KEY vbeln = wa_vbfa-vbelv
                          posnr = wa_vbfa-posnn.
            IF sy-subrc = 0.
              CLEAR wa_del.
              MOVE wa_it_del_ful TO wa_del.
              APPEND wa_del TO it_del1.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ********* SECOND ALV GRID DISPLAY ***********************************
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        i_callback_program                = sy-repid
    *   I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
        i_callback_user_command           = 'USER_COMMAND2'
        i_callback_top_of_page            = 'TOP_OF_PAGE'
        i_background_id                   = 'ALV_BACKGROUND'
        it_fieldcat                       = i_fldcat2[]
        it_sort                           = i_sort
        TABLES
        t_outtab                          = it_del_ful
    *  IF sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
    ENDFORM .                    "USER_COMMAND1
    ********** FORM FOR EVENT USER_COMMAND 2 ******************************
    FORM user_command2 USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
      CLEAR wa_so.
      REFRESH: it_del1 .
      IF r_ucomm = '&IC1' AND rs_selfield-fieldname = 'VBELN' AND
      rs_selfield-value IS NOT INITIAL.
        READ TABLE it_so1 INTO wa_so INDEX rs_selfield-tabindex.
    *    IF SY-SUBRC = 0.
    *       LOOP AT it_vbfa INTO wa_vbfa WHERE vbelv = WA_SO-vbeln
    *                                    AND   posnv = WA_SO-posnr.
        READ TABLE it_del_ful INTO wa_it_del_ful
             WITH KEY vbeln = rs_selfield-value
                     " vbeln = wa_vbfa-vbeln
                      posnr = wa_vbfa-posnn.
        IF rs_selfield-fieldname = 'VBELN'.
          SET PARAMETER ID 'VL' FIELD wa_vbfa-vbeln .
          CALL TRANSACTION 'VL03' AND SKIP FIRST SCREEN.
        ENDIF .
    *       ENDLOOP.
    *    ENDIF.
      ENDIF.
    ENDFORM .                    "USER_COMMAND2
    ********* SECOND FIELDCATALOG ******************************************
    *&      Form  FLD_CAT2
    *       text
    *      -->P_I_FLDCAT2[]  text
    FORM fld_cat2  USING    p_i_fldcat2 TYPE slis_t_fieldcat_alv .
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'VBELN'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-tabname     = 'IT_DEL_FUL'."TABLE NAME
      i_fldcat2-seltext_m   = 'DELIVERY NO.'.
      i_fldcat2-col_pos     = 1.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-hotspot     = 'X'.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'POSNR'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'DELIVERY ITEM'.
      i_fldcat2-col_pos     = 2.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'MATNR'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'MATERIAL NO.'.
      i_fldcat2-col_pos     = 3.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'WERKS'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'PLANT.'.
      i_fldcat2-col_pos     = 4.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'LGORT'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'ST. LOCATION'.
      i_fldcat2-col_pos     = 5.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'CHARG'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'BATCH NO.'.
      i_fldcat2-col_pos     = 6.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'LFIMG'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'ACT. DEL. QTY.'.
      i_fldcat2-col_pos     = 7.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'VRKME'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'SALES UNIT.'.
      i_fldcat2-col_pos     = 8.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
    ENDFORM.                                                    " FLD_CAT2
    ***************** ALV LAYOUT *******************************************
    *&      Form  LAYOUT
    *       text
    *      -->P_I_LAYOUT  text
    FORM t_layout  USING    p_i_layout TYPE slis_layout_alv .
      p_i_layout-zebra  = 'X'.
      p_i_layout-totals_text = 'GRAND TOTAL ='.
    *  p_i_layout-CONFIRMATION_PROMPT = 'X'.
    *  p_i_layout-DEF_STATUS  = ' '.
      p_i_layout-info_fieldname = 'LINE_COLOR'.
    ENDFORM.                    " LAYOUT

  • How to check the Conditional transition while submit the jsp as screenflo

    Hi All,
    I want to know that how to check the conditional transition, which result is used to decide the next Activity while submit the JSP as Screen Flows
    Edited by bpmvasu at 03/27/2007 11:14 PM

    Hi,
    Unlike BPM Object Presentations where the 'selectedButton' is automatically assigned to the predefined screenflow 'result' variable, when using JSP Persentations you need to do the mapping yourself (I don't think there is a way around this).
    Assuming you're using a JSP Presentation with a Fuego Object Interactive Call, click the 'Advanced' button at the bottom of the Main Task dialog.
    Select the 'showOut' argument set, add a new argument mapping. Select 'result' from the Screenflow's instance variables and map it to 'parameters["paramName"]'. Where paramName is the name of the HTML submit input element in your JSP.
    Hope this helps,
    Tim

  • How to Delete the condition record in CRM

    HI,
    Can you please help me how to delete the condition record from condition table in CRM.
    Please explain the usage of FM CRMXIF_CONDITION_SEL_DELETE with examples.
    I have also read the documention of the function module. How to use this FM for custom defined condition table.
    (this is the code given in Documentation)
    DATA-OBJECT_REPRESENTATION         = 'E'
    DATA-SEL_OPT-CT_APPLICATION              = 'CRM'
    DATA-SEL_OPT-OBJECT_TASK                    = 'D'
    DATA-SEL_OPT-RANGE-FIELDNAME        = 'PRODUCT_ID'
    DATA-SEL_OPT-RANGE-R_SIGN                  = 'I'    (Including)
    DATA-SEL_OPT-RANGE-R_OPTION           = 'EQ'
    DATA-SEL_OPT-RANGE-R_VALUE_LOW  = 'PROD_1'
    Thanks
    Shankar

    Hi Shankar,
    I am using the same CRMXIF_CONDITION_SEL_DELETE function module to delete condition record present in CRM.
    But it is giving me below error in the return table of the FM after i run the program. Can you please correct me if I am doing any thing wrong?
    Error in  lt_return: SMW3     CND_MAST_SEL_DEL_EXT_VALIDATE     CND_M_SD
    code:
    ls_range-fieldname = 'PRODUCT_ID''.
    ls_range-R_SIGN = 'I'.
    ls_range-R_OPTION = 'EQ'.
    ls_range-R_VALUE_LOW = '123456'.
    APPEND ls_range TO lt_range.
    MOVE lt_range TO ls_entry-SEL_OPT-range.
    ls_data-SEL_OPT-object_task = 'D'.
    ls_data-SEL_OPT-ct_application = 'CRM'.
    ls_data-object_representation = 'E'.
    CALL FUNCTION 'CRMXIF_CONDITION_SEL_DELETE'
      EXPORTING
        DATA          = ls_date
    IMPORTING
       RETURN        = lt_return
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      IMPORTING
        return = lt_ret.
    Edited by: Saravanaprasad Nadar on Jul 7, 2010 1:27 AM

  • How to add the date field in the dso and info cube

    Hi all.
    I am new to bi 7. in the earlier version v hav to button to add the date field. but in the bi 7 der is no option so can any body tell me how to add the date field in the data targets
    Thanks & Regard
    KK

    my prob is solved
    KK

  • SSRS 2008 Work order report , in sub total donot want to add the 0 level in ( how to add the expression )

    working in Work order report, this report has different level , for example
    0 level transaction
    1 level transaction
    in subtotal don't want to add 0 level transaction,
    when I did the sub total it added all the level , so in sub total amount double up because of that
    how to add the expression so I can the level 0 take out from sub total , so it does not include in sub total
    can some one please help me with this
    thanks in advance

    Hi Simon_ Hou
    I tried the expr the way you suggested , it did not work  getting  error message,  the exp I added is below
    this the expression I added on sub total where is highlighted in Yellow,  under Cost amount column,
    I really appreciate the help
    =Sum(IIF(Fields!COLLECTREFLEVEL.Value=
    "0",0,Fields!CostAMOUNT.Value),"DataSet1")
    please see below my QUERY, can you please help and let me know what I did wrong in my exp
    SELECT        PRODTABLE.PRODID, PRODCALCTRANS.COSTGROUPID, PRODTABLE.QTYCALC, PRODTABLE.PRODSTATUS, PRODCALCTRANS.COSTAMOUNT,
                             PRODCALCTRANS.COSTMARKUP, PRODCALCTRANS.REALCOSTAMOUNT, PRODCALCTRANS.CALCTYPE, PRODTABLE.DATAAREAID, PRODCALCTRANS.KEY3,
                             PRODCALCTRANS.CONSUMPVARIABLE, PRODCALCTRANS.REALCONSUMP, PRODTABLE.ITEMID, PRODTABLE.SCHEDDATE, PRODTABLE.FINISHEDDATE,
                             PRODCALCTRANS.KEY1, PRODCALCTRANS.TRANSDATE, PRODCALCTRANS.QTY, PRODCALCTRANS.KEY2, PRODCALCTRANS.COLLECTREFLEVEL,
                             PRODCALCTRANS.LINENUM
    FROM            PRODTABLE INNER JOIN
                             PRODCALCTRANS ON PRODTABLE.PRODID = PRODCALCTRANS.PRODID AND PRODTABLE.DATAAREAID = PRODCALCTRANS.DATAAREAID
    WHERE        (PRODTABLE.PRODSTATUS = 7) AND (PRODTABLE.DATAAREAID = N'AR1') AND (PRODTABLE.ITEMID = @itemid) AND
                             (PRODTABLE.FINISHEDDATE >= @Paramfromdate) AND (PRODTABLE.FINISHEDDATE <= @Paramtodate)

  • How to update the condition price in the sales order for all the items

    Hi,
    How to update the condition price for all the itmes in the sales order to carry out the new price automatically through a stand alone program, for all the orders in the billing due list table?
    Thanks,
    Balaram

    Hi,
    There is a change in the requirement.
    Scenario:
    I have created a sales order with some 4 condition types, in that 2 condition types are of class A & B and the other two is of class C. Here I need to update the condition price of class A & B only and the remaining condition types should not get update even though there is an updated price is available.
    For the above scenario, I need to write a standalone program. Do we have any function modules to update the price of the single condition in the sales order? Please tell me how we can update the sales order at item condition level.
    Thanks.
    Balaram

  • How to update the condition price in sales order while creating the invoice

    Hi,
    How to update the condition price in the sales order to carry out the new price while creating the invoice?
    While creating the invoice it should update the condition price in sales order.
    Thanks,
    Balaram

    No, pricing is not there in delivery.
    I found an exit for VF01transaction where we can update the price in order.
    Can you please tell me how to update the price if I have the order, material numbers and conditions number?
    Thanks,
    Balaram

  • How to add the Match code object for the requisitioner field in TCODE ME51N

    Hi,
    How to add the search help (Match code object) for the requisitioner field in transaction ME51N.
    Please  do the needful to me.
    Regards
    Rajesh

    don't you think that posting your question to a microsoft developer site would be more efficient?
    regards,
    anton

  • How to add the entries and how to delete the entries from custom Z-table?

    Hi Experts,
    My requirement is I need to add the entries from program to three custom z-tables . Assume as zabc1,zabc2,zabc3.
    Here how to add the entries from program to Z-table.???
    And one more requirement is I want to provide a deletion checkbox in selection screen . Initial it was unchecked. If I am giving tick mark then the entries should be deleted from above custom Z-tables. this all will done in backgroung job?
    Could you please guide me the logic how to crack this???
    Let me know if you need more Info
    Thanks
    Sanju

    Hi Sanjana,
    What you can do is to use the ABAP keyword INSERT or MODIFY to add or modify records to a given database table. Here are the syntax taken from SAP documentation:
    *Insert Statement
    INSERT dbtab
    Syntax
    INSERT { {INTO target VALUES source }
           | {     target FROM   source } }.
    Effect
    The INSERT statement inserts one or more rows specified in source in the database table specified in target. The two variants with INTO and VALUES or without INTO with FROM behave identically, with the exception that you cannot specify any internal tables in source after VALUES.
    System Fields
    The INSERT statement sets the values of the system fields sy-subrc and sy-dbcnt.
    sy-subrc Meaning
    0 At least one row was inserted.
    4 At least one row could not be inserted, because the database table already contains a row with the same primary key or a unique secondary index.
    The INSERT statement sets sy-dbcnt to the number of rows inserted.
    Note
    The inserted rows are finally included in the table in the next database commit. Up until this point, they can still be removed by a database rollback.
    *Modify Statement
    MODIFY dbtab
    Syntax
    MODIFY target FROM source.
    Effect
    The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines.
    System fields
    The MODIFY statement sets the values of the sy-subrc and sy-dbcnt system fields.
    sy-subrc Meaning
    0 At least one line is inserted or changed.
    4 At least one line could not be processed since there is already a line with the same unique name secondary index in the database table.
    The MODIFY statement sets sy-dbcnt to the number of processed lines.
    Note
    The changes are transferred finally to the database table with the next database commit. Up to that point, they can be reversed using a database rollback.
    Hope it helps...
    P.S. Please award points if it helps...

Maybe you are looking for

  • Having trouble with web authentication in 5504

    Hi everybody, We´re experiencing a trouble with our Wireles LAN solution. We have a WLC 5504, a ACS 4.2 and APs 1131AG. After deploying the solution and doing some tests we noticed when a user attempted to connect by wireless network there was too mu

  • Inserting Live Clock in Final Cut Pro Video Project

    Does anyone know how to insert a live clock in FCP? I am looking for something like inserting a game clock for a sporting event. I don't know if this is possible at all, but if so....any tips? Thanks

  • Email a file

    Okay I have read lots of very confusing information about emailing a pdf from a form. All I know is mine does not work. It says acrobat is unable to connect to my email program when the email button is clicked. I am sure I need to set that up somehow

  • Binnig Ghost E-Mails

    Hi I seem to be getting a number of ghost e-mails with NO SENDER, NO SUBJECT and under that it says THIS MESSAGE HAS NO CONTENT. how do I din these e-mails they are not on my main computer only on the iPad and they will not high light so I can't dele

  • Flash stopped working and won't reinstall, same error everytime.

    Nothing even changed. Just bam, stopped working. Got it to work once, second time it failed. Uninstalled the program I installed that was "not compatible with this version of windows" cleaned the registry, and restored to an earlier point... The prob