How to insert line with values in ALV (CL_GUI_ALV_GRID)?

Hi,
Does anyone know how to get control of new line inserted in ALV (I am using class CL_GUI_ALV_GRID) before the new line is shown to the user. What I want the user to see is not a completely blank line, but a new line with certain fields filled with data.
I have tried with ALL events in CL_GUI_ALV_GRID but without any luck. If I create my own user command and insert it in the alv menu I get control, but not with the standards. Why?
Please help
Kind regards - Keld Gregersen

Hi,
I created a nice work around...
CLASS lcl_event_handler DEFINITION.
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
handle_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
ENDCLASS. "lcl_event_handler DEFINITION
CLASS lcl_event_handler IMPLEMENTATION.
METHOD handle_toolbar.
DATA:
l_toolbar TYPE stb_button.
Here I replace SAP standard functions with own functions
READ TABLE e_object->mt_toolbar INTO l_toolbar
WITH KEY function = '&LOCAL&APPEND'.
IF sy-subrc = 0.
l_toolbar-function = 'OWN_APPEND'.
MODIFY e_object->mt_toolbar FROM l_toolbar INDEX sy-tabix.
ENDIF.
READ TABLE e_object->mt_toolbar INTO l_toolbar
WITH KEY function = '&LOCAL&COPY_ROW'.
IF sy-subrc = 0.
l_toolbar-function = 'OWN_COPY_ROW'.
MODIFY e_object->mt_toolbar FROM l_toolbar INDEX sy-tabix.
ENDIF.
ENDMETHOD. "handle_toolbar
METHOD handle_user_command.
CASE e_ucomm.
WHEN 'OWN_APPEND'.
CALL METHOD ref_alv->check_changed_data
IMPORTING
e_valid =
CHANGING
c_refresh = 'X'
CREATE YOUR OWN CODE HERE
CALL METHOD ref_alv->refresh_table_display
EXPORTING
is_stable = 'X'
i_soft_refresh =
EXCEPTIONS
finished = 1
others = 2
ENDMETHOD. "handle_user_command
ENDCLASS. "lcl_event_handler IMPLEMENTATION
Kind regards
Keld Gregersen

