How can use simpler code?

How can use simpler code for checking a particular value in a string?
FIND 'C' IN fg_result ."FOR PAYMENT METHODS "CPRS"
IF sy-subrc NE 0. FIND 'P' IN fg_result.ENDIF.
IF sy-subrc NE 0. FIND 'R' IN fg_result.ENDIF.
IF sy-subrc NE 0. FIND 'S' IN fg_result.ENDIF.
IF SY-SUBRC = 0.

Dear Shashank,
DATA:  GV_SRCH(1)    TYPE   C.
CASE  GV_SRCH.
  WHEN 'C'.
                  FIND 'C' IN fg_result.
  WHEN 'P'.
                  FIND 'P' IN fg_result
  WHEN 'R'.
                  FIND 'R' IN fg_result
  WHEN 'S'.
                  FIND 'S' IN fg_result
ENDCASE.
Regards,
Abir
Don't forget to award Points *

Similar Messages

  • How  can use a variable in the folowing code?

    How  can use a variable 'W_ROWNUM2' in the folowing code?
    MOVE '1' TO CNT.
    LOOP AT L_T_PM2.
                  CONCATENATE '0' CNT INTO W_ROWNUM2.CONDENSE W_ROWNUM2.
                   CONCATENATE 'F110V-VARI'W_ROWNUM2'(01)' INTO FLD2.
        perform  DYNPRO_FIELD       using FLD2
                                     L_T_PM2-vari12_con.
                   CNT = CNT + 1.
                   CONDENSE CNT.                                                              
    ENDLOOP.
    I need to increment the value of W_ROWNUM2.
    Please ,it is urgent!!

    Hello
    CONCATENATE 'F110V-VARI'W_ROWNUM2'(01)' INTO FLD2.
    Try using spaces between parts of the resulting string.
    CONCATENATE 'F110V-VARI'  W_ROWNUM2  '(01)'   INTO FLD2
    Regards
    Greg Kern.

  • How can change my code without using if else in procedure

    Hai ,
    I have wrote code like this
    if RPTFORMNTH='M' then
    SELECT coalesce(SUM(IN_RWEEKS),0),
    INTO C2_COL1
    FROM HS_CASEDTA_DTLS_TB
    WHERE UPPER(VR_HAUNM) like NVL(case when HAUNM='0' then null else UPPER(HAUNM) END , UPPER(VR_HAUNM))||'%'
    AND IN_ULBOBJID=ULBOBJID AND CH_FLAG!='D'
    AND VR_RPTFORMNTH=VR_RPTFORMNTH
    AND IN_YEAR=IN_YEAR;
    ELSE
    SELECT
    coalesce(SUM(IN_RWEEKS),0),
    INTO C2_COL1
    FROM HS_CASEDTA_DTLS_TB
    WHERE UPPER(VR_HAUNM) like NVL(case when HAUNM='0' then null else UPPER(HAUNM) END , UPPER(VR_HAUNM))||'%'
    AND IN_ULBOBJID=ULBOBJID AND CH_FLAG!='D'
    AND
    TO_DATE(('01/'||VR_RPTFORMNTH||'/'||IN_YEAR),'DD/MM/YYYY')
    BETWEEN to_date('04/' || to_char(RPTYEAR-1),'MM/YY')
    AND add_months(to_date(RPTFORMNTH || to_char(RPTYEAR),'MonYYYY'),1)-1;
    END IF;
    My query is without using if else and replicate data in if and else how can i modify code.Observe that only where condition i want changes that's why i used if else without that how can i modify where clause with that two conditions.Please give me guidance.
    Regards ,
    rajendar.

    hi,
    I think you want your condition to change inside the where clause so you could have only one select statement. If that is so try this:
    SELECT coalesce(SUM(IN_RWEEKS),0),
    INTO   C2_COL1
    FROM   HS_CASEDTA_DTLS_TB
    WHERE  1 = CASE WHEN RPTFORMNTH='M' THEN
                    CASE WHEN UPPER(VR_HAUNM) like NVL(case when HAUNM='0' then null else UPPER(HAUNM) END , UPPER(VR_HAUNM))||'%'
                              AND IN_ULBOBJID=ULBOBJID AND CH_FLAG!='D'
                              AND VR_RPTFORMNTH=VR_RPTFORMNTH
                              AND IN_YEAR=IN_YEAR
                   THEN 1
                         ELSE 0
                    END
               ELSE --  RPTFORMNTH !='M'
                    CASE WHEN UPPER(VR_HAUNM) like NVL(case when HAUNM='0' then null else UPPER(HAUNM) END , UPPER(VR_HAUNM))||'%'
                              AND IN_ULBOBJID=ULBOBJID AND CH_FLAG!='D'
                              AND TO_DATE(('01/'||VR_RPTFORMNTH||'/'||IN_YEAR),'DD/MM/YYYY')
                              BETWEEN to_date('04/' || to_char(RPTYEAR-1),'MM/YY')
                              AND add_months(to_date(RPTFORMNTH || to_char(RPTYEAR),'MonYYYY'),1)-1
                         THEN 1
                         ELSE 0
                    END
               ENDMessage was edited by:
    Bobbydj
    hi Are, after belatedly reading Rob's post, I think his post is better. I was only looking at your highlighted code, but he took the most common conditions inside the where clause.

  • HT201328 I have iphone 4 with virgin mobile canada, virgin provided me SIM unlock code online, but i don't know how to use that code to unlock my phone. Can anyone help me in this?

    I have iphone 4 with virgin mobile canada, virgin provided me SIM unlock code online, but i don't know how to use that code to unlock my phone. Can anyone help me in this?

    That's not how unlocking an iPhone works.
    The carrier the phone is locked to submits a request to Apple, wh updates their database. When that is complete, you restore the phone with iTunes to process the unlock.

  • How Can i hard code variable at reports in obiee 11g

    Hi
    I created as variable at rpd and using variable i am able to get expected results.
    But i dont want to use variable directly , how can i hard code variable code at report and get same results.
    Can anyone help me on this.
    Thanks

    Not clear what you trying to achieve, try to go thru given info.
    The statement 'select 1 from dual' in init blocks works using connection pool, but the same will not work in report since report understands Presentation Catalog objects.
    In the report your query suppose to be like select 1 from Subject area where someColumn >0
    If helps pls mark

  • How to use Java code inside WebDynpro-ABAP

    Hi,
        How to use Java code inside WebDynpro-ABAP.
    Could any one provide sample code.
    Cheers,
    Sam

    Hi Sam,
    We can't Bring Java Inside the ABAP. Both are running in different Environments.
    and also ABAP Codes are runs on BASIS.
    -Basis is a middleware between ABAP codes and Ur OS.
    -Contains set of programs to load,RUN,intepret the ABAP program..
    So Both are Different.
    Regards,
    Ramganesan K.

  • Where is View Source? How can the source code of a website be viewed?

    Where is View Source? How can the source code of a website be viewed?
    View Source used to be accessed via a drop-down menu, but no longer. Why?
    I'm using Firefox 24.0.

    1.)Get into Firefox.
    2.)open any page that you want to see the source code.
    3.)After complete opening of the page do"right click"then you can see view page source,click it to see Source of the page.
    Thank you.

  • How can i write code in Inbound ABAP proxy method

    Hi,
    All
    Iam doing server proxy ascenario
    /people/siva.maranani/blog/2005/04/03/abap-server-proxies
    i have done
    steps:
    1:I have done inbound  proxy interface in xi
    2:i have created a inbound abap proxy in my SAP WEB AS6.4 using SPROXY.
    3:I need to write code in Z11_EMPDETAILS_IN~EXEXUTE_ASYNCHRONOUS method
    if i double click on that method it is not opening how can I write code.

    Hi,
    You have to goto the class
    <b>ZCL</b>_EMPDETAILS_IN~EXEXUTE_ASYNCHRONOUS not
    <b>Z11</b>_EMPDETAILS_IN~EXEXUTE_ASYNCHRONOUS
    Check on the third step.
    Regards
    Vijaya

  • How can use Attrib and Trasitive attrib in Infoset in BI7

    Hi Experts,
    How can use Attrib and Trasitive attrib in Infoset In BI7.
    Detail will be great.
    Thanks

    Hi Saipriya
    the code :
    data : begin of itab occurs 0,
    partner_no like crmd_order_index-partner_no,
    gross_value like crmd_pricing_i-gross_value,
    end of itab .
    data : begin of wa occurs 0,
    partner_no like crmd_order_index-partner_no,
    gross_value like crmd_pricing_i-gross_value,
    end of wa .
    data : begin of itab2 occurs 0,
    partner_no like crmd_order_index-partner_no,
    gross_value like crmd_pricing_i-gross_value,
    end of itab2 .
    data : begin of wa2,
    partner_no like crmd_order_index-partner_no,
    gross_value like crmd_pricing_i-gross_value,
    end of wa2 .
    START-OF-SELECTION.
    select partner_no
           gross_value
    into CORRESPONDING FIELDS OF TABLE itab
    from crmd_order_index join crmd_pricing_i on crmd_order_index~item eq
    crmd_pricing_i~guid
    where crmd_order_index~process_type_ix = 'ZTA'
      and crmd_order_index~pft_1 = 'X'  .
    LOOP AT itab INTO wa .
          MOVE-CORRESPONDING wa TO itab2.
      COLLECT itab2.
    ENDLOOP.
    LOOP AT itab2 INTO wa2 .
    APPEND BP_GROSS.
    actually we don't know how can we benefit from this code in infoset.
    table1 :CRMD_ORDER_INDEX (the table we take customer number (CRMD_ORDER_INDEX-PARTNER_NO))
    table2 : CRMD_PRICING_I (We take gross value form this table)
    We added BP_GROSS field (adtiona filed to infoset) and would like to append the value we have from the code (Total gross per Customer) but it doesn't work in infoset.
    Thanks in advance.
    M.

  • This device cannot find enough free resources that it can use. (Code 12)

    Got the above error when i insert a firewire card with via chipset. I have update the firewire driver by picking a list of device driver from my computer and though it prompt me to restart but yet it still shows the yellow exclamation mark and next i update it through online, same thing it prompt me to restart which i did but sad to say it shows the yellow exclamation again
    When i check under properties>general tab, it says the following Quote
    This device cannot find enough free resources that it can use. (Code 12)
    If you want to use this device, you will need to disable one of the other devices on this system.
    You need to restart your computer before the changes you made to this device will take effect.
    Click 'Check for solutions' to send data about this device to Microsoft and to see if there is a solution available.
    As far as i know the irq in bios setup is all set as auto and the total there's 4 pci slot and only 1 that is using, so how can it be resources being used up?? 
    Fyi i'm using Msi P35 neo3 mobo with vista ultimate sp1

    Under device manager> VIA OCHI Compliant IEEE 1394 host controller> right click it and choose update driver follow by choosing the option of search automatically for updated software (window would search your computer and the internet for the lastest driver software for your device)
    Once done i reboot and next bingo.... the yellow exclamation was no longer there, infact it was quite wierd when i try updating online, as the very first time it doesn't work but wouldn't know why the second time it does  

  • How can i write code inside methods.

    Hi,
       I am new to wbdynpro. How can i write code in Webdynpro?
    I have created one layout in that two textboxes are there. After entering the details when i click on the button the datas should be saved into the database table. How can i write code in this.
    please help me.
    Shyja

    Hi,
    First in context create node for 2 input field. Then disign layout for input filds and do data binding. Then create button and assign ON action event to it. In action method use wizard to read the values from the node.
    DATA: Node type REF TO IF_WD_CONTEXT_NODE,
    elem_node1 TYPE REF TO if_wd_context_element,
    stru_node1 type ZEMP.
    Node = wd_Context->get_Child_Node( Name = `S_NODE2` ).
    get element via lead selection
    elem_node1 = node->get_element( ).
    get all declared attributes
    elem_node1->get_static_attributes(
    IMPORTING
    static_attributes = stru_node1 ).
    INSERT ZEMP FROM stru_node1.
    If helpful reward points.
    Regards,
    Karthick S

  • How can use linux in my macbook?

    how can use linux in my macbook?

    You can use various distributions of Linux either by running them under Boot Camp, or in a virtualized environment such as Parallels or VMWare's Fusion. Note that you may have to try several different distros until you find one that works. I settled on Ubuntu running under Parallels.
    Best of luck.

  • How can use my songs as my ringtone...???

    How can use my songs as my ringtone...???

    You have to create the ringtones.
    Type "create iphone ringtones" inot the google search bar.  I did and got several links to learn how to make ringtones.

  • How can use my Wireless Location Appliance to work with RF ID's?

    How can use my Wireless Location Appliance to work with RF ID's for Asset Tagging.
    It seems Smartcard used for ID cards have a small RF ID, can I use this for Asset Tagging?
    Thanks in Advance

    There are two kinds of RFID tags: Active tags, which have a battery or other internal power source, and passive tags, which have no power source and work by reflecting the energy from an RFID scanner (basically). At the energy levels and distances used for WiFi location detection, passive tags will not return a detectable signal.
    Take a look at http://www.aeroscout.com/ for more info on WiFi RFID tagging.

  • How to use pramotional code in iStore?

    Hi,
    We have added promotional code. Its for 10% discount. But as we add code number still at item level discount is not calculated.
    So if any setup is missing plz tell. We are using 11i.
    Regards,
    Ashish

    Hello Ashish,
    Confirm your setups are as per the example in:
            How to use Promotion Codes in iStore Shopping Cart (Doc ID 156009.1)
    Check qualifiers on this modifier -
      Remove and re-add one by one to determine if any are problematic
    Please check above items to isolate possible setup issues.
    Regards,
    Debbie

Maybe you are looking for

  • Schedule Lines dates for sales order

    Our goal is this:  On the line item > Schedule Line tab there is the requested delivery date.  In the details of that schedule line there are five different dates: Delivery Date Goods Issue Date Loading Date Material Aval. Date Transportation Plan. d

  • GE70 2PE Apache Pro - Bluetooth not fully functional

    Hi. I just bought the laptop mentioned in the subject line and I have not been able to get Bluetooth to work fully. Everything shows up normally and correctly in the Device Manager and the System Tray, but connecting to my iPhone sometimes works and

  • Setup could not find sound blaster card Audigy on your system, But I'ts there, can anyone he

    Still having problems, card works fine , no conflicts, onboard soundcard disabled, but can't install software, I have the same system that it has always worked fine on, only difference is I have bought Windows XP Media Edition, It's a Audigy Platinum

  • Download error server not responding

    I keep getting a download error "server not responding correctly" when I try to download creative cloud.  I had it on my old system, buy now I've installed a new hard drive and can't get creative cloud downloaded.

  • Groupware Connecter/Exchange Server

    Hi All, We are thinking about using the Groupware connector for MS Exchange server.  The installation guide instructs to store the contact information in Public folder but Public folders are going away.  Yes we can use the private folders but then sy