How to save data in a report?Urgent...

hi all,
I'm doing a project in java to create report generator..After creating a report i have to save the report..For that i have to save the datas & the program to execute the data..My doubt is that how i would store the data?.According to my idea i created a table that contains the field names for report header,date ,fieldcount etc..how to store the field values?Because different people selecting different fields from a table..How could i store the values?is it to create each table for storing field values for each report?Could you please clarify my doubt as soon as possible?
Regards
Preethi

hi,
Thanks so much for your quick reply..i'll clear my doubt..I'm doing a project in java that helps to create reports for java programs(same concept as that of crystal repots)..For that I made 3 tabs in a tabpane.The first tab consists of Mainpanel(to select the database,then table, fields and report header)..The next tab is the Design tab.This tab consists of ReportHeader,PageHeader,Detail Section etc.In this tab there are facilities to adjust the font size,font type,the position of each headings and field positions.And final tab is the Preview tab.Here the reports can be viewed with the selected font and with data for each field..Here i have to give an option to save the report.To save the report i have to save the data and the code necessary to execute these datas.i think i have to store the font type,font size,the x && y position that the user selected at the time of design.My doubt is how could I save these values?by using database & table concept or by using FileOutPutStreams..The number of field sthe user selected may be diffreent for each of the file?Didi you get my doubt?Hope you got it..
Regards
Preethi Renjith