Similar Messages

  • The document contains no posting lines with value other than zero

    Hi!
    We are having problems posting a invoice in MIRO. When entering the PO number we receive the error message "The document contains no posting lines with value other than zero".
    What could be the problem?
    /Anders

    Hi!
    The GR_BASEDIV is set in the PO. The PO is replicated from SRM where this flag has been set for no reason. Only GR and IV are set and we have implemented a note 1155266 so that Confirmation-Related IV will not be set.
    How come it is set anyway?
    Sincerely
    Anders

  • How to insert line number into APPLIED_CUSTOMER_TRX_LINE_ID?

    Hi All,
    I am working on the table of receivable AR_RECEIVABLE_APPLICATIONS_ALL.
    I get some information about APPLIED_CUSTOMER_TRX_LINE_ID form TRM.
    APPLIED_CUSTOMER_TRX_LINE_ID     NUMBER     (15)     
    The line number of the debit item or credit memo to which a payment or credit memo is applied
    So, I want to use APPLIED_CUSTOMER_TRX_LINE_ID to join with transaction's line (RA_CUSTOMER_TRX_LINES_ALL).
    But after applied the credit memo, the APPLIED_CUSTOMER_TRX_LINE_ID is NULL.
    How to insert line number into APPLIED_CUSTOMER_TRX_LINE_ID?

    Hi Eric,
    The application is already at the AR Invoice (header) level. Oracle doesn't give you privilege to apply the invoice at invoice line or distribution level. You need to match the applied_customer_trx_id to customer_trx_id of ra_customer_trx_all to get the applied invoice/debit memo number. Hope my comments are helpful to you.
    KG

  • How to insert Google geocoded values in database

    Hi
    I have tried Google map integration with apex , it is wonderful.
    Can I have some tips on how can I insret the same geocoded values in my database for the infrastructure and mesh the infra with google map.
    Please help
    Prashant

    Hi,
    how to insert and update values in mysql database in c++ from"mysql.h"
    Please see some thread with some samples:
    http://www.cplusplus.com/forum/general/118160/
    I suggest you ask this issue to MySQL forum since you are using it.
    http://forums.mysql.com/
    Best regards,
    Shu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Display Currency symbol with value in ALV Report

    Hi Experts,
    I need to display currency symbol with value in ALV Report like if currency type is dollar then $200.
    Here I am using field catalog type slis_t_fieldcat_alv and suing field merge catalog FM: 'REUSE_ALV_FIELDCATALOG_MERGE'
    I tried like this
        IF <fs_fieldcat>-fieldname = 'STPRS'.
          <fs_fieldcat>-seltext_s = 'Std Cost '.
          <fs_fieldcat>-seltext_m = 'Std Cost'.
          <fs_fieldcat>-seltext_l = 'Std Cost '
           <fs_fieldcat>-tabname = 'MBEW'.
          <fs_fieldcat>-ctabname = 'T001'.
          <fs_fieldcat>-cfieldname ='WAERS'.
          <fs_fieldcat>-datatype = 'CURR'.
        ENDIF.
    Please any one can suggest the solution for this.
    Advance Thanks.
    Regards,
    Bala Achari

    Hİ,
    Check this link.
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=24379571
    Take care.
    Çağatay

  • How to insert check box value in table?

    Hi all
    kindly help me how to insert check box value in database. what code i have to use as i am new in programing.
    thanx in advance

    Hi,
    There is no "Check box" in a table, a check box is a GUI (Graphical user interface) item.
    What you want is to store a boolean value in a table. For that you can use the varchar2(1) datatype and store Y or N. (or anything else)
    (you cannot define boolean as a datatype for a column).
    If you're using a front-end application like apex then it might be useful for you to read the documentation about chekc boxes :
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/check_box.htm#CHDDFBFH
    (for the rest if it's Oracle Forms then everything is already said).
    Edited by: user11268895 on Aug 17, 2010 10:44 AM

  • SQL Loader-How to insert -ve & date values from flat text file into coloumn

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide.

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide. Try something like
    someDate    DATE 'DDMMYYYY'
    someNumber1      "TO_NUMBER ('s99999999.00')"
    someNumber2      "TO_NUMBER ('99999999.00s')"Good luck,
    Eric Kamradt

  • How to insert or select value d'silva

    Hi,
    How to insert or select value d'silva into/from table.
    please let me know.
    Thanks,
    Sathis.

    Just escape the ' character:
    SQL> insert into emp values(999, 'D''Silva', 'Jose');
    1 row created.
    SQL> select * from emp where last_name = 'D''Silva';
    EMPLOYEE_ID LAST_NAME                 FIRST_NAME
            999 D'Silva                   Jose
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to insert date with timestamp into table values

    hi,
    I have a table
    create table abc1(dob date);
    insert into abc1 values (to_date(sysdate,'RRRR/MM/DD HH24:MI:SS'))
    but when i see in data base it shows as normal date without time stamp.
    Is it possible to insert into back end with timestamp.
    Thanks..

    First, SYSDATE is a DATE already, no need to convert it to a DATE using the TO_DATE() function.
    The date ALWAYS has a time component, whether or not it is displayed is up to your NLS settings. for example:
    SQL> CREATE TABLE ABC1(DOB DATE);
    Table created.
    SQL> ALTER SESSION SET NLS_DATE_FORMAT='MM/DD/YYYY';
    Session altered.
    SQL> INSERT INTO ABC1 VALUES(SYSDATE);
    1 row created.
    SQL> SELECT * FROM ABC1;
    DOB
    02/04/2010
    SQL> ALTER SESSION SET NLS_DATE_FORMAT='MM/DD/YYYY HH24:MI:SS';
    Session altered.
    SQL> SELECT * FROM ABC1;
    DOB
    02/04/2010 12:54:57
    SQL> DROP TABLE ABC1;
    Table dropped.

  • How to insert a specific record into alv

    Hi everyone,
      here is my problem:
        I put an ALV GRID control in my screen , it display some records.
        and I create a new button on the toolbar, and in the "handle user command class" , I need to
    select a record from DB table into a work area.
        after I select the record I need, here is the key question:
          *I want to insert the record into the ALV at a specific row position which the user decided,
    what should I do?*
      METHOD HANDLE_ON_USER_COMMAND.
        CASE E_UCOMM.
          WHEN CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
          WHEN 'FC_ASSIGN'.
    ***I do some selection here  
            select %%%$$%%%^&&** into GS_HOLIDAYS.
    *** after the selection, what should I do then????
    *** I want to insert the work area GS_HOLIDAYS into ALV at a specific position
    *** e.g.  into the 3rd row.
    *** how can I achieve that????
    ***call a method or something??????I don't know    
          WHEN 'FC_DELETE'.
          WHEN OTHERS.
        ENDCASE.
      ENDMETHOD.
    pls don't let me go through the programs in package "SLIS",because I have already done that and
    I haven't solved my problems yet.
    Thanks for your help.

    All u need to do is on user command for inserting new records u just insert a blank record in your internal table that u are displaying with required style informaion for making it editable and then refresh alv display by method REFRESH_TABLE_DISPLAY.
    Thanks & Regards,
    Vivek Gaur

  • How to insert line or row in a table?

    Hi OAF experts,
    can anyone show me how to insert row or line in a table bean by setting the table.setAutoInsertion(false) ?
    Thank you.
    Jon

    As per Dev Guide:---
    The other change you can make is to suppress the default Add Another Row button behavior of adding a
    single row to the view instance associated with the table, so that you can handle the event with your own code.
    The following code example illustrates how to accomplish this:
    processRequest
    // Enabled add row and turn off the default "Add Another Row" table event
    // The add row event has to be auto-handled by developer in processFormRequest
    tableBean.setInsertable(true);
    tableBean.setAutoInsertion(false);
    processFormRequest
    if ((tableBean.getName()Equals(pageContext.getParameter(SOURCE_PARAM))) &&
    (ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM))))
    OAApplicationModule am = pageContext.getApplicationModule(tableBean);
    am.invokeMethod("handleInsertRow", null);
    // The ***AMImpl.java in which method "handlInsertRow" has been defined
    public void handleInsertRow()
    OAViewObject vo = findViewObject("voName");
    vo.invokeMethod("handleInsertRow");
    // The ***VOImpl.java which is associated with the table; and in which the
    // handleInsertRow is defined
    public void handleInsertRow()
    Row row = createRow();
    // Set any default attributes
    row.setAttribute(...);
    // Insert the row into the VO
    insertRow(row);
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to insert into default values in onli 1 column of a table

    if u create a table with onli 1 column
    which can accept a default value of say
    only 100.
    then how do u actualli enter values into the table.
    is there any data dictionary which stores details about default
    values of a table

    The default value for a column is the value that will be stored
    for that column if you do not provide one in your insert
    statement. If you do provide a value, then it will be stored in
    the column.
    You can query user_tab_columns ( or all_ or dba_)to see the
    default value assigned to a column.

  • How to change sub total value in ALV Grid.

    Hi All,
    Can u please explain how to change SUBTOTAL Value in ALV Grid display based on another field value.
    EX; F1 subtotal is  initial then we have to modify the F2 sub total to 9999.9.
    Thanks
    Radha.

    Hi Radha,
    I doubt if that can be changed....because the event that i was referring to in my previous post works with ALV List display...But in any case you can try that.....
    There is an event in SLIS....(As i told you, i dont remember the name and currently i dont have access to SAP system, so i am not able to verify and let you know that event name).....
    Other thatn TOP and END of PAGE events, there is an event for sub-total text......i think it would start with "SUBTOTAL"...
    you need to use that event in your events table and pass it to ALV Grid display.
    Then create a sub-routine with that name (As you do for TOP-OF-PAGE event)....and in this event you can change the values in runtime (PROVIDED, this event gets triggered for ALV GRID).....
    If this does not work, i think calculating sub-totals while you build the internal table would be a better option....(If you have time constraint....else you can do some more research on the same)........
    Best Regards,
    Ram.

  • How to insert sysdate with associated time

    I want to insert a record into a date field with yesterday dates (sysdate-1) plus time 23:59:59. Any idea on how to do this? I have tried a couple of things but so far no luck.
    Any help would be greatly appreciated.
    Thank you.

    HI,
    You can try this.
    SQL> CREATE TABLE T1 (FLD1 DATE);
    Table created.
    SQL> INSERT INTO T1 VALUES(SYSDATE-1) ;
    1 row created.
    SQL> SELECT * FROM t1;
    FLD1
    02-MAY-07
    SQL> SELECT fld1 , TO_CHAR(fld1, 'MON/DD/YYYY HH:MI:SS') FROM T1;
    FLD1 TO_CHAR(FLD1,'MON/DD
    02-MAY-07 MAY/02/2007 01:08:49
    SQL>
    Thanks

  • How to insert a blank value in not nul column using transform activity

    can anyone help me on how to insert blank values in a not null column using transform activity or however possible..This is a requirement in my project ..

    vidya
    In DB adapter or-mappings.xml , did you made any changes. If not the open that file in any notepad editor and change the following
    <attribute-mapping xsi:type="direct-mapping">
    <attribute-name>director</attribute-name>
    <field table="MYTABLE" name="MAKE_IT_BLANK_NOT_NULL" xsi:type="column"/>
    <attribute-classification>java.lang.String</attribute-classification>
    </attribute-mapping>You can try to add this:
    <attribute-mapping xsi:type="direct-mapping">
    <attribute-name>director</attribute-name>
    <field table="MYTABLE" name="MAKE_IT_BLANK_NOT_NULL" xsi:type="column"/>
    <null-value></null-value>
    <attribute-classification>java.lang.String</attribute-classification>
    </attribute-mapping>Refer below link for details
    Re: Insertion of Blank value to a Not Null varchar column in SQL server table
    Thanks
    AJ

Maybe you are looking for

  • Work with ListBox in Acrobat Reader and 3D Pdf

    I have a template with LiveCycle Designer 8.2. This listbox i fill dynamically with JavaScript in the 3D Model and in the template. I can manipulate both scripts. The user should select items in that view. So i have choosen User Entered - Optional as

  • Send data from PHP - Flash - PHP

    Hi, I have some issue with passing data from Flash to PHP and reciprocally. when i browse the FlashDataExchange.php file (which includes the flash) it does not redirect automatically to the 2nd PHP page... And i do not get any data on the 2nd PHP pag

  • After table partition, some transactions hang

    I am running SAP 4.6 and Oracle 10.2 I recently used online reorg to partition table DFKKOP (over 100 million records) into two parts.  One partition was for "closed" orders, and the other was for "open" orders (less than 2% of the rows).  Since most

  • Wifi dropping issues on mac os x lion

    I have a mac my wifi work fine and so as my other computers and iphones and so on. But as soon as i upgraded to to mac os x lion my wifi started to drop  and lose wifi range no i can only use wifi close to my dsl which is sensless but thats the only

  • PT60 the field Personnel Area( PERSA ) of the authorization object P_ORGIN

    Hi, When running transaction PT60 the field Personnel Area( PERSA ) of the authorization object P_ORGIN is not checked. I have run SU24 ,the objects are there with chech indicator of authorization object = "CHECK". What can I do about it ? Is there a