How to get editable data into internal table

Hi ABAPers,
I am displaying REUSE_ALV_GRID_DISPLAY report with one editable field and i have post button in report. Once i select post button i need to get editable data to internal table which i passed to REUSE_ALV_GRID_DISPLAY.
actually i am writing below code but data is not coming to internal table.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     i_callback_program                          =  sy-repid
     i_callback_pf_status_set                  = 'PF-STATUS'
     i_callback_user_command               = 'USER_COMMAND '
     it_fieldcat                                        = t_field[]
     i_default                                          = 'X'
    TABLES
      t_outtab                          =   <fs_display1>.       "t_display
FORM user_command USING g_ucomm LIKE sy-ucomm
               rs_selfield TYPE slis_selfield.
  g_test1 = g_ucomm.
  CASE g_ucomm.
    WHEN 'POST'.
      READ TABLE <fs_display1> ASSIGNING <fsw_display1> INDEX 1.    "Just for testing index 1
      IF sy-subrc = 0.
        w_display = <fsw_display1>.
        APPEND w_display TO t_display.
        CLEAR : w_display.
      ENDIF.
      PERFORM v1.
      PERFORM bapi_call.
  ENDCASE.
ENDFORM.                    "USER_COMMAND
Please help me how to get.
Regards,
Raju.

Hi,
Try the following:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'PF-STATUS'
i_callback_user_command = 'USER_COMMAND '
it_fieldcat = t_field[]
i_default = 'X'
TABLES
t_outtab = <fs_display1>. "t_display
FORM user_command USING g_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
g_test1 = g_ucomm.
CASE g_ucomm.
WHEN 'POST'.
* 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.
READ TABLE <fs_display1> ASSIGNING <fsw_display1> INDEX 1. "Just for testing index 1
IF sy-subrc = 0.
w_display = <fsw_display1>.
APPEND w_display TO t_display.
CLEAR : w_display.
ENDIF.
PERFORM v1.
PERFORM bapi_call.
ENDCASE.
ENDFORM. "USER_COMMAND
Hope it helps.
Regards,
Gilberto Li