Similar Messages

  • How to save data in ztable after editing in alv report

    how to save data in ztable after editing in alv report?

    Hi,
        Please find the attachment below.This may be usefull to you.
         [http://wiki.sdn.sap.com/wiki/display/Snippets/ALV-Editingandsavingtheeditedvaluesin+Database%28OOPS%29]
    Regards,
    Ramakrishna Yella.

  • How to exctract data from a report to use it in a process

    Hi! I would like to know how to exctract data from a report to use it in a process. Let's say that I have a report which have following fields: id_person, name_person. And then, I want to make a process which introduce the id_person (from report) into an associative tabel. How can I reffer to the fields from my report?
    I was thinking about something like that( this should be the code from my process)
    insert into associative_table(id_person)
    values(id_person) or
    insert into associative_table(id_person)
    values(Report_name.id_person) but it doesn't work....
    Thank you very much.

    Another option, use collections.
    Create an on load process that loads all the rows you would have in your report into a collection:
    begin
    HTMLDB_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(
    p_collection_name => 'ASSIGNED_CALENDAR_CONTACTS' );
    for x in (SELECT CONTACT_ID, CONTACT_FNAME, CONTACT_LNAME
    FROM CONTACT
    WHERE InStr( pkg_CalendarMgr.f_FetchContactIDsForDay( TO_DATE( :P3_CALENDAR_DT, 'YYYYMMDD' ), 'OF' ), CONTACT_ID ) > 0 )
    loop
    htmldb_collection.add_member(p_collection_name => 'ASSIGNED_CALENDAR_CONTACTS',
    p_c001 => x.CONTACT_ID,
    p_c002 => x.CONTACT_FNAME,
    p_c003 => x.CONTACT_LNAME);
    end loop;
    end;
    Then, instead of your report selecting from the table, have it select from the collection, this way your display will match what's in the collection:
    SELECT c001, c002 || Chr(32) || c003 CONTACT_NAME, 'Remove' remove
    FROM htmldb_collections
    WHERE collection_name = 'ASSIGNED_CALENDAR_CONTACTS'
    ORDER BY c003, c002
    Then you can have a button on the form that steps through the collection, one element at a time and does whatever you want it to.

  • Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it. 
    Alex D
    Applications Engineer
    National Instruments

  • How to save data model design in pdf or any format..?

    how to save data model design in pdf or any format..?
    i ve created design but not able to save it any mage or pdf format

    File -> Print Diagram -> To PDF File

  • How to save data in New Excel Sheet on each time run the VI?

    Hello everyone 
    I am doing my dissertation. In that i have to store the data of load cell in the excel sheet. I have done that.
    Here i have attach the vi , template in which want to save data named My , and output when complete the rn of vi named My Report.
    Now the problem is once i have run the vi , my report is generated but second time when i run the vi the new my report sheet is not generated. and the second problem is i am getting out put as 511, 0,  2.49.  
    I want the when ever i run the vi every time the new excel sheet should be generated and saved with date, time and my report tag. ex. My Report 20/11/13 12:00
    And i want the output 511,2.49,...dont want this 0.
    please hepl me out its urgent
    Attachments:
    COM TO EXCEL WITH EXCEL TOOLKIT.vi ‏44 KB
    MY.xlsx ‏12 KB
    My_Report 1.xlsx ‏12 KB

    You just need to change the settings. Whenever it will write to excel it will display the save as option.
    Then user will confirm the same
    In the excel dispose report.vi passsave change and close report boolean input as TRUE and see
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet

  • Save Data in ALV Report .

    Hello,
    Given below is my code
    *& Report  ZALV_TEST_SA                                                *
    REPORT  ZALV_TEST_SA NO STANDARD PAGE HEADING.
    *----------------------TYPE POOL OF ALV--------------------------------*
    TYPE-POOLS: SLIS.
    *----------------------DATABASE TABLES---------------------------------*
    TABLES: ZFLIGHTM_SA, ZFLIGHT_AVAIL_SA.
    *-------------DATA DECLARATION-----------------------------------------*
    DATA: BEGIN OF ITAB OCCURS 0,
             ZFLIGHT_ID TYPE ZFLIGHT_ID,
             ZCITY_FROM TYPE ZCITY_FROM,
             ZCITY_TO TYPE ZCITY_TO,
             ZDEP_DATE TYPE DATS,
             ZTIME TYPE TIMS,
             ZPRICE TYPE ZPRICE,
             ZNUM_OF_PSNGRS(3) TYPE N,
             ZAVAIL_SEATS(3) TYPE N,
          END OF ITAB.
    DATA: BEGIN OF ITABM OCCURS 0,
             MANDT TYPE MANDT,
             ZFLIGHT_ID TYPE ZFLIGHT_ID,
             ZCITY_FROM TYPE ZCITY_FROM,
             ZCITY_TO TYPE ZCITY_TO,
             ZTIME TYPE TIMS,
             ZPRICE TYPE ZPRICE,
          END OF ITABM.
    DATA: BEGIN OF ITAB_AVAIL OCCURS 0,
             MANDT TYPE MANDT,
             ZFLIGHT_ID TYPE ZFLIGHT_ID,
             ZDEP_DATE TYPE DATS,
             ZNUM_OF_PSNGRS(3) TYPE N,
             ZAVAIL_SEATS(3) TYPE N,
          END OF ITAB_AVAIL.
    DATA: WA_ITAB LIKE LINE OF ITAB,
          WA_ITABM LIKE LINE OF ITABM,
          WA_ITAB_AVAIL LIKE LINE OF ITAB_AVAIL.
    DATA: L_REPID LIKE SY-REPID,
          L_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          L_LAYOUT TYPE SLIS_LAYOUT_ALV,
          L_EVENTS TYPE SLIS_T_EVENT.
    DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    *----------------SELECTION SCREEN SELECT-OPTIONS-----------------------*
    SELECT-OPTIONS S_CITY FOR ZFLIGHTM_SA-ZCITY_FROM NO INTERVALS.
    SELECT-OPTIONS D_CITY FOR ZFLIGHTM_SA-ZCITY_TO NO INTERVALS.
    SELECT-OPTIONS D_DATE FOR ZFLIGHT_AVAIL_SA-ZDEP_DATE NO INTERVALS.
    *----------------------SELECTION OF DATA-------------------------------*
    PERFORM SELECT_DATA.
    *----------------SETTING DATA IN TABLE FOR FIELD CATALOG---------------*
    PERFORM CALL_FIELDCAT_MERGE.
    *----------CALLING FUNCTION FOR DISPLAYING REPORT----------------------*
    PERFORM DISPLAY_TABLE.
    *----------------------AT SELECTION SCREEN EVENT-----------------------*
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'STORE'.
           PERFORM SAVE_DATA.
        WHEN 'PREVIOUS'.
           LEAVE TO SCREEN 0.
        WHEN OTHERS.
      ENDCASE.
    *------------------------------FORMS-----------------------------------*
    *&      Form  SELECT_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM SELECT_DATA .
      SELECT A~ZFLIGHT_ID    ZCITY_FROM
             ZCITY_TO        ZDEP_DATE
             ZTIME           ZPRICE
             ZNUM_OF_PSNGRS  ZAVAIL_SEATS
         FROM ZFLIGHTM_SA AS A INNER JOIN ZFLIGHT_AVAIL_SA AS B
            ON A~ZFLIGHT_ID = B~ZFLIGHT_ID
             INTO CORRESPONDING FIELDS OF TABLE ITAB
                WHERE A~ZCITY_FROM IN S_CITY
                  AND A~ZCITY_TO IN D_CITY
                  AND B~ZDEP_DATE IN D_DATE.
      L_REPID = SY-REPID.
    ENDFORM.                    " SELECT_DATA
    *&      Form  CALL_FIELDCAT_MERGE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM CALL_FIELDCAT_MERGE .
    *  CLEAR WA_FIELDCAT.
    *  WA_FIELDCAT-TABNAME       = ITAB.
    *  WA_FIELDCAT-FIELDNAME     = 'ZFLIGHT_ID'.
    *  WA_FIELDCAT-KEY           = 'X'.     "sets key field
    *  APPEND WA_FIELDCAT TO  L_FIELDCAT.
    *  WA_FIELDCAT-TABNAME       = ITAB.
    *  WA_FIELDCAT-FIELDNAME     = 'ZPRICE'.
    * WA_FIELDCAT-KEY           = 'X'.     "sets key field
    *  APPEND WA_FIELDCAT TO  L_FIELDCAT.
    *  WA_FIELDCAT-TABNAME       = ITAB.
    *  WA_FIELDCAT-FIELDNAME     = 'ZAVAIL_SEATS'.
    *  WA_FIELDCAT-KEY           = 'X'.     "sets key field
    *  APPEND WA_FIELDCAT TO  L_FIELDCAT.
    *--------------CALLING FUNCTION FOR FIELD CATALOG----------------------*
      CLEAR L_FIELDCAT.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
         I_PROGRAM_NAME               = L_REPID
         I_INTERNAL_TABNAME           = 'ITAB'
    *       I_STRUCTURE_NAME             = 'WA_ITAB'
    *       I_CLIENT_NEVER_DISPLAY       = 'X'
         I_INCLNAME                   = 'ZALV_TEST_SA'
         I_BYPASSING_BUFFER           = 'X'
    *       I_BUFFER_ACTIVE              =
        CHANGING
          CT_FIELDCAT                  = L_FIELDCAT
    *     EXCEPTIONS
    *       INCONSISTENT_INTERFACE       = 1
    *       PROGRAM_ERROR                = 2
    *       OTHERS                       = 3
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *--------------EDITING FIELDS IN FIELD CATALOG ------------------------*
      LOOP AT L_FIELDCAT INTO WA_FIELDCAT.
        CASE WA_FIELDCAT-FIELDNAME.
             WHEN 'ZFLIGHT_ID'.
               WA_FIELDCAT-COL_POS = '1'.
    *          WA_FIELDCAT-text_fieldname = 'Flight ID'.
               WA_FIELDCAT-KEY = '3'.
               WA_FIELDCAT-JUST = 'L'.
               WA_FIELDCAT-NO_ZERO = 'X'.
               WA_FIELDCAT-EMPHASIZE = 'X'.
               WA_FIELDCAT-SELTEXT_L = 'Flight ID'. "40 char long field name
               WA_FIELDCAT-SELTEXT_M = 'Flight ID'. "20 char long field name
               WA_FIELDCAT-SELTEXT_S = 'Flight ID'. "10 char long field name
             WHEN 'ZCITY_FROM' .
               WA_FIELDCAT-NO_OUT = 'X'.
             WHEN 'ZCITY_TO' .
               WA_FIELDCAT-NO_OUT = 'X'.
             WHEN 'ZDEP_DATE' .
               WA_FIELDCAT-NO_OUT = 'X'.
             WHEN 'ZTIME' .
               WA_FIELDCAT-NO_OUT = 'X'.
             WHEN 'ZPRICE' .
               WA_FIELDCAT-COL_POS = '2'.
    *          WA_FIELDCAT-text_fieldname = 'Flight ID'.
               WA_FIELDCAT-KEY = '4'.
               WA_FIELDCAT-JUST = 'L'.
               WA_FIELDCAT-NO_ZERO = 'X'.
    *          WA_FIELDCAT-EMPHASIze = 'X'.
               WA_FIELDCAT-SELTEXT_L = 'Price'. "40 char long field name
               WA_FIELDCAT-SELTEXT_M = 'Price'. "20 char long field name
               WA_FIELDCAT-SELTEXT_S = 'Price'. "10 char long field name
               WA_FIELDCAT-EDIT = 'X'.
             WHEN 'ZNUM_OF_PSNGRS' .
               WA_FIELDCAT-NO_OUT = 'X'.
             WHEN 'ZAVAIL_SEATS' .
               WA_FIELDCAT-COL_POS = '3'.
    *          WA_FIELDCAT-text_fieldname = 'Flight ID'.
               WA_FIELDCAT-KEY = '4'.
               WA_FIELDCAT-JUST = 'L'.
               WA_FIELDCAT-NO_ZERO = 'X'.
    *          WA_FIELDCAT-EMPHASIze = 'X'.
               WA_FIELDCAT-SELTEXT_L = 'Available Seats'.
               "40 char long field
               WA_FIELDCAT-SELTEXT_M = 'Available Seats'.
               "20 char long field
               WA_FIELDCAT-SELTEXT_S = 'Seats'. "10 char long field name
               WA_FIELDCAT-EDIT = 'X'.
             WHEN OTHERS.
               WA_FIELDCAT-NO_OUT = 'X'.
        ENDCASE.
    MODIFY L_FIELDCAT FROM WA_FIELDCAT.
      ENDLOOP.
    ENDFORM.                    " CALL_FIELDCAT_MERGE
    *&      Form  USER_COMMAND_ALV_SA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM USER_COMMAND_ALV_SA USING I_UCOMM LIKE SY-UCOMM
                            IS_SELFIELD TYPE SLIS_SELFIELD.
    *****form frm_usercommand using r_ucomm like sy-ucomm
    *****rs_selfield type slis_selfield.
    ****CASE I_UCOMM.
    CASE sy-ucomm.
        WHEN 'STORE'.
           PERFORM SAVE_DATA ON COMMIT.
        WHEN 'PREVIOUS'.
           LEAVE TO SCREEN 0.
        WHEN OTHERS.
    ENDCASE.
    ENDFORM.                    "USER_COMMAND_ALV_SA
    *&      Form  DISPLAY_TABLE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM DISPLAY_TABLE .
    *  L_FIELDCAT-input = 'X'.
    *  L_FIELDCAT-edit = 'X'.
    *  L_LAYOUT-Edit = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
    I_CALLBACK_PROGRAM                = L_REPID " report id
    I_CALLBACK_PF_STATUS_SET          = 'ZALV_TEST_SA' " to set pf-status
    I_CALLBACK_USER_COMMAND           = 'USER_COMMAND_ALV_SA' " to handle
                                                              " user command
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  = ''
    *   I_BACKGROUND_ID                   = ' '
    *   I_GRID_TITLE                      =
    *   I_GRID_SETTINGS                   =
    *   IS_LAYOUT                         = L_LAYOUT
    IT_FIELDCAT                       = L_FIELDCAT " for field catalog
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
    *   IS_VARIANT                        =
    IT_EVENTS                         = L_EVENTS "internal table with
                                                               " user events
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   I_HTML_HEIGHT_TOP                 =
    *   I_HTML_HEIGHT_END                 =
    *  IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
       TABLES
        T_OUTTAB                          = ITAB "internal table with
                                                                   " records
       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_TABLE
    *-------------------------SET PF-STATUS--------------------------------*
    *&      Form  ZALV_TEST_SA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM  ZALV_TEST_SA USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'ZALV_TEST_SA' .
    ENDFORM.                    "ZALV_TEST_SA
    *&      Form  SAVE_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM SAVE_DATA.
      LOOP AT ITAB INTO WA_ITAB.
    ****HIDE:WA_ITAB-ZFLIGHT_ID,      WA_ITAB-ZCITY_FROM,
    ****WA_ITAB-ZCITY_TO,        WA_ITAB-ZTIME,
    ****WA_ITAB-ZDEP_DATE,       WA_ITAB-ZNUM_OF_PSNGRS,
    ****WA_ITAB-ZAVAIL_SEATS.
        CLEAR: WA_ITABM,WA_ITAB_AVAIL.
        WA_ITABM-ZFLIGHT_ID          = WA_ITAB-ZFLIGHT_ID.
        WA_ITABM-ZCITY_FROM          = WA_ITAB-ZCITY_FROM.
        WA_ITABM-ZCITY_TO            = WA_ITAB-ZCITY_TO.
        WA_ITABM-ZTIME               = WA_ITAB-ZTIME.
        WA_ITABM-ZPRICE              = WA_ITAB-ZPRICE.
        WA_ITAB_AVAIL-ZDEP_DATE      = WA_ITAB-ZDEP_DATE.
        WA_ITAB_AVAIL-ZNUM_OF_PSNGRS = WA_ITAB-ZNUM_OF_PSNGRS.
        WA_ITAB_AVAIL-ZAVAIL_SEATS   = WA_ITAB-ZAVAIL_SEATS.
        APPEND WA_ITABM TO ITABM.
        APPEND WA_ITAB_AVAIL TO ITAB_AVAIL.
      ENDLOOP.
      MODIFY ZFLIGHTM_SA FROM TABLE ITABM.
      MODIFY ZFLIGHT_AVAIL_SA FROM TABLE ITAB_AVAIL.
      COMMIT WORK.
    ENDFORM.                    " SAVE_DATA
    I want to edit a field--the price and save the changes. I have assigned a button STORE for this. But my data is not getting saved.
    I searched the forum and wrote the code accordingly. I even referred the stored programs. Still I am not getting the output. Please help.
    Regards,
    Smruthi.
    Edited by: Smruthi Acharya on Feb 10, 2009 3:31 PM
    Edited by: Julius Bussche on Feb 10, 2009 12:16 PM
    Please use code tags

    Hi,
    You must have taken some function code for that STORE button (say you have taken it as   MODIFY )
    Use this code, it will modify the code in internal table from alv.
    I have tried it, n its working:-
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                = ' '
    *     I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = v_rep_id       " report id
         i_callback_pf_status_set          = 'PF'           " for PF-STATUS
         i_callback_user_command           = 'USER_COMMAND' " for User-Command
    *     I_CALLBACK_TOP_OF_PAGE            = ' '
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
    *     I_GRID_TITLE                      =
    *     I_GRID_SETTINGS                   =
         is_layout                         = wa_layout      " for layout
         it_fieldcat                       = it_field       " field catalog
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS                 =
         it_sort                           = it_sort        " sort info
    *     IT_FILTER                         =
    *     IS_SEL_HIDE                       =
    *     I_DEFAULT                         = 'X'
    *     i_save                            = 'A'
    *     is_variant                        = wa_variant     " variant name
    *     IT_EVENTS                         =
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT                          =
    *     IS_REPREP_ID                      =
    *     I_SCREEN_START_COLUMN             = 0
    *     I_SCREEN_START_LINE               = 0
    *     I_SCREEN_END_COLUMN               = 0
    *     I_SCREEN_END_LINE                 = 0
    *     I_HTML_HEIGHT_TOP                 = 0
    *     I_HTML_HEIGHT_END                 = 0
    *     IT_ALV_GRAPHICS                   =
    *     IT_HYPERLINK                      =
    *     IT_ADD_FIELDCAT                   =
    *     IT_EXCEPT_QINFO                   =
    *     IR_SALV_FULLSCREEN_ADAPTER        =
    *   IMPORTING
    *     E_EXIT_CAUSED_BY_CALLER           =
    *     ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_final      " internal table
       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.
    *&      Form  USER_COMMAND
    *       SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
    *       AND EXECUTE THE APPROPIATE CODE
    *      -->LV_OKCODE   used to capture the function code
    *                     of the user-defined push-buttons
    *      -->L_SELFIELD   text
    FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
    * assign the function code to variable v_okcode
      lv_okcode = sy-ucomm.
    * handle the code execution based on the function code encountered
      CASE lv_okcode.
    * when the function code is MODIFY (STORE button) then save data
        WHEN 'MODIFY'.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          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.
    " at this point your data in internal table is changed
    * refresh the ALV Grid output from internal table
          l_selfield-refresh = c_check.
    ENDFORM.                    "USER_COMMAND
    Hope this helps you.
    Regards,
    Tarun

  • How to print Data Model in Report??

    Do anyone know how to print Data Model??
    Thanks your help.
    - Frank

    Hi Venkat,
    Thanks alot.... i am checking the appendix k.
    I want to know that if i want to customize the report as per the client requirement,
    can you please let me know which template i will use if i required remittence advice as well as check print data on the layout.
    The following is the list of field i required:
    Vendor ID
    Check Date
    Check number
    invoice date
    invoice/ CR memo number
    invoice description
    invoice gross amount
    invoice discount amount
    invoice net amount
    total gross amount
    total discount amount
    total net amount
    logo
    company name and info
    bank name and info
    check number
    check amount spelled out
    check date
    check amount numeric
    payee name
    CEO signature
    MICR check number
    MICR routing number
    MICR bank account number
    mailing return address
    mailing address
    Venkat it would be great help if you please let me know the exact process to be follow for check printing report.
    I worked on bi publisher report in 11i, but in 12i the process is bit different.
    also if you have any template ready can you please send me on my mail id ... i forwarded you the test mail from my official id or on [email protected]
    Looking forward to your kind response.
    Regards
    Ratnesh

  • How to print date/time in report page footer?

    Hi
    I have a report which users can print as PDF.
    However, I like to display current date/time in report footer.
    I can see the Page Footer in section but can't figure out how to print date/time there.
    Thanks for help.

    hi movilogo
    Please try this.
    Create hidden item P1_DATE
    Create On load process in page 1 and put this code
    begin
    :P1_DATE:=TO_CHAR(SYSDATE,'DD-MON-YYYY HH:MM:SS');
    end;
    Open your region in Page 1 put this code in Footer area
    *&P1_DATE.*
    Refresh your page.
    you will get the output like this.
    16-SEP-2009 11:09:17
    thanks
    Mark Wyatt

  • How generate a XML file & how to save data in that file?

    hi,
    How to generate an xml file & how to add data in that xml file? is there anyone who can help me about this? Firstly i need to open a xml file and after that i need to save user data in that file? how i will do it? What will be the solution of this? please give me solution........
    with regards
    Bina

    With an API like Xerces you can parse an XML document into a DOM tree. You can do modifications on that tree manually and then write it back out as XML data.
    http://xerces.apache.org/xerces2-j/

  • How to save data after clicking checkbox stored in databasetable

    TYPE-pools: slis.
    tables:mkpf,mseg,mard.
    TYPES: BEGIN OF tp_data,
          mblnr LIKE mseg-mblnr,
         matnr LIKE mseg-matnr,
         werks LIKE mard-werks,
         lgort LIKE mard-lgort,
         lgpbe LIKE mard-lgpbe,
         charg LIKE mseg-charg,
         bwart LIKE mseg-bwart,
         budat LIKE mkpf-budat,
         menge LIKE mseg-menge,
         meins LIKE mseg-meins,
         kostl LIKE mseg-kostl,
         aufnr LIKE mseg-aufnr,
         rsnum LIKE mseg-rsnum,
         checkbox TYPE c,
      __mark,
    END OF tp_data,
    tp_tbl_data TYPE STANDARD TABLE OF tp_data.
    Constants
    Data objects (variable declarations and definitions)
    Report data to be shown.
    DATA: it_data TYPE STANDARD TABLE OF tp_data.
    Heading of the report.
    DATA: t_heading TYPE slis_t_listheader.
    ========================== Selection Screen ==========================
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
                   smatnr FOR mseg-matnr MODIF ID m2,
                   swerks FOR mard-werks MODIF ID m3,
                   slgort FOR mard-lgort MODIF ID m4,
                   slgpbe FOR mard-lgpbe MODIF ID m5,
                   scharg FOR mseg-charg MODIF ID m6,
                   sbwart FOR mseg-bwart MODIF ID m7,
                   skostl FOR mseg-kostl MODIF ID m8,
                   saufnr FOR mseg-aufnr MODIF ID m9,
                   srsnum FOR mseg-rsnum MODIF ID m10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
               pse RADIOBUTTON GROUP radi,
               bps RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETER:layout TYPE i.
    SELECTION-SCREEN END OF BLOCK b3.
    =========================== Event Blocks =============================
    AT selection-SCREEN.
    start-OF-selection.
    PERFORM get_data USING it_data.
    END-OF-selection.
    PERFORM build_alv USING it_data t_heading.
    =========================== Subroutines ==============================
    *&      Form  get_data
          Gets the information to be shown in the report.
    FORM get_data USING t_data TYPE tp_tbl_data.
      SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
        msegmenge  msegmeins msegkostl msegaufnr mseg~rsnum
      INTO CORRESPONDING FIELDS OF TABLE t_data
      FROM mseg
      JOIN mard ON mardmatnr EQ msegmatnr
                   JOIN mkpf ON msegmblnr EQ mkpfmblnr
                   WHERE mseg~matnr IN smatnr.
    ENDFORM.                    " get_data
    *&      Form  build_alv
          Builds and display the ALV Grid.
    FORM build_alv USING t_data TYPE tp_tbl_data
          t_heading  TYPE slis_t_listheader.
    ALV required data objects.
      DATA: w_title   TYPE lvc_title,
            w_comm    TYPE slis_formname,
            w_status  TYPE slis_formname,
            x_layout  TYPE slis_layout_alv,
            t_event    TYPE slis_t_event,
            t_fieldcat TYPE slis_t_fieldcat_alv,
            t_sort     TYPE slis_t_sortinfo_alv.
      REFRESH t_fieldcat.
      REFRESH t_event.
      REFRESH t_sort.
      CLEAR x_layout.
      CLEAR w_title.
    Field Catalog
      PERFORM set_fieldcat2 USING:
            1 'MBLNR' 'MBLNR' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
            2 'MATNR' 'MATNR' 'MSEG' space space space space space space space space space space space space  t_fieldcat ,
            3 'WERKS' 'WERKS' 'MARD' space space space space space space space space space space space space  t_fieldcat,
            4 'LGORT' 'LGORT' 'MARD' space space space space space space space space space space space space t_fieldcat ,
            5 'LGPBE' 'LGPBE' 'MARD' space space space space space space space space space space space space t_fieldcat ,
            6 'CHARG' 'CHARG' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
            7 'BWART' 'BWART' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            8 'BUDAT' 'BUDAT' 'MKPF' space  space space space space space space space space space space space t_fieldcat,
            9 'MENGE' 'MENGE' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            10 'MEINS' 'MEINS' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            11 'KOSTL' 'KOSTL' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            12 'AUFNR' 'AUFNR' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            13 'RSNUM' 'RSNUM' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            14 '__MARK' 'XFELD' space space space 'Select' 'Select this row' 'Sel' 'Select this row' space space space 'X' 'X' space t_fieldcat.
    Layout
      x_layout-zebra = 'X'.
    Top of page heading
      PERFORM set_top_page_heading USING t_heading t_event.
    Events
      PERFORM set_events USING t_event.
    GUI Status
      w_status = ''.
    User commands
      w_comm   = 'USER_COMMAND'.
    Order
    Example
    PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
    PERFORM set_order USING 'LIFNR' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELN' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELP' 'IT_DATA' 'X' space space t_sort.
    Displays the ALV grid
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program       = sy-repid
        it_fieldcat              = t_fieldcat
        is_layout                = x_layout
        it_sort                  = t_sort
        i_callback_pf_status_set = w_status
        i_callback_user_command  = w_comm
        i_save                   = 'X'
        it_events                = t_event
        i_grid_title             = w_title
      TABLES
        t_outtab                 = t_data
      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.                    " build_alv.
    *&      Form  set_top_page_heading
          Creates the report headings.
    FORM set_top_page_heading USING t_heading TYPE slis_t_listheader
          t_events  TYPE slis_t_event.
      DATA: x_heading TYPE slis_listheader,
            x_event   TYPE LINE OF slis_t_event.
    Report title
      CLEAR t_heading[].
      CLEAR x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'Reporte Prueba'(001).
      APPEND x_heading TO t_heading.
    Program name
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Program: '.
      x_heading-info = sy-repid.
      APPEND x_heading TO t_heading.
    User who is running the report
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'User: '.
      x_heading-info = sy-uname.
      APPEND x_heading TO t_heading.
    Date of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Date: '.
      WRITE sy-datum TO x_heading-info.
      APPEND x_heading TO t_heading.
    Time of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Time: '.
      WRITE sy-uzeit TO x_heading-info.
      APPEND x_heading TO t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-FORM = 'TOP_OF_PAGE'.
      APPEND x_event TO t_events.
    ENDFORM.
    *&      Form  set_events
          Sets the events for ALV.
          The TOP_OF_PAGE event is alredy being registered in
          the set_top_page_heading subroutine.
    FORM set_events USING t_events TYPE slis_t_event.
      DATA: x_event   TYPE LINE OF slis_t_event.
    Example
    clear x_event.
    x_event-name = .
    x_event-form = .
    append x_event to t_event.
    ENDFORM.
    *&      Form  set_order
          Adds an entry to the order table.
    FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
          t_sort TYPE slis_t_sortinfo_alv.
      DATA: x_sort TYPE slis_sortinfo_alv.
      CLEAR x_sort.
      x_sort-fieldname = p_fieldname.
      x_sort-tabname   = p_tabname.
      x_sort-UP = p_up.
      x_sort-down = p_down.
      x_sort-subtot = p_subtot.
      APPEND x_sort TO t_sort.
    ENDFORM.                    "set_order
    *&      Form  set_fieldcat2
          Adds an entry to the field catalog.
    FORM set_fieldcat2 USING p_colpos p_fieldname p_ref_fieldname p_ref_tabname
          p_outputlen p_noout
          p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
          p_hotspot p_showasicon p_checkbox p_edit
          p_dosum
          t_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-col_pos = p_colpos.
      wa_fieldcat-no_out = p_noout.
      wa_fieldcat-HOTSPOT = p_hotspot.
      wa_fieldcat-CHECKBOX = p_checkbox.
      wa_fieldcat-ICON = p_showasicon.
      wa_fieldcat-do_sum = p_dosum.
    Set reference fieldname, tablenam and rollname.
    If p_ref_tabname is not given, the ref_fieldname given is a data element.
    If p_ref_tabname is given, the ref_fieldname given is a field of a table. In case ref_fieldname is not given, it is copied from the fieldname.
      IF p_ref_tabname IS INITIAL.
        wa_fieldcat-rollname =   p_ref_fieldname.
      ELSE.
        wa_fieldcat-ref_tabname = p_ref_tabname.
        IF p_ref_fieldname EQ space.
          wa_fieldcat-ref_fieldname =   wa_fieldcat-fieldname.
        ELSE.
          wa_fieldcat-ref_fieldname =   p_ref_fieldname.
        ENDIF.
      ENDIF.
    Set output length.
      IF NOT p_outputlen IS INITIAL.
        wa_fieldcat-outputlen = p_outputlen.
      ENDIF.
    Set text headers.
      IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
      ENDIF.
      IF NOT p_seltext_l IS INITIAL.
        wa_fieldcat-seltext_l = p_seltext_l.
      ENDIF.
      IF NOT p_seltext_s IS INITIAL.
        wa_fieldcat-seltext_s = p_seltext_s.
      ENDIF.
      IF NOT p_reptext_ddic IS INITIAL.
        wa_fieldcat-reptext_ddic = p_reptext_ddic.
      ENDIF.
      IF NOT p_ddictxt IS INITIAL.
        wa_fieldcat-ddictxt = p_ddictxt.
      ENDIF.
    Set as editable or not.
      IF p_edit IS NOT INITIAL.
        wa_fieldcat-INPUT     = 'X'.
        wa_fieldcat-EDIT     = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                   "set_fieldcat2
    =========================== Subroutines called by ALV ================
    *&      Form  top_of_page
          Called on top_of_page ALV event.
          Prints the heading.
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        i_logo             = 'XXXXX'
        it_list_commentary = t_heading.
    ENDFORM.                    " alv_top_of_page
    *&      Form  user_command
          Called on user_command ALV event.
          Executes custom commands.
    FORM user_command USING r_ucomm     LIKE sy-ucomm
          rs_selfield TYPE slis_selfield.
    Example Code
    Executes a command considering the sy-ucomm.
    CASE r_ucomm.
       WHEN '&IC1'.
         Set your "double click action" response here.
         Example code: Create and display a status message.
         DATA: w_msg TYPE string,
               w_row(4) TYPE n.
         w_row = rs_selfield-tabindex.
         CONCATENATE 'You have clicked row' w_row
                     'field' rs_s lfield-fieldname
                     'with value' rs_selfield-value
                     INTO w_msg SEPARATED BY space.
         MESSAGE w_msg TYPE 'S'.
    ENDCASE.
    End of example code.
    ENDFORM.                    "user_command
    this is mycode,mblnr, matnr and checkbox both field had created in database table
    then save data after clicking checkbox data stored in database table,and next clickin checkboxes are no change. this my requirment.
    plz send me code .

    Try this
    In user_command form...
    LOOP AT IT_DATA.
    IF  CHECKBOX __MARK EQ 'X'.
    write logic wht u want....
    ENDIF.
    ENDLOOP.

  • How to save data from a waveform chart to a file?

    Hi! I have a question:how to save a real time data from a waveform chart? attachement is a example,how can i do to save the data from 0 second to 25 seconds to a file ?thanks!
    Attachments:
    example.vi ‏23 KB

    You can use a property node to get the chart history as a array. Then you can write that data to the file. The data in the array in you example can also be writen to a file. If you only wnat a portion of the data to be saved, use the Array Subset function to get the part you want.
    Lynn

  • Offline Adobe Form using GP - How to save data to SAP

    Hi,
    I have the following requirement.
              o An offline form is sent to different users and when they fill the form and Click on Submit, the data should be saved to SAP.
              o When the data is submitted, it should be recognize the user and multiple clicks if any so that data is not duplicated
    I have used Guided Procedures for this. I have created an Interactive Form callable object with an xdp template and "Create offline Interactive form and send by e-mail" option.
    Problem:
    1. The document emailed to user can be submitted only once. My requirement is whenever form is submitted it should update the previous data.
    2. How to save this data to SAP?
    Version:
    SAP NW SP12
    Adobe Live cycle designer 7.1
    I have gone through various blogs on Adobe Offline interactive forms and GP but I could not get a solution for this. Please help.
    Thank you,
    Vasu

    Hi,
    IMHO there is no easy solution for your requirement. However there is a workaround: you can create so-called "impersonalized" forms. They can be sent or returned as many times as needed from same or different users. However the effect will be that for each form sent out and accepted by GP, GP will start a new GP process. That means that the forms are the first step of such a process - so to say.
    An offline form "in the middle" of a process can be embedded into the process as a dedicated step only. Once this form is returned to GP by the user, the process is continued and 2nd or later form returns are ignored. However there is the possibility to build an additional step into GP to check the input data and if they aren't valid to send out the form to the user once again.
    So you see that there are some possibilities but no straight forward solution for your needs. Hope I could help anyhow.
    Regards,
        Jan

  • How to save data acquired from NI-DAQ in text format instead of TDMS using the DAQ-mx ANSI C code?

    Hi,
    I wanted to save data acquired from NI-DAQ (for example, NI 9234) in a file using the DAQ-mx ANSI C Code. The response I got was as follows:-
    One way to do it is with TDMS logging. DAQmx comes with functions designed to log to a TDMS file. This is a special file type that is used for collecting data in a logical format. It can be displayed in a TDMS viewer where data is separated into groups and channels. NI-DAQmx provides examples for how to log to TDMS. Look at the TDMS examples in the C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage directory.
    However, now I want to know is there a way that using that same C code, can we save the data in a .txt file format (Text File) instead of a TDMS file? We actually want to access that file through MATLAB (that's why we want to save it in text format).
    Also on an other note, is there a way we can access & open TDMS files by MATLAB?
    Thanks,
    Sauvik Das Gupta

    There's a way you can access TDMS files in MATLAB:
    http://zone.ni.com/devzone/cda/tut/p/id/7446

  • How to save data in 4-bit mode instead of U8

    Hi
    I use LabVIEW to acquire and save data through the counter timer PCI6602.
    My signals are really low so the data can be expressed in 4-bits (0-15).
    I have used the conversion to U8 and write them using "Write Binary Files"
    So this uses 1 byte for each data point but I would like to reduce it to 4bit (half byte) for each data point.
    Can anyone help me with this?
    I am attaching my program for reference 
    Solved!
    Go to Solution.
    Attachments:
    DAQ-longvector1.vi ‏64 KB

    Here's some easy code how to do it.
    Note that this code assumes that the data is 4bit (0..15). If any of the upper 4 bit are set, you've got problems, of course
    See if this makes sense. Good luck.
    This example uses a single 1D array. You would eliminate the decimate/interleave and just use the two arrays.
    A small comment to your code. There are a few weird constructs, but the use of two "split array" operations to take a simple derivative seems overkill. This made a honorary mention in the Rube Goldberg Hall of Fame.
    Message Edited by altenbach on 12-04-2008 05:18 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    8bitTo4bit.png ‏18 KB

Maybe you are looking for

  • Itunes won't open - get message that .itl file cannot be found or created

    My HP laptop with windows just crashed, and I'm trying to get everything back to working order. I reloaded itunes and it seemed to be working fine. Then at some point, I went to open it and received the messsage: The itunes library .itl file cannot b

  • How to apply formula field for a chart object in crystal report XI

    Hi how to add formula field for a chartobject, i tried the following code but returns invalid condition field. i want to show  different chart in same crystal report viewer with different coursestatus values. please suggest where ia m wrong.         

  • Remote network setup help

    I have an iMac at home and I want to access the files on my iMac in the office. I also want others who have PC's to get to the files at the office. I have a Airport base station at my office. All computers have access to broadband. Do I have to setup

  • Oracle Database 11g Express Edition (11.2) Beta is now available!

    [url http://forums.oracle.com/forums/forum.jspa?forumID=1378]Forum Home » Database » Oracle Database 11g Express Edition Beta ばかりじゃなんなので. Forum Home » コミュニティ » OTNカフェ に [url http://forums.oracle.com/forums/thread.jspa?threadID=2201589]Thread: Oracle

  • Hiding selection screen fields upon clicking a button

    Hi . I have a requirement like we need to hide and bring back the selection screen fields upon clicking a button( Expand and collapse in the same button) . in ABAP Query,we can maintain this,  for the variant we created. We need this functionality on