How to check a parameter for legitimate blank value?

Hi,
I have a parameter with a drop down for a standard field from table BSEG. There are 3 possible values in the drop down, i.e. blank, 1, or, C.
If the user enters '1' or 'C' there is no problem I can use this value in my code, i.e. I can select from BSEG where this value is a '1' or a 'C'.
How can I differentiate between an initial value in the parameter and a ' ', i.e. if the user doesn't select a value in this parameter the I need to get all BSEG records, but if the user selects ' ' for this parameter I need to get all values from BSEG where this field = ' '.

Hi,
Use the below code.
parameters: p_list as listbox visible length 20.
initialization.
type-pools vrm.
data: v_id type vrm_id,
      i_list type vrm_values,
      wa_list like line of i_list.
v_id = 'P_LIST'.
wa_list-key = '1'.
wa_list-text = '1'.
append wa_list to i_list.
wa_list-key = 'C'.
wa_list-text = 'C'.
append wa_list to i_list.
wa_list-key = ''.
wa_list-text = ''.
append wa_list to i_list.
*p_list = '3'.  "this is to set the default value of the list box.
CALL FUNCTION 'VRM_SET_VALUES'
  EXPORTING
    id                    = v_id
    values                = i_list
EXCEPTIONS
   ID_ILLEGAL_NAME       = 1
   OTHERS                = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
start-of-selection.
if not p_list is initial.
select * from BSEG into table itab where field = p_list.
else.
select * from BSEG into table itab where field is initial.
endif.