Similar Messages

  • How to load text data into internal table

    I have a text file to load txt data into internal table. So how to read text data with validation and to load all text data into the internal table?
    Say this is the text file:
    IO_NAME, IO_TYPE, IO_SHTXT, IO_LONGTEXT, DATATYPE, DATA LENGTH
    ZIO_TEST1, CHA,      IO TEST1,      IO TEST 1,        CHAR,         20
    ZIO_TEST2, CHA,      IO TEST2,      IO TEST 2,        CHAR,         20
    Regards,
    Mau

    Hi,
    U can use GUI_UPLOAD for this...
    Declare an internal table like
    data: begin of itab occurs 0,
    string(1200),
    end of itab.
    check the sample code:
    cange as you need
    DATA: DATEI_PC TYPE STRING VALUE 'C:\MATNR.TXT'.
    DATA: BEGIN OF ITAB occurs 0,
    TXT(1024),
    END OF ITAB.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
    FILENAME = DATEI_PC
    FILETYPE = 'ASC'
    CHANGING
    DATA_TAB = ITAB[]
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_READ_ERROR = 2
    NO_BATCH = 3
    GUI_REFUSE_FILETRANSFER = 4
    INVALID_TYPE = 5
    NO_AUTHORITY = 6
    UNKNOWN_ERROR = 7
    BAD_DATA_FORMAT = 8
    HEADER_NOT_ALLOWED = 9
    SEPARATOR_NOT_ALLOWED = 10
    HEADER_TOO_LONG = 11
    UNKNOWN_DP_ERROR = 12
    ACCESS_DENIED = 13
    DP_OUT_OF_MEMORY = 14
    DISK_FULL = 15
    DP_TIMEOUT = 16
    NOT_SUPPORTED_BY_GUI = 17
    ERROR_NO_GUI = 18
    OTHERS = 19.
    IF SY-SUBRC NE 0. WRITE: / 'Error in Uploading'. STOP. ENDIF.
    WRITE: / 'UPLOAD:'.
    LOOP AT ITAB. WRITE: / ITAB-TXT. ENDLOOP.

  • Char data into internal table.

    Hi all,
    I will get data from the FTP (.TXT file) through FTP_SERVER_TO_R3.
    in chardata with separater Tab delimited.
    here i took one field symbol and assigning the data into internal table.
    till here every thing is ok.
    My problem is one data type is 13 char, if that field is more than 13 char in the file
    it is giving DUMP. (DUMP is OVERFLOW Field 999976767878.22)
    TYPES : BEGIN OF X_STRING,
                       LINE(150) TYPE STRING,
                  END OF X_STRING.
    data : IT_STRING TYPE STANDARD TABLE OF X_STRING,
              WA_STRING TYPE X_STRING.
                          FIELD-SYMBOLS : <fs> TYPE ANY.
                        LOOP AT chardata INTO wa_chardata.
                          REFRESH it_string.
                          SPLIT wa_chardataline AT cl_abap_char_utilities=>horizontal_tab INTO TABLE it_string.
                          LOOP AT it_string INTO wa_string FROM 1 TO 29.
                            ASSIGN COMPONENT sy-tabix OF STRUCTURE wa_data TO <fs>.
                            <fs> = wa_string-field1.
                            UNASSIGN <fs>.
                          ENDLOOP.
                          APPEND wa_data TO it_data.
                          CLEAR wa_data.
                        ENDLOOP.
    Please give me solution to over come this.
    Regards,
    Sri

    In Statement ASSIGN COMPONENT sy-tabix OF STRUCTURE wa_data TO <fs>.
    insted of using SY-TABIX  use the actual field name of the structre wa_data .
    Use a RTTS Method to get all the fields of the structre WA_DATA and then loop at all the fields and then manuplate teh that which has been splitted...!
    Hope it helps it will not cause any over flow..and ...( Try to condence the The splitted dat use condence addition while moveing the data to wa_data it will avoide the leading and trailing spaces.... )
    Edited by: Anup Deshmukh on Jun 17, 2010 8:31 AM

  • Extract the classification data into internal table

    Hi all,
    I having requirement to extract classification data for material number.
    1) Provide the selection option for material number (MATNR).
    2) Based on the material number, then extract all that data into internal table as below layout. My problem is how to retrieve the following data from different table based on the MATNR (material number).
    Please provide the sample code for select the following data. Thanks.
    Classification table
    OBJEK  (from AUSP table)
    MAFID (from AUSP table)
    KLART (from AUSP table)
    CLASS  (from KLAH table)
    ATWRT (from AUSP table)
    MSEHI  (from CABN table)
    OBTAB (check if class type=002, set it as “MARA”)
    STDCL (from KSSK table)

    Hi,
    if I understand, you´re trying to get information from the classification system for the material. You can use the following code:
    DATA: clases LIKE TABLE OF sclass WITH HEADER LINE,
          datos LIKE TABLE OF clobjdat WITH HEADER LINE.
    CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
         EXPORTING
              class              = 'DESK'               "clase a buscar
              classtype          = '001'                "tipo de la clase
              features           = 'X'
              language           = sy-langu
              object             = 'PM00A000C055'       "Material
              objecttable        = 'MARA'
              key_date           = sy-datum
              initial_charact    = 'X'
              change_service_clf = 'X'
         TABLES
              t_class            = clases
              t_objectdata       = datos
         EXCEPTIONS
              no_classification  = 1
              no_classtypes      = 2
              invalid_class_type = 3
              OTHERS             = 4.
    loop at datos.
    endloop.

  • How to get the data from Pooled Table T157E.

    Hi Experts,
    How to get the data from Pooled Table T157E.
    Any help.
    Thanks in Advance,
    Ur's Harsha.

    create some internal table similar to T157E and pass all data as per SPRAS.
    After that use internal table in your program as per the requirement.
    Regds,
    Anil

  • Problem to upload the data into internal table record length more than 6000

    Hi all
            I stuck with this problem from past 3 days. I have to upload the data from excel sheet. iam making it tab delimited and trying to upload from gui_upload. but in the structure of file, we have, one field of 4000 characters, and other fields of 255 characters.
    how can i upload this into internal table . From excel sheet or from tab delimeted or any other format? or any special function module is there?  while iam doing this its truncating the datat 255 characters and not uploading the other fields also...
    can any one of you help me out. ASAP
    thnks in advance

    from one of the forum iam just pasting code which it is used in lsmw, try the same logic in ur code hope it can work.
    you have to create multiple lines with do...enddo loop., like this:
    (assuming excel_long_text-text is 924 characters long, 7 lines X 132 char)
    __GLOBAL_DATA__
    data: offset type i,
    text_132(132) type c.
    __BEGIN_OF_RECORD__ Before Using Conversion Rules
    Rule : Default Settings Modified
    Code: /sapdmc/ltxtl = init_/sapdmc/ltxtl.
    CLEAR offset.
    DO 7 TIMES.
    text_132 = excel_long_text-text+offset(132).
    offset = offset + 132.
    __END_OF_RECORD__ After Using Conversion Rules
    Rule : Default Settings Modified
    Code: transfer_record.
    ENDDO.
    also check this
    COMMIT_TEXT
    To load long text into SAP
    READ_TEXT
    To load long text into SAP

  • Problem in collecting Spool data into internal table

    Hi ,
    i need to download  spool request data into internal table,
    after collecting i need to loop it and delete some records,
    for this i am using  Fm  RSPO_RETURN_ABAP_SPOOLJOB
    but getting some extra spaces and lines,unable to get right format.
    please help me in this issue to prepare internal table like normal internal table with spool id.
    Regards
    sarath

    Hi ,
    Thanks for the reply,
    My requirement is like i need to collect all the records from the spool to Internal table and
    after that based on one field in the internal table i have to separate error records by deleting sucess records from that internal table(from spool),
    for that i have to loop the internal table and need to count the error records, after that download to excel and mail functionalities
    required for that .
    so please help me in this.
    Regards
    sarath

  • Uploading  Excel sheet  data into internal table

    Hi All,
    I want to upload Excel file data into internal table. My problem is that my excel file  having more than one sheets. I want to upload  the data of particula Excel sheet..
    Please suggest me how can I upload particulat Excel sheet data .
    Thanks and regards
    Praveen

    check this link
    Uploading multiple excel sheets
    You can check Satish's answer in the above link
    Re: uploading data from excel sheets through BDC's into sap system
    <b>Award points if found helpful</b>

  • Loading Text data into internal table

    I have a text file to load txt data into internal table. So how to read text data with validation and to load all text data into the internal table?
    Say this is the text file:
    IO_NAME, IO_TYPE, IO_SHTXT, IO_LONGTEXT, DATATYPE, DATA LENGTH
    ZIO_TEST1, CHA, IO TEST1, IO TEST 1, CHAR, 20
    ZIO_TEST2, CHA, IO TEST2, IO TEST 2, CHAR, 20
    Regards,
    Mau

    hi Mau,
    look this code, maybe it's help u.
    <b>REPORT  ZTXTTOTABLE.</b>
    DATA: p_file   TYPE string value 'C:\teste.txt',
          BEGIN OF TI_table OCCURS 0,
            COD(5) TYPE C,
            NAME(40),
          END OF TI_table,
          a(2).
    PARAMETERS: sel_file(128) TYPE c
                default 'C:\teste.txt' OBLIGATORY LOWER CASE.
    p_file = sel_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename = p_file
      TABLES
        data_tab = ti_table[].
    format color COL_TOTAL INTENSIFIED ON.
    loop at ti_table.
      write: / sy-vline, ti_table-cod, at 10 sy-vline, ti_table-name,
             at 60 sy-vline.
    endloop.
    write: / sy-uline(60).
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_file.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_filename     = ''
          def_path         = 'C:\'
          mask             = ',Documentos de texto (*.txt), *.txt.'
          mode             = ''
        IMPORTING
          filename         = p_file
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
      find '.txt' IN p_file.
      if sy-subrc <> 0.
        concatenate p_file '.txt' into sel_file.
      else.
        sel_file = p_file.
      endif.
    top-of-page.
      format color COL_HEADING INTENSIFIED ON.
      uline (60).
      write: / sy-vline, 'COD', at 10 sy-vline, 'NAME', at 60 sy-vline.
      write: / sy-uline(60).
    good luck!
    Regards
    Allan Cristian

  • Upload excel data into Internal table

    Hi,
    I'm trying to upload excel data into internal table, well the excel file layout will be different on each run of the report.
    Excel file will have 60 columns and 500 record limit. I can upload the excel data using 'ALSM_EXCEL_TO_INTERNAL_TABLE' and 'KCD_EXCEL_OLE_TO_INT_CONVERT' but the output table is generates 60 lines for each record i.e.., 60 * 500 = 30,000 which could cause performance.
    I try with the FM 'TEXT_CONVERT_XLS_TO_SAP', but this will only work if the file structure is static. It didn't work for dynamic file layout. Even GUI_UPLOAD doesn't work to upload excel file, it will work if I convert the file to Tab delimited file.
    Please advise if you know any alternate procedure to upload excel data into internal table.
    Thanks,
    Kumar.

    Moderator message - Cross post locked
    Rob

  • How to insert  Legacy data into QP_RLTD_MODIFIERS table?

    How to insert  Legacy data into QP_RLTD_MODIFIERS table in R12 instance.

    I would use the API QP_Modifiers_PUB.Process_Modifiers for pushing legacy pricing data into R12.  QP_RLTD_MODIFIERS is only used for certain types of discounts (in my prod environnment, only promos have data in this table).

  • How to import legacy data into apex tables

    Hi All,
    Please tell me How to import legacy data into apex tables.
    Thanks&Regards,
    Raghu

    SQL WorkshopUtilitiesData Workshop...
    you can import the data from already exported as (text/csv/xml) data
    Note: the table name and column name should be equal if the table already Existing table.

  • Function module to get data into internal table from Excel file sheets

    Hi,
    I have to upload customers from excel file.
    we are donloading customer data excel file sheets.
    Customer data in 1 sheet, tax data the other sheet of same excel file, Customer master-Credit data in other sheet of same excel file.
    so i have 3-4 sheet in one excel file.
    now my requirement is to get the data from excel file into internal table.
    is there any function module.
    Thanks & Regards

    I am sending you the idea with an example how you can upload data from an EXCEL file into an internal table. I am not sure if you can take data from different sheet in the same EXCEL file. I think that this is not possible (try it )
    Upload the data into an internal table, like the way that I am describing in the above:
      DATA: L_MAX_COL_NB TYPE I.
      DATA: l_file_name LIKE RLGRAP-FILENAME.
    Just to be sure that is the correct type for the FM.
      l_file_name = P_FILE_NAME.
      L_MAX_COL_NB = 58.  "Maximum nb of colums that the FM can read.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                FILENAME                = l_file_name
                I_BEGIN_COL             = 1
                I_BEGIN_ROW             = 2
                I_END_COL               = L_MAX_COL_NB
                I_END_ROW               = 9999
           TABLES
                INTERN                  = PT_EXCEL
           EXCEPTIONS
                INCONSISTENT_PARAMETERS = 1
                UPLOAD_OLE              = 2
                OTHERS                  = 3.
      IF SY-SUBRC <> 0.
      ENDIF.
    Now you should upload the data into your own itab. The Function Module will return to you all the an itab
    from all fields and columns. Define the structure of the uploading file into SE11 - Data Dictionary. Then read the fieldcatalog of this structure. In the code that I am sending to you, I am insearting an empty line into the internal table and then I am assigning this line into a corresponding field-symbol. Then I am able to change the working area - so and the line of the itab. Propably you could you the statement APPEND INITIAL LINE TO (your_table_name) ASSIGNING <your_field_symbol>, but the example was written in an old SAP version.
      FIELD-SYMBOLS:
                     <F_REC> LIKE WA_UPLOAD_FILE,      "working are of the uploading file
                     <F_FIELD> TYPE ANY.
      DATA: COLUMN_INT TYPE I,
            C_FIELDNAME(30) TYPE C.
      PERFORM GET_FIELDCATOLG TABLES FIELDCAT
                               USING 'ZECO_CHARALAMBOUS_FILE'.
      LOOP AT PT_EXCEL.
        AT NEW ROW.
          ASSIGN WA_UPLOAD_FILE TO <F_REC>.
        ENDAT.
        COLUMN_INT = PT_EXCEL-COL.
        READ TABLE FIELDCAT INTO WA_FIELDCAT INDEX COLUMN_INT.
        CONCATENATE '<F_REC>-' WA_FIELDCAT-FIELDNAME INTO C_FIELDNAME.
        ASSIGN (C_FIELDNAME) TO <F_FIELD>.
        <F_FIELD> = PT_EXCEL-VALUE.
        AT END OF ROW.
          APPEND WA_UPLOAD_FILE TO GT_UPLOAD_FILE.
          CLEAR WA_UPLOAD_FILE.
        ENDAT.
      ENDLOOP.
    With Regards
    George
    Edited by: giorgos michaelaris on Mar 4, 2010 3:44 PM

  • How to get the data from one table and insert into another table

    Hi,
    We have requirement to build OA page with the data needs to be populated from one table and on save data into another table.
    For the above requirement what the best way to implement in OAF.
    I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
    Thanks

    You can achieve this in many different ways, one is
    1. Create another VO based on the EO which is based on the dest table.
    2. At save, copy the contents of the source VO into the dest VO (see copy routine in dev guide).
    3. commiting the transaction will push the data into the dest table on which the dest VO is based.
    I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
    if by table you mean a DB table, then no, you can have a VO based on multiple EOs which will do DMLs accordingly.Thanks
    Tapash

  • Uploading data into internal table

    hi all ,
    i;m uploading the file using Function module  ALSM_EXCEL_TO_INTERNAL_TABLE  . problem now is  when i given lower cae in excel it is not taking . when i use upper case then it is taking from excel and putting into internal table  . now i need to take records from excel even it is lower case . can u pls suggest how to proceed and help . Thanks

    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = pa_f
          i_begin_col             = co_x  " column num shd start take as 1
          i_begin_row             = co_y "row number shd start take based on the heading in excel sheet
          i_end_col               = co_n13 "end column is 13 here
          i_end_row               = co_50000 "endrow is 50000 here
        TABLES
          intern                  = ta_file
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc EQ 0.
        LOOP AT ta_file INTO wa_file.
          AT NEW row.
          Clear the  work area
            CLEAR wa_file.
          ENDAT.
        Check the Columen numbers and move the file data in to work area of Task.
        For Column  One
          IF wa_file-col =  '1'.
            MOVE wa_file-value TO wa_ztemp_employee-employeid.
          ENDIF.
        For Column Two
          IF wa_file-col = '2'.
            MOVE wa_file-value TO wa_ztemp_employee-employe_name.
          ENDIF.
          AT END OF row.
          The Data Transfer from work area to Internal table
            APPEND wa_ztemp_employee TO ta_ztemp_employee.
          Clear the  work area
            CLEAR wa_ztemp_employee.
          ENDAT.
        ENDLOOP.
       ELSE.
      MESSAGE e004 DISPLAY LIKE 'I'.
    try this code
    u will get
    Regards
    Edited by: Rasheed salman on Nov 28, 2008 6:33 AM

