cancel
Showing results for 
Search instead for 
Did you mean: 

Adding row in table ui using scroll bar.

Former Member
0 Kudos

Hi Experts,

I have 5 row editable row,when i am scrolling 5 rows should be add to the table and the 6th row should be on the the top row by following 7,8,9,10 rows.when every the user scroll 5 rows should be add.Please provided me with right information.

Thanks & Regards.

Krishna.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member196213
Active Participant
0 Kudos

Hi krishna,

if you are using a table control not alv, what you can do is you can bind the total row count to a context.

Then in the onscroll event you can read the content value then add on to it.

I hope it helped a bit

Thanks

HAPPY ABAPing

Former Member
0 Kudos

Hi Vishal,

Thanks for the mail.Issuse has been solved.And i have one more issuse

I need to set lead selection for a specified row in table ui dynamically.

My Requriement

I my table one of the column i have f4 help.if i selected f4 help that which is in 3 rd row of the table then that 3rd row should be set as leadselection and i should get that index of that row.dynamically.And in the same way user select the f4 help in 50th row then that 50th row should be set to leadselection

Note: ( The row should be selected based on the cursor position,Like in ABAP we use GET_CURSOR_FIELD that which brings the record from the table where cursor is placed )

Please provide me the information.

Thanks & Regards.

Krishna.

former_member196213
Active Participant
0 Kudos

Hi Krishna,

     Sorry man!!. I thought of giving a try I dont know how to do it. What I would suggest you to close this thread and make a separate thread so that new people can see it. Please mark me as well, even I wanted to know how to make it working.

HAPPY ABAPing

Former Member
0 Kudos

Hi Vishal,

i need to upload a XLSX (EXCEL) to webdynpro abap table.

please provide me the information.

Thanks & Regards.

Krishna.

Former Member
0 Kudos

Hi Krishna,

Create a function module with import/export parameter  to get the uploading xlsx format file to webdynpro table. It easy t resuse for any requiremnt.

   FUNCTION zsample_xlsx_conv_itab.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(IV_UPL) TYPE  CHAR1 OPTIONAL
*"     VALUE(IV_XSTRING) TYPE  XSTRING OPTIONAL
*"     VALUE(IV_FILE_NAME) TYPE  STRING OPTIONAL
*"  EXPORTING
*"     REFERENCE(EV_FLAG) TYPE  CHAR1
*"     REFERENCE(EV_MESSAGE) TYPE  STRING
*"  TABLES
*"      DATA_TAB TYPE  STRING_TABLE OPTIONAL
*"----------------------------------------------------------------------
  DATA:
          lo_sprd_sheet  TYPE REF TO cl_fdt_xl_spreadsheet,
          lx_fdt_xl_core TYPE REF TO cx_fdt_excel_core,
          lx_fdt_xl      TYPE REF TO cx_fdt_excel,
          lr_data        TYPE REF TO data.
  DATA:
        lv_ws_name     TYPE string,
        lv_index       TYPE i.

  DATA: lt_ws_name     TYPE STANDARD TABLE OF string.

  DATA: lv_string      TYPE string.
  FIELD-SYMBOLS:
        <lta_table>    TYPE STANDARD TABLE,
        <la_data>      TYPE any,
        <la_data_str>  TYPE any.
  DATA: lv_doc_file    TYPE dsvasdocid.

  DATA: lt_dd03l       TYPE TABLE OF dd03l,
        wa_dd03l       TYPE dd03l.
  FIELD-SYMBOLS: <fs>  TYPE any.
  IF iv_file_name IS INITIAL AND iv_upl EQ 'X'.
    ev_flag = 'F'.
    ev_message = 'Please pass file name path'.
    EXIT.
  ENDIF.

  lv_doc_file = iv_file_name.
  CALL FUNCTION 'DSVAS_DOC_FILENAME_SPLIT'
    EXPORTING
      pf_docid     = lv_doc_file
    IMPORTING
      pf_extension = lv_doc_file.

  TRANSLATE lv_doc_file TO LOWER CASE.

  IF lv_doc_file NE 'xlsx'. ev_flag = 'F'. ev_message = 'Excel file should be xlsx format'. EXIT. ENDIF.
  TRY.

      CREATE OBJECT lo_sprd_sheet
        EXPORTING
          document_name = iv_file_name
          xdocument     = iv_xstring.

    CATCH cx_fdt_excel_core INTO lx_fdt_xl_core.
      CLEAR ev_message.
      ev_message = 'Please upload the formatted file'.
  ENDTRY.
  IF ev_message IS NOT INITIAL.  ev_flag = 'F'. EXIT.  ENDIF.
  lo_sprd_sheet->if_fdt_doc_spreadsheet~get_worksheet_names( IMPORTING worksheet_names = lt_ws_name  ).

  READ TABLE lt_ws_name INTO lv_ws_name INDEX 1.

  lr_data = lo_sprd_sheet->if_fdt_doc_spreadsheet~get_itab_from_worksheet( lv_ws_name ).

  ASSIGN lr_data->* TO <lta_table>.
  READ TABLE <lta_table> ASSIGNING <la_data_str> INDEX 1.

  DO.
    lv_index = sy-index.
    ASSIGN COMPONENT lv_index OF STRUCTURE <la_data_str> TO <la_data>.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    wa_dd03l-fieldname = <la_data>.
    APPEND wa_dd03l TO lt_dd03l.
  ENDDO.

  LOOP AT <lta_table> ASSIGNING <la_data_str>.

    LOOP AT lt_dd03l INTO wa_dd03l.
      lv_index = sy-tabix.
      ASSIGN COMPONENT lv_index OF STRUCTURE <la_data_str> TO <la_data>.
      ASSIGN <la_data> TO <fs>.
      TRANSLATE <fs> TO UPPER CASE.
      CASE lv_index.
        WHEN '1'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN '2'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN '3'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN '4'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN '5'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN '6'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN '7'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN '8'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN '9'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN '10'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN '11'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN '12'.
          CONCATENATE lv_string <fs> INTO lv_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        WHEN OTHERS.
      ENDCASE.
      CLEAR lv_index.
    ENDLOOP.
    APPEND lv_string TO data_tab.
    CLEAR lv_string.
  ENDLOOP.




ENDFUNCTION.

Regards.

Suresh kumar.