Regarding Ranges

Hi all,
INITIALIZATION.
  S_KSTAR-SIGN = 'I'.
  S_KSTAR-OPTION = 'BT'.
  S_KSTAR-LOW = '600000'.
  S_KSTAR-HIGH = '699999'.
  APPEND S_KSTAR.
  S_KSTAR-SIGN = 'I'.
  S_KSTAR-OPTION = 'BT'.
  S_KSTAR-LOW = '400000'.
  S_KSTAR-HIGH = '499999'.
  APPEND S_KSTAR.
  Through initialization i have appended two ranges for select option but when i am retrieving data from select statement it's taking only one range which is in header line. Please help me how to retrive data between two data ranges.
Thanks  & Regards,
Nagalakshmi.

If it is defined as a select option, the [] is not required.
This works:
TABLES t100.
DATA: t_100  TYPE STANDARD TABLE OF t100,
      wa_100 TYPE t100.
SELECT-OPTIONS: s_msg FOR t100-msgnr.
INITIALIZATION.
  s_msg-option = 'BT'.
  s_msg-sign = 'I'.
  s_msg-low = '020'.
  s_msg-high = '030'.
  APPEND s_msg.
  s_msg-low = '120'.
  s_msg-high = '130'.
  APPEND s_msg.
START-OF-SELECTION.
  SELECT * FROM t100 INTO TABLE t_100 WHERE sprsl EQ 'EN'
                                        AND arbgb EQ '00'
                                        AND msgnr IN s_msg.
END-OF-SELECTION.
  LOOP AT t_100 INTO wa_100.
    WRITE: / wa_100-msgnr.
  ENDLOOP.
So the question is: how have you defined s_kstar, what is your select statement? If s_kstar is defined as a select-option, or via the RANGES statement, then it DOES NOT use the header in the selection.