Maybe you are looking for

  • How to do it? Need help in syntax - new to Oracle syntax

    create or replace PROCEDURE "SP_SAMPLE_data" (prodName in VARCHAR2) AS where_criteria char(100); BEGIN if prodName = 'A' then I want to build the where criteria string as "product_name in ('iPod','iPad')" else I want to build the where criteria strin

  • IPod touch 5 lag issue running iOS 8.1 ( PLEASE RESOLVE THIS ASAP)

    OMG, i'm just fed up of using this iPod 5 after this new update of apple's iOS 8.1.  I did checkout iOS 8.1.1 but as it bought no changes to the performance i just downgraded it back to iOS 8.1. Well performance really matters on a device. The day i

  • Assigning a super class attributes to a sub class in an OO way

    I think you OO and Pattern forumites might want to help me out on this one. I started this in the beginners forum, much heat, but not too much light http://forum.java.sun.com/thread.jsp?forum=54&thread=439107 Make sure you at least read past peoples

  • Preventing automatic search results

    I recently created a custom search form on a uix page that allows me to search for multiple conditions following a HOWTO from Oracle: http://www.oracle.com/technology/products/jdev/tips/shmeltzer/setwhereclause/uix.html It works great, but when I log

  • Using Java Logging with Tomcat

    Hi in a previous non Tomcat project I wrote some classes that used the java.util.logging library that comes with java 1.4 quite successfully. I am now trying to use the same classes with Tomcat 5.0 but it doesnt like it. With the logging classes you