Query on retrieving data back to the program from ALV List

Hi Group,
I have a requirement to send the details of the selected data as an ALV list to the user.
Then, the user selects either 1 or 2 or all or none back to the program from the ALV.
Thing is that,
1) when the user selects ( Icon ) to choose all the fields, they were not getting checked and in turn, I was not been able to read the records as checked in the program ( this is for All selection records ).
2) And also, I am not able to get the records checked ( incase of the user selects all fields ).
In short, I should be able to read the records which were checked and process only that records.
please let me know if you have any queries on the same.
Thank you very much in advance for the help.
Regards,
Vishnu.

hi,
try like this
TABLES:     ekko.
TYPE-POOLS: slis.                           
TYPES: BEGIN OF t_ekko,
  sel,                         "stores which row user has selected
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
  statu TYPE ekpo-statu,
  aedat TYPE ekpo-aedat,
  matnr TYPE ekpo-matnr,
  menge TYPE ekpo-menge,
  meins TYPE ekpo-meins,
  netpr TYPE ekpo-netpr,
  peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
      wa_ekko TYPE t_ekko.
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
      fieldcatalog1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
      gd_tab_group TYPE slis_t_sp_group_alv,
      gd_layout    TYPE slis_layout_alv,
      gd_repid     LIKE sy-repid.
DATA : BEGIN OF det_tab OCCURS 0,
        ebeln LIKE ekpo-ebeln,
       END OF det_tab.
START-OF-SELECTION.
  PERFORM data_retrieval.
  PERFORM build_fieldcatalog.
  PERFORM build_layout.
  PERFORM display_alv_report.
*&      Form  BUILD_FIELDCATALOG
      Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
  fieldcatalog-fieldname   = 'EBELN'.
  fieldcatalog-seltext_m   = 'Purchase Order'.
  fieldcatalog-outputlen   = 10.
  fieldcatalog-emphasize   = 'X'.
  fieldcatalog-key         = 'X'.
  APPEND fieldcatalog TO fieldcatalog.
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'EBELP'.
  fieldcatalog-seltext_m   = 'PO Item'.
fieldcatalog-col_pos     = 1.
  APPEND fieldcatalog TO fieldcatalog.
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'STATU'.
  fieldcatalog-seltext_m   = 'Status'.
  APPEND fieldcatalog TO fieldcatalog.
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'AEDAT'.
  fieldcatalog-seltext_m   = 'Item change date'.
  APPEND fieldcatalog TO fieldcatalog.
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'MATNR'.
  fieldcatalog-seltext_m   = 'Material Number'.
  APPEND fieldcatalog TO fieldcatalog.
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'MENGE'.
  fieldcatalog-seltext_m   = 'PO quantity'.
  APPEND fieldcatalog TO fieldcatalog.
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'MEINS'.
  fieldcatalog-seltext_m   = 'Order Unit'.
  APPEND fieldcatalog TO fieldcatalog.
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'NETPR'.
  fieldcatalog-seltext_m   = 'Net Price'.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-do_sum      = 'X'.        "Display column total
  fieldcatalog-datatype     = 'CURR'.
  APPEND fieldcatalog TO fieldcatalog.
  CLEAR  fieldcatalog.
  fieldcatalog-fieldname   = 'PEINH'.
  fieldcatalog-seltext_m   = 'Price Unit'.
  APPEND fieldcatalog TO fieldcatalog.
  CLEAR  fieldcatalog.
ENDFORM.                    " BUILD_FIELDCATALOG
*&      Form  BUILD_LAYOUT
      Build layout for ALV grid report
FORM build_layout.
  gd_layout-box_fieldname     = 'SEL'.
  "set field name to store row selection
  gd_layout-edit              = 'X'. "makes whole ALV table editable
  gd_layout-zebra             = 'X'.
ENDFORM.                    " BUILD_LAYOUT
*&      Form  DISPLAY_ALV_REPORT
      Display report using ALV grid
FORM display_alv_report.
  gd_repid = sy-repid.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = gd_repid
      i_callback_user_command  = 'USER_COMMAND'
      i_callback_pf_status_set = 'SET_STAT'
      is_layout                = gd_layout
      it_fieldcat              = fieldcatalog[]
      i_save                   = 'X'
    TABLES
      t_outtab                 = it_ekko
    EXCEPTIONS
      program_error            = 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.