Similar Messages

  • Regarding ranges in my report

    HI EXPERTS,
    i have write a ranges in my report for checking pay scale group,
    i m passing 'W6'  but it is taking wagetypes '1000', it sud have taken wagetype '2000'....plz help me to sort out this.
    ***RANGES
    RANGES: R_TRFGR FOR p0008-TRFGR.
    INITIALIZATION.
      R_TRFGR-sign = 'I'. R_TRFGR-option = 'EQ'.
      R_TRFGR-low  = 'W1'.
      R_TRFGR-high  = 'W6'.
      APPEND R_TRFGR. CLEAR R_TRFGR.
    WHEN '0006'.
            if wa_final-TRFGR NOT IN R_TRFGR.
              move:'1000' to wa_final-lga01.
            else.
              move:'2000' to wa_final-lga01.
            endif.
            move:wa_excel-value to wa_final-bet01.

    Hi Rajat,
    instead of 'EQ' u use'  BT'
    i hope u will get some help...
    RANGES: R_TRFGR FOR p0008-TRFGR.
    INITIALIZATION.
    R_TRFGR-sign = 'I'. R_TRFGR-option = 'BT'.
    R_TRFGR-low = 'W1'.
    R_TRFGR-high = 'W6'.
    APPEND R_TRFGR. CLEAR R_TRFGR.
    WHEN '0006'.
    if wa_final-TRFGR NOT IN R_TRFGR.
    move:'1000' to wa_final-lga01.
    else.
    move:'2000' to wa_final-lga01.
    endif.
    move:wa_excel-value to wa_final-bet01.
    Thanks & Regards
    Ashu Singh

  • Regarding Range Partition

    Hi,
    Is it possible to add a partition which will only contain NULL values for RANGE PARTITIONING.
    Actually I cann't add a partition like "VALUES LESS THAN (MAXVALUE)"
    as dynamically we will drop and add partition in this table and if I add a partition like "VALUES LESS THAN (MAXVALUE)" then we cann't add a partition, as it will gives an error "ORA-14074: partition bound must collate higher than that of the last partition". Is there any way of adding only NULL partition for range partition.
    Thanks in advance,
    Koushik

    Hi,
    Yes, you won't be able to add a new partition.. but did you think about SPLIT partition instead of ADD ?
    Regards,
    Yoann.

  • Regarding range

    Hi experts,
    i used a range in my selection screen and used in a select statement . every thing was doing fine but when it (range field)was empty no data is selected by the select statement.
    select * from tab_name into table where matnr IN r_matnr .
    what should i do...
    thanks and regards
    abap.

    hi,
    the declaretion of range is :
    RANGES r_matnr FOR mara-matnr.
    r_matnr-low = p_matnr.
    r_matnr-sign = 'I'.
    r_matnr-option = 'CP'.
    APPEND r_matnr.
    and select is :
    SELECT vbeln matnr vgbel vgpos lfimg FROM lips
        INTO CORRESPONDING FIELDS OF TABLE it_lips FOR ALL ENTRIES IN it_likp
        WHERE vbeln EQ it_likp-vbeln and matnr IN r_matnr..
    if range field on selection screen is empty then this select fetch no data.
    what went wrong and what should i do for this..
    thanks and rgds
    abaper.

  • Regarding range tables

    Hello,
    I have a range table which gets populated with the following data.
    S.....O.......Low................High
    I......BT......<lower id>.......<higher id>
    I need to do some processing for each of the values in the range table, ie, all ids in the 'between' range. How do i get the individual ids in that range?
    Regards,
    Suraj

    Hello,
    Thank you all for your inputs.
    In my case, the user would enter either one or a range of ids ( this is master data).
    I need to get the details for each of these ids. The selection criteria entered by the user would be filled in a range table.
    My range table can have EQ or BT in that case.
    I now need to hit the DB to get the values of these ids.
    Can i still do a select * from table where id IN <range table name>.... even though it has both EQ and BT entries? Will it work?
    Regards,
    Suraj

  • Regarding Range of i/p to the Smartform

    hi all,
          I am Developing Credit Note. Here i/p is range like multiple selection ( 1 to 10 numbers ).
    For Each Number i need to display in Separate Page.
    Ex :     Credit Note Number 1       1st  Page
               Credit Note Number 2       2nd Page
               Credit Note Number 3       3rd  Page
               Credit Note Number 10     10th Page
      Here I done for Single Credit Note Number. I am unable to do for multiple selection through Smartform.
    (Because loop is not existing at Page Level ).
    Please Suggest any solution.
    Thanx & Regards
    Rami

    Hi
    In the MAIN window, you have a table I suppose..which runs a loop...so after disaplying the details of a single credit number, then create a Program  Lines node...and then...there write a code similar to this:
    on change of wa_credit. "here wa_credit is credit number field.
    v_counter = 1.
    endon.
    Now, Create a Command Node..and select check box goto next page, and give the second page...in conditions tab, write v_counter = 1.
    This wil trigger new page once details of a credit number have been displayed.
    Vishwa.

  • Regarding Ranges : to search for a patter which starts with 0 and any no: 0

    HI,
    My requirement is to use ranges on LIFNR to select data from EKKO.
    Here, I need to give 000123 for a vendor 123. ie, I need to prefix zeros.
    The problem is I cannot use any pattern here.. like if I give 12*, the conversion exit will give a dump.
    Is there any pattern to specify <0(or any occurance of 0)>12.*
    Thanks in advance,
    Sreekanth
    Edited by: Sreekanth Krishnan on Dec 1, 2009 7:46 AM

    hai sreekanth,
    try given Below program, May be helpful For u.....
    TABLES LFA1.
    data : begin of ivendor OCCURS 10,
           lifnr like lfa1-lifnr,
           end of ivendor.
    data: iekko like ekko OCCURS 10 WITH HEADER LINE.
    SELECT-OPTIONS : VENDOR FOR LFA1-LIFNR.
    INITIALIZATION.
    VENDOR-LOW    =   1000.        " It specifies the range starting value.
    VENDOR-HIGH    =   2000.       " It specifies the range ending value.
    VENDOR-OPTION  =  'BT'.        " specifies ranges value is in between.
    VENDOR-SIGN      = 'I'.           "specifies both inclussive.
    APPEND VENDOR.
    shift vendor-low LEFT DELETING LEADING space.
    shift vendor-high LEFT DELETING LEADING space.
    ivendor-lifnr = vendor-low.
    CONCATENATE '000' ivendor-lifnr into ivendor-lifnr.
    append ivendor.
    loop at ivendor.
    if ivendor-lifnr+3(6) <> vendor-high.
    ivendor-lifnr = ivendor-lifnr + 1.
    shift ivendor-lifnr LEFT DELETING LEADING space.
    CONCATENATE '000' ivendor-lifnr into ivendor-lifnr.
    append ivendor.
    endif.
    endloop.
    select * from ekko into table iekko for all ENTRIES IN ivendor
                                      where lifnr = ivendor-lifnr.

  • Query regarding Clustering

              We are able to run 6.0 and 6.1 versions in win2000 .can we do this on Solaris ..
              Do we need a differnet license for clustering ...
              Can we use one of the weblogic servers in cluster as proxy or sholud we use a
              differnt one as a proxy server
              Regards
              Ranga
              

    1. WebLogic runs on Sparc/Solaris. It is commonly deployed on Sparc/Solaris.
              2. WebLogic clustering requires a clustering license from BEA.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              Clustering Weblogic? You're either using Coherence, or you should be!
              Download a Tangosol Coherence eval today at http://www.tangosol.com/
              "Ranga Rao" <[email protected]> wrote in message
              news:[email protected]..
              >
              > We are able to run 6.0 and 6.1 versions in win2000 .can we do this on
              Solaris ..
              >
              > Do we need a differnet license for clustering ...
              >
              > Can we use one of the weblogic servers in cluster as proxy or sholud we
              use a
              > differnt one as a proxy server
              >
              > Regards
              > Ranga
              >
              >
              

  • Some Help regarding Clustering setup

              1.What are the versions of Weblogic supports clustering
              2.Do we need to have the same version of weblogic on the clustered servers
              3.Is it platform independent
              4.Can i work with different Unix flavours (Sun Solaris and HP-UX)
              5.What are the minimum requirements of S/W and H/W to setup Clustering
              6.Can i have two different versions of weblogic on the same server (Ex Weblogic
              6.0 and 6.1)
              Regards
              Ranga rao
              

    [att1.html]
              

  • RANGES USE

    Hi Friends,
    why we are sing ranges in org..
    what is diffreence between RANGES AND SELECT-OPTIONS..
    REGARDS,

    RANGES have to be declared when you want to put IF condition against a group of records.
    suppose you wanna say IF a = 3 or a = 5 or a = 7 or a =11
    you can do
    ranges xxx for XXX
    xxx-sign = 'I'
    xxx-option = 'EQ'
    xxx-low = 3
    append xxx
    xxx-sign = 'I'
    xxx-option = 'EQ'
    xxx-low = 5
    append xxx
    xxx-sign = 'I'
    xxx-option = 'EQ'
    xxx-low = 7
    append xxx
    xxx-sign = 'I'
    xxx-option = 'EQ'
    xxx-low = 11
    append xxx
    IF a IN xxx.
    logic
    ENDIF.

  • AE Range vs. other brands

    What's the consensus on the latest Airport Extreme base regarding range? I've read some that it's really good on distance for wireless use. Is that your experience?
    How does it compare with other brands?
    LinkSys? Netgear? Belkin? D-Link?
    Bottom line... is it worth the $180 or are there better routers out there with wired/wireless support?

    I'll second that. I'm running on b/g/n mode and I didn't have success with only N mode due to the fact I have two other b and g routers and a 5ghz phone system. Something was conflicting...
    Now, I get 4 bars whether inside or outside and the range is twice that of my two other older Linksys routers.
    Good luck!

  • Ranges in program

    Hi,
    please help me regarding ranges for an internal table

    Hi,
    Try this.
    *--- MACRO - Fill Company Code
    DEFINE fill_bukrs.
      r_bukrs-sign     = 'I'.
      r_bukrs-low      =  &1.
      r_bukrs-option  = 'EQ'.
      append r_bukrs.
    END-OF-DEFINITION.
    TABLES: t001.
    DATA: lit_bkpf LIKE STANDARD TABLE OF bkpf.
    RANGES: r_bukrs FOR t001-bukrs.
    fill_bukrs '0001'.
    fill_bukrs '0100'.
    fill_bukrs '1000'.
    fill_bukrs '1001'.
    * here DBTAB = database table
    * & INTAB = internal table
    SELECT *
            FROM <DBTAB>
            INTO TABLE <INTAB>
            WHERE bukrs IN r_bukrs.
    Let me know if you need any other information.
    Regards,
    RS

  • Ranges in Selection Screens

    Hi
    Can any body give the info regarding ranges in selection screens instead of selection-options.
    I want to use multiple selections
    Thanks & Regrads
    venkat

    Hi,
    Here both SELECT-OPTIONS & RANGES works for the same purpose.  They both are used for the range selection from selection screen.  The main diff. between them is, while we use SELECT-OPTIONS system implicitly creates the select options internal table which contains the fields of SIGN,OPTION,LOW & HIGH.  But in case of RANGES, this internal table should be defined explicitly.
    Eg. to SELECT-OPTIONS :
    REPORT YARSELECT.
    TABLES YTXLFA1.
    SELECT-OPTIONS : VENDOR FOR YTXLFA1-LIFNR.
    INITIALIZATION.
    VENDOR-LOW    =   1000.               " It specifies the range starting value.
    VENDOR-HIGH    =   2000.               " It specifies the range ending value.
    VENDOR-OPTION  =  'BT'.                " specifies ranges value is in between.
    VENDOR-SIGN      = 'I'.                     "specifies both inclussive.
    APPEND VENDOR.
    SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB 
    WHERE LIFNR IN VENDOR.
    Eg. to RANGES:
    REPORT YARRANGE.
    TABLES YTXLFA1.
    RANGES: VENDOR FOR YTXFLA1-LIFNR.
    SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB 
    WHERE LIFNR IN VENDOR.
    Here with RANGES  user has to design an internal table with fields - 
    SIGN,OPTION,LOW and HIGH EXPLICITLY.
    >
    Example:
    select-options: bukrs for zstock-bukrs.
    Should the user fill in 'ABFI' in BUKRS on the selection screen, BUKRS will look like this:
    IEQABFI
    This is because BUKRS is set as a table as follows:
    begin of bukrs occurs 0,
      SIGN(1)    type c,
      OPTION(2) type c,
      LOW         like bukrs,
      HIGH         like bukrs,
    end of bukrs.
    Now, when you create the following range, it will have the exact same fields set inside its table:
    Ranges: bukrs for zstock-bukrs.
    The difference is, because ranges doesn't show on the selection screen, you will have to fill it yourself, meaning you will have to fill bukrs-sign, bukrs-option, bukrs-low & bukrs-high all manually.
    Some tips:
    Sign is always I (for Include) or E (for Exclude)
    Option can be a whole range, which includes:
    EQ        (Equal) 
    BT        (Between)) 
    CP        (Contain Pattern)
    So let's say you want to have the range check for all company codes not starting with AB, you will set your code as follow:
    ranges: bukrs for zstock-bukrs.
    bukrs-sign = 'E'.             "Exclude
    bukrs-option = 'CP'.        "Pattern
    bukrs-low = 'AB*'.            "Low Value
    bukrs-high = ''.                "High Value
    append bukrs.
    Always remember to APPEND your range when you fill it, as the WHERE clause checks against the lines of the range table, not against the header line.
    Hope this explains it well enough.
    >
    What does SIGN "I" & "E" mean?
    The "I" stands for Include, and the "E" for Exclude.
    The easiest way to learn how the range selections work is, create the following dummy program:
    report dummy.
    tables: mara.
    select-options: matnr for mara-matnr.
    start-of-selection.
    loop at matnr.
    write: / matnr-sign,
               matnr-option,
               matnr-low,
               matnr-high.
    endloop.
    Run this program, and fill in a lot of junk into MATNR. Fill in some includes, some excludes, some ranges, etc., and you will soon realise how the system builds ranges (select-options). Once you know that, you can fill your own ranges quickly and efficiently.
    Regards,
    Sruthi

  • Opening and closing stock report

    Hi,
    i have to develop  a report in abap of stock (Opening and closing stock) with each material, plant, business area & monthly date wise. I got some fields from mseg like material number, plant, business area but i didnt get fileds like opening stock, purchase, consumption & closing stock
    in report fileds should be like
    material number
    plant
    business area
    posting date
    opening stock
    purchase
    consumption
    closing stock
    kinldy help <removed by moderator>
    Moderator message: Welcome to SCN!
    Moderator message: please search for available information, ask a functional consultant near you.
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|Asking Good Questions in the SCN Discussion Spaces will help you get Good Answers]
    Edited by: Thomas Zloch on Nov 21, 2011 3:35 PM

    Yes umesh from external 99% of your stock from mvt 101, 501 is very rare case & 561 is not from external source it is initial stock updation which will be done only once when you are going live & later 561 mvt will be normally blocked for use.
    You can also sort in MB5B more than one movement type click on multiple selection (that is on yellow arrow icon) & in single value tab enter mvt 101 below that 501.
    This will give you report for mvt types 101 & 501 in this way you can also sort reports for more than one mvt type.
    Regards
    Rang
    Message was edited by:
            Ranganath Mysore

  • Selection using check box in std ALV grid!

    Hi all,
    I have written a custom report to show the O/p in ALV grid.
    This is my code:
    TABLES :zpo_loi.
    TYPE-POOLS : slis.
    TYPE-POOLS: icon.
    TABLES : sscrfields.
    DATA : ls_composer TYPE ssfcompop,
               ls_control TYPE ssfctrlop.
    DATA : wa_return TYPE TABLE OF bapiret2  ,
            wa_address TYPE bapiaddr3.
    DATA : wa_crmd_orderadm_h TYPE zpo_loi,
           it_po TYPE TABLE OF crmd_orderadm_h,
           wa_po TYPE bbp_pds_header.
    DATA : it_tab TYPE TABLE OF zpo_loi.
    DATA :  it_data TYPE TABLE OF crmd_orderadm_h,
            wa_data TYPE bbp_pds_header,
            et_data TYPE bbps_sf_po_output.
    DATA : w_formname TYPE tdsfname ,
           w_sfname TYPE rs38l_fnam.
    DATA :it_po_no TYPE TABLE OF select_be_obj_id,
          wa_it_po_no  LIKE LINE OF it_po_no.
    DATA :r_itab TYPE ddshretval OCCURS 0.
    DATA : it_output LIKE TABLE OF zloi,
           wa_output TYPE zloi.
    DATA : w_answer TYPE c.
    DATA : g_repid LIKE sy-repid,
          g_title TYPE lvc_title,
          g_set_pf_stat TYPE slis_formname VALUE 'SET_PF_STATUS',
          g_user_command TYPE slis_formname VALUE 'USER_COMMAND',
          g_layout TYPE slis_layout_alv,
          g_print_alv TYPE slis_print_alv,
          g_variant LIKE disvariant,
          c_char_a(1) VALUE 'A',
          c_char_x(1) VALUE 'X',
          itab_alv_sort TYPE slis_t_sortinfo_alv,
          itab_alv_fcat TYPE slis_t_fieldcat_alv.
    *       Internal tables          Begin with IT_                       *
    DATA : it_fcat TYPE slis_t_fieldcat_alv,                           "---ALV
           it_disp TYPE TABLE OF zloi.
    *       Work Area for Internal tables      Begin with WA_             *
    DATA : wa_fcat TYPE slis_fieldcat_alv ,              "---ALV
           wa_layout           TYPE lvc_s_layo,               "---ALV
           wa_it_disp LIKE LINE OF it_disp.
    DATA : it_sf_po TYPE TABLE OF crmd_orderadm_h,
           wa_sf_po TYPE bbp_pds_header.
    *SELECTION-SCREEN:
    *  BEGIN OF SCREEN 500 AS WINDOW TITLE title,
    *  END OF SCREEN 500.
    *DATA : functxt TYPE smp_dyntxt.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS sel_po FOR zpo_loi-zobject_id.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS : pr_loi RADIOBUTTON GROUP grp1 USER-COMMAND ucom,
                 pr_fondo RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN END OF BLOCK b2.
    *       At selection-screen output                                    *
    AT SELECTION-SCREEN OUTPUT.
      IF pr_fondo = 'X'.
        REFRESH sel_po.
        LOOP AT SCREEN.
          IF screen-name = text-003 OR screen-name = text-004.
            screen-input = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF pr_loi = 'X'.
        LOOP AT SCREEN.
          IF screen-name = text-003 OR screen-name = text-004.
            screen-input = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *       At selection-screen on radiobutton                            *
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP grp1.
      IF pr_fondo  = 'X'.
        REFRESH sel_po.
        LOOP AT SCREEN.
          IF screen-name = text-003 OR screen-name = text-004.
            screen-input = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF pr_loi = 'X'.
        LOOP AT SCREEN.
          IF screen-name = text-003 OR screen-name = text-004.
            screen-input = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_po-low.
      PERFORM populate_table.
      PERFORM f4_help.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_po-high.
      PERFORM populate_table.
      PERFORM f4_help.
    *       At selection-screen                                           *
    AT SELECTION-SCREEN.
    *---CHECKING THE INPUT >>>
      IF sy-ucomm = 'ONLI'.
        PERFORM f002-check_input.
        PERFORM f001-check.
      ENDIF.
    *&      Form  POPULATE_TABLE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM populate_table .
      SELECT zobject_id
               description
      FROM zpo_loi
      INTO CORRESPONDING FIELDS OF TABLE it_tab.
      SORT it_tab BY zobject_id ASCENDING.
    ENDFORM.                    " POPULATE_TABLE
    *&      Form  F4_HELP
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f4_help .
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          ddic_structure = ' '
          retfield       = 'ZOBJECT_ID'
          dynpprog       = sy-repid
          dynpnr         = sy-dynnr
          dynprofield    = 'A'
          value_org      = 'S'
        TABLES
          value_tab      = it_tab
          return_tab     = r_itab.
    ENDFORM.                                                    " F4_HELP
    *&      Form  F001-CHECK
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f001-check .
      IF pr_fondo = 'X'.
        PERFORM display_expiring_fondos.
      ELSEIF pr_loi = 'X'.
        PERFORM fetch_po_det.
        PERFORM build_fcat.
        PERFORM alv_display.
      ENDIF.
    ENDFORM.                    " F001-CHECK
    *&      Form  F002-CHECK_INPUT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f002-check_input .
      IF pr_loi = 'X'.
        REFRESH it_po.
        IF sel_po-low IS NOT INITIAL.
          SELECT object_id
          FROM crmd_orderadm_h
          INTO CORRESPONDING FIELDS OF TABLE it_po
          WHERE object_type = 'BUS2201'
          AND object_id = sel_po-low.
          IF sy-subrc NE 0.
            IF sel_po-high IS NOT INITIAL.
              SELECT object_id
              FROM crmd_orderadm_h
              INTO CORRESPONDING FIELDS OF TABLE it_po
              WHERE object_type = 'BUS2201'
              AND  object_id = sel_po-high.
              IF sy-subrc NE 0.
                MESSAGE e009(zsrm).
              ENDIF.
            ENDIF.
            MESSAGE e007(zsrm).
          ENDIF.
        ELSE.
          MESSAGE e010(zsrm).
        ENDIF.
        IF sel_po-high IS NOT INITIAL.
          SELECT object_id
          FROM crmd_orderadm_h
          INTO CORRESPONDING FIELDS OF TABLE it_po
          WHERE object_type = 'BUS2201'
          AND  object_id = sel_po-high.
          IF sy-subrc NE 0.
            MESSAGE e008(zsrm).
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " F002-CHECK_INPUT
    *&      Form  FETCH_PO_DET
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fetch_po_det .
      REFRESH it_po.
      it_po_no[] = sel_po[].
      DATA : w_count TYPE i,
             w_lines TYPE c,
             wa_header TYPE bbp_pds_po_header_d.
      REFRESH : it_po,it_output.
      IF sel_po-high IS NOT INITIAL.
        SELECT object_id
               description
               posting_date
               created_by
        FROM crmd_orderadm_h
        INTO CORRESPONDING FIELDS OF TABLE it_po
        WHERE object_type = 'BUS2201'
        AND object_id BETWEEN sel_po-low AND sel_po-high.
      ELSE.
        SELECT object_id
               description
               posting_date
               created_by
        FROM crmd_orderadm_h
        INTO CORRESPONDING FIELDS OF TABLE it_po
        WHERE object_type = 'BUS2201'
        AND object_id = sel_po-low.
      ENDIF.
      w_lines = sy-dbcnt.
      w_count = 1.
      DO.
        IF w_count LE w_lines.
          READ TABLE it_po INTO wa_po INDEX w_count.
          MOVE wa_po-object_id TO wa_output-zzpono.
          MOVE wa_po-description TO wa_output-zzpodesc.
          MOVE wa_po-posting_date TO wa_output-zzpodate.
          MOVE wa_po-created_by TO wa_output-zzpocreator.
          CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
            EXPORTING
              i_object_id = wa_output-zzpono
            IMPORTING
              e_header    = wa_header.
          CALL FUNCTION 'BAPI_USER_GET_DETAIL'
            EXPORTING
              username = wa_output-zzpocreator
            IMPORTING
              address  = wa_address
            TABLES
              return   = wa_return.
          CLEAR wa_output-zzpocreator.
          CONCATENATE wa_address-firstname '   '  wa_address-lastname INTO wa_output-zzpocreator .
          MOVE wa_header-total_value TO wa_output-zzpoval.
          MOVE wa_header-currency TO wa_output-zzpocur.
          APPEND wa_output TO it_output.
          w_count = w_count + 1.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.                    " FETCH_PO_DET
    *&      Form  BUILD_FCAT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fcat .
      g_repid = sy-repid.
      g_title = 'Print LOI details'.
      g_print_alv-no_print_listinfos = 'X'.
      g_variant-report = sy-repid.
      g_variant-variant = sy-title.
      CLEAR g_layout.
      g_layout-f2code = ' '.
      wa_layout-zebra       = 'X'.
      g_layout-flexible_key = 'X'.
      g_layout-colwidth_optimize = 'X'.
      g_layout-detail_initial_lines = 'X'.
      g_layout-box_fieldname = 'ZZCHECK'.
      REFRESH it_fcat.
    *Po no
      CLEAR wa_fcat.
      wa_fcat-fieldname = 'ZZPONO' .
      wa_fcat-tabname = 'IT_DISP'.
      wa_fcat-seltext_m  = 'Purchase Order'.
    *wa_fcat-seltext_s = 'Purchase Order.
      wa_fcat-icon = 'X'.
      wa_fcat-col_pos = '2'.
      wa_fcat-outputlen = 10.
      APPEND wa_fcat TO it_fcat.
    *Description
      CLEAR wa_fcat.
      wa_fcat-fieldname = 'ZZPODESC' .
      wa_fcat-tabname = 'IT_DISP'.
    *wa_fcat-seltext_l = 'Description'.
      wa_fcat-seltext_m = 'Description'.
    *wa_fcat-seltext_s = 'Description'.
      wa_fcat-col_pos = '3'.
      wa_fcat-outputlen = 10.
      APPEND wa_fcat TO it_fcat.
    *Posting date
      CLEAR wa_fcat.
      wa_fcat-fieldname = 'ZZPODATE' .
      wa_fcat-tabname = 'IT_DISP'.
      wa_fcat-seltext_l = 'Posting Date'.
      wa_fcat-seltext_m = 'Posting Date'.
    *wa_fcat-seltext_s = 'Posting Date'.
      wa_fcat-col_pos = '4'.
      wa_fcat-outputlen = 8.
      APPEND wa_fcat TO it_fcat.
    *value
      CLEAR wa_fcat.
      wa_fcat-fieldname = 'ZZPOVAL' .
      wa_fcat-tabname = 'IT_DISP'.
    *wa_fcat-seltext_l = 'PO value'.
      wa_fcat-seltext_m = 'PO value'.
    *wa_fcat-seltext_s = 'PO value'.
      wa_fcat-col_pos = '5'.
      wa_fcat-outputlen = 15.
      wa_fcat-no_zero = 'X'.
      APPEND wa_fcat TO it_fcat.
    *Currency
      CLEAR wa_fcat.
      wa_fcat-fieldname = 'ZZPOCUR' .
      wa_fcat-tabname = 'IT_DISP'.
    *wa_fcat-seltext_l = 'PO Currency'.
      wa_fcat-seltext_m = 'PO Currency'.
    *wa_fcat-seltext_s = 'PO Currency'.
      wa_fcat-col_pos = '6'.
      wa_fcat-outputlen = 5.
      APPEND wa_fcat TO it_fcat.
    *Creator
      CLEAR wa_fcat.
      wa_fcat-fieldname = 'ZZPOCREATOR' .
      wa_fcat-tabname = 'IT_DISP'.
    *wa_fcat-seltext_l = 'Buyer'.
      wa_fcat-seltext_m = 'Buyer'.
    *wa_fcat-seltext_s = 'Buyer'.
      wa_fcat-col_pos = '7'.
      wa_fcat-outputlen = 12.
      APPEND wa_fcat TO it_fcat.
    ENDFORM.                    " BUILD_FCAT
    *&      Form  ALV_DISPLAY
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM alv_display .
      SORT it_output BY zzpono.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = g_repid
          i_callback_pf_status_set = g_set_pf_stat
          i_callback_user_command  = g_user_command
          i_grid_title             = g_title
          is_layout                = g_layout
          it_fieldcat              = it_fcat[]
          is_variant               = g_variant
          is_print                 = g_print_alv
        TABLES
          t_outtab                 = it_output[]
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.                    " ALV_DISPLAY
    *&      Form  user_command
    *       text
    *      -->R_UCOMM      text
    *      -->RS_SELFIELD  text
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.                             "#EC CALLED
      DATA: gd_repid LIKE sy-repid, "Exists
      ref_grid TYPE REF TO cl_gui_alv_grid.
      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.
      IF NOT ref_grid IS INITIAL.
        CALL METHOD ref_grid->check_changed_data .
      ENDIF.
      rs_selfield-refresh = 'X'.
      CASE r_ucomm.
        WHEN 'PRINTLOI'.
          PERFORM call_sf.
        WHEN 'BACK'.
          CALL SELECTION-SCREEN 1000.
        WHEN 'CANCEL'.
          CALL SELECTION-SCREEN 1000.
        WHEN 'EXIT'.
          CALL SELECTION-SCREEN 1000.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  set_pf_status
    *       text
    *      -->RT_EXTAB   text
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZALV' EXCLUDING rt_extab.
      SET TITLEBAR 'ZALV'.
    ENDFORM.                    "set_pf_status
    *&      Form  CALL_SF
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM call_sf .
      REFRESH it_sf_po.
      LOOP AT it_output INTO wa_output WHERE zzcheck = 'X'.
        wa_sf_po-object_id = wa_output-zzpono.
        APPEND wa_sf_po TO it_sf_po.
      ENDLOOP.
      w_formname = 'ZSR_EBP_DOCU_LETTEROFINTENT1'.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = w_formname
        IMPORTING
          fm_name            = w_sfname
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
      ENDIF.
      ls_composer-tdnewid = 'X'.
      ls_control-no_dialog = 'X'.
      LOOP AT it_sf_po INTO wa_sf_po.
        CALL FUNCTION w_sfname
          EXPORTING
            control_parameters = ls_control
            output_options     = ls_composer
            wa_object          = wa_sf_po
          EXCEPTIONS
            formatting_error   = 1
            internal_error     = 2
            send_error         = 3
            user_canceled      = 4
            OTHERS             = 5.
        IF sy-subrc <> 0.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " CALL_SF
    *&      Form  DISPLAY_EXPIRING_FONDOS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_expiring_fondos .
      SET PF-STATUS 'ZLOI'.
      SET TITLEBAR 'ZLOI'.
      TYPES : BEGIN OF ty_output1,
                guid TYPE bbp_guid,
                object_id TYPE crmt_object_id_db,
                description TYPE crmt_process_description,
                posting_date TYPE crmt_posting_date,
                zzfondo_dat TYPE zfondo_dat,
                created_by TYPE crmt_created_by,
               END OF ty_output1.
      DATA : it_output1 TYPE TABLE OF ty_output1,
             wa_output1 TYPE ty_output1,
              w_lines,
              w_count,
              it_fondo TYPE TABLE OF zsr_fondo,
              it_temp_fondo TYPE TABLE OF zsr_fondo,
              wa_temp_fondo TYPE zsr_fondo,
              wa_fondo TYPE zsr_fondo,
              w_diff TYPE p,
              wa_header1  TYPE bbp_pds_po_header_d.
      CONSTANTS : c_otype(8) VALUE 'BUS2201'.
      REFRESH : it_output1,it_temp_fondo,it_fondo.
      SELECT b~zzfondo_dat
             a~guid
             a~object_id
             a~description
             a~posting_date
             a~created_by
      INTO CORRESPONDING FIELDS OF TABLE it_output1
      FROM bbp_pdhsc AS b
      LEFT OUTER JOIN crmd_orderadm_h AS a ON b~guid = a~guid
      AND a~object_type = c_otype.
      LOOP AT it_output1 INTO wa_output1.
        CALL FUNCTION '/SDF/CMO_DATETIME_DIFFERENCE'
          EXPORTING
            date1            = sy-datum
            date2            = wa_output1-zzfondo_dat
          IMPORTING
            datediff         = w_diff
          EXCEPTIONS
            invalid_datetime = 1
            OTHERS           = 2.
        IF sy-subrc <> 0.
        ENDIF.
        IF w_diff <= '7'.
          wa_temp_fondo-zzpono = wa_output1-object_id.
          APPEND wa_temp_fondo TO it_temp_fondo.
        ENDIF.
      ENDLOOP.
    *select the final entries for PO whose FONDO is expiring
      DESCRIBE TABLE it_temp_fondo LINES w_lines.
      w_count = 1.
      DO.
        IF w_count LE w_lines.
          READ TABLE it_temp_fondo INTO wa_temp_fondo INDEX w_count.
          IF sy-subrc = 0.
            CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
              EXPORTING
                i_object_id = wa_temp_fondo-zzpono
              IMPORTING
                e_header    = wa_header1.
            wa_fondo-zzpono = wa_temp_fondo-zzpono.
            wa_fondo-zzpodesc = wa_header1-description.
            wa_fondo-zzpodate =  wa_header1-posting_date.
            wa_fondo-zzexpdate = wa_header1-zzfondo_dat.
            wa_fondo-zzpoval = wa_header1-total_value.
            wa_fondo-zzpocur = wa_header1-currency.
            wa_fondo-zzpocreator = wa_header1-created_by.
            CLEAR : wa_address.
            REFRESH wa_return.
            CALL FUNCTION 'BAPI_USER_GET_DETAIL'
              EXPORTING
                username = wa_header1-created_by
              IMPORTING
                address  = wa_address
              TABLES
                return   = wa_return.
            CLEAR wa_fondo-zzpocreator.
            CONCATENATE wa_address-firstname '   '  wa_address-lastname INTO wa_fondo-zzpocreator .
            w_count = w_count + 1.
            APPEND wa_fondo TO it_fondo.
          ENDIF.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_structure_name = 'ZSR_FONDO'
          i_grid_title     = 'EXPIRING FONDOS'
        TABLES
          t_outtab         = it_fondo[]
        EXCEPTIONS
          program_error    = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.                    " DISPLAY_EXPIRING_FONDOS
    Now in my ALV grid o/p i can see the check box but if i select one row and then try to select another the first one gets deselected.
    Can anybody tell me what is missing?

    Hi,
    Try like changing  this
    insted of
    g_layout-f2code = ' '.
    use this
    g_layout-f2code = 'DISP'. " Sets fcode for when double
    and
    g_layout-f2code = '&ETA'. " it will display POPUP screen
    Best Regards
    Ranga
    Edited by: Ranga Swamy on Nov 1, 2008 11:07 PM
    Edited by: Ranga Swamy on Nov 1, 2008 11:17 PM

Maybe you are looking for