How to restrict the Null Values for Key Figules in the Bex Query

Hi Friends,
    I want to restrict the Null values of a perticular key figure in the Bex Query Output.
I will explain in details. i have 3 key figures in my query.. let us assume.. key1 key2key3
key1           key2                key3
4                4                   100.00
5                0                   200.00
1                0                    19.00
0                1                    10.00
i don't want to see the the records for which key 2 is 0.
we have a setting in the Bex Query for restricting the Zero values in the query properties. If we enable that setting it will show
4               4          100.00
but i want the report to display..
4               4           100.00
0               1           10.00
can any body guide me. <b>i want to display the values if key2 <> 0.</b>
Regards,
Nagesh.

Hi AVR,
nice to see reply.
can you eloborate your view...how can i put the condition.
<b>i want to put the condition key2 <> 0.</b>
Regards,
Nagesh.

Similar Messages

  • How can I get null values for the later weeks

    Hi All,
    When I execute this code I get the records till current week.
    How can I display the output so that I get null values for the later weeks. (with the help of v_numOfWeeks variable in the code)
    Thanks,
    Vikram
    DECLARE
       v_query VARCHAR2(4000);
       TYPE ref_cursor IS REF CURSOR;
       v_refcur ref_cursor;
       v_sum NUMBER;
       v_id NUMBER;
       v_name VARCHAR2(1000);
       v_weeknum NUMBER;
       v_pernum NUMBER;
       v_numOfWeeks NUMBER := 5;
    BEGIN
    v_query := ' SELECT SUM(product_bkg), postn_id, postn_tbl.postn_name, b.week_num, b.period_num
                              FROM ops_cv_extract b, (SELECT row_id, desc_text postn_name
                          FROM s_postn) postn_tbl
                          WHERE lvl_6_id = 5767
                          AND fiscal_year = 2008
                          AND b.week_num < 4
                          AND b.period_num = 3
                          AND b.postn_id = TO_NUMBER(postn_tbl.row_id)
                          GROUP BY postn_id, postn_tbl.postn_name, b.week_num, b.period_num
                          ORDER BY  postn_tbl.postn_name, b.week_num';
    OPEN v_refcur FOR v_query;
    LOOP
       FETCH v_refcur INTO v_sum, v_id, v_name, v_weeknum, v_pernum;
       EXIT WHEN v_refcur%notfound;
       dbms_output.put_line('P'|| v_pernum||'W'|| v_weeknum||' '||v_name||' '||v_sum);
    END LOOP;
    END;
    This is the output when I execute this code.
    P3W1 COMM CNTRL ISAM 213 26961.61
    P3W2 COMM CNTRL ISAM 213 12870.4
    P3W3 COMM CNTRL ISAM 213 245.88
    P3W1 COMM CNTRL ISAM 273 72831.2
    P3W2 COMM CNTRL ISAM 273 8739.38
    P3W3 COMM CNTRL ISAM 273 3764.92
    P3W1 COMM CNTRL TAM 213 49844
    P3W2 COMM CNTRL TAM 213 20515.17
    P3W3 COMM CNTRL TAM 213 16167.46
    P3W2 COMM CNTRL TAM 216 12561.4
    P3W3 COMM CNTRL TAM 216 2027.1
    P3W1 COMM CNTRL TAM 273 -3336.71
    P3W2 COMM CNTRL TAM 273 -1376.68
    P3W3 COMM CNTRL TAM 273 19707.42
    P3W1 Damon Walters -609.07
    P3W2 Damon Walters 30030.24
    P3W3 Damon Walters 37475.1
    This is the output I'd like to get
    P3W1 COMM CNTRL ISAM 213 26961.61
    P3W2 COMM CNTRL ISAM 213 12870.4
    P3W3 COMM CNTRL ISAM 213 245.88
    P3W4 COMM CNTRL ISAM 213
    P3W5 COMM CNTRL ISAM 213
    P3W1 COMM CNTRL ISAM 273 72831.2
    P3W2 COMM CNTRL ISAM 273 8739.38
    P3W3 COMM CNTRL ISAM 273 3764.92
    P3W4 COMM CNTRL ISAM 273
    P3W5 COMM CNTRL ISAM 273
    P3W1 COMM CNTRL TAM 213 49844
    P3W2 COMM CNTRL TAM 213 20515.17
    P3W3 COMM CNTRL TAM 213 16167.46
    P3W4 COMM CNTRL TAM 213
    P3W5 COMM CNTRL TAM 213
    P3W1 COMM CNTRL TAM 273 -3336.71
    P3W2 COMM CNTRL TAM 273 -1376.68
    P3W3 COMM CNTRL TAM 273 19707.42
    P3W4 COMM CNTRL TAM 273
    P3W5 COMM CNTRL TAM 273
    P3W1 Damon Walters -609.07
    P3W2 Damon Walters 30030.24
    P3W3 Damon Walters 37475.1
    P3W4 Damon Walters
    P3W5 Damon Walters Edited by: polasa on Oct 28, 2008 6:42 PM

    Sure, in a Single SQL ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>
    satyaki>-- Start Of Test Data --
    satyaki>with week_tab
      2  as
      3    (
      4      select 1 period_num, 1 week_num, 10 bkg1 from dual
      5      union all
      6      select 1, 2, 40 from dual
      7      union all
      8      select 1, 3, 30 from dual
      9      union all
    10      select 1, 2, 20 from dual
    11      union all
    12      select 1, 1, 10 from dual
    13      union all
    14      select 1, 1, 20 from dual
    15      union all
    16      select 1, 3, 10 from dual
    17      union all
    18      select 2, 1, 15 from dual
    19      union all
    20      select 2, 2, 20 from dual
    21      union all
    22      select 2, 3, 10 from dual
    23      union all
    24      select 2, 1, 15 from dual
    25      union all
    26      select 2, 2, 30 from dual
    27      union all
    28      select 2, 3, 20 from dual
    29    )
    30  -- End Of Test Data --
    31  select period_num,
    32         week_num,
    33         (
    34            select sum(week_tab.bkg1)
    35            from week_tab
    36            where period_num = m.period_num
    37            and   week_num   = m.week_num
    38            group by week_num, period_num
    39         ) sum_bkg1
    40  from (
    41        select dum.week_num,
    42              wk.period_num
    43        from (
    44                select 1 week_num from dual
    45                union all
    46                select 2 from dual
    47                union all
    48                select 3 from dual
    49                union all
    50                select 4 from dual
    51                union all
    52                select 5 from dual
    53              ) dum ,
    54              (
    55                select distinct period_num
    56                from week_tab
    57          ) wk
    58      ) m;
    PERIOD_NUM   WEEK_NUM   SUM_BKG1
             1          1         40
             1          2         60
             1          3         40
             1          4
             1          5
             2          1         30
             2          2         50
             2          3         30
             2          4
             2          5
    10 rows selected.
    Elapsed: 00:00:00.48
    satyaki>Regards.
    Satyaki De.

  • How to restrict access to views for some users in the app?

    Hi SDN!
    I have an WD application wich embedded in the portal. Appication has 2 iViews (and 2  pages respectively). These iViews consist several views connected with each other (e.g. one view provide list data, second view is add/edit form for this data). I need to restrict access for some users for view with add/edit form. I can't make separate page for this view.
    What I've done:
    1) create yet another UIContainer for this view in main window and embed view to this container. It was be done for create separate iView for form.
    2) in the portal I create iView for this form but don't embedd in any page.
    When I try to call my form from list data (that is one iView from another) I get exception:
    <b>com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: duplicate usage of view .MyCarRentalAddCity</b>
    Is there a way to get needed functional?
    Thanks,
    Lev

    Hi,
    do you need to remove the IView from the portal menu or do you just want to make a View container in your WD application invisible if the user doesn't have the rights to see it.
    If so, you could create your own roles on the app server:
    You need to create a new class that extends NamePermission like:
    import com.sap.security.api.permissions.NamePermission;
    public class ApplicationAccessPermission extends NamePermission {
               * @param name
              public ApplicationAccessPermission(String name) {
                   super(name);
               * @param name
               * @param action
              public ApplicationAccessPermission(String name, String action) {
                   super(name, action);
    Also, you have to create an Action.XML file that looks like this:
    <BUSINESSSERVICE
         NAME="com.vendor.administration">
         <DESCRIPTION
              LOCALE="en"
              VALUE="actions view usage"/>
         <ACTION
              NAME="View Permission">
              <DESCRIPTION
                   LOCALE="en"
                   VALUE="Show view"
                   />
              <PERMISSION
                   CLASS="com.vendor.utilities.ApplicationAccessPermission"
                   NAME="ShowView"
                   />
         </ACTION>
    </BUSINESSSERVICE>
    If you have created these to files in your packages, you can access this function like:
    IUser user ;
    try {
              user = WDClientUser.getCurrentUser().getSAPUser();
              if(user.hasPermission(new ApplicationAccessPermission("Show view"))){
                   wdContext.currentV_UIElement().setViewVisibility(WDVisibility.VISIBLE);
              }else{
                   wdContext.currentV_UIElement().setViewVisibility(WDVisibility.NONE);
         }catch (WDUMException e1) {
              wdContext.currentV_UIElement().setViewVisibility(WDVisibility.NONE);
                    e1.printStacktrace();
    You have to bind the ViewVisibility attribute of the context to the View Container you want to hide.
    The applicationAccessPermission you defined in the XML File will be visible in the UME Manager of you J2EE engine. With this action you can create a new role and group that you can map to the users that should see you view.
    But, the exception you get is because you have embedded one view twice, which is not possible.
    Hope this helps.
    Regards,
    Dennis

  • How to update the null values to some number on the NUMBER type of column

    Hello All,
    I have one NUMBER type of column in DB table. It has some (null) values. I want to update with value 1. I tried to run the Update statement , It gives 0 rows updated.
    SELECT objectid,attr20 FROM table;
    object id attr20
    ====== ====
    fff70b67-8d54-4ad7-bc57-7b40a0d8b219     (null)
    cac5264a-b363-487b-bfe6-6b84d60064e9     (null)
    2fc2a626-51d8-401c-9495-18aacd4c35c8     (null)
    1b60bfa4-ff68-4488-adf6-2a83528c0e20     (null)
    1c662829-24c1-4b3c-9289-0128e170c043     5
    74f11331-545b-435f-bf4b-f57c7a6b4500     2
    c941c1ac-a18e-47ec-843c-dbe2a5b51001     0
    d7eba203-93c0-48ea-a109-9b06015ef387     0
    eba72fa3-21d8-4489-bb93-917ebbd67de2     0
    I ran following query but no success.
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 = NULL
    0 rows updated
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 = null
    0 rows updated
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 = ''
    0 rows updated
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 =' '
    Error starting at line 1 in command:
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 =' '
    Error report:
    SQL Error: ORA-01722: invalid number
    01722. 00000 - "invalid number"
    *Cause:   
    *Action:
    can some one help me out to update such values ????

    Hi,
    "=" will not work for NULL values. Please remeber two NULL values are NOT same. Try IS operator.
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 IS NULLRegards,
    Avinash

  • How to show the variable values in key format in the information tab

    Dear all
      in the information tab of the query, we can see all the filters and the variable value. But we can only see the infoobject <b>text</b> of this variable, how can we do if the user needs to see the <b>key</b> of this variable?

    I've referred to the Web API, and find a way to display some specified variable, but since this is the standard webtemplate and we need to show all the possbible variable used in the query. Anybody has better solution?
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="GET_ITEM"/>
             <param name="NAME" value="StaticFilter"/>
             <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_TEXT_ELEMENTS"/>
             <param name="DATA_PROVIDER" value="DP"/>
             <param name="CAPTION" value="SAP_BW_TEXT?program=SAPLRRSV&amp;key=722"/>
             <param name="GENERATE_LINKS" value=""/>
             <param name="WIDTH" value="330"/>
             <param name="ELEMENT_TYPE_100" value="VARIABLE_KEY" />
             <param name="ELEMENT_NAME_100" value="0P_WBSO"/>
             <param name="ELEMENT_TYPE_101" value="VARIABLE_KEY" />
             <param name="ELEMENT_NAME_101" value="0P_PRJ"/>
             ITEM:            FILTERS
    </object>

  • Getting null value for inputfile component in the popup

    Hi,
    My requirement is when i select the selectBooleanCheckBox a popup has to be rendered and with in that popup i have to display the inputfile component when i browse it should read the appropriate file.
    But i am getting null from the input file component.
    I written the code like this:-
    1.First i have written a value change listener for the selectBoolenCheckBox.
    2.I am rendering the popup from the valueChageEvent.
    3.And i written the dialogListener for the Dialog in the popup.
    and the code for the Dilog listener is:--
    public void readingInputFile(DialogEvent dialogEvent) {
    inputFile1.getValue();
    //it is giving null value.
    thanks in advance.
    From
    Srikanth.V

    thanks for giving suggestion.
    but i am not able to understand what meant by multipart in dialog page.
    Actually,The code i written was:--
    1. for selectBooleanCheckBox i written value chage listener
    onChangeValue(ValueChageEvent valueChageEvent){
    // in this i call the method to raise popup;
    risePopUp();
    2.The popup structure has follows:-
    af:form --> af:popup ---> af:dialog --->af:inputfile
    for this dialog i have written dilogListener:
    getInputFile(DialogEvent dialogEvent){
    //giving null for the inputFile,getValue();
    for this dialog i don't have any multipart property
    From,

  • Taking display value for calculations using structures in Bex query

    Hi
    I am using Bex analyzer to do a simple report with two key figures ‘Sales’ and ‘Plans’ from cube and two more calculated key figures ‘Abs Deviation’ and ‘% error’. The report displays at category and product levels. Category is higher and one category contains multiple products.
    The simple formulas for the two calculated KF are,
    1. Abs Deviation = Abs (Sales – Plans).
    Abs Deviation is set with the property Calculate result as ‘summation’ to add up Abs deviations at product level to show at Category level.
    2. % Error = Abs Deviation / Plan.
    The issue is with the % Error value at category level. At product level, all the values are showing correctly.
    To illustrate the issue with a simple test case,
    CategryProductSale-PlanAbs Dev----%Error
    C1--P1--100-60---40--
    67%
    C1--P2---50120---70--
    58%
    C1 Total--150180---110--
    17%
    Observe that in the output the calculation for ‘%Error’ at product level is correct all the way. But the summary
    calculation for ‘Error%’ i.e. C1 total which is showing as 17% is wrong. The correct value as per the formula should be 110/180 = 61%.
    SAP, through OSS replied that it is not a bug but the default behavior of OLAP calculation. OLAP processor first calculates the formula for % Error and then shows the display value at C1 total for Abs Dev. Meaning, ‘% Error’ is calculated first and next the summation for Abs dev is displayed. Abs dev 110 at C1 level is only a display value but not the value taken for % Error at C1 level. Instead OLAP calculates the Abs Dev at C1 level by Total sale – Total plan = 180 – 150 = 30 and the % Error calculation takes this 30 value in the formula and gives % Error = 30/180 * 100 = 17% at C1 level. But 17% doesn't make any sense to the user. Further, to display value of 61% at % Error at C1, it is being advised that by defining two structures, I can force the calculation to take display value of 110 in the % Error calculation at C1 level by using the cell editor.
    Has any body tried to achieve similar result as above by defining two structures and cell editor in the query? If so, can you please throw some pointers of how to define two structures in a query and how to force the % Error at category level to take the display value of 110 in the calculation? I have gone through the documentaion on structures and cell editor but the approach is not at all clear.
    Thanks in advance for your suggestions.
    Prasad
    Unilever Asia IT department

    Hi,
    Have u read aabout the Formula Collision.
    Take a look on this link .
    http://help.sap.com/saphelp_bw32/helpdata/en/d2/02223c5f00612be10000000a11402f/frameset.htm
    Read the Formula Collision, and let us know , whether your pb is solved by changing the Formula Collision of % error formula.
    With rgds,
    Anil Kumar Sharma .P
    Kindly assign points , If it really helps you.

  • V$parameter view - How do I get these values for both instances on the db?

    I have a procedure that dumps the contents of all the parameters from the system view v$parameter for auditing purposes, so that we know if a parameter changed from month to month, but we have 2 instances running. How do I make sure and log the parameters for both the instances? So far the procedure will log the parameters for the instance it happened to run on (it is random).
    However, when I use TOAD, I can access parameters for both instances by going to Database/Administer/Oracle Parameters.
    Thanks!

    Instead of V$PARAMETER use GV$PARAMETER so you can obtain the the instance id
    SQL> describe gv$parameter
    Name                                      Null?    Type
    INST_ID                                            NUMBER
    NUM                                                NUMBER
    NAME                                               VARCHAR2(80)
    TYPE                                               NUMBER
    VALUE                                              VARCHAR2(4000)
    DISPLAY_VALUE                                      VARCHAR2(4000)
    ISDEFAULT                                          VARCHAR2(9)
    ISSES_MODIFIABLE                                   VARCHAR2(5)
    ISSYS_MODIFIABLE                                   VARCHAR2(9)
    ISINSTANCE_MODIFIABLE                              VARCHAR2(5)
    ISMODIFIED                                         VARCHAR2(10)
    ISADJUSTED                                         VARCHAR2(5)
    ISDEPRECATED                                       VARCHAR2(5)
    ISBASIC                                            VARCHAR2(5)
    DESCRIPTION                                        VARCHAR2(255)
    UPDATE_COMMENT                                     VARCHAR2(255)
    HASH                                               NUMBER
    SQL>

  • Eliminating the null values from popup list item

    Dear All,
    i create a popup list,at runtime it shows a null blank value among the values i specified while the combo box is not,
    i want to eleminate the blank null value from the popup list.
    Need Help.
    Thanks & Regards.

    Okay,
    i create a popup list, populate it in runtime with create_group_from_query builtin.
    now when i run the form and click the list item, it display a null value among the other values which are
    return from the create_group_from_query .
    the procedure is below
    procedure Department_proc is
    rg recordgroup;
    n number;
    begin
    remove_record_group('RG');------  this is another procedure which checks for Record group existance and remove it.
    rg=:=create_group_from_query('RG4','SELECT NAME,TO_CHAR(DEPT_ID) FROM TAB_DEPT_SECTION
    UNION
    SELECT '||'''All Departments'''||'as name,'||'''0'''||' as name from dual');
    n:=populate_group(rg4);
    populate_list('control_block.department',rg4);
    end;
    it display a null value among the other values for the first time is run the form,but when i click it and select a value from it
    and the onward click dont show the null value.i want to eleminate the null value even for the first time when the user run the
    from.
    Best Regards

  • SQL Loader Null Value for Date

    Dear buddies,
    This is how my date column is in my control file.
    dtEdu timestamp(6) with local time zone "YYYY-MM-DD HH24:MI:SS"  "nvl (to_date (:dtEdu, 'YYYY-MM-DD HH24:MI:SS'), to_date ('1982-03-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'))",  The problem is some of the columns in dtEdu has NULL values and I couldn't load them.
    So, trying to replace it with something else.
    Could someone help me?
    Thanks a lot.
    Nith

    >
    The problem is some of the columns in dtEdu has NULL values and I couldn't load them.
    >
    I don't know how your so called "NULL" values look like, but if the null data is actually made up of blanks, try adding LTRIM() around :dtEdu.

  • Pro*C & SQLDA with NULL value for predicate column

    Hi: I am using a C program to update a table via a dynamic sql (method 4) and SQLDA. In the update statement predicate, I have place holders (as in TBLCOL=:C000). One of the columns in the predicate contains null values, so I set L[n] = 0, V[n] = pData (which pData[0] = '\0'), *(I[n]) = -1, and T[n] = 5 (for text). I cannot find the row that I know is there.
    I cannot change my statement to contain TBLCOL IS NULL, since I don't know ahead of time if I'm looking for rows with null values for this column. The Pro*C manual says that by setting the appropriate *(I[n]) = -1, it indicates to Oracle to simulate the "IS NULL" clause, and update the appropriate rows. In my case, I receive 1403 as SQLCODE when I use TBLCOL=:C000 vs TBLCOL IS NULL. What am I doing wrong? Thank you for your help.

    You should include these columns as well;
    ChangeType (see mxi_changetype)
    ValOwner (repository)
    UserID ("jobid=<>", usermskey, GUI (mmc), DG (dyngrp), reconcile)
    IdAudit  (This is the event task (add and del member for assignments)
    ParentAuditId (AuditID of parent which last updated the attribute, not consistent)
    ChangedBy (Holds the MSKEY of the user which last changed the attribute)
    ExpiryTime
    to make sure you get a fuller picture of the audit record.
    Your selection does not cover all events and descriptions
    br,
    Chris

  • Can you specify the allowable values for vertical range and offset for the NI 5112 PCI Digitizer?

    The NI 5112 manual indicates that the vertical range can be set from +/- 25mV to +/-25V in 10% steps. Can you explain exactly what this means? (For example, could you give me a series of allowable values.)
    Also, what are the allowable values for voltage offset?
    The reason for my question is: I am specifying the vertical configuration using the niScope_ConfigureVertical() function. The observed raw (8 bit) sampling does not appear to change at all for small changes in voltage range and offset. I would like to know where the hardware breakpoints are, so that I can apply correct scaling from bits to voltage.
    In addition, I have tried to use the niScope_CheckAt
    tributeViReal64() function to "check" a value before applying it to NISCOPE_ATTR_VERTICAL_RANGE or NISCOPE_ATTR_VERTICAL_OFFSET, but it fails in the linking step in Microsoft Dev. Studio. (niScope.lib & niscope_32.lib do not seem to contain any of the CheckAttribute functions that are listed in the NI-Scope function reference.)
    Thank you for your response.

    There is a nice reference at:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/38f18d418e2433ed8625690e006bbe94?OpenDocument
    which explains that allowable voltage ranges can be expressed by the equation:
    next_range_value = range_value * 1.1 starting at +/- 25 mV.
    When a range is specified that does not match this series, the device driver rounds UP to the next value.

  • How does APEX check for null values in Text Fields on the forms?

    Hello all,
    How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
    I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
    All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
    Declare
    v_valid boolean;
    Begin
    IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := FALSE;
    ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := FALSE;
    END IF;
    return v_valid;
    END;
    My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
    Thanks

    See SQL report for LIKE SEARCH I have just explained how Select list return value works..
    Cheers,
    Hari

  • How to transfer database table contain null values, primary key, and foreign key to the another database in same server. using INSERT method.

    how to transfer database table contain null values, primary key, and foreign key to the another database in same server. using INSERT method.  thanks

    INSERT targetdb.dbo.tbl (col1, col2, col3, ...)
       SELECT col1, col2, col3, ...
       FROM   sourcedb.dbo.tbl
    Or what is your question really about? Since you talke about foreign keys etc, I suspect that you want to transfer the entire table definition, but you cannot do that with an INSERT statement.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to assign the two values for constant (same key)

    How to assign the two values for constant (same key)
    CONSTANTS: c_pstkey TYPE  bschl VALUE '09',
               c_splgl  TYPE  umskz VALUE 'I',
               c_buzei  TYPE  buzei VALUE '001'.
    using BSCH1 again i have two asign vaue
    can you just let me know
    Edited by: sravya_se38 on Nov 23, 2010 12:14 AM

    You can create a structure for that constant .
    You can define in this way
    CONSTANTS : BEGIN OF c_pstkey,
                             01 TYPE bschl VALUE '01',
                             02 TYPE bschl VALUE '02',
                          END OF c_pstkey.
    and can access using...
    c_pstkey-01, c_pstkey-02 ........

Maybe you are looking for