ENDFORM.                    " DISPLAY_ALV_REPORT
*&      Form  DATA_RETRIEVAL
      Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
  SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
   UP TO 10 ROWS
    FROM ekpo
    INTO CORRESPONDING FIELDS OF TABLE it_ekko.
ENDFORM.                    " DATA_RETRIEVAL
      FORM USER_COMMAND                                          *
      --> R_UCOMM                                                *
      --> RS_SELFIELD                                            *
FORM user_command USING r_ucomm LIKE sy-ucomm
                  rs_selfield TYPE slis_selfield.
  CASE r_ucomm.
    WHEN '&IC1'.
      IF rs_selfield-fieldname = 'EBELN'.
        READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
        SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
        CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
      ENDIF.
    WHEN 'DET'.  "user presses SAVE
      CLEAR det_tab.
      REFRESH det_tab.
      LOOP AT it_ekko INTO wa_ekko WHERE sel = 'X'.
        MOVE-CORRESPONDING wa_ekko TO det_tab.
        APPEND det_tab.
      ENDLOOP.
      PERFORM build_cat.
      PERFORM dis_data.
  ENDCASE.
ENDFORM.                    "user_command
*&      Form  set_stat
      text
     -->RT_EXTAB   text
FORM set_stat USING rt_extab TYPE slis_t_extab.
  SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.
ENDFORM.                    "set_stat
*&      Form  build_cat
      text
FORM build_cat.
  CLEAR fieldcatalog1.
  REFRESH fieldcatalog1.
  fieldcatalog1-fieldname = 'EBELN'.
  fieldcatalog1-tabname = 'DET_TAB'.
  fieldcatalog1-seltext_m = 'Order No.'.
  fieldcatalog1-outputlen = 10.
  APPEND fieldcatalog1 TO fieldcatalog1.
  CLEAR fieldcatalog1.
ENDFORM.                    "build_cat
*&      Form  dis_data
      text
FORM dis_data.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = 'ZTEST_DS'
      it_fieldcat        = fieldcatalog1[]
      i_save             = 'X'
    TABLES
      t_outtab           = det_tab.
ENDFORM.                    "dis_data
here i have created one button(DET) in toolbar along with all the buttons of ALV..
when i click on this i am getting detail list....
reward if usefull....