Similar Messages

  • How to check with table for cursor..?

    How to check with table for cursor..?
    Here I have Table temp_final_plan
    Here i want to update if already exit...below is the procedure....
    CREATE OR REPLACE PROCEDURE spu_final_profit_plan
    AS
    -- Constant declarations
      ln_errnum number := 0;
    -- Variable declarations
       ls_errmsg app_errors.err_msg%TYPE;
       ls_appmsg app_errors.app_msg%TYPE;
       ls_appid  app_errors.app_id%TYPE;
    -- Cursor declaration for final_update_el
    CURSOR cur_final_update_el IS
        select '910' ent,
               '9127316' center,
               post_acct,
               sum(avg_mtd_01) sum_avg_mtd_01,
               sum(avg_mtd_02) sum_avg_mtd_02,
               sum(avg_ytd_01) sum_avg_ytd_01,
               sum(avg_ytd_02) sum_avg_ytd_02
          from mon_act_cypy
         where rec_type = 'A'
           and sum_flag = 'D'
           and yr = '2008'
           and substr(ctr_or_hier, 1, 2) = 'el'
           and ent || sub_ent in
               (select ent || sub_ent
                  from ent_ref
                 where roll_ent || roll_sub_ent = '999100')
         group by post_acct
        having sum(avg_mtd_01) <> 0
            or sum(avg_mtd_02) <> 0
            or sum(avg_ytd_01) <> 0
            or sum(avg_ytd_02) <> 0;
    -- Cursor declaration for final_update
    CURSOR cur_final_update IS
        select b.plan_ent b_plan_ent,
               b.plan_ctr b_plan_ctr,
               a.post_acct a_post_acct,
               sum(a.avg_mtd_01) sum_avg_mtd_01,
               sum(a.avg_mtd_02) sum_avg_mtd_02,
               sum(a.avg_ytd_01) sum_ytd_mtd_01,
               sum(a.avg_ytd_02) sum_ytd_mtd_02
          from mon_act_cypy a,
               plan_unit_tbl b
         where a.ent || a.ctr_or_hier = b.ent || b.ctr_or_hier
           and a.rec_type = 'A'
           and a.sum_flag = 'D'
           and a.yr = '2008'
           and b.hier_tbl_num = '001'
           and a.ent || a.sub_ent in
               (select ent || sub_ent
                  from ent_ref
                 where roll_ent || roll_sub_ent = '999100')
         group by b.plan_ent, b.plan_ctr, a.post_acct
        having sum(a.avg_mtd_01) <> 0
            or sum(a.avg_mtd_02) <> 0
            or sum(a.avg_ytd_01) <> 0
            or sum(a.avg_ytd_02) <> 0;
    -- Begin the procedure body
       BEGIN
    -- Insert / Update final profit plan for final_update query using cursor
       FOR rec_final_update_el IN cur_final_update_el
       LOOP
       EXIT WHEN rec_final_update_el%NOTFOUND;
       IF rec_final_update_el. THEN
          UPDATE temp_final_plan
             SET sum_avg_mtd_01 = rec_final_update_el.sum_avg_mtd_01,
                 sum_avg_mtd_02 = rec_final_update_el.sum_avg_mtd_02,       
                 sum_avg_ytd_01 = rec_final_update_el.sum_avg_ytd_01,       
                 sum_avg_ytd_02 = rec_final_update_el.sum_avg_ytd_02,       
           WHERE ent = rec_final_update_el.ent
             AND center = rec_final_update_el.center
             AND post_acct = rec_final_update_el.post_acct;
       ELSE
          INSERT INTO temp_final_plan VALUES(rec_final_update_el.ent,
                                             rec_final_update_el.center,
                                             rec_final_update_el.post_acct,
                                             rec_final_update_el.sum_avg_mtd_01,
                                             rec_final_update_el.sum_avg_mtd_02,
                                             rec_final_update_el.sum_avg_ytd_01,
                                             rec_final_update_el.sum_avg_ytd_02);
       END IF;
       END LOOP;
    -- Insert / Update final profit plan for final_update query using cursor
       FOR rec_final_update IN cur_final_update
       LOOP
       EXIT WHEN rec_final_update%NOTFOUND;
       IF rec_final_update. THEN
          UPDATE temp_final_plan
             SET sum_avg_mtd_01 = rec_final_update.sum_avg_mtd_01,
                 sum_avg_mtd_02 = rec_final_update.sum_avg_mtd_02,       
                 sum_avg_ytd_01 = rec_final_update.sum_avg_ytd_01,       
                 sum_avg_ytd_02 = rec_final_update.sum_avg_ytd_02,       
           WHERE ent = rec_final_update.b_plan_ent
             AND center = rec_final_update.b_plan_ctr
             AND post_acct = rec_final_update.a_post_acct;
       ELSE
          INSERT INTO temp_final_plan VALUES(rec_final_update.b_plan_ent,
                                             rec_final_update.b_plan_ctr,
                                             rec_final_update.a_post_acct,
                                             rec_final_update.sum_avg_mtd_01,
                                             rec_final_update.sum_avg_mtd_02,
                                             rec_final_update.sum_avg_ytd_01,
                                             rec_final_update.sum_avg_ytd_02);
       END IF;
       END LOOP;
    -- EXCEPTION handling section
       EXCEPTION
    -- Fire OTHERS Exception case by default
       WHEN OTHERS THEN
    -- ROLL BACK Transaction, if any failure
       ROLLBACK;
       ln_errnum := SQLCODE;
       ls_errmsg := SUBSTR(SQLERRM, 1, 100);
    -- Log the ERRORS into APP_ERRORS table using SPU_LOG_ERRORS procedure
       spu_log_errors(ln_errnum, ls_errmsg, ls_appid, ls_appmsg);
    -- End of the stored procedure
    END spu_final_profit_plan;
    [\pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I'm not sure what you mean by, 'How to check with table for cursor..?' but I'll offer a comment on your Code Snippet. I think you want to know how to check if a record exists so you know if you need to perform an INSERT or an UPDATE.
    Here is a snippet of your code. I'll put my comments in "Comment" style in your code.
    -- Insert / Update final profit plan for final_update query using cursor
       FOR rec_final_update_el IN cur_final_update_el
       LOOP
    /* There is no need to test for %NOTFOUND since you are using Cursor FOR Loop! 
    ** This construct automatically exits when the last record is processed. */
       EXIT WHEN rec_final_update_el%NOTFOUND;
    /* Is this where you would like to know how to Check if the record already exist??
    ** I asked this because, 'rec_final_update_el.' is not valid syntax.  Are you looking for
    ** an Cursor Attribute or Method you can check here? 
    ** I would suggest a Primary Key or Unique Index on ENT, CENTER, and POST_ACCT
    ** on the TEMP_FINAL_PLAN table. Then simply perform an INSERT and code an
    ** Exception to UPDATE when you get a DUP_VAL_ON_INDEX exception.  Otherwise,
    ** you will need to simply run an Implicit or Explicit Cursor to test if the row exists and
    ** use this return value to determine if you should INSERT or UPDATE.  */
       IF rec_final_update_el. THEN
          UPDATE temp_final_plan
             SET sum_avg_mtd_01 = rec_final_update_el.sum_avg_mtd_01,
                 sum_avg_mtd_02 = rec_final_update_el.sum_avg_mtd_02,       
                 sum_avg_ytd_01 = rec_final_update_el.sum_avg_ytd_01,       
                 sum_avg_ytd_02 = rec_final_update_el.sum_avg_ytd_02,       
           WHERE ent = rec_final_update_el.ent
             AND center = rec_final_update_el.center
             AND post_acct = rec_final_update_el.post_acct;
       ELSE
          INSERT INTO temp_final_plan VALUES(rec_final_update_el.ent,
                                             rec_final_update_el.center,
                                             rec_final_update_el.post_acct,
                                             rec_final_update_el.sum_avg_mtd_01,
                                             rec_final_update_el.sum_avg_mtd_02,
                                             rec_final_update_el.sum_avg_ytd_01,
                                             rec_final_update_el.sum_avg_ytd_02);
       END IF;
       END LOOP;I hope I've answered your question, but if I haven't please provide more details so we can better understand your request.
    Craig...

  • Is there a solution for iphone 4 too like iphone5, It doesnt have tab Cellular. How to check call duration for total dialled calls (after resting) on a particular day?

    How to check call duration for total dialled calls (after resting) on a particular day in iphone 4?
    Is there a solution like iphone 5, i.e.Settings > Cellular.

    if the device is unlocked cellular is called mobile

  • How to use execute immediate for character string value 300

    how to use execute immediate for character string value > 300 , the parameter for this would be passed.
    Case 1: When length = 300
    declare
    str1 varchar2(20) := 'select * from dual';
    str2 varchar2(20) := ' union ';
    result varchar2(300);
    begin
    result := str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || ' ';
    dbms_output.put_line('length : '|| length(result));
    execute immediate result;
    end;
    /SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
    length : 300
    PL/SQL procedure successfully completed.
    Case 2: When length > 300 ( 301)
    SQL> set serveroutput on size 2000;
    declare
    str1 varchar2(20) := 'select * from dual';
    str2 varchar2(20) := ' union ';
    result varchar2(300);
    begin
    result := str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || ' ';
    dbms_output.put_line('length : '|| length(result));
    execute immediate result;
    end;
    /SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 6

    result varchar2(300);Answer shouldn't be here ? In the greater variable ?
    Nicolas.

  • How to disable selection parameter for a particular radio button

    hi experts,
    How to disable selection parameter(bukrs) for a particular radio button 'radio1'.

    hi,
    Check This Code (copy paste and run it ).
    U have to use MODIF ID along with the parameter.
    *----------------Option
    *---Background
    *---Summary Report
    PARAMETERS       : p_backgd RADIOBUTTON GROUP rad1
                       USER-COMMAND radio DEFAULT 'X'.
    PARAMETERS       : p_sumrep RADIOBUTTON GROUP rad1 .
    *----------------File
    PARAMETERS       : p_sumfl TYPE char255 modif id ABC  .
    PARAMETERS       : p_detfl TYPE char255 modif id ABC.
    *---------------Activate & Deactivate Screen Fields--------------------*
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF p_sumrep = 'X'.
          IF screen-group1  = 'ABC'.
            screen-input  = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    <b>Please Reward Points & Mark Helpful Answers</b>
    To mark Helpful Answers ;click radio Button next to the post.
    RadioButtons
    <b>o</b> Helpful Answer
    <b>o</b> Very helpful Answer
    <b>o</b> Problem Solved.
    Click any of the above button next to the post; as per the anwers
    <b>To close the thread; Click Probelm solved Radio Button next to the post ,
    which u feel is best possible answers</b>

  • How set and get parameter for a session of a portlet (Java)

    I would like get parameter and set parameter for a portlet in portal 9.02. This parameter must be availbale during the session of the portal.
    With Java Servlet
    // I retrieve my session
    HttpServletRequest httpreq = (HttpServletRequest)req;
    HttpServletResponse httpresp = (HttpServletResponse)resp;
    HttpSession session = httpreq.getSession();
    //And after i can get or set some parameter for this servlet
    //Example
    session.setAttribute("MyEmployeeNumber","600000");
    String id = (String)session.getAttribute("MyEmployeeNumber");
    // But with Portlet in portal, i can't do it.
    PortletRenderRequest pr= (PortletRenderRequest)httpreq.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    String sUser=pr.getUser().getName();
    ProviderSession session=pr.getSession();
    // But after if i want get or set a value in this session i have a internal error 500
    session.setAttribute("MyEmployeeNumber","600000");
    I would like my parameter is avalaible during a session for a user in each page of the portal, because my portlet is on each page.

    I have almost the same problem. I tried as you suggested, but it doesn't work yet.
    provider.xml
    <session>true</session>
    <passAllUrlParams>true</passAllUrlParams>
    My code in my jsp-portlet is
    <%@page contentType="text/html; charset=windows-1252"
    import="oracle.portal.provider.v2.render.PortletRenderRequest"
    import="oracle.portal.provider.v2.render.PortletRendererUtil"
    import="oracle.portal.provider.v2.http.HttpCommonConstants"
    import="oracle.portal.provider.v2.ParameterDefinition"
    import="oracle.portal.provider.v2.render.http.HttpPortletRendererUtil"
    %>
    <%@page session="true"%>
    <%
    PortletRenderRequest pReq = (PortletRenderRequest)request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    String valueSession = (String)pReq.getAttribute("sesion");
    if (valueSession != null) {
    pReq.setAttribute("session", "value1");
    out.println("<br>(1)valueSession != null");
    out.println("<br>(1)valueSession : " + pReq.getAttribute("session"));
    } else {
    pReq.setAttribute("session", "value2");
    out.println("<br>(2)valueSession == null");
    out.println("<br>(2)valueSession : " + pReq.getAttribute("session"));
    %>
    And i always get as result:
    (2)valueSession == null
    (2)valueSession : value2
    Even when i send values (post) at the same page or browsing between tabs:
    I check my provider registration and it has the value "once per session"
    I have portal 9.0.2.2.14
    Thanks

  • How to check FCC parameter

    Dear All expert
    I have define FCC parameter for flat file to IDOC scenario but its not working
    But when we send XML format file it posted successfully so any way to check where we have put wrong value of FCC and why it not working
    Txt Format -
    1     5500     20080508               
    2     ARTN     VANHUSEN     -     2     5000
    2     ARTN     VANHUSEN     -     2     5000
    2     ARTN     VANHUSEN     -     2     5000
    Thanks
    Amit Shivhare

    Hi All
    this is my FCC value
    Record set structure MP01,1,MP02,*
    Record Sequences  - ascending 
    Record Set per message -2
    Key field value - KZ
    Key Filed Type - integer
    MP01.fieldNames     KZ,POS_StoreCode,POS_Date
    MP01.keyFieldValue     1
    MP01.keyFieldinStructure     Ignore
    MP02.fieldSeparator     '0x09'
    MP02.endSeparator     'nl'
    MP02.fieldNames     KZ,QUALARTNR,ARTNR,VORZMENGE,UMSMENGE,UMSWERT
    MP02.keyFieldValue     2
    MP02.keyFieldinStructure     Ignore
    IgnoreRecordsetName     true
    Thanks
    Amit Shivhare

  • How to check Business Partner for archiving ?

    Hi friends,
    I want to check the BP for Archiving.
    So I am trying to set the Archiving Flag in BP Status Tab
    But the Archiving Falg Check box is never in Display Mode and so I am not able to check the BOx. What is the use of that box if it can't be accessed ? Any clues on how to check it ?
    Many thanks
    C.K.

    Hi,
    You can run DACONTROL transaction to set the deletion flag for business partner.
    -Thanks,
    Ajay

  • How to check silent switches for adobe reader installation ?

    Hi All,
    We are working on one project where we have to install adobe remotely and silently on around 5K machines. I am wondering how to check all adobe reader silent installation switches.
    Any help would be great
    Thanks And Regards
    Vaibhav Singh
    [personal info removed by moderator]

    What do you mean by "check" the silent switches? Do you mean you want the documentation for enterprise deployment?
    (Worth mentioning just in case: you will need a deployment license from Adobe).

  • [Win-ILL 10]How to check overprint  & color for Pattern Swatches?

    Hi all,
    Im using Visual C++ 6.0 & Illustrator 10.
    Please tell how to check whether overprint is applied to an object inside a Pattern Swatch(I dont want to Expand the object)
    I also want to get the color for the object inside the Pattern Swatch
    .Any Solution for this?
    Thanks
    myRiaz

    The reference to port 427 is in any firewall on the computer.  Network communication is done over these ports and the job of the firewall is to monitor and block these ports.
    This document might also be relevant for the problem.
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c04011652&lc=en&cc=us&dlc=en&product=5199463
    I was an HP employee.
    Please mark the post that solves your problem as "Accepted Solution"

  • How to find average for non blank values

    I need to calculate avarage for each restricted key figures. There are some blank values in this restricted key figures. Now I need to sumup and divide by non blank count. Do you know how to do it? How to count non blnak values and find avereage.
    Thanks,
    Phani

    In the properties of Key figure used in column/row, Calculations section, you can maintain calculation type for result as well as single value. There is "Average of all values not equal 0" option is available.
    Rgds,
    Vikram.
    Edited by: Vikram Kate on May 22, 2008 11:23 AM

  • How to check the DPI for images on pages

    hi,
            I want to check the DPI for images programatically, is there any function available in acrobat SDK,
            If not what other option we have to check the DPI for images programatically.
    Thank you,

    You don't mention which parts of the SDK, but you can use the Preflight feature of Acrobat via either JavaScript or C/C++ (plugin) to generate a report of images in a document and their information (including dpi).
    You can also write a plugin to iterate over each image individually and get its properties.

  • How to create a graph for the exact values in pivot table

    hi all,
    how can i create a graph exactly that shows pivoted values. i created one pivot table and deleted the table view. when i am creating the graph it is not showing the graph for pivot table values.

    for that you need to edit the pivot table properties and then select graph pivot results tab in the top middle .. hope this helps

  • How to create a variable for key figure (value will be entered by the user

    I want to create one query, where the user has to entered a max value when the query is started, so that only the query rows will be listed, where the key figure value (integer) of the row is smaller than the max value given.
    How can i define that variable which has to start at the begin of the query; and also the restricted key figure iin consideration of the KF variable.
    Thanks for helping
    Ar.

    Hi Arnaud,
                Go to Conditions-> Right click -> New Condition -> Edit -> NEw -> Selct the KEy figures from the dropdown( the KFs that are used in the rows/columns) -> Select Less than from the operator drop down (less than is for you case) -> Values, there is an option to create a variable -> Select the variable -> transfer. It will appear on the top.
    Save & Execute, you will find it in your selction criteria.
    Regards
    Sunil

  • Tab delimition for the blank values

    Hi experts,
    I need to generate the tab delimited file.
    I m using FCC for the same.
    if there are 3 fields in my structure and values are coming for all, then its working fine, but if any of the blank value is coming as blank, the its giving prb.
    I am facing the below problem.
    if  Input is - Jack  Michael  Richard
    output file is generated prorperly
    if input is- Jack           Richard
    then output is coming as - Jack  Richard 
    But I want result as - Jack                  Richard
    Please advise.
    Thanks in advance.

    Hi,
    Try this mapping:
                                                                                    InputField----
    >
    InputField --->
                           equalS  -
    >ifThenElse
    Constant[] --->                              Constant(with blank -
    >
                                                          spaces equal to length)
    -Supriya.

Maybe you are looking for

  • Credit Check in Sales order with partner other than payer

    Hello, We have typical business scenario in the sales process in yarn industry. Details are mention below: - Complete sales process starts with agent and ends with agent but payer(debtor) are always the end customer(Form C customers) which are also p

  • J_security_check and cookies

    Hi all. Im on a WLCS 3.5 with WLS 6.0 and am using Form based authentication against the RDBMS realm of the commerce server. The login page has a j_username and a j_password. If i want to add a check box for the user to approve to store a cookie on h

  • How can I email a song from my iTunes library?

    I have a song demo (my own song)  in my iTunes as an mp3 file; how do I go about emailing it to my producer??

  • Repeat Last Action?

    I'm fairly new to FM9 and am wondering if this feature exists already (and I just don't know about it). Coming from MS Word, it has a great "repeat last action" function hooked up to the F4 key. As I've been selecting text in FM and applying a charac

  • Showing location information in conversation windows

    Hi, I would like to know if it's possible to show location information in the conversation window. By default you see name - status - job title. I tried to do this with ABSConfig but didn't succeed. Is there any way to force this?