Dynamic selection

Hi experts,
           I want to include a abap routine in the infopackage so that it changes the selection field whenever the infopackage is run automatically with the current value . the field i want to inculde in the routine is calweek ( 0CALWEEK). the from value shld be current week and the to value is a constant some value in the future. Is there a any code for this. Thank u
Dave

hi Dave,
you can use function module DATE_GET_WEEK to convert date to week, try following routine.
hope this helps.
data: l_idx like sy-tabix,
l_week like SCAL-WEEK.
read table l_t_range with key
iobjnm = '0calweek'.
l_idx = sy-tabix.
DELETE l_t_range
WHERE iobjnm = '0calweek'.
L_t_RANGE-SIGN = 'I'.
L_t_RANGE-OPTION = 'BT'.
current calweek
call function 'DATE_GET_WEEK'
exporting
  date = sy-datum
importing
  week = l_week.
L_t_RANGE-LOW = l_week.
append l_t_range.
week in future (e.g week 50->200650)
L_t_RANGE-HIGH = '200650'.
append l_t_range.
modify l_t_range index l_idx.
p_subrc = 0.
$$ end of routine - insert your code only before this line -
endform.

Similar Messages

  • How to get resultset from procedure having dynamic select sql query ?

    Hi,
    I have created a procedure, in which there is dynamic select query. The procedure has one out put parameter which gives error code. When I compile that procedure it compiles successufully. When I run it it executes successfully and gives output error code. But I don't know how to get resultset of that dynamic select sql query. I need that.
    This is the procedure:
    create or replace
    PROCEDURE uspGetProductDetailsMultiOrder
      v_DefinitionDBName IN VARCHAR2,
         v_CommonDBName IN VARCHAR2,
         v_Filter_FilledStatus IN VARCHAR2,
         v_Filter_Internal_Counterparty IN nvarchar2,
         v_Filter_NoteType IN nvarchar2,
         v_Filter_Exchange IN nvarchar2,
         v_Filter_Issuer IN nvarchar2,
         v_Filter_Product_Category  IN VARCHAR2,
         v_DateToFilter IN VARCHAR2,     
         v_Filter_FromDate IN VARCHAR2,
         v_Filter_ToDate IN VARCHAR2,
         v_Active_YN_Flag IN NVARCHAR2,
         v_Entity_ID IN NVARCHAR2,
         v_ErrorNumber  OUT NUMBER
       as
       v_SelectSQL  nvarchar2(32767);
          v_Setting_Name  nvarchar2(32767);
       v_Default_Value  nvarchar2(32767);
       v_Config_Value  nvarchar2(32767);
       v_CCY_ID  NUMBER(10,0);
       v_CCY_Data  nvarchar2(32767);
       v_CCY_List  nvarchar2(32767);
       v_Seq_Id  NUMBER(10,0);
       SWV_Active_YN_Flag NVARCHAR2(1);
       SWV_VarStr long;--varchar2(4000);
       SWV_TRANCOUNT NUMBER(10,0);
        SWV_fnc_SplitString_Id_var1 NUMBER(10,0);
       SWV_fnc_SplitString_Id_var0 NUMBER(10,0);
      CURSOR RestrictTermsheetVisibilityByC 
       IS select CS.Setting_Name,Default_Value,Config_Value
       from Config_Settings CS   LEFT OUTER JOIN Entity_Config EC  ON EC.Setting_ID = CS.Setting_ID
       where EC.Entity_ID = v_Entity_ID AND Setting_Level = 'ENTITY';
       CURSOR Get_RestrictCCY_List_Cursor IS SELECT Id_1,Data_1 FROM table(fnc_SplitString(v_Config_Value,','));
       --CURSOR Get_RestrictCCY_List_Cursor IS SELECT Id,Data FROM imp;
       CURSOR GetRestrictTemplateListCursor 
      -- is select id,data from imp;
       IS SELECT Id_1,Data_1 FROM table(fnc_SplitString(v_Config_Value,',')) ;
         --Parikshit 18-Jul-2010, active YN flag param added in SP
    BEGIN
    SWV_Active_YN_Flag := v_Active_YN_Flag;
       if SWV_Active_YN_Flag = ' '  then
          SWV_Active_YN_Flag := 'Y';
       end if;
       v_SelectSQL := ' ';
       v_SelectSQL := v_SelectSQL || ' Select ';
       v_SelectSQL := v_SelectSQL || '  NM.Note_Master_Id, NM.Product_Name, NM.Template_ID, NM.Template_Sr_No, NM.Asset, NM.Exchange, NM.Type, NM.Currency';
         --SET @SelectSQL = @SelectSQL + ' , NM.Trade_Date, NM.Value_Date, NM.Valuation_Date, NM.Maturity_Date, NM.Tenor, NM.Strike_Price_Percentage, (case when (NM.Type like '' ELN%'' or NM.Type like ''RELN%'') THEN  NOP.Issue_Price Else NM.Customer_Price End) as Customer_Price, NM.Dealer_Price, (case when (NM.Type like '' ELN%'' or NM.Type like ''RELN%'') THEN  NOP.Customer_Yield Else NM.Customer_Yield End) as Customer_Yield,  NOP.Dealer_Cost_PA as Internal_Cost '
       v_SelectSQL := v_SelectSQL || ' , NM.Trade_Date, NM.Value_Date, NM.Valuation_Date, NM.Maturity_Date, NM.Tenor, NM.Strike_Price_Percentage, (case when (NM.PriceList_YN = ''Y'') THEN  NOP.Issue_Price Else NM.Customer_Price End) as Customer_Price, NM.Dealer_Price, (case when (NM.PriceList_YN = ''Y'') THEN  NOP.Customer_Yield Else NM.Customer_Yield End) as Customer_Yield,  NOP.Dealer_Cost_PA as Internal_Cost ';
       v_SelectSQL := v_SelectSQL || ' , NM.Minimum_Issue_Size, NM.Maximum_Issue_Size, NM.Minimum_Tolerence_Amount, NM.Maximum_Tolerence_Amount, NM.Trigger_Amount_Warning, nvl(NM.PerUnit_Equivalent_Amount,1) as PerUnit_Equivalent_Amount,  NM.Active_YN_Flag, NM.Verify_YN_Flag ';
       v_SelectSQL := v_SelectSQL || ' , NM.Tranche_YN_Flag, NM.Launch_Date, NM.Open_Date, NM.Close_Date, NM.PreHedged_YN, NM.Created_By, NM.Created_At,  NM.Verified_At, NM.Verified_By, NM.ISIN, NM.Issuer';
       v_SelectSQL := v_SelectSQL || ' , NM.Product_Catagory as Product_Category, NM.Note_Issuer_Type as Issuer_Category, NM.Series_No as Series_No, NM.Minimum_Investment_Amount ';
         --Added by Parikshit on 14-Jun-2011, to remove the unwinding amounts from the total issue size
         --SET @SelectSQL = @SelectSQL + ' , NOP.LastTimeWhenProductModified,NOP.Nominal_Amount as Current_Issue_Size, NOP.Filled_Status, NM.Counterparty as Internal_Counterparty  '
       v_SelectSQL := v_SelectSQL || ' , NOP.LastTimeWhenProductModified,(NOP.Nominal_Amount - nvl(ND.Unwind_Amount,0) ) as Current_Issue_Size, NOP.Filled_Status, NM.Counterparty as Internal_Counterparty  ';
         --********************************************************END
       v_SelectSQL := v_SelectSQL || ' ,T2.Confirmed_Amount, T2.Confirmed_Shares';
       v_SelectSQL := v_SelectSQL || ' , T3.Live_Deals';
       v_SelectSQL := v_SelectSQL || ' , BS.Net_Trade_Hedged, BS.Net_Trade_Outstanding, BS.Hedged_Nominal_BUY, BS.Hedged_Nominal_SELL, BS.Outstanding_Nominal_BUY, BS.Outstanding_Nominal_SELL   ';
       v_SelectSQL := v_SelectSQL || ' , ( case    When UPPER(NM.PreHedged_YN) = ''Y'' Then ''Launched'' ';
       v_SelectSQL := v_SelectSQL || '              When ((NM.Maturity_Date IS  NOT NULL) AND to_date(NM.Maturity_Date) <= to_date(sysdate)) Then ''Matured''';
       v_SelectSQL := v_SelectSQL || '              When (UPPER(NM.PreHedged_YN) = ''N'' AND NM.Launch_Date IS NOT NULL)  Then ''Launched''';     
         --Ready to launch
       v_SelectSQL := v_SelectSQL || '              When (UPPER(NM.PreHedged_YN) = ''N'' AND NM.Launch_Date  IS  NULL AND (T2.Confirmed_Amount >= NM.Minimum_Issue_Size) AND  to_date(Close_Date) > to_date(sysdate) ) Then ''Ready To Launch''';     
         --Ready to launch
       v_SelectSQL := v_SelectSQL || '              When (UPPER(NM.PreHedged_YN) = ''N'' AND NM.Launch_Date  IS  NULL AND (T2.Confirmed_Amount >= (NM.Minimum_Issue_Size - NM.Minimum_Tolerence_Amount)) AND  to_date(Close_Date)= to_date(sysdate)    )  Then ''Ready To Launch''';     
       v_SelectSQL := v_SelectSQL || '              When (UPPER(NM.PreHedged_YN) = ''N'' AND NM.Launch_Date  IS  NULL AND (T2.Confirmed_Amount >= (NM.Minimum_Issue_Size - NM.Minimum_Tolerence_Amount)) AND  to_date(Close_Date)< to_date(sysdate)    )  Then ''Ready To Launch''';     
         --Warning trigger reached
       v_SelectSQL := v_SelectSQL || '              When (UPPER(NM.PreHedged_YN) = ''N'' AND NM.Launch_Date IS  NOT NULL AND (T2.Confirmed_Amount >= NM.Trigger_Amount_Warning ))  Then ''Warning Trigger Reached''';          
       v_SelectSQL := v_SelectSQL || '              Else ''Not Ready'' ';
       v_SelectSQL := v_SelectSQL || '              End)Launch_Status';
       v_SelectSQL := v_SelectSQL || ' , NI.Issuer_Code';
          v_SelectSQL := v_SelectSQL || ' , (nvl(NOP.Nominal_Amount,0) - nvl(T2.Confirmed_Amount,0)) as Unconfirmed_Amount, NM.Upfront as Upfront,   case when UPPER(NM.PreHedged_YN) = ''Y'' THEN 0 else (nvl(T2.Confirmed_Amount,0) - nvl(BS.Net_Trade_Hedged,0)) end as ReadyToHedge';
          v_SelectSQL := v_SelectSQL || ' , NOP.Hard_Margin  as Margin_Amount, NM.YearBasis as YearBasis, NM.Note_Product_Rating as Equity_Risk_Score, AD.Equity_Asset_Class ';
          v_SelectSQL := v_SelectSQL || '  , NM.Note_Product_Rating as Product_Rating,  NOP.PO_ID, AD.LotSize as Lot_Size, NM.Max_Orders_Per_Product as MAX_Orders, NOP.Order_Count as Current_Order_Count,  nvl(NM.Denomination_Ccy,NM.Currency) as Denomination_Ccy, NM.Note_Scheme_Type as Underlying_Type, NM.Note_Asset_Class as Asset_Class, NULL as Product_Created_YN, NULL as Product_Created_ID,  ( (case when NM.Note_Order_Type = '''' then N''Market'' else NM.Note_Order_Type end )  ) as  Order_Type, NOP.Spot_Price, NM.Note_Price_Link, NOP.Strike_Price, NVL(NM.C_Fixing_Frequency,''Atmaturity'') as Fixing_Frequency, NM.Document_Uploaded_YN, NM.Document_Uploaded_At, NM.Document_Uploaded_By, NM.Document_File_Name, NM.Document_File_Extension, NM.Document_File_Path, NM.CutOff_Time, NM.Soft_Tenor, NM.NM_Sn_Code_All, NULL as Note_Price_Source, AD.LongName, NVL(NM.Pricelist_YN,''N'') as Pricelist_YN, AD.AlternateIdentifierAlias as Underlying, NM.Note_Issuer_Date_Offset, NM.Counterparty as Note_Counter_Party, NULL as
    Note_Premium_PC  ';
       v_SelectSQL := v_SelectSQL || '  , NI.Issuer_Name, IP.Issuer_Id, IP.Broad_Cash, IP.Odd_Cash, IP.Account_Note, IP.Rounding, IP.Decimal_Truncate, IP.Misc1 as Recidual_YN, NM.Note_Issuer_Type, NM.Target_Coupon, C_Fixing_Frequency as C_Fixing_Frequency, NM.Callable_Frequency as Callable_Frequency, NM.Strike_Price_Percentage as C_Note_Strike_PC, NM.NM_Airbag_PC as  Airbag_PC, C_Note_Barrier_PC as C_Note_Barrier_PC, TM.Template_Name, ''Product'' as Record_Type, NM.C_Settlement_Frequency, NM.Coupon_Frequency, NM.NM_Fixing_Source as Note_Fixing_Source, NM.Order_Entry_Type, (nvl(NM.Minimum_Issue_Size,0) - nvl(T2.Confirmed_Amount,0)) as Remaining_Launch_Amount, NM.C_Fixing_Start_Point, NM.C_Fixing_End_Point, NM.Order_Entry_Type, SC.Scheme_Alias, SC.Scheme_Name, CM.CM_ID, CM.CM_Name as Counterparty_Name, NM.NM_Other_Features as Other_Features, NM.Strike_Price_Percentage as Accrual_Strike, NM.NM_KnockIn as KnockIn, NM.NM_Airbag_Type, NM.NM_Put_strike as Put_Strike, NM.NM_Accrual_Strike,
    NM.NM_Counterparty_Upfront,  NM.Price_Updated_YN as Prices_Updated_YN, AD.Code as Asset_Name,NULL as KO_FREQ_TYPE, NM.Daily_Accumalation_Equities, NM.MaxNoAcc_days, NM.Guaranteed_Days, NM.Leverage_ratio, NM.NORM_IF, NM.NORM_PAIR, NM.NORM_FXRate ';
       v_SelectSQL := v_SelectSQL || ' from ';
       v_SelectSQL := v_SelectSQL || v_CommonDBName|| '.Note_Master NM  ';
       v_SelectSQL := v_SelectSQL || 'Left Outer Join ';
       v_SelectSQL := v_SelectSQL || v_CommonDBName||'.Issuer_Master NI ';
          v_SelectSQL := v_SelectSQL || ' On NM.Issuer = (case when  ISNUMERIC(NM.Issuer) = 0  then  cast (NI.Issuer_Name as nvarchar2(25))  else  cast(NI.Issuer_Id as nvarchar2(25)) end )';     
       v_SelectSQL := v_SelectSQL || ' Left Outer Join ';
       v_SelectSQL := v_SelectSQL || v_CommonDBName||'.Note_Order_Product NOP ';
       v_SelectSQL := v_SelectSQL || ' On NOP.Note_Master_ID = NM.Note_Master_ID';
       v_SelectSQL := v_SelectSQL || ' Left Outer Join ';
       v_SelectSQL := v_SelectSQL || v_DefinitionDBName||'.AssetDef AD ';
       v_SelectSQL := v_SelectSQL || ' On AD.Code = NM.Asset';
         v_SelectSQL := v_SelectSQL || ' AND AD.TypeAsset  = substr(NM.Note_Asset_Class,1,2) ';
       v_SelectSQL := v_SelectSQL || ' Left Outer Join ';
       v_SelectSQL := v_SelectSQL || v_CommonDBName||'.Issuer_Parameter IP ';
          v_SelectSQL := v_SelectSQL || ' On NM.Issuer = (case when  ISNUMERIC(NM.Issuer) = 0  then  cast (IP.Issuer_Name as nvarchar2(25))  else  cast(IP.Issuer_Id as nvarchar2(25)) end )';
       v_SelectSQL := v_SelectSQL || ' Left Outer Join ';
       v_SelectSQL := v_SelectSQL || v_CommonDBName||'.Template_Master TM ';
       v_SelectSQL := v_SelectSQL || ' On  TM.Template_Id =  NM.Template_ID ';
       v_SelectSQL := v_SelectSQL || ' Left Outer Join ';
       v_SelectSQL := v_SelectSQL || v_CommonDBName||'.Scheme_Codes SC ';
       v_SelectSQL := v_SelectSQL || ' On  SC.Scheme_Alias =  NM.Type';     
       v_SelectSQL := v_SelectSQL || ' Left Outer Join ';
       v_SelectSQL := v_SelectSQL || v_CommonDBName||'.Counterparty_Master CM ';
       v_SelectSQL := v_SelectSQL || ' On  CM.CM_ID =  NM.Counterparty';     
          v_SelectSQL := v_SelectSQL || ' Left Outer Join      ';
       v_SelectSQL := v_SelectSQL || ' ( ';
       v_SelectSQL := v_SelectSQL || ' Select Note_master_ID, sum(Nominal_Amt) as Unwind_Amount from ';
       v_SelectSQL := v_SelectSQL || v_CommonDBName||'.Note_Deals ';
       v_SelectSQL := v_SelectSQL || ' where Prematurity_Date IS NOT NULL';
       v_SelectSQL := v_SelectSQL || ' AND (UPPER(Deletion_Reason ) = ''PART REDEMPTION'' or UPPER(Deletion_Reason ) = ''FULL REDEMPTION'')';
       v_SelectSQL := v_SelectSQL || ' Group by Note_master_ID ';
       v_SelectSQL := v_SelectSQL || ' ) ND ';
       v_SelectSQL := v_SelectSQL || ' On  ND.Note_Master_ID =  NM.Note_Master_ID';
    if  (v_Filter_FilledStatus = ' ' OR UPPER(v_Filter_FilledStatus) = 'ALL' ) then
          v_SelectSQL := v_SelectSQL || ' ';
       else
          v_SelectSQL := v_SelectSQL || ' AND NOP.Filled_Status IN (' || v_Filter_FilledStatus  || ')';
       end if;                         
         --AND NOP.Internal_Counterparty = 'DEFAULT''
       if(SUBSTR(to_char(v_Filter_Internal_Counterparty),1,4000)= ' ')  then
          v_SelectSQL := v_SelectSQL || ' ';
       else
          v_SelectSQL := v_SelectSQL || ' AND NOP.Internal_Counterparty IN (' || v_Filter_Internal_Counterparty || ')';
       end if;                    
         --SET @SelectSQL = @SelectSQL + ' --Filter--'
       v_SelectSQL := v_SelectSQL || ' LEFT OUTER JOIN ';
       v_SelectSQL := v_SelectSQL || ' (';
       v_SelectSQL := v_SelectSQL || '   select Note_Master_ID, sum(Nominal_Amount) As Confirmed_Amount, sum(No_Of_Shares)  As Confirmed_Shares  ';
       v_SelectSQL := v_SelectSQL || '   from '||v_CommonDBName||'.Note_Order_RM  ';
       v_SelectSQL := v_SelectSQL || '   Where substr(UPPER(Order_Status_Flag),1,6) = ''YYYYYY'' AND substr(substr(UPPER(Order_Status_Flag),1,7),-1,1) = ''N'' ';
       v_SelectSQL := v_SelectSQL || '   group by  Note_Master_ID';
       v_SelectSQL := v_SelectSQL || ' ) T2';
       v_SelectSQL := v_SelectSQL || ' ON T2.Note_Master_ID = NM.Note_Master_ID';
       v_SelectSQL := v_SelectSQL || ' LEFT OUTER JOIN';
       v_SelectSQL := v_SelectSQL || ' (';
       v_SelectSQL := v_SelectSQL || '   Select ND.Note_Master_ID, sum(ND.Nominal_Amt) As Live_Deals ';
       v_SelectSQL := v_SelectSQL || '   from '||v_CommonDBName||'.Note_Deals ND  ';
       v_SelectSQL := v_SelectSQL || '   where ND.Active_YNFlag = ''Y'' ';
       v_SelectSQL := v_SelectSQL || '   group by  Note_Master_ID';
       v_SelectSQL := v_SelectSQL || ' ) T3';
       v_SelectSQL := v_SelectSQL || ' ON T3.Note_Master_ID = NM.Note_Master_ID';
       v_SelectSQL := v_SelectSQL || '  LEFT OUTER JOIN';
       v_SelectSQL := v_SelectSQL || '  (';
       v_SelectSQL := v_SelectSQL || '  SELECT NH_Note_Master_ID,';
       v_SelectSQL := v_SelectSQL || '  (CAST(SUM(Hedged_Nominal_Buy) AS BINARY_FLOAT) -CAST(SUM(Hedged_Nominal_Sell) AS BINARY_FLOAT))  Net_Trade_Hedged,';
       v_SelectSQL := v_SelectSQL || '  (CAST(SUM(Outstanding_Nominal_BUY) AS BINARY_FLOAT) -CAST(SUM(Outstanding_Nominal_SELL) AS BINARY_FLOAT))  Net_Trade_Outstanding,';
       v_SelectSQL := v_SelectSQL || '  SUM(Hedged_Nominal_BUY) AS Hedged_Nominal_BUY,';
       v_SelectSQL := v_SelectSQL || '  SUM(Hedged_Nominal_SELL) AS Hedged_Nominal_SELL,';
       v_SelectSQL := v_SelectSQL || '  SUM(Outstanding_Nominal_BUY) AS Outstanding_Nominal_BUY,';
       v_SelectSQL := v_SelectSQL || '  SUM(Outstanding_Nominal_SELL) As Outstanding_Nominal_SELL';
       v_SelectSQL := v_SelectSQL || '  From';
       v_SelectSQL := v_SelectSQL || '  (';
       v_SelectSQL := v_SelectSQL || '  SELECT NH_Note_Master_ID,';
       v_SelectSQL := v_SelectSQL || '  SUM(NH_Hedged_Nominal) AS Hedged_Nominal_BUY, 0 AS Hedged_Nominal_SELL,';
       v_SelectSQL := v_SelectSQL || '  SUM(NH_Outstanding_Nominal) AS Outstanding_Nominal_BUY, 0 AS Outstanding_Nominal_SELL';
       v_SelectSQL := v_SelectSQL || '  FROM '||v_CommonDBName||'.Note_Hedge  ';
       v_SelectSQL := v_SelectSQL || '  WHERE NH_Direction = ''BUY'' ';
       v_SelectSQL := v_SelectSQL || '  GROUP BY NH_Note_Master_ID';
       v_SelectSQL := v_SelectSQL || '  Union';
       v_SelectSQL := v_SelectSQL || '  SELECT NH_Note_Master_ID,';
       v_SelectSQL := v_SelectSQL || '  0 AS Hedged_Nominal_BUY, SUM(NH_Hedged_Nominal) AS Hedged_Nominal_SELL,';
       v_SelectSQL := v_SelectSQL || '  0 AS Outstanding_Nominal_BUY, SUM(NH_Outstanding_Nominal) AS Outstanding_Nominal_SELL';
       v_SelectSQL := v_SelectSQL || '  FROM '||v_CommonDBName||'.Note_Hedge  ';
       v_SelectSQL := v_SelectSQL || '  WHERE NH_Direction = ''SELL''  ';
       v_SelectSQL := v_SelectSQL || '  GROUP BY NH_Note_Master_ID';
       v_SelectSQL := v_SelectSQL || '  ) ';
       v_SelectSQL := v_SelectSQL || '  GROUP BY NH_Note_Master_ID';
       v_SelectSQL := v_SelectSQL || '  ) BS';
       v_SelectSQL := v_SelectSQL || '  ON BS.NH_Note_Master_ID = NM.Note_Master_ID';
       v_SelectSQL := v_SelectSQL || ' Where NM.Verify_YN_Flag = ''Y'' ';
      v_SelectSQL := v_SelectSQL || ' AND NM.Active_YN_Flag = ''' || SWV_Active_YN_Flag || '''';
       if(SUBSTR(to_char(v_Filter_NoteType),1,4000) = ' ' OR UPPER(v_Filter_NoteType) = 'ALL' ) then
               v_SelectSQL := v_SelectSQL || ' ';
       else
          v_SelectSQL := v_SelectSQL || ' AND NM.Type IN (' || v_Filter_NoteType  || ')';
       end if;     
    IF UPPER(v_Entity_ID) <> 'ALL'  then
          OPEN RestrictTermsheetVisibilityByC;
          FETCH RestrictTermsheetVisibilityByC INTO v_Setting_Name,v_Default_Value,v_Config_Value;
          WHILE RestrictTermsheetVisibilityByC%FOUND   LOOP
         --2) Convert comma separated ccy (CNY,HKD,USD) string to single quote ccy with comma separated Ccy ('CNY','HKD','USD') string
             if (UPPER(v_Setting_Name) = 'RESTRICT_TERMSHEET_VISIBILITY_BY_CCY')  then
                if v_Config_Value is not null  then
              SELECT COUNT(Id_1) INTO SWV_fnc_SplitString_Id_var0 FROM TABLE(fnc_SplitString(v_Config_Value,',')) ;
                   IF (SWV_fnc_SplitString_Id_var0 > 0)  then
                        --print 'Before Single  quote separated ccy : ' + '''' + @Config_Value + ''''
                      v_Seq_Id := 0;
                      OPEN Get_RestrictCCY_List_Cursor;
                      FETCH Get_RestrictCCY_List_Cursor
                      INTO v_CCY_ID,v_CCY_Data;
                      WHILE Get_RestrictCCY_List_Cursor%FOUND   LOOP
                         if v_Seq_Id = 0  then
                            v_CCY_List := '''' || v_CCY_Data || '''';
                         else
                            v_CCY_List := v_CCY_List || ',' || '''' || v_CCY_Data || '''';
                         end if;
                         v_Seq_Id := v_Seq_Id+1;
                         FETCH Get_RestrictCCY_List_Cursor INTO v_CCY_ID,v_CCY_Data;
                      END LOOP;
                      CLOSE Get_RestrictCCY_List_Cursor;
                        --print 'After Single quote ccy : ' + @CCY_List
                      v_SelectSQL := v_SelectSQL || ' AND nvl(NM.Denomination_Ccy,NM.Currency) NOT IN (' || v_CCY_List   || ')';
                   end if;
                end if;
             end if;
    --3) Convert comma separated template (ELN,BELN,BELN_B) string to single quote template code with comma separated template ('ELN','BELN','BELN_B') string
             if (UPPER(v_Setting_Name) = 'RESTRICT_TERMSHEET_VISIBILITY_BY_SUBSCHEME')  then
                if v_Config_Value is not null then
          SELECT COUNT(Id_1) INTO SWV_fnc_SplitString_Id_var1 FROM TABLE(fnc_SplitString(v_Config_Value,',')) ;
                   IF (SWV_fnc_SplitString_Id_var1 > 0)  then
                      v_Seq_Id := 0;
                      OPEN GetRestrictTemplateListCursor;
                      FETCH GetRestrictTemplateListCursor
                      INTO v_CCY_ID,v_CCY_Data;
                      WHILE GetRestrictTemplateListCursor%FOUND 
                      LOOP
                         if v_Seq_Id = 0  then
                            v_CCY_List := '''' || v_CCY_Data || '''';
                         else
                            v_CCY_List := v_CCY_List || ',' || '''' || v_CCY_Data || '''';
                         end if;
                         v_Seq_Id := v_Seq_Id+1;
                         FETCH GetRestrictTemplateListCursor INTO v_CCY_ID,v_CCY_Data;
                      END LOOP;
                      CLOSE GetRestrictTemplateListCursor;
                   --print 'After Single quote template code: ' + @CCY_List
                      v_SelectSQL := v_SelectSQL || ' AND TM.Template_Code NOT IN (' || v_CCY_List   || ')';
                   end if;
                end if;
             end if;
             FETCH RestrictTermsheetVisibilityByC INTO v_Setting_Name,v_Default_Value,v_Config_Value;
          END LOOP;
          CLOSE RestrictTermsheetVisibilityByC;
       end if;
      if  (v_Filter_Exchange = ' ' OR UPPER(v_Filter_Exchange) = 'ALL')  then
          v_SelectSQL := v_SelectSQL || ' ';
       else
          v_SelectSQL := v_SelectSQL || ' AND NM.Exchange IN (' || v_Filter_Exchange  || ')';
       end if;                         
         --SET @SelectSQL = @SelectSQL + ' --AND NM.Issuer = 4'
      if  (v_Filter_Issuer = ' ' OR UPPER(v_Filter_Issuer) = 'ALL') then
          v_SelectSQL := v_SelectSQL || ' ';
       else
          v_SelectSQL := v_SelectSQL || ' AND NM.Issuer IN (' || v_Filter_Issuer  || ')';
       end if;     
          if  v_Filter_Product_Category    = ' '  then
          v_SelectSQL := v_SelectSQL || ' ';
       else
          v_SelectSQL := v_SelectSQL || ' AND UPPER(NM.Note_Issuer_Type) IN (''' || v_Filter_Product_Category  || ''')';
       end if;          
       if UPPER(v_DateToFilter) = 'NA'  then
          v_SelectSQL := v_SelectSQL || ' ';
       else
          if UPPER(v_DateToFilter) = 'CLOSE_DATE'  then
             v_SelectSQL := v_SelectSQL || ' AND to_char( '|| v_DateToFilter || ') >= to_date(''' || v_Filter_ToDate ||  ''');
                             -- AND convert(smalldatetime,''' || v_Filter_ToDate || ''',106) ';
          else
             v_SelectSQL := v_SelectSQL || ' AND to_char(''' || v_DateToFilter || ''') BETWEEN to_date(''' || v_Filter_FromDate ||  ''') AND to_date(''' || v_Filter_ToDate || ''') ';
          end if;
       end if;
       v_SelectSQL := v_SelectSQL || ' Order by NM.Product_Name';
       SWV_VarStr := v_SelectSQL;
       DBMS_OUTPUT.PUT_LINE(SWV_VarStr);
       EXECUTE IMMEDIATE SWV_VarStr;
       IF SQLCODE <> 0  then
          GOTO ERROR_HANDLER;
       end if;
       IF SQL%rowcount > 0  then
          COMMIT;
          SWV_TRANCOUNT := SWV_TRANCOUNT -1;
       end if;     --Commit Transaction
       v_ErrorNumber := SQLCODE;
       RETURN;
       << ERROR_HANDLER >> v_ErrorNumber := SQLCODE;
       ROLLBACK;
       SWV_TRANCOUNT := 0;     --Rollback Transaction
       RETURN;
    END;Please suggest something. Thanks
    Edited by: BluShadow on 30-Nov-2011 11:00
    added {noformat}{noformat} tags for formatting of code.  Please read {message:id=9360002} to learn to do this yourself in future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Connecting to the database sample_adf_finiq_common.
    Select NM.Note_Master_Id, NM.Product_Name, NM.Template_ID, NM.Template_Sr_No, NM.Asset, NM.Exchange, NM.Type, NM.Currency , NM.Trade_Date, NM.Value_Date, NM.Valuation_Date, NM.Maturity_Date, NM.Tenor, NM.Strike_Price_Percentage, (case when (NM.PriceList_YN = 'Y') THEN NOP.Issue_Price Else NM.Customer_Price End) as Customer_Price, NM.Dealer_Price, (case when (NM.PriceList_YN = 'Y') THEN NOP.Customer_Yield Else NM.Customer_Yield End) as Customer_Yield, NOP.Dealer_Cost_PA as Internal_Cost , NM.Minimum_Issue_Size, NM.Maximum_Issue_Size, NM.Minimum_Tolerence_Amount, NM.Maximum_Tolerence_Amount, NM.Trigger_Amount_Warning, nvl(NM.PerUnit_Equivalent_Amount,1) as PerUnit_Equivalent_Amount, NM.Active_YN_Flag, NM.Verify_YN_Flag , NM.Tranche_YN_Flag, NM.Launch_Date, NM.Open_Date, NM.Close_Date, NM.PreHedged_YN, NM.Created_By, NM.Created_At, NM.Verified_At, NM.Verified_By, NM.ISIN, NM.Issuer , NM.Product_Catagory as Product_Category, NM.Note_Issuer_Type as Issuer_Category, NM.Series_No as Series_No, NM.Minimum_Investment_Amount , NOP.LastTimeWhenProductModified,(NOP.Nominal_Amount - nvl(ND.Unwind_Amount,0) ) as Current_Issue_Size, NOP.Filled_Status, NM.Counterparty as Internal_Counterparty ,T2.Confirmed_Amount, T2.Confirmed_Shares , T3.Live_Deals , BS.Net_Trade_Hedged, BS.Net_Trade_Outstanding, BS.Hedged_Nominal_BUY, BS.Hedged_Nominal_SELL, BS.Outstanding_Nominal_BUY, BS.Outstanding_Nominal_SELL , ( case When UPPER(NM.PreHedged_YN) = 'Y' Then 'Launched' When ((NM.Maturity_Date IS NOT NULL) AND to_date(NM.Maturity_Date) <= to_date(sysdate)) Then 'Matured' When (UPPER(NM.PreHedged_YN) = 'N' AND NM.Launch_Date IS NOT NULL) Then 'Launched' When (UPPER(NM.PreHedged_YN) = 'N' AND NM.Launch_Date IS NULL AND (T2.Confirmed_Amount >= NM.Minimum_Issue_Size) AND to_date(Close_Date) > to_date(sysdate) ) Then 'Ready To Launch' When (UPPER(NM.PreHedged_YN) = 'N' AND NM.Launch_Date IS NULL AND (T2.Confirmed_Amount >= (NM.Minimum_Issue_Size - NM.Minimum_Tolerence_Amount)) AND to_date(Close_Date)= to_date(sysdate) ) Then 'Ready To Launch' When (UPPER(NM.PreHedged_YN) = 'N' AND NM.Launch_Date IS NULL AND (T2.Confirmed_Amount >= (NM.Minimum_Issue_Size - NM.Minimum_Tolerence_Amount)) AND to_date(Close_Date)< to_date(sysdate) ) Then 'Ready To Launch' When (UPPER(NM.PreHedged_YN) = 'N' AND NM.Launch_Date IS NOT NULL AND (T2.Confirmed_Amount >= NM.Trigger_Amount_Warning )) Then 'Warning Trigger Reached' Else 'Not Ready' End)Launch_Status , NI.Issuer_Code , (nvl(NOP.Nominal_Amount,0) - nvl(T2.Confirmed_Amount,0)) as Unconfirmed_Amount, NM.Upfront as Upfront, case when UPPER(NM.PreHedged_YN) = 'Y' THEN 0 else (nvl(T2.Confirmed_Amount,0) - nvl(BS.Net_Trade_Hedged,0)) end as ReadyToHedge , NOP.Hard_Margin as Margin_Amount, NM.YearBasis as YearBasis, NM.Note_Product_Rating as Equity_Risk_Score, AD.Equity_Asset_Class , NM.Note_Product_Rating as Product_Rating, NOP.PO_ID, AD.LotSize as Lot_Size, NM.Max_Orders_Per_Product as MAX_Orders, NOP.Order_Count as Current_Order_Count, nvl(NM.Denomination_Ccy,NM.Currency) as Denomination_Ccy, NM.Note_Scheme_Type as Underlying_Type, NM.Note_Asset_Class as Asset_Class, NULL as Product_Created_YN, NULL as Product_Created_ID, ( (case when NM.Note_Order_Type = '' then N'Market' else NM.Note_Order_Type end ) ) as Order_Type, NOP.Spot_Price, NM.Note_Price_Link, NOP.Strike_Price, NVL(NM.C_Fixing_Frequency,'Atmaturity') as Fixing_Frequency, NM.Document_Uploaded_YN, NM.Document_Uploaded_At, NM.Document_Uploaded_By, NM.Document_File_Name, NM.Document_File_Extension, NM.Document_File_Path, NM.CutOff_Time, NM.Soft_Tenor, NM.NM_Sn_Code_All, NULL as Note_Price_Source, AD.LongName, NVL(NM.Pricelist_YN,'N') as Pricelist_YN, AD.AlternateIdentifierAlias as Underlying, NM.Note_Issuer_Date_Offset, NM.Counterparty as Note_Counter_Party, NULL as
    Note_Premium_PC , NI.Issuer_Name, IP.Issuer_Id, IP.Broad_Cash, IP.Odd_Cash, IP.Account_Note, IP.Rounding, IP.Decimal_Truncate, IP.Misc1 as Recidual_YN, NM.Note_Issuer_Type, NM.Target_Coupon, C_Fixing_Frequency as C_Fixing_Frequency, NM.Callable_Frequency as Callable_Frequency, NM.Strike_Price_Percentage as C_Note_Strike_PC, NM.NM_Airbag_PC as Airbag_PC, C_Note_Barrier_PC as C_Note_Barrier_PC, TM.Template_Name, 'Product' as Record_Type, NM.C_Settlement_Frequency, NM.Coupon_Frequency, NM.NM_Fixing_Source as Note_Fixing_Source, NM.Order_Entry_Type, (nvl(NM.Minimum_Issue_Size,0) - nvl(T2.Confirmed_Amount,0)) as Remaining_Launch_Amount, NM.C_Fixing_Start_Point, NM.C_Fixing_End_Point, NM.Order_Entry_Type, SC.Scheme_Alias, SC.Scheme_Name, CM.CM_ID, CM.CM_Name as Counterparty_Name, NM.NM_Other_Features as Other_Features, NM.Strike_Price_Percentage as Accrual_Strike, NM.NM_KnockIn as KnockIn, NM.NM_Airbag_Type, NM.NM_Put_strike as Put_Strike, NM.NM_Accrual_Strike,
    NM.NM_Counterparty_Upfront, NM.Price_Updated_YN as Prices_Updated_YN, AD.Code as Asset_Name,NULL as KO_FREQ_TYPE, NM.Daily_Accumalation_Equities, NM.MaxNoAcc_days, NM.Guaranteed_Days, NM.Leverage_ratio, NM.NORM_IF, NM.NORM_PAIR, NM.NORM_FXRate from Sample_ADF_finiq_Common.Note_Master NM Left Outer Join Sample_ADF_finiq_Common.Issuer_Master NI On NM.Issuer = (case when ISNUMERIC(NM.Issuer) = 0 then cast (NI.Issuer_Name as nvarchar2(25)) else cast(NI.Issuer_Id as nvarchar2(25)) end ) Left Outer Join Sample_ADF_finiq_Common.Note_Order_Product NOP On NOP.Note_Master_ID = NM.Note_Master_ID Left Outer Join Sample_ADF_finiq_Common.AssetDef AD On AD.Code = NM.Asset AND AD.TypeAsset = substr(NM.Note_Asset_Class,1,2) Left Outer Join Sample_ADF_finiq_Common.Issuer_Parameter IP On NM.Issuer = (case when ISNUMERIC(NM.Issuer) = 0 then cast (IP.Issuer_Name as nvarchar2(25)) else cast(IP.Issuer_Id as nvarchar2(25)) end ) Left Outer Join Sample_ADF_finiq_Common.Template_Master TM On TM.Template_Id = NM.Template_ID Left Outer Join Sample_ADF_finiq_Common.Scheme_Codes SC On SC.Scheme_Alias = NM.Type Left Outer Join Sample_ADF_finiq_Common.Counterparty_Master CM On CM.CM_ID = NM.Counterparty Left Outer Join      ( Select Note_master_ID, sum(Nominal_Amt) as Unwind_Amount from Sample_ADF_finiq_Common.Note_Deals where Prematurity_Date IS NOT NULL AND (UPPER(Deletion_Reason ) = 'PART REDEMPTION' or UPPER(Deletion_Reason ) = 'FULL REDEMPTION') Group by Note_master_ID ) ND On ND.Note_Master_ID = NM.Note_Master_ID AND NOP.Internal_Counterparty IN (1) LEFT OUTER JOIN ( select Note_Master_ID, sum(Nominal_Amount) As Confirmed_Amount, sum(No_Of_Shares) As Confirmed_Shares from Sample_ADF_finiq_Common.Note_Order_RM Where substr(UPPER(Order_Status_Flag),1,6) = 'YYYYYY' AND substr(substr(UPPER(Order_Status_Flag),1,7),-1,1) = 'N' group by Note_Master_ID ) T2 ON T2.Note_Master_ID = NM.Note_Master_ID LEFT OUTER JOIN ( Select ND.Note_Master_ID, sum(ND.Nominal_Amt) As Live_Deals from Sample_ADF_finiq_Common.Note_Deals ND where ND.Active_YNFlag = 'Y' group by Note_Master_ID ) T3 ON T3.Note_Master_ID = NM.Note_Master_ID LEFT OUTER JOIN ( SELECT NH_Note_Master_ID, (CAST(SUM(Hedged_Nominal_Buy) AS BINARY_FLOAT) -CAST(SUM(Hedged_Nominal_Sell) AS BINARY_FLOAT)) Net_Trade_Hedged, (CAST(SUM(Outstanding_Nominal_BUY) AS BINARY_FLOAT) -CAST(SUM(Outstanding_Nominal_SELL) AS BINARY_FLOAT)) Net_Trade_Outstanding, SUM(Hedged_Nominal_BUY) AS Hedged_Nominal_BUY, SUM(Hedged_Nominal_SELL) AS Hedged_Nominal_SELL, SUM(Outstanding_Nominal_BUY) AS Outstanding_Nominal_BUY, SUM(Outstanding_Nominal_SELL) As Outstanding_Nominal_SELL From ( SELECT NH_Note_Master_ID, SUM(NH_Hedged_Nominal) AS Hedged_Nominal_BUY, 0 AS Hedged_Nominal_SELL, SUM(NH_Outstanding_Nominal) AS Outstanding_Nominal_BUY, 0 AS Outstanding_Nominal_SELL FROM Sample_ADF_finiq_Common.Note_Hedge WHERE NH_Direction = 'BUY' GROUP BY NH_Note_Master_ID Union SELECT NH_Note_Master_ID, 0 AS Hedged_Nominal_BUY, SUM(NH_Hedged_Nominal) AS Hedged_Nominal_SELL, 0 AS Outstanding_Nominal_BUY, SUM(NH_Outstanding_Nominal) AS Outstanding_Nominal_SELL FROM Sample_ADF_finiq_Common.Note_Hedge WHERE NH_Direction = 'SELL' GROUP BY NH_Note_Master_ID ) GROUP BY NH_Note_Master_ID ) BS ON BS.NH_Note_Master_ID = NM.Note_Master_ID Where NM.Verify_YN_Flag = 'Y' AND NM.Active_YN_Flag = 'Y' AND UPPER(NM.Note_Issuer_Type) IN ('Internal') AND to_char('16-oct-11') BETWEEN to_date('15-oct-11') AND to_date('17-oct-11') Order by NM.Product_Name
    V_ERRORNUMBER = 0
    Process exited.
    Disconnecting from the database sample_adf_finiq_common.
    here v_errornumber=0 is the output when i run it in oracle sql developer.

  • Problem in dynamic selection in vendor balance report  tcode S_ALR_87012082

    Hello Friends,
    After upgrading from 4.7 to ecc 6.0 we are facing the below mentioned problem.
    In a Vendor Balances report, the document selection is not available in the dynamic selections and hence i am not able to select the business area to suit the requirement. We have only, vendor master and company code in the dynamic selections.
    Is there any customization tht needs to be set???
    Thanks,
    Sunny

    Hi Vas,
    I am not sure..... but you can view the details in "S_ALR_87012079", you need to chnage the layout....
    If the hint is useful… Say thanks by reward….
    Regards,
    Prabhu Rajesh

  • FBL5N Dynamic Selection

    Hi,
    When they use FBL5N to minimize the selection of data to the Branch level they need to open the Dynamic Selections area of the selection screen, scroll down (page down several times) in the left panel in a long list of available fields to find "Branch account", double click on the field to activate it in the right panel.  Once activated the Branch number can be entered in the screen to see only the documents related to the Branch.
    It would be quicker and more efficient if the Branch account field was defaulted to active in the Dynamic Selections area in FBL5N.  The default setting will save the scrolling and clicking part of getting the Branch data and make the system easier to use.
    The change will create a transportable Workbench request.
    Can anyone please explain how to bring this Branch account field in Dynamic selection as has been mentioned above.
    I will be grateful
    Warm Regards

    Hi,
    Please refer the below link for the process to add/remove any fields in the dynamic selection. If you want any field to selected by default on the right side of the screen then, in T.Code: SE36 for the Logical Database (refer the below link) you need to preselect the desired field.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e0039a-0d79-2c10-0aaf-9f6c062c0ffb?quicklink=index&overridelayout=true
    Regards,
    Kiron Kumar T.

  • How to add a field in dynamic selections

    HI,
    There is a requirement in which i need to add a field in existing program of dynamic selections.
    I have added a field in the screen.But I was not able to write the label and is not displaying.
    I ahve copied evrything from existing coding.but still.
    In the program ,Field groups are being used.
    I have inserted my field in that header and item of field groups.
    But i was not able to select the data based on this selection.
    i will attach my code here for reference.
    can anyone please help me how to use these filed symbols.
    If possible send me the document on Dynamic selections.
    the field i need to add is bkpf-bktxt
    TABLES:
      tcurx,
      lfa1,
      kna1,
      bhdgd,
      bkpf,
      bseg,
      bsega,
      b0sg,
      fimsg,
      sarkey,
      t001,
      vbset,
      sscrfields.
          Selektionsparameter                                           *
    begin_of_block 1.
    PARAMETERS:
      par_nbel       LIKE rfpdo-bpetnbel,  "Normale Belege
      par_vbel       LIKE rfpdo-epojvbel,  "Vorerfaßte Belege
      par_sbel       LIKE rfpdo-bpetsbel,  "Statistischen Belege
      par_mbel       LIKE rfpdo-epojmbel,  "Musterbelege
      par_dbel       LIKE rfpdo1-korbdbel. "Dauerbuchungsurbelege
    end_of_block 1.
    begin_of_block 2.
    PARAMETERS:
      par_summ       LIKE rfpdo1-allgsumm, "nur Summenausgabe
      par_hkto       LIKE rfpdo2-beljhkto, "Hauptbuch- statt Personenkonto
      par_altk       LIKE rfpdo1-allgaltk, "alternative Kontonummer
      par_lsep       LIKE rfpdo-allglsep,  "Listseparation
      par_mikf       LIKE rfpdo-allgmikf,  "Mikrofiche-Zeile
      par_line       LIKE rfpdo1-allgline. "Zusatztitel
    Eingaben für optische Archivierung
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:     arc     LIKE rfpdo1-allgarch.
    SELECTION-SCREEN COMMENT 3(29) text-103 FOR FIELD arc.
    SELECTION-SCREEN POSITION POS_LOW.
    PARAMETERS:     arc_msg1(10) MODIF ID arc.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION POS_LOW.
    PARAMETERS:     arc_msg2(10) MODIF ID arc.
    SELECTION-SCREEN END OF LINE.
    end_of_block 2.
    PARAMETERS:     arc_mem LIKE arc_params NO-DISPLAY.
          Felder und Feldleisten                                        *
    CONSTANTS:
      con_true       TYPE i                VALUE 1,
      con_false      TYPE i                VALUE 2,
      con_hash       TYPE i                VALUE 1,
      con_vendor     TYPE c                VALUE 'K',
      con_cust       TYPE c                VALUE 'D'.
    Global Data
    DATA: BEGIN OF hash_totals OCCURS 25,
             bukrs LIKE t001-bukrs,
             poper(7),
             dramt LIKE bseg-wrbtr,
             cramt LIKE bseg-wrbtr,
          END OF hash_totals.
    DATA:
      factor         TYPE i,
    Zähler
      cnt_bukrs(4)   TYPE p,               "Anzahl Buchungskreise
      cnt_max        LIKE sy-tfill,        "Maximum der CNT_Ti
      cnt_t0         LIKE sy-tfill,        "Anzahl Einträge in Ti
      cnt_t1         LIKE sy-tfill,
      cnt_t2         LIKE sy-tfill,
      cnt_t3         LIKE sy-tfill,
      cnt_t4         LIKE sy-tfill,
      cnt_t5         LIKE sy-tfill,
    Fehler
      err_altkt(1)   TYPE c,               "alt. Kontonummer nicht gefunden
    Flags
      flg_section    TYPE i,
      flg_vendr2     TYPE i,
      flg_vendr3     TYPE i,
      flg_color(1)   TYPE n,               "0 - intensified off
    Hilfsfelder
      hlp_belnr(10)  TYPE c,               "Anzeigefeld Belegnummer
      hlp_bstat      LIKE bkpf-bstat,      "Status vorerfaßter Belege
      hlp_buper(7)   TYPE c,               "Buchungsperiode mit '/'
      hlp_null(1)    TYPE p VALUE 0,       "Betrag Null
      hlp_sakan      LIKE ska1-sakan,      "Anzeigefeld Kontonummer
      hlp_wrshb(26)  TYPE c,               "FW-Betrag mit Währung in Klammer
      hlp_vnd_amt(43) TYPE c,
    Texte
      txt_line0(132) TYPE c,               "Überschriften
      txt_line1(132) TYPE c,
      txt_line2(132) TYPE c,
      txt_line(132)  TYPE c,               "Hilfstext
    Feldleisten
      BEGIN OF mikfi,                      "Information Mikrofiche-Zeile
        bstat        LIKE bkpf-bstat,
        bukrs        LIKE bkpf-bukrs,
        gjahr        LIKE bkpf-gjahr,
        belnr        LIKE bkpf-belnr,
      END OF mikfi.
          Interne Tabellen                                              *
    DATA:
    Belegkopfinformationen
      BEGIN OF t0 OCCURS 4,                "0 - allgemeine Angaben
        info(1)  TYPE n,                   "1 - vorerfaßter Beleg
      END OF t0,                           "2 - Referenz
                                                                "3 - Storno
                                           "4 - gelöschter vorerfaßter Beleg
                                           "5 - ersetzter vorerfaßter Beleg
                                           "6 - Ausgleichsbeleg
                                           "7 - zurückgenommener Ausgleich
    Personenkonteninformationen je Beleg
      BEGIN OF t1 OCCURS 10,
        koart    LIKE bseg-koart,          "Kontoart
        ktonr    LIKE bseg-kunnr,          "Kontonummer(Debitor/Kreditor)
        bschl    LIKE bseg-bschl,          "Buchungsschlüssel
        xnegp    LIKE bseg-xnegp,          "Negativbuchung
        umskz    LIKE bseg-umskz,          "Sonderumsatzkennzeichen
        zlspr    LIKE bseg-zlspr,          "Payment Block Key - CR 21709
        dmshb    LIKE bsega-dmshb,         "Soll-Haben Betrag in Hauswährung
        wrshb    LIKE bsega-dmshb,         "Betrag in Fremdwährung
        xfwae(1) TYPE c,                   "X - Fremdwährungsinformation
        name1    LIKE lfa1-name1,          "Customer/ Vendor Name
      END OF t1,
    Steuerinformationen je Beleg
      BEGIN OF t2 OCCURS 10,
        mwskz    LIKE bseg-mwskz,          "Mehrwertsteuerkennzeichen
        dmshb    LIKE bsega-dmshb,         "Soll-Haben Betrag in Hauswährung
      END OF t2,
    Sachkonteninformationen je Beleg
      BEGIN OF t3 OCCURS 20,
        mwskz    LIKE bseg-mwskz,          "Mehrwertsteuerkennzeichen
        bschl    LIKE bseg-bschl,          "Buchungsschlüssel
        xnegp    LIKE bseg-xnegp,          "Negativbuchung
        koart    LIKE bseg-koart,          "Kontoart
        hkont    LIKE bseg-hkont,          "Hauptbuchkonto
        dmshb    LIKE bsega-dmshb,         "Soll-Haben Betrag in Hauswährung
        kostl    LIKE bseg-kostl,          "Cost Center
        prctr    LIKE bseg-prctr,          "Profit Center
      END OF t3,
    Sonderhauptbuchbeträge für Debitoren (nur Ausgabe)
      BEGIN OF t4 OCCURS 5,
        umskz         LIKE bseg-umskz,     "Sonderumsatzkennzeichen
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
      END OF t4,
    Sonderhauptbuchbeträge für Kreditoren (nur Ausgabe)
      BEGIN OF t5 OCCURS 5,
        umskz         LIKE bseg-umskz,     "Sonderumsatzkennzeichen
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
      END OF t5,
    Summeninformationen je Buchungskreis
      BEGIN OF tbukrs OCCURS 20,
        bstat         LIKE bkpf-bstat,     "Belegstatus
        bukrs         LIKE bkpf-bukrs,     "Buchungskreis
    START OF CHANGE FOR CR63816 by OS0794 on 01/29/2008
        bktxt         LIKE bkpf-bktxt,
    END OF CHANGE FOR CR63816 by OS0794 on 01/29/2008
        gjahr         LIKE bkpf-gjahr,     "Buchungsjahr
        monat         LIKE bkpf-monat,     "Buchungsmonat
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
        waers         LIKE t001-waers,     "Währungsschlüssel (nur Ausgabe)
      END OF tbukrs,
    Sonderhauptbuchinformationen je Buchungskreis
      BEGIN OF tbukrs_u OCCURS 20,
        bstat         LIKE bkpf-bstat,     "Belegstatus
        bukrs         LIKE bkpf-bukrs,     "Buchungskreis
    START OF CHANGE FOR CR63816 by OS0794 on 01/29/2008
        bktxt         LIKE bkpf-bktxt,
    END OF CHANGE FOR CR63816 by OS0794 on 01/29/2008
        gjahr         LIKE bkpf-gjahr,     "Buchungsjahr
        monat         LIKE bkpf-monat,     "Buchungsmonat
        koart         LIKE bseg-koart,     "Kontoart
        umskz         LIKE bseg-umskz,     "Sonderumsatzkennzeichen
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
        waers         LIKE t001-waers,     "Währungsschlüssel (nur Ausgabe)
      END OF tbukrs_u,
    Summeninformationen je Hauswährung
      BEGIN OF twaers OCCURS 10,
        bstat         LIKE bkpf-bstat,     "Belegstatus
        waers         LIKE t001-waers,     "Hauswährungsschlüssel
        gjahr         LIKE bkpf-gjahr,     "Buchungsjahr
        monat         LIKE bkpf-monat,     "Buchungsmonat
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
      END OF twaers,
    Sonderhauptbuchinformationen je Hauswährung
      BEGIN OF twaers_u OCCURS 20,
        bstat         LIKE bkpf-bstat,     "Belegstatus
        waers         LIKE t001-waers,     "Währungsschlüssel
        gjahr         LIKE bkpf-gjahr,     "Buchungsjahr
        monat         LIKE bkpf-monat,     "Buchungsmonat
        koart         LIKE bseg-koart,     "Kontoart
        umskz         LIKE bseg-umskz,     "Sonderumsatzkennzeichen
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
      END OF twaers_u,
    Fehlerprotokoll im Batch
      BEGIN OF tfimsg OCCURS 10.
            INCLUDE STRUCTURE fimsg.
    DATA END OF tfimsg.
          Strukturen für optische Archivierung                          *
    DATA BEGIN OF info OCCURS 10.
            INCLUDE STRUCTURE bhinf.
    DATA END OF info.
    DATA:
      arc_save LIKE arc_params,
      arc_valid.
          Feldgruppen                                                   *
    FIELD-GROUPS: header, daten.
    INSERT:
      bkpf-bukrs                           "Buchungskreis
      bkpf-bktxt                           "Change by OS0794
      bkpf-bstat                           "Belegstatus
      bkpf-gjahr                           "Geschäftsjahr
      bkpf-belnr                           "Belegnummer
      bseg-buzei                           "Buchungszeile
    INTO header.
    INSERT
      bkpf-blart                           "Belegart
      bkpf-bktxt                           "Change by OS0794
      bkpf-budat                           "Buchungsdatum
      bkpf-stblg                           "Stornobelegnummer
      bkpf-waers                           "Währungsschlüssel
      bkpf-xblnr                           "Referenzangabe
      bseg-bschl                           "Buchungsschlüssel
      bseg-xnegp                           "Negativbuchung
      bseg-zlspr                           "Payment Block Key - CR 21709
      bseg-hkont                           "Hauptbuchkonto
      bseg-koart                           "Kontoart
      bseg-kunnr                           "Debitornummer
      bseg-lifnr                           "Kreditornummer
      bseg-mwart                           "Mehrwertsteuerart (A oder V)
      bseg-mwskz                           "Mehrwertsteuerkennzeichen
      bseg-umskz                           "Sonderhauptbuch-Kennzeichen
      bsega-dmshb                          "S/H-Betrag in Hauswährung
      bsega-mdshb                          "Umsatzsteuerbetrag in Hauswährg
      bsega-wrshb                          "S/H-Betrag in Fremdwährung
      hlp_bstat                            "Status vorerfaßter Belege bzw.
      bseg-kostl
      bseg-prctr
      bkpf-monat
    INTO daten.                            "Status von Belegen ohne Zeilen
          Vorschlagswerte                                               *
    INITIALIZATION.
      get_frame_title: 1,2.
      par_nbel = 'X'.
      par_sbel = space.
      par_mbel = space.
      par_dbel = space.
      par_vbel = 'X'.
          Archivinformationen nur fuer Ausgabe                          *
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group1 = 'ARC'.
          screen-input = '0'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
          Prüfung und Korrektur der eingegebenen Daten                  *
    AT SELECTION-SCREEN ON arc.
      IF arc <> ' ' AND arc_mem(20) = space.
        CALL FUNCTION 'GET_ARCHIVE_PARAMETERS'
          EXPORTING
            in_parameters  = arc_save
            printer        = '    '
          IMPORTING
            out_parameters = arc_mem
            valid          = arc_valid
          EXCEPTIONS
            OTHERS         = 04.
        IF arc_valid <> 'X' OR arc_mem = space.
          CLEAR arc_mem.
          MESSAGE e999 WITH text-102.
        ENDIF.
        arc_msg1 = arc_mem(10).
        arc_msg2 = arc_mem+10(10).
      ENDIF.
      IF arc = ' '.
        CLEAR arc_mem.
        arc_msg1 = arc_msg2 = space.
      ENDIF.
      arc_save = arc_mem.
    AT SELECTION-SCREEN ON arc_msg1.
      arc_msg1 = arc_mem(10).
    AT SELECTION-SCREEN ON arc_msg2.
      arc_msg2 = arc_mem+10(10).
    AT SELECTION-SCREEN.
      IF par_nbel EQ space AND
         par_mbel EQ space AND
         par_dbel EQ space AND
         par_sbel EQ space AND
         par_vbel EQ space.
        SET CURSOR FIELD 'PAR_NBEL'.
        MESSAGE e111.
      ENDIF.
    optische Archivierung
      IF arc <> ' ' AND par_mikf <> ' '.
        CLEAR arc_mem.
        MESSAGE e999 WITH text-100.
      ENDIF.
      IF arc <> ' ' AND par_lsep <> ' '.
        CLEAR arc_mem.
        MESSAGE e999 WITH text-101.
      ENDIF.
      IF arc = 'X' AND sscrfields-ucomm = 'PRIN'.
        sscrfields-ucomm = 'ONLI'.
        sy-pdest = 'LP01'.                 "wegen Abfrage in Batch-Heading
      ENDIF.
          Vorbelegungen                                                 *
    START-OF-SELECTION.
      bhdgd-lines = sy-linsz.
      bhdgd-repid = sy-repid.
      bhdgd-uname = sy-uname.
      bhdgd-separ = par_lsep.
      bhdgd-domai = 'BUKRS'.
      IF arc = 'X'.
        bhdgd-miffl = 'A'.
      ENDIF.
      IF par_mikf = 'X'.
        bhdgd-miffl = 'X'.
      ENDIF.
    Initialisierung für optisches Archiv
      PERFORM open_archive(rsbtchh0) USING arc_mem.
      info-name = 'BKPF-BSTAT'. info-len = space. APPEND info.
      info-name = 'BKPF-BUKRS'. info-len = space. APPEND info.
      info-name = 'BSEG-GJAHR'. info-len = space. APPEND info.
      info-name = 'BKPF-BELNR'. info-len = space. APPEND info.
      info-name = 'BKPF-BKTXT'. info-len = space. APPEND info.
      PERFORM start_archive(rsbtchh0) TABLES info.
      b0sg-xstan = par_nbel.
      b0sg-xstam = par_mbel.
      b0sg-xstad = par_dbel.
      b0sg-xstas = par_sbel.
      b0sg-xstaa = 'X'.
      IF par_vbel EQ 'X'.
        b0sg-xstav = 'Z'.
      ENDIF.
          Selektion                                                     *
    GET bkpf FIELDS blart bstat budat monat stblg waers xblnr bktxt.
      CLEAR hlp_bstat.
      IF 'ABVWZ' CA bkpf-bstat.
        hlp_bstat = bkpf-bstat.
        CLEAR bkpf-bstat.
        IF 'ABWZ' CA hlp_bstat.
          CLEAR: bseg, bsega.
          IF par_summ EQ space.
            EXTRACT daten.
          ENDIF.
          PERFORM summe_merken.
        ENDIF.
      ENDIF.
    GET bseg.
      IF par_summ EQ space.
        EXTRACT daten.
      ENDIF.
      PERFORM summe_merken.
    GET bkpf LATE.
      PERFORM vorerfasste_steuer_merken.
          Seitenkopf                                                    *
    TOP-OF-PAGE.
      PERFORM batch-heading(rsbtchh0).
      ULINE.
      IF flg_section <> con_hash.
        FORMAT COLOR 1 INTENSIFIED OFF.
        WRITE    / txt_line0.
        ULINE.
        FORMAT COLOR 1 INTENSIFIED.
        WRITE:   / txt_line1,
                 / txt_line2.
      ELSE.
        FORMAT COLOR 1 INTENSIFIED OFF.
        WRITE: / sy-vline NO-GAP,
                 'Hash Totals'(205),
           132   sy-vline.
        ULINE.
        FORMAT COLOR 1 INTENSIFIED.
        WRITE:   /     sy-vline NO-GAP,
                  (10) 'CoCd'(200),
                  (07) 'Period'(201),
                       sy-vline,
                  (16) 'Debit Amount'(202),
                  (16) 'Credit Amount'(203),
                       sy-vline,
                  (16) 'Total'(204).
      ENDIF.
      ULINE.
          Sortieren der Daten                                           *
    END-OF-SELECTION.
      DESCRIBE TABLE tbukrs LINES sy-tfill.
      IF sy-tfill EQ 0.
        CALL FUNCTION 'POPUP_NO_LIST'.
      ENDIF.
      SORT.
      SORT tbukrs.
          Belegjournal                                                  *
      LOOP.
    *-- Neuer Buchungskreis -
        AT NEW bkpf-bukrs.
          SELECT SINGLE * FROM t001 WHERE bukrs EQ bkpf-bukrs.
          IF sy-subrc NE 0.
            IF sy-batch EQ space.
              MESSAGE a101 WITH bkpf-bukrs.
            ELSE.
              MESSAGE s101 WITH bkpf-bukrs.
              STOP.
            ENDIF.
          ENDIF.
          bhdgd-bukrs = bkpf-bukrs.
          bhdgd-werte = bkpf-bukrs.
          PERFORM new-section(rsbtchh0).
          PERFORM titel_fuellen USING '5'.
        ENDAT.
    *-- Neuer Belegstatus -
        AT NEW bkpf-bstat.
          PERFORM new_page USING bkpf-bstat.
          flg_color = 1.
        ENDAT.
    *-- Neue Belegnummer -
        AT NEW bkpf-belnr.
          REFRESH: t0, t1, t2, t3.
          PERFORM belegkopf_merken.
          mikfi-bstat = bkpf-bstat.
          mikfi-bukrs = bkpf-bukrs.
          mikfi-gjahr = bkpf-gjahr.
          mikfi-belnr = bkpf-belnr.
          bhdgd-grpin = mikfi.
        ENDAT.
    *-- Belegzeile -
        PERFORM belegzeile_merken.
    *-- Ende einer Belegnummer -
        AT END OF bkpf-belnr.
          PERFORM beleg_schreiben.
          ULINE.
        ENDAT.
    *-- Ende eines Buchungskreises -
        AT END OF bkpf-bukrs.
          PERFORM titel_fuellen USING '4'.
          PERFORM buchungskreis_schreiben USING bkpf-bukrs.
        ENDAT.
      ENDLOOP.
          Summenblätter                                                 *
      bhdgd-bukrs = '    '.
      bhdgd-werte = '    '.
      PERFORM new-section(rsbtchh0).
      PERFORM titel_fuellen USING '4'.
      PERFORM buchungskreis_schreiben USING '    '.
      PERFORM hauswaehrung_schreiben.
          Print Hash Totals                                             *
      flg_section = con_hash.
      NEW-PAGE.
      PERFORM prt_hash TABLES hash_totals.
          Fehlerprotokoll                                               *
      CALL FUNCTION 'FI_MESSAGE_CHECK'
        EXCEPTIONS
          no_message = 4.
      IF sy-subrc = 0.
        IF sy-batch EQ space.
          PERFORM titel_fuellen USING '6'.
          NEW-PAGE.
          FORMAT COLOR 6 INTENSIFIED.
          CALL FUNCTION 'FI_MESSAGE_SORT'.
          CALL FUNCTION 'FI_MESSAGE_PRINT'
            EXPORTING
              i_xskip = 'X'.
        ELSE.
          CALL FUNCTION 'FI_MESSAGE_GET'
            TABLES
              t_fimsg = tfimsg.
          LOOP AT tfimsg.
            MESSAGE ID tfimsg-msgid TYPE tfimsg-msgty NUMBER tfimsg-msgno
              WITH tfimsg-msgv1 tfimsg-msgv2 tfimsg-msgv3 tfimsg-msgv4.
          ENDLOOP.
        ENDIF.
      ENDIF.
           U N T E R P R O G R A M M E                                  *
                0. TITEL_FUELLEN                                        *
                1. NEW_PAGE                                             *
                2. SUMME_MERKEN                                         *
                3. VORERFASSTE_STEUER_MERKEN                            *
                4. BELEGKOPF_MERKEN                                     *
                5. BELEGZEILE_MERKEN                                    *
                6. BELEG_SCHREIBEN                                      *
                7. BUCHUNGSKREIS_SCHREIBEN                              *
                8. HAUSWAEHRUNG_SCHREIBEN                               *
                9. SUMMENZEILE_SCHREIBEN                                *
               10. KONTONUMMER                                          *
    0.   FORM TITEL_FUELLEN                                            *
          Ersetzt das Global &CCCU durch die Buchungskreiswährung       *
          F00_TEXT ist 4, 5 oder 6, je nach Gruppe der Textelemente     *
    FORM titel_fuellen USING f00_text.
      DATA:
        BEGIN OF txt_502,
         T1(49) TYPE C, "CR 21709
         W1(23) TYPE C, "CR 21709
          t1(50) TYPE c,                                        "CR 21709
          w1(22) TYPE c,                                        "CR 21709
          t2(6)  TYPE c,
          w2(15) TYPE c,
          t3(21) TYPE c,
          w3(16) TYPE c,
          t4(2)  TYPE c,
        END OF txt_502.
      CASE f00_text.                       "Textelemente
        WHEN '4'.                          "- für die Summenliste
          txt_line0 = text-400.
          txt_line1 = text-401.
          txt_line2 = text-402.
        WHEN '5'.                          "- für die Einzelpostenliste
          txt_line0 = text-500.
          txt_line1 = text-501.
          txt_line2 = text-502.
          IF par_hkto EQ 'X'.
            txt_line1+33(10) = text-505.
            txt_line2+33(10) = text-506.
          ENDIF.
          txt_502   = txt_line2.
          REPLACE '&CCCU' WITH t001-waers INTO:
            txt_502-w1, txt_502-w2, txt_502-w3.
          CONDENSE:
            txt_502-w1, txt_502-w2, txt_502-w3.
          WRITE:
            txt_502-w1 TO txt_502-w1 RIGHT-JUSTIFIED,
            txt_502-w2 TO txt_502-w2 RIGHT-JUSTIFIED,
            txt_502-w3 TO txt_502-w3 RIGHT-JUSTIFIED.
          txt_line2 = txt_502.
        WHEN '6'.                          "- für die Fehlerliste
          txt_line0 = text-600.
          txt_line1 = text-601.
          txt_line2 = space.
        WHEN OTHERS.                       "- initialisieren
          txt_line0 = space.
          txt_line1 = space.
          txt_line2 = space.
      ENDCASE.
    ENDFORM.                    "TITEL_FUELLEN
    1.   FORM NEW_PAGE                                                 *
          Initialisierungen für BATCH-HEADING Routine                   *
          F01_BSTAT steuert den Aufbau des Reporttitels                 *
    FORM new_page USING f01_bstat.
      CASE f01_bstat.                      "Reporttitel
        WHEN 'D'.                          "- für Dauerbuchungsurbelege
          bhdgd-line1 = text-001.
        WHEN 'M'.                          "- für Musterbelege
          bhdgd-line1 = text-002.
        WHEN 'S'.                          "- für statistische Belege
          bhdgd-line1 = text-003.
        WHEN OTHERS.                       "- für normale/vorerfaßte Belege
          bhdgd-line1 = sy-title.
      ENDCASE.
      bhdgd-line2 = par_line.
      bhdgd-inifl = 0.
      NEW-PAGE.
    ENDFORM.                    "NEW_PAGE
    2.   FORM SUMME_MERKEN                                             *
          Merken der Summeninformation                                  *
    FORM summe_merken.
      CLEAR tbukrs.
      tbukrs-bstat = bkpf-bstat.
      tbukrs-bukrs = bkpf-bukrs.
      tbukrs-bktxt = bkpf-bktxt.
      tbukrs-gjahr = bkpf-gjahr.
      tbukrs-monat = bkpf-monat.
      tbukrs-dmsol = bsega-dmsol.
      tbukrs-dmhab = bsega-dmhab.
      IF 'DK' CA bseg-koart.
        MOVE-CORRESPONDING tbukrs TO tbukrs_u.
        tbukrs_u-koart   = bseg-koart.
        tbukrs_u-umskz   = bseg-umskz.
        tbukrs_u-dmsol   = bsega-dmsol.
        tbukrs_u-dmhab   = bsega-dmhab.
        COLLECT tbukrs_u.
        tbukrs_u-monat   = 0.              "Summe für das Geschäftsjahr
        COLLECT tbukrs_u.
      ENDIF.
      COLLECT tbukrs.
    ENDFORM.                    "SUMME_MERKEN
    3.   FORM VORERFASSTE_STEUER_MERKEN                                *
          Nachlesen der Steuerzeilen vorerfaßter Belege                 *
          Gefüllt wird TBUKRS und der Extrakt                           *
    FORM vorerfasste_steuer_merken.
      CHECK hlp_bstat EQ 'V'.
      SELECT * FROM vbset
        WHERE ausbk EQ bkpf-bukrs
          AND belnr EQ bkpf-belnr
          AND gjahr EQ bkpf-gjahr.
        CHECK vbset-hwste NE 0.
        CLEAR: bseg, bsega.
        bseg-koart    = 'S'.
        bseg-mwart    = 'V'.               "oder 'A', nur zum Füllen von T2
        bseg-mwskz    = vbset-mwskz.
        IF vbset-shkzg EQ 'S'.
          bsega-dmsol = vbset-hwste.
          bsega-dmshb = vbset-hwste.
        ELSE.
          bsega-dmhab = vbset-hwste.
          bsega-dmshb = - vbset-hwste.
        ENDIF.
        IF par_summ EQ space.
          EXTRACT daten.
        ENDIF.
        PERFORM summe_merken.
      ENDSELECT.
    ENDFORM.                    "VORERFASSTE_STEUER_MERKEN
    4.   FORM BELEGKOPF_MERKEN                                         *
          Je Beleg werden gefüllt:                                      *
          T0 - Informationsflag                                         *
    FORM belegkopf_merken.
      t0-info = 0.                         "Belegkopf
      APPEND t0.
      CASE hlp_bstat.
        WHEN 'A'.
          t0-info = 6.                     "Ausgleichsbeleg
          APPEND t0.
        WHEN 'B'.
          t0-info = 7.                     "zurückgen. Ausgleichsbeleg
          APPEND t0.
        WHEN 'V'.
          t0-info = 1.                     "vorerfaßter Beleg
          APPEND t0.
        WHEN 'W'.
          t0-info = 5.                     "ersetzter vorerfaßter Beleg
          APPEND t0.
        WHEN 'Z'.
          t0-info = 4.                     "gelöschter vorerfaßter Beleg
          APPEND t0.
      ENDCASE.
      IF bkpf-xblnr NE space AND hlp_bstat NA 'BWZ'.
        t0-info = 2.                       "Referenz
        APPEND t0.
      ENDIF.
      IF bkpf-stblg NE space.
        t0-info = 3.                       "Storno
        APPEND t0.
      ENDIF.
      SORT t0.
    ENDFORM.                    "BELEGKOPF_MERKEN
    5.   FORM BELEGZEILE_MERKEN                                        *
          Je Beleg werden gefüllt:                                      *
          T1 - Personenkonteninformation                                *
          T2 - Steuerinformation (nicht bei vorerfaßten Belegen)        *
          T3 - Sachkonteninformation                                    *
    FORM belegzeile_merken.
    Vendors/ Customers
      IF bseg-koart CA 'DK'.
        t1-koart   = bseg-koart.
        IF par_hkto EQ 'X'.
          t1-ktonr = bseg-hkont.
        ELSEIF bseg-koart EQ 'K'.
          t1-ktonr = bseg-lifnr.
        ELSE.
          t1-ktonr = bseg-kunnr.
        ENDIF.
        t1-bschl   = bseg-bschl.
        t1-umskz   = bseg-umskz.
        t1-xnegp   = bseg-xnegp.
        t1-zlspr   = bseg-zlspr.                                "CR 21709
        t1-dmshb   = bsega-dmshb.
        t1-wrshb   = bsega-wrshb.
        t1-xfwae   = space.
        APPEND t1.
      Read the vendor description.
        IF bseg-koart = con_vendor.
          flg_vendr2 = con_true.
          flg_vendr3 = con_true.
          CLEAR lfa1-name1.
          SELECT SINGLE name1
          INTO   lfa1-name1
          FROM   lfa1
          WHERE  lifnr = bseg-lifnr.
        ELSEIF bseg-koart = con_cust.
          CLEAR kna1-name1.
          SELECT SINGLE name1
          INTO   kna1-name1
          FROM   kna1
          WHERE  kunnr = bseg-kunnr.
        ENDIF.
        IF bkpf-waers EQ t001-waers.
          CLEAR t1.
        ENDIF.
        t1-xfwae = 'X'.
        t1-name1 = lfa1-name1.
        IF t1-name1 IS INITIAL.
          t1-name1 = kna1-name1.
        ENDIF.
        APPEND t1.
        CLEAR:
           kna1-name1,
           lfa1-name1.
        CLEAR t1.
      Save the hash total amounts
        CLEAR tcurx-currdec.
        SELECT SINGLE currdec
        INTO   tcurx-currdec
        FROM   tcurx
        WHERE  currkey = bkpf-waers.
        IF tcurx-currdec = 1.
          factor = 10.
        ELSE.
          factor = 100.
        ENDIF.
        CLEAR hash_totals.
        hash_totals-bukrs = bkpf-bukrs.
        CONCATENATE bkpf-monat '/' bkpf-gjahr INTO hash_totals-poper.
        IF bsega-wrshb < 0.
          hash_totals-cramt = bsega-wrshb * factor.
        ELSE.
          hash_totals-dramt = bsega-wrshb * factor.
        ENDIF.
        COLLECT hash_totals.
    Tax accounts
      ELSEIF bseg-mwart CA 'AV'.
        t2-mwskz   = bseg-mwskz.
        t2-dmshb   = bsega-dmshb.
        APPEND t2.
        IF flg_vendr2 = con_true.
          flg_vendr2 = con_false.
          CLEAR t2.
          APPEND t2.
        ENDIF.
    GL Accounts
      ELSEIF hlp_bstat NA 'ABWZ'.
        t3-mwskz   = bseg-mwskz.
        t3-bschl   = bseg-bschl.
        t3-xnegp   = bseg-xnegp.
        t3-koart   = bseg-koart.
        t3-hkont   = bseg-hkont.
        t3-dmshb   = bsega-dmshb.
        APPEND t3.
        IF flg_vendr3 = con_true
        OR NOT bseg-kostl IS INITIAL
        OR NOT bseg-prctr IS INITIAL.
          flg_vendr3 = con_false.
          CLEAR t3.
          t3-kostl = bseg-kostl.
          t3-prctr = bseg-prctr.
          APPEND t3.
          CLEAR t3.
        ENDIF.
      ENDIF.
    ENDFORM.                    "BELEGZEILE_MERKEN
    6.   FORM BELEG_SCHREIBEN                                          *
          Ausgabe der Belginformationen                                 *
    FORM beleg_schreiben.
      DATA:
         len TYPE i.
    Berechnung der benötigten Zeilen pro Beleg
      DESCRIBE TABLE:
        t0 LINES cnt_t0,
        t1 LINES cnt_t1,
        t2 LINES cnt_t2,
        t3 LINES cnt_t3.
      cnt_max = cnt_t0.
      IF cnt_max LT cnt_t1.
        cnt_max = cnt_t1.
      ENDIF.
      IF cnt_max LT cnt_t2.
        cnt_max = cnt_t2.
      ENDIF.
      IF cnt_max LT cnt_t3.
        cnt_max = cnt_t3.
      ENDIF.
      ADD 1 TO cnt_max.
      IF cnt_max LE 10.
        RESERVE cnt_max LINES.
      ELSE.
        RESERVE 5 LINES.
      ENDIF.
      SUBTRACT 1 FROM cnt_max.
    Farbe setzen
      IF flg_color EQ 0.
        FORMAT COLOR 2 INTENSIFIED OFF.
        flg_color = 1.
      ELSE.
        FORMAT COLOR 2 INTENSIFIED.
        flg_color = 0.
      ENDIF.
    Index fuer optische Archivierung
      PERFORM new-group(rsbtchh0).
      DO cnt_max TIMES.
      Belegkopfinformationen
        WRITE     /1 sy-vline NO-GAP.
        IF sy-index LE cnt_t0.
          READ TABLE t0 INDEX sy-index.
          CASE t0-info.
            WHEN 0.                        "Belegkopf
              hlp_belnr = bkpf-belnr.      "Belegnr. mit führenden Nullen
            Referenz auf Originalbeleg
              PERFORM start_doc_reference(rsbtchh0)
                USING bkpf-bukrs bkpf-belnr bkpf-gjahr bkpf-bktxt. " change*
              WRITE:
                     bkpf-bukrs,
                     hlp_belnr,
                     bkpf-blart,
                     bkpf-budat DD/MM/YYYY.
            Ende der Referenz auf Originalbeleg
              PERFORM end_doc_reference(rsbtchh0).
            WHEN 1.                        "Vorerfaßter Beleg
              WRITE:
                (29) text-507.
            WHEN 2.                        "Referenz
              WRITE:
                (12) text-503,
                     bkpf-xblnr.
            WHEN 3.                        "Storno
              WRITE:
                (12) text-504,
                     bkpf-stblg.
            WHEN 4.                        "Gelöschter vorerfaßter Beleg
              WRITE:
                (29) text-507,
                (40) text-508.
            WHEN 5.                        "Ersetzter vorerfaßter Beleg
              txt_line = text-509.
              REPLACE:
                '&BLN' WITH bkpf-xblnr(10) INTO txt_line,
                '&GJR' WITH bkpf-xblnr+10  INTO txt_line.
              WRITE:
                (29) text-507,
                (40) txt_line.
            WHEN 6.                        "Ausgleichsbeleg
              WRITE:                       "
                (29) text-510.             "
            WHEN 7.                        "zurückgen. Ausgleichsbeleg
              WRITE:                       "
                (29) text-511.             "
          ENDCASE.
        ENDIF.
      Personenkonteninformationen
      Subledger Account Information
        WRITE  31(1) sy-vline NO-GAP.
      Internal tables T0 - T5 hold data for each section.
        IF sy-index LE cnt_t1.
          READ TABLE t1 INDEX sy-index.
          IF par_hkto EQ 'X'.
            PERFORM kontonummer USING t1-ktonr hlp_sakan.
          ELSE.
            hlp_sakan = t1-ktonr.
          ENDIF.
          IF t1-xfwae EQ space.
            IF t1-xnegp = 'X'.
              t1-xnegp = '-'.
            ENDIF.
          Write the vendor number.
            WRITE:   t1-koart,
                     hlp_sakan,
                     t1-bschl NO-GAP.
            IF t1-umskz IS INITIAL.
              WRITE:    t1-xnegp NO-GAP,
                        t1-umskz.
            ELSE.
              WRITE:    t1-umskz NO-GAP,
                        t1-xnegp.
            ENDIF.
            WRITE: t1-zlspr. "CR 21709 / 23588
            WRITE: (22) t1-dmshb CURRENCY t001-waers.
          ELSE.
          Write the document currency, amount and the
          vendor/ customer

    Hi,
    Please see documentation of enhancement MM06E005 (transaction SMOD).          
    Userexit EXIT_SAPMM06E_016 is a component of enhancement MM06E005.            
    With that enhancement, you can                                                
      -   Maintain/supply your own customer fields                                
      -   Update your own customer-specific tables                                
    You cannot:                                                                   
      -   Change standard fields                                                  
      -   Change data that depends on the document header in the items            
      -   Change data that depends on an item in the document header                                                                               
    Please have a look at Business Add-In (BAdI) ME_PROCESS_PO_CUST.              
    Regards,
    Edit

  • Is it possible to display only dynamically selected fields in the out put?

    Is it possible to display only dynamically selected fields in the out put? i need to display set of columns in the selection criteria, but in the output i have display only input given fields. because i need to convert it into .csv file. So i have to display selected fields from internal table. In oracle they are using"execute immediate". is there any equivalent in SAP?
    thanks in advance.

    Hi Remya,
    Are you talking about dynamic programming in ABAP ?
    If yes, there are concepts like RTTS which facilitates it.
    Yes, the select query also supports dynamic selection of fields. ( Please care about ( ) in dynamic sql ).
    Do more research on Field Symbols and statements like ASSIGN COMPONENT OF.
    Regards,
    Philip.

  • Need to know the column names in my dynamic select clause

    Dear All,
    Please go through the following code. While executing the following code i am getting an error saying that dbms_sql.describe_columns overflow, col_name_len=35. Use describe_columns2.
    Please guide me how to proceed further. Or please help me, how can i get the column names when i issue a dynamic select clause.
    DECLARE
    CUR INTEGER;
    COL_CNT INTEGER ;
    A INTEGER;
    SEL_CLAUSE VARCHAR2(2000);
    DESC_T DBMS_SQL.DESC_TAB;
    REC DBMS_SQL.DESC_REC;
    b number;
    BEGIN
    SEL_CLAUSE := 'SELECT 1,2,DECODE(1,1,''ONE'',2,''TWO'',3,''THREE'') FROM DUAL';
    --'SELECT ROWID,PARA_SUB_CODE,DECODE('||''''||'ENG'||''''||','||''''||'ENG'||''''||',PARA_NAME,PARA_BL_NAME),NULL,NULL FROM PCOM_APP_PARAMETER';
    --'SELECT 1,2,DECODE(1,1,''ONE'',2,''TWO'') FROM DUAL';
    DBMS_OUTPUT.PUT_LINE( SEL_CLAUSE );
    CUR := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(CUR,SEL_CLAUSE,DBMS_SQL.NATIVE);
    DBMS_SQL.DESCRIBE_COLUMNS(CUR,COL_CNT,DESC_T);
    B := desc_t.first;
    FOR J IN 1..COL_CNT
    LOOP
    DBMS_OUTPUT.PUT_LINE('J := '||J || ' COL CNT ' || COL_CNT);
    END LOOP;
    BEGIN
    A := DBMS_SQL.EXECUTE(CUR);
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    END;
    Regards,
    Balaji

    Is there any way can i have it directly??It does not work with static SQL either. Dynamic SQL is no different.
    SQL> select 1 x from dual where x = 1 ;
    select 1 x from dual where x = 1
    ERROR at line 1:
    ORA-00904: "X": invalid identifier
    SQL>As suggested already, you will need to use alias if you want your select expression to be referred in the where clause.
    SQL> BEGIN
      2      FOR rec IN (SELECT *
      3                  FROM   (SELECT 1,
      4                                 2,
      5                                 DECODE(1, 1, 'ONE', 2, 'TWO', 3, 'THREE') "DECODE(1, 1, 'ONE', 2, 'TWO', "
      6                          FROM   DUAL)
      7                  WHERE  "DECODE(1, 1, 'ONE', 2, 'TWO', " = 'ONE')
      8      LOOP
      9          NULL;
    10      END LOOP;
    11  END;
    12  /
    PL/SQL procedure successfully completed.
    SQL>Message was edited by:
    Kamal Kishore

  • Dynamic Selection on report not working

    Dear all,
    I have several reports on which the dynamic selection is not working. For instance, the report CN43N. The report is outputting all data in a year i.e it is disregarding the condition I specified in the dynamic selection fields.
    Is there some configuration to make to this report so that the dynamic selection works?
    Thanks for ur help.
    Nas

    Also Nelmaz,
    I have just checked OSS notes and found below note helpful to you:
    Note 1059465 - CN43N: Dynamic selections for scheduling data of WBS elemnts
    Symptom
    You cannot use transaction CN43N to create dynamic selections for scheduling data of WBS elements (table PRTE). You can use transaction CNS43 to do so.
    Hope this helps.
    Please assign points as way to say thanks

  • How to deal with dynamic selection screen elements when macros are used?

    Hello experts,
    This is regarding the dynamic selection screen elements. Actually the requirement is to modify the existing standard report program RFUMSV00 by copying it into a Z report, adding a few selection screen elements and new fields in the output. I actually did everything required except for the one thing that is going out of my reach.
    There are a certain fields which are coming when they are not supposed to get displayed. I don't understand the code because of its obsoleteness. Neither can I debug it because it is just data declaration.
    This is the code where there is a fault. If I copy the entire code into a new Z report, I'm getting new fields like Entry Date, Document Type, Reference Transaction,  Reference key, Logical system.
      DEFINE selection_screen_line.
      selection-screen: begin of line.
      parameters &3 like &4 default 'X' modif id mc4.
      selection-screen: comment (30) &1 for field &3 modif id mc4.
      selection-screen: comment pos_low(10) text-019
                        for field &2 modif id mc4.  "neu
      parameters &2 like rfums_alv-variante modif id mc4.
      selection-screen:
          position pos_high.
      selection-screen: pushbutton (15) text-028
                        user-command &5 modif id mc4.
      selection-screen end of line.
    END-OF-DEFINITION.
    Kindly, suggest me the right solution.

    In the program attributes ( SE38 > RFUMSV00 > GOTO > Properties ), you will find a logical database BRF declared. The include DBBRFSEL is part of the selection screen of this logical database.
    The selection screen is actually the selection screen of this logical database.
    Under the Logical Database field, there is a Selection screen field where you can input which selection screen of the logical database to be used.
    But, this is just to change the selection screen that is displayed. To completely suppress it you need to remove logical database declaration from the properties of the program and call it inside your program through function module.
    You cannot just remove it from the declaration because many of its variables are used in the program.
    So call it using function module as the first step in INITIALIZATION section of the program.
    The syntax and function module to call it in your program can be found in the following thread :
    How to hide the selection screen of a Logical datebase?
    Regards,
    Ashish

  • Submit report with dynamic selections

    Hi All,
    I am trying to Submit a report with dynamic selections. I am using the option SUBMIT REPORT WITH FREE SELECTIONS.
    But the dynamic selections are not getting passed.
    Request you to kindly provide some inputs
    My code is
    DATA: trange TYPE rsds_trange,
          trange_line LIKE LINE OF trange,
          trange_frange_t_line LIKE LINE OF trange_line-frange_t,
          trange_frange_t_selopt_t_line LIKE LINE OF trange_frange_t_line-selopt_t,
          texpr TYPE rsds_texpr.
    trange_line-tablename = 'PA0002'.
    *trange_frange_t_line-tablename = 'PA0002'.
    trange_frange_t_line-fieldname = 'GBJHR'.
    trange_frange_t_selopt_t_line-sign   = 'I'.
    trange_frange_t_selopt_t_line-option = 'EQ'.
    trange_frange_t_selopt_t_line-low    = '1987'.
    trange_frange_t_selopt_t_line-high   = '1987'.
    APPEND trange_frange_t_selopt_t_line TO   trange_frange_t_line-selopt_t.
    APPEND trange_frange_t_line TO trange_line-frange_t.
    APPEND trange_line TO trange.
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
      EXPORTING
        field_ranges = trange
      IMPORTING
        expressions  = texpr.
    submit RPCADVQ0
    VIA SELECTION-SCREEN
                    WITH SELECTION-TABLE rspar_tab
                    WITH FREE SELECTIONS it_texpr
                    and returN.
    Kindly provide your inputs
    Regards
    Reshma

    Hi Reshma,
    Use the FM - RS_REFRESH_FROM_DYNAMICAL_SEL before FREE_SELECTIONS_RANGE_2_EX.
      data: trange  type rsds_trange,
              g_repid type sy-repid.
    g_repid = 'RPCADVQ0'.
      call function 'RS_REFRESH_FROM_DYNAMICAL_SEL'
        exporting
          curr_report        = g_repid
          mode_write_or_move = 'M'
        importing
          p_trange           = trange
        exceptions
          not_found          = 1
          wrong_type         = 2
          others             = 3.
      if sy-subrc eq 0.
    " Do the changes to the trange
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
    EXPORTING
    field_ranges = trange
    IMPORTING
    expressions = texpr.
    submit RPCADVQ0
    VIA SELECTION-SCREEN
    WITH SELECTION-TABLE rspar_tab
    WITH FREE SELECTIONS it_texpr
    and returN.
    endif.
    Cheers,
    Kothand

  • How to add a new Field in the Dynamic Selection screen section.

    HI,
    There is a requirement in which I need to add a field in existing program of dynamic selections.
    I need to add a field KNKK-DBRTG (Customer Rating) in dynamic selections screen of some existing report
    which has a dynamic selection screen with other fields like customer account, company code etc. Along with this i need to add Customer rating field also in the selection screen.
    I have used GET KNKK statement to select this in the Dynamic selection screen. But I need to make it appear
    on the screen.
    LDB used is the Customer Database.
    I have added GET KNKK statement after GET KNA1 statement.
    Can any one help me how we can make this rating field appear in the selection screen.
    With the GET statement Credit control area Fields can be selected in the selection screen but I have to permanantly add the field in the selection screen.
    Regards
    Prashant Prabhu

    Hi,
    So you need that this new field have data in old records?
    1.- If you are in BI 7.0 and the logic or data for that New field are in the same Dimension, you can use a Remodeling to fill it. I mean if you want if you want to load from a Master Data from other InfoObject in the same Dim.
    2.- If condition "1" is not yours.
    First add the new field, then create a Backup Cube (both cubes with the new field) and make a full update with all information in the original Cube. The new field willl be empty in both cubes.
    Create an UR from BackUp_Cube to Original_Cube with all direct mapping and create a logic in the Start Routine of the UR (modiying the data_package) you can look for the data in the DSO that you often use to load.
    To do that both cubes have to be Datasources ( right click on Cube-> aditional function-> and I think is "Extract Datasource")
    Hope it helps. Regards, Federico

  • How can i dynamically select columns based on the input parameter?

    I have an input parameter which takes single numeric value.
    Based on this value i have to dynamically select table-columns .
    For eg: if i have following fields in my table :
    SEM_1
    SEM_2
    SEM_3 and SEM_4.
    And if i give numeric input as 2 , then i have to select "SEM_2" column only.
    if the input is 3 then i have to select "SEM_3" only and leave the rest of the columns.
    how do i achieve this dynamic feature in the "Select .....  From...... table...." statement in the ABAP??

    Hi,
    you should try something like this.
    TYPES: cond(72) TYPE c.
    data: condtab TYPE TABLE OF cond,
             condw type cond.
    data: lv_field(30) type c value 'SEM_'.
    write p_num to lv_field+4(1).
    condw = lv_field.
    append condw to condtab.
    SELECT (CONDTAB) FROM table INTO.....
    Kostas
    Message was edited by:
            Kostas Tsioubris

  • Adding of new field in dynamic selection for financial statements

    Hi ALL,
    I want to add Trading partner in dynamic selection fields of financial statement report at document level not yet GL master level: S_ALR_87012284 - Balance Sheet / Profit and Loss Statement .
    Can any one tell how to proceed?
    I have referred notes: Note 188663 - Enhancing selection views and dynamic selection.
    But exactly I am unable to find which logical database has to be given?
    regs,
    ramesh b

    Hi,
    If you want to add extra field in your report you can do the setting in Layout selection. If it is not available kinldy check any SAP notes available or not. Otherwise do Zreport with your ABAPer.
    Regards,
    Mohan.

  • How to change the text of a user defined field in dynamic selections?

    Logical Database PSJ is used by t code CJI3 - we added a couple of user fields into the dynamic selections of CJI3.
    Now - how to change the text of this user filed (USR01 of structure PRSP_R in logical database PSJ)?
    Found an OSS note - 86980 - that tells that this is not possible.
    But when we read the documentation on the user field (CJI3 - dynamic selections  - double click on user field - F1), it shows the following text:
    User-defined field in which you can enter general information with a length of up to 20 characters.
    Dependencies
    The names (key words) for  user-defined fields depend on the field key.
    Now the question is where to change the field key..
    Thanks,
    Ven

    Madhu - you did not get the question I think.
    Anyways - I found an OSS note 1266643 - this code change should take care of the issue - it will then reflect the details maintained in custoizng at transaction code OPS1..
    Thanks,

  • Exclude one field from Logical Database's dynamic selection screen

    Hi Guru,
    I have a requirement to amend a program to exclude the document number field (bsik-belnr) from the dynamic selection-screen of the logical database KDF(Vendor Database) so that the program will not filter according to the document number.
    I have use the below syntax in my zprogram.
      selection-screen exclude select-options: doc-no.
    However I get syntax error "The addition EXCLUDE is only allowed in INCLUDE DBKDFSEL".
    Please advice.
    Best Regards,
    Fung

    The selection part of the logical database defines input fields for selecting data.
              The runtime environment displays these on the selection screen when you run an executable program linked to the logical database.
              Include called DB<ldbname>SEL.
            SELECTION-SCREEN BEGIN OF VERSION ver TEXT-xxx.
                                                                    SELECTION-SCREEN EXCLUDE ... .
                                                    SELECTION-SCREEN END OF VERSION ver.
    Defines a selection screen version (with a three-character name ver ). Between BEGIN OF VERSION and END OF VERSION , you can exclude selection screen objects for the version ver , i.e. remove them from the selection screen with SELECTION-SCREEN EXCLUDE.
              SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE dbtab
    If one of these tables is active in the report (i.e. it is declared under TABLES or lies somewhere on the path from the root of the database hierarchy to a table declared with TABLES ), a pushbutton called 'Dynamic selections' appears on the selection screen.

  • How to extend dynamic selection for Logical Database PNPCE

    Hi All,
    I need to extend dynamic selection for Logical Database PNPCE. Can someone able to help with steps?
    Thanks
    Ranjith

    Hi All,
    I need to extend dynamic selection for Logical Database PNPCE. Can someone able to help with steps?
    Thanks
    Ranjith

Maybe you are looking for

  • MAIL Adapter Transformation Bean

    Hi Guys, I am working on Mail 2 CSV file interface. Can any one provide me information on Sender side MAIL transformation Bean  to convert  CSV file to XML. Thnx, Siva.

  • Firewire Connection is Slow

    I have an iMac Core Duo and a new MacBook Core 2 Duo. I've been transfering files between the two over the past week and noticed that the transfer rate is around 20MB/s ... Not to bad. But shouldn't I be getting upwards around 40 - 50MB/s? Yes, I und

  • GPS Question [might be dumb]

    Last night was the first night I used GPS on my phone, I had to pick someone up. Well I got there and couldn't figure out how to shut the thing off, it kept tracking where I was. Or as soon as you hit the home button an exit out of maps does it stop?

  • [JS] Write XML file

    Hello  I read an XML file I y contribution of the change and I want to write it in a new XML file. I would get this presentation but I opt cesi Here is my code :     leDossierOEBPS = "~/Desktop/content/";     monEcritureContent(File (leDossierOEBPS +

  • SUCCESS w/ Wells Fargo Dealer Services - removal of two erroneous 30 day lates!

    After numerous disputes throughout the years and finally coming across the info for Wells Fargo Dealer's Services Office of the President on this board, I've finally gotten my erroneous 2 30 day lates prior to the last payoff of my loan confirmed as