Similar Messages

  • How to write a sql query to retrieve data entered in the past 2 weeks

    Hi,
    I have file names and last accessed date(java.sql.Date format) stored in my database table, I would like to know how I can write a query to get the name of files accessed in the past 2 weeks,I use open sql server at the back end.
    Thanks in advance.

    This has essentially nothing to do with JDBC. JDBC is just an API to execute the SQL language using Java and thus interact with the databases.
    Your problem is related to the SQL language, you don't know how to write the SQL language. I suggest you to go through a SQL tutorial (there is one at w3schools.com) and to read the SQL documentation which come along with the database in question. A decent database manfacturer has a website and probably also a discussion forum / mailinglist as well.
    I'll give you a hint: you can just use equality operators in SQL like everywhere. For example: "WHERE date < somedate".

  • Web Analysis Error -- Error while executing query and retrieving data

    Regarding Web Analysis:
    We have a number of reports that we created. yesterday they were all working fine. today we try to open them and most are generating an error.
    The error is:
    Error while executing query and retrieving data.; nested exception is:
    com.hyperion.ap.APException: [1033] Native:
    1013033[Thu Oct 22 09:08:17
    2009]server name/application name/database name/user name/Error91013033)
    ReportWriter exit abnormally
    Does anyone have any insight into what is going on?
    My version information is:
    Hyperion System 9 BI+ Analytic Administration Services 9.3.0.1.1 Build 2
    Web Analysis 9.3.0.0.0.286
    Thanks in advance for your help.
    DaveW

    Hi,
    And also click on check option by opening the query in Query designer,as Mr . Arun suggested.
    And if you get any error in checking, see the long message(detail).
    With rgds,
    Anil Kumar Sharma .P

  • Send Data back to the Server

    Hi.
    how to send data back to the server using J2ME or how to communicate with server using J2ME

    i am using http its work well on emulator but when i install the application on sony ericsssin p910i or k700i or nokia 7710 then its not working and simply hang.
    here is sample code which is run well on emulator but not on mobile.
    what is the problem in that or how can this code run in mobile is there any mobile specific setting or internet setting.
    Pls reply asap.
    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    * An example MIDlet to invoke a CGI script.
    public class ThirdExample extends MIDlet {
    private Display display;
    // String url = "http://www.javacourses.com/cgi-bin/getgrade.cgi?idnum=182016";
    String url = "http://sampler.infopro.stpn.soft.net/midletdata.asp?name=name";
    public ThirdExample() {
    display = Display.getDisplay(this);
    * Initialization. Invoked when we activate the MIDlet.
    public void startApp() {
         try {
    getGrade(url);
         } catch (IOException e) {
         System.out.println("IOException " + e);
         e.printStackTrace();
    * Pause, discontinue ....
    public void pauseApp() {
    * Destroy must cleanup everything.
    public void destroyApp(boolean unconditional) {
    * Retrieve a grade....
    void getGrade(String url) throws IOException {
    HttpConnection c = null;
    InputStream is = null;
    OutputStream os = null;
    StringBuffer b = new StringBuffer();
    TextBox t = null;
    int x = 5, y =7;
    try {
    c = (HttpConnection)Connector.open(url);
    c.setRequestMethod(HttpConnection.GET);
    c.setRequestProperty("IF-Modified-Since", "10 Nov 2000 17:29:12 GMT");
    c.setRequestProperty("User-Agent","Profile/MIDP-1.0 Confirguration/CLDC-1.0");
    c.setRequestProperty("Content-Language", "en-CA");
    os = c.openOutputStream();
    String str = "?idnum=182016";
    byte postmsg[] = str.getBytes();
    for(int i=0;i<postmsg.length;i++) {
    os.writeByte(postmsg);
    os.flush();
    is = c.openDataInputStream();
    int ch;
    while ((ch = is.read()) != -1) {
    b.append((char) ch);
    System.out.println((char)ch);
    t = new TextBox("Final Grades", b.toString(), 1024, 0);
    } finally {
    if(is!= null) {
    is.close();
    if(os != null) {
    os.close();
    if(c != null) {
    c.close();
    display.setCurrent(t);

  • Hi, I have a new cell phone, I wanted to give my iphone to my father, instead of deleting the content on the iphone I have deleted the entire iphone. It starts up no more. iTunes will not recognize the iphone. How do I get my old data back onto the phone?

    Hi, I have a new cell phone, I wanted to give my iphone to my father, instead of deleting the content on the iphone I have deleted the entire iphone. It starts up no more. iTunes will not recognize the iphone. How do I get my old data back onto the phone?

    Place the device in DFU mode (google it) and restore as new.

  • Importing XML Data Back into the Form

    I have a form that shows several subforms based on the selections the user has made while filling in the form. This is working quite well but when I import the XML data back into the form it doesn't show the subforms that have been used.
    Is there an easy way to change this?
    Thanks in advance!
    Emma

    Actually the issue may actually have to do with the fact that the connections aren't bound, but I haven't seen the data.
    I have some fairly complex forms that include both subforms and instances, have an XSD embedded and export as XML. When I import the data, everythi
    Now, that being said...
    Are your subforms "hidden" and you opt to display them upon selection of a radio button for example, or do you SetInstances()? If you're using visible=TRUE or FALSE, that may also cause some issues.
    Try this -- on Form:ready try this code:
    if(this.rawValue == "on"){ //this radio button 1
    _subform1.setInstances(1);
    _subform2.setInstances(0);
    _subform3.setInstances(0);
    else if(this.rawValue == "on"){ //this radio button 1
    _subform1.setInstances(0);
    _subform2.setInstances(1);
    _subform3.setInstances(0);
    else if(this.rawValue == "on"){ //this radio button 1
    _subform1.setInstances(0);
    _subform2.setInstances(0);
    _subform3.setInstances(1);
    else { // this is fisrt time open -- i sometimes had issues with subforms being visible on first entry
    _subform1.setInstances(0);
    _subform2.setInstances(0);
    _subform3.setInstances(0);
    Then on:Click essentially copy most of the code you put in form:ready
    if(this.rawValue == "on"){ //this radio button 1
    _subform1.setInstances(1);
    _subform2.setInstances(0);
    _subform3.setInstances(0);
    else if(this.rawValue == "on"){ //this radio button 1
    _subform1.setInstances(0);
    _subform2.setInstances(1);
    _subform3.setInstances(0);
    else if(this.rawValue == "on"){ //this radio button 1
    _subform1.setInstances(0);
    _subform2.setInstances(0);
    _subform3.setInstances(1);
    Of course this will go on top of your radio button group.
    If you are exporting to XML, it will make your life a whole lot easier, by the way, to import an XSD and bind your nodes, especially as your forms and data start to get more complex.
    Finally, you may also know this but -- unless you have Forms Server, any user that wants to export the data or import the data will need to have at least full Acrobat Professional. If you want people to be able to save data in the form but import/export isn't that important, they will need to have full Acrobat.
    I hope that helps a bit. Good luck!
    Lisa

  • There was an error while writing data back to the server: Failed to commit objects to server : Duplicate object name in the same folder.

    Post Author: dmface15
    CA Forum: Administration
    I am working in a new enviorment and i am trying to save a report to the Crystal Server via the CMC. I am uploading the report from the objects tab and attempting to save to a folder. The report has 1 static defined parameter and that's it. When i click submit to save the report i receive the following error message: "There was an error while writing data back to the server: Failed to commit objects to server : Duplicate object name in the same folder." There is not a anothe report within the folder with that name. What could be causing this error message and equally important, what is the solution.

    hte message you received about duplicate user probably means something hadn't fully updated yet. Once it did then it worked...
    Regards,
    Tim

  • Backed up my songs from itunes onto a hard drive and now my playlists in itunes are gone! How do I retrieve them back to the way it was before?

    Help! My husband backed up my songs from itunes onto a hard drive and now my playlists in itunes are gone from my library! How do I retrieve them back to the way it was before?

    Hello Nataroo007,
    Thank you for using Apple Support Communities!
    There is a file in the iTunes library folder that contains your playlist information is the iTunes Library.xml file.
    Try and find the file, usually located in one of these locations depending on your OS:
    Operating System
    Default location of iTunes Folder
    Mac OS X
    /Users/[your username]/Music
    Microsoft Windows XP
    \Documents and Settings\[your username]\My Documents\My Music\
    Microsoft Windows Vista
    \Users\[your username]\Music\
    Microsoft Windows 7
    \Users\[your username]\My Music\
    Then you can import this file to your iTunes Library like this:
    1. Choose File > Library > Import Playlist.
    2. Navigate to the "iTunes Library.xml" file
    3. Windows users: Click Open.
    If your Podcasts list in iTunes is empty after following these steps, learn how to add them back into iTunes.
    Note: information in this post comes from article:
    iTunes: How to re-create your iTunes library and playlists
    http://support.apple.com/kb/HT1451
    Cheers,
    Sterling

  • I am using a program that opens a document in adobe and I need to save it back in the program.  I get this message: this document is trying to connet to: fill://index.cfm?event=vendorsonly.submiteventform.  Help

    I am using a program that opens a document in adobe and I need to save it back in the program.  I get this message: this document is trying to connet to: fill://index.cfm?event=vendorsonly.submiteventform.  Help

    Have you contacted the people who make the program? It sounds like something special from that program.

  • After restoring my phone as New, how do I get my contacts and data back without the restrictions password

    I forgot my restrictions password so I restored my Iphone as a New phone.  Now, how do I get the contacts, apps and other data back on the Iphone? Can I restore my contacts & data without it also requiring a restrictions password again?

    Thanks for replying.  I had to do this process in order to get ICloud activated so I don't have it there.  I do have an external backup of the Itunes library, but it sounds like that would also restore the restriction password that I don't know.
    Why would ICloud be different (if I had backed up there?) Does it only save data?
    And It sounds like I need to keep my contacts in another source .... such as? ...  No, I don't use email much and my contacts arec the phone numbers I've captured in my phone.  After I have them backed up to ICloud, do I also need to make sure they are somewhere else to where I won't run into losing them again?
    appreciate your experience and help.

  • Dynamically pass the date to all the programs in a chain

    Hi,
    I have a requirement to pass the date to all the programs in the chain. The first step when the chain starts should be to calculate the next batch date from a oracle table, and then pass that date as an argument to all the programs.
    For example,
    This should be the sequence of steps once the chain has started.
    1. Start Chain
    2. Step1 - Calculate the next batch date from the oracle table.
    3. Step2 - After the successful completion of Step1, run the program with the input parameter as date which is calculated from Step1.
    4. End Chain
    Please help.

    Hi,
    The recommended way of doing this is to store tha data to be passed (in this case the date) in a table and have the other steps access it.
    If you have many chains, or the same chain used several times, you can use the job name and owner as the primary key for the table. You can then pass the job name and owner into every program as metadata arguments (see define_metadata_argument) so every step knows what job is a part of and can select the data from the table.
    Hope this helps,
    Ravi.

  • Re-initialize the data during running the program

    Any function in the Labview that can help me to re-initialize the data during running the program?
    Thanks!
    Regards,
    Ivan

    Ivan,
    I am not sure if I understand your question. You can reinitialize your board and load different board parameters at any time as a part of your program. This will stop actions on the board and then start over with any movements. Use Initialize Controller.flx VI to do this.
    A. Talley
    Applications Engineering
    National Instruments

  • After I did a change in the drumsection on a song the program just "went down". It's impossible to go back tinto the program. It just tryn to open the song, nothing happend and then out again... What can I do?

    After I did a change in the drumsection on a song the program just "went down". It's impossible to go back tinto the program. It just tryn to open the song, nothing happend and then out again... What can I do?

    see if anything in this troubleshooting article helps: http://support.apple.com/kb/HT2801?viewlocale=en_US

  • How do I pass an error status from my java code back to the Program Job Ser

    How do I pass an error status from my java code back to the Program Job Server?
    I have a jar program object that reports a scheduled status of "Success" even if the java code errors out.

    Exceptions thrown from the program object are ignored by the program job server.
    You need to configure the Program Object, then stream out a special string sequence to the stdout of the Program Object, to set the scheduled instance status to Failed.
    Look up SAP KBase  1201804 - How to programmatically set the status of a Program object to "Failed"
    Sincerely,
    Ted Ueda

  • The programs open tab ( list of programs open on comp) is always popping up on middle of screen whenever I go near the mouse.  HELP!!!  Have turned it off recently and moved it, a mac mini, now on new plug in and set up it now does it.

    The programs open tab ( list of programs open on comp) is always popping up on middle of screen whenever I go near the mouse.  HELP!!!  Have turned it off recently and moved it, a mac mini, now on new plug in and set up it now does it.
    Yes I have turned it off and restarted it, ubnplugged mouse and plugged it back  in.
    Have not updated it in a little bit
    running mavericks, which I dislike.10.9.1
    This is a new problem,
    Why where and what do I need to do to fix it? Please.
    Thanks for your help community, You guys are awesome, better than the guys n girls at Apple!!
    I have also noticed the drop down menu arrow on Numbers Tabs has dissappeared since move.
    you know the invisible arrow that appears in the additional tabs pages in "Numbers program"
    Especially an inconvenient for previous Numbers users as you all know.
    any word on New Numbers Tutes at all??
    You'd think with a Billion dollars they could make a 10 min clip saying here are changes guys, go enjoy new layout.....  Just saying...  not.
    anyway Hi and any help out there tonight is GREATLY APPRECIATED.
    Cheers Jason.

    If the reset doesn't work:
    FORCE IPAD INTO RECOVERY MODE
    1. Turn off iPad
    2. Turn on computer and launch iTune (make sure you have the latest version of iTune)
    3. Plug USB cable into computer's USB port
    4. Hold Home button down and plug the other end of cable into docking port. Do not release button until you see picture of iTune and plug (very important)
    5. Release Home button.
    ON COMPUTER
    6. iTune has detected iPad in recovery mode. You must restore this iPad before it can be used with iTune.
    7. Select "Restore iPad"...
    Note: Data will be lost

Maybe you are looking for

  • IO Error while deploying CAF WebDynpro DC

    I am trying to deploy a CAF WebDynpro DC and get this error message while deploying with LocalDevelopment (no NWDI): All required pre-development steps for local development of a WebDynpro with GP interface (used DC's, implemented interfaces, WebDynp

  • Monitor for IMac is Faded and Blueish

    What is causing my faded and blue tintish display right now?

  • Functional Area (FN) missing in objects list

    Hi All, In transaction PP01, we cannot view "Functional Area (FN)" object under the Object type drop down list. It is als not shown under "Maintain Object Type" list. Can someone help how can be available. Is there any business function or switch to

  • ADS: com.adobe.ProcessingException: XMLFM Exception - P(200101)

    Hi, Exception       SYSTEM_ERROR Message ID:          FPRUNX                     Message number:           001 Message: ADS: com.adobe.ProcessingException: XMLFM Exception - P(200101) I am getting the above error while executing adobe forms function

  • Synchrone read file interface ?

    Hi Guys, I need to build a webservice that returns a .jpg picture as an attachment to the SOAP messgae. I have build a webservice to java proxy interface. But i*m stuck, because the MessageAttachment is not working on PI 7.11 yet. Any of you have a g