How to do parallel processing with dynamic internal table
Hi All,
I need to implement parallel processing that involves dynamically created internal tables. I tried doing so using RFC function modules (using starting new task and other such methods) but didn't get success this requires RFC enabled function modules and at the same time RFC enabled function modules do not allow generic data type (STANDARD TABLE) which is needed for passing dynamic internal tables. My exact requirement is as follows:
1. I've large chunk of data in two internal tables, one of them is formed dynamically and hence it's structure is not known at the time of coding.
2. This data has to be processed together to generate another internal table, whose structure is pre-defined. But this data processing is taking very long time as the number of records are close to a million.
3. I need to divide the dynamic internal table into (say) 1000 records each and pass to a function module and submit it to run in another task. Many such tasks will be executed in parallel.
4. The function module running in parallel can insert the processed data into a database table and the main program can access it from there.
Unfortunately, due to the limitation of not allowing generic data types in RFC, I'm unable to do this. Does anyone has any idea how to implement parallel processing using dynamic internal tables in these type of conditions.
Any help will be highly appreciated.
Thanks and regards,
Ashin
try the below code...
DATA: w_subrc TYPE sy-subrc.
DATA: w_infty(5) TYPE c.
data: w_string type string.
FIELD-SYMBOLS: <f1> TYPE table.
FIELD-SYMBOLS: <f1_wa> TYPE ANY.
DATA: ref_tab TYPE REF TO data.
CONCATENATE 'P' infty INTO w_infty.
CREATE DATA ref_tab TYPE STANDARD TABLE OF (w_infty).
ASSIGN ref_tab->* TO <f1>.
* Create dynamic work area
CREATE DATA ref_tab TYPE (w_infty).
ASSIGN ref_tab->* TO <f1_wa>.
IF begda IS INITIAL.
begda = '18000101'.
ENDIF.
IF endda IS INITIAL.
endda = '99991231'.
ENDIF.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = pernr
infty = infty
begda = '18000101'
endda = '99991231'
IMPORTING
subrc = w_subrc
TABLES
infty_tab = <f1>
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
subrc = w_subrc.
ELSE.
ENDIF.
Similar Messages
-
How to write a perform with dynamic internal table
Hi to all experts,
i have to read infotype 2001 2003 2002 with same pernr, begin date, end date im calling hr_read_infotype three times
can i write a single perform and call it three how to pass different tables (2001, 2002, 2003).try the below code...
DATA: w_subrc TYPE sy-subrc.
DATA: w_infty(5) TYPE c.
data: w_string type string.
FIELD-SYMBOLS: <f1> TYPE table.
FIELD-SYMBOLS: <f1_wa> TYPE ANY.
DATA: ref_tab TYPE REF TO data.
CONCATENATE 'P' infty INTO w_infty.
CREATE DATA ref_tab TYPE STANDARD TABLE OF (w_infty).
ASSIGN ref_tab->* TO <f1>.
* Create dynamic work area
CREATE DATA ref_tab TYPE (w_infty).
ASSIGN ref_tab->* TO <f1_wa>.
IF begda IS INITIAL.
begda = '18000101'.
ENDIF.
IF endda IS INITIAL.
endda = '99991231'.
ENDIF.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = pernr
infty = infty
begda = '18000101'
endda = '99991231'
IMPORTING
subrc = w_subrc
TABLES
infty_tab = <f1>
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
subrc = w_subrc.
ELSE.
ENDIF. -
Using where condition with dynamic internal table
Hi Friends.
How to use where condition with dynamic internal table ?
Regards,
Amit RautHai Amit
REPORT ZDYNAMIC_SELECT .
TABLES: VBAK.
DATA: CONDITION TYPE STRING.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
END OF ITAB.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
CONCATENATE 'VBELN' 'IN' 'S_VBELN.'
INTO CONDITION SEPARATED BY SPACE.
SELECT VBELN POSNR FROM VBAP INTO TABLE ITAB
WHERE (CONDITION).
LOOP AT ITAB.
WRITE 'hello'.
ENDLOOP.
Thanks & Regards
Sreenivasulu P -
How to add new field into dynamic internal table
Hello Expert.
how to add new field into dynamic internal table.
PARAMETERS: P_TABLE(30). "table name
DATA: I_TAB TYPE REF TO DATA.
FIELD-SYMBOLS: <TAB> TYPE standard TABLE.
*Create dynamic FS
create DATA I_TAB TYPE TABLE OF (p_table).
ASSIGN I_TAB->* TO <TAB>.
SELECT * FROM (p_table) INTO TABLE <TAB>.
here i want to add one more field into <TAB> at LAST position and my
Field name = field_stype and
Field type = 'LVC_T_STYL'
could you please helpme out .Hi,
Please find the code below.You can add the field acc to your requirement.
Creating Dynamic internal table
TYPE-POOLS: slis.
FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE, u201C Dynamic internal table name
<fs_dyntable>, u201C Field symbol to create work area
<fs_fldval> type any. u201C Field symbol to assign values
PARAMETERS: p_cols(5) TYPE c. u201C Input number of columns
DATA: t_newtable TYPE REF TO data,
t_newline TYPE REF TO data,
t_fldcat TYPE slis_t_fldcat_alv,
t_fldcat TYPE lvc_t_fcat,
wa_it_fldcat TYPE lvc_s_fcat,
wa_colno(2) TYPE n,
wa_flname(5) TYPE c.
Create fields .
DO p_cols TIMES.
CLEAR wa_it_fldcat.
move sy-index to wa_colno.
concatenate 'COL'
wa_colno
into wa_flname.
wa_it_fldcat-fieldname = wa_flname.
wa_it_fldcat-datatype = 'CHAR'.
wa_it_fldcat-intlen = 10.
APPEND wa_it_fldcat TO t_fldcat.
ENDDO.
Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fldcat
IMPORTING
ep_table = t_newtable.
ASSIGN t_newtable->* TO <t_dyntable>.
Create dynamic work area and assign to FS
CREATE DATA t_newline LIKE LINE OF <t_dyntable>.
ASSIGN t_newline->* TO <fs_dyntable>.
Populating Dynamic internal table
DATA: fieldname(20) TYPE c.
DATA: fieldvalue(10) TYPE c.
DATA: index(3) TYPE c.
DO p_cols TIMES.
index = sy-index.
MOVE sy-index TO wa_colno.
CONCATENATE 'COL'
wa_colno
INTO wa_flname.
Set up fieldvalue
CONCATENATE 'VALUE' index INTO
fieldvalue.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
ENDDO.
Append to the dynamic internal table
APPEND <fs_dyntable> TO <t_dyntable>.
Displaying dynamic internal table using Grid.
DATA: wa_cat LIKE LINE OF fs_fldcat.
DO p_cols TIMES.
CLEAR wa_cat.
MOVE sy-index TO wa_colno.
CONCATENATE 'COL'
wa_colno
INTO wa_flname.
wa_cat-fieldname = wa_flname.
wa_cat-seltext_s = wa_flname.
wa_cat-outputlen = '10'.
APPEND wa_cat TO fs_fldcat.
ENDDO.
Call ABAP List Viewer (ALV)
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = fs_fldcat
TABLES
t_outtab = <t_dyntable>. -
How to upload data with dynamic internal table
Hi,
I have to upload the basic , sales, purchasing view data by using bapi depend on check box selected for views.
i have filled fieldcatalog for selected views and pass the field catalog structure to dynamic int table and
import it into the field symbol <fs_data>. this field symbol assigned to <fs_1>.
then callED the 'GUI_UPLOAD ' and when i pass field symbo for function module i am getting first 10 rows 0f the file .
flat file has basic data,sales ,purchase fields data
ex: i was selected basicview and purchase view and execute i am getting basic,sales view data.
how can i get only basic and purchase data.hi ,
please find code.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_fieldcatalog
IMPORTING
ep_table = <fs_data>
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
IF sy-subrc <> 0. "#EC NEEDED
ENDIF.
So <FS_1> now points to our dynamic internal table.
ASSIGN <fs_data>->* TO <fs_1>.
Next step is to create a work area for our dynamic internal table.
CREATE DATA new_line LIKE LINE OF <fs_1>.
A field-symbol to access that work area
ASSIGN new_line->* TO <fs_2>.
ASSIGN new_line->* TO <fs_3>.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_f
filetype = 'DAT'
TABLES
data_tab = <fs_1>
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
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. -
How to transfer data from a dynamic internal table
Hi All
I want to transfer data from a dynamic internal table<dyn_table>
to a non dynamic internal table itab which should have the same structure as <dyn_table>.
How can this be done?
Regards,
Harshit RungtaAs stated earlier this can be done only through field symbols...
You cannot create an non dynamic internal table with ANY structure...using DATA statement
If the strucutre is defined well and good...you can create an non-dynamic internal table...
If you do not know the structure then the internal table has to be dynamic...and to be generated using field symbols
DATA: lv_ref TYPE REF TO data.
FIELD-SYMBOLS: <fs_dyn_table> TYPE STANDARD TABLE.
* You create a dynamic internal table...
CREATE DATA lv_ref LIKE (your_dynamic_internal_table).
ASSIGN lv_ref->* TO <fs_dyn_table>.
Now...do the transfer.
<fs_dyn_table> = "your_dynamic_internal_Table
Hope it helps! -
Working with dynamic internal tables
Hi,
I've created dynamic internal table and then assigned it to field symbol structure.
This is part of the code.
wa_tab = cl_abap_structdescr=>create( comp_tab ).
i_tab = cl_abap_tabledescr=>create( wa_tab ).
create data i_table type handle i_tab.
assign i_table->* to <f_tab1>.
As a second step I am populationg that structure <f_tab1> with data using dynamic select:
select (sel_list) from (p_table)
into table <f_tab1>
up to p_row rows.
So far so good but I need to copy the data from <f_tab1> into internal table with the same structure and to use that internal table on a later stage as a driver table in select...for all entries.
How can I doo that ?
Thanks,
Stefan
<Code tags added>
Edited by: Suhas Saha on Oct 27, 2011 4:23 PMHello Stefan,
You might be interested in reading this thread How to use dynamic internal table with FOR ALL ENTRIES.
Do let us know if you find any alternative solution
Cheers,
Suhas -
Problem with dynamic internal table updation
Hello Folks,
I created a dynamic internal table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = i_fieldcat
IMPORTING
ep_table = i_dyntab
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
ASSIGN i_dyntab->* TO <f_dyntable>.
and created a work area
CREATE DATA wg_f_split LIKE LINE OF <f_dyntable>.
ASSIGN wg_f_split->* TO <f_wg_dyntable>.
My requirement is that , i have to loop a normal internal table and append those records to the filed symbol internal table.
READ TABLE i_normal_itab INTO wg_split INDEX wl_rows-index.
IF sy-subrc EQ 0.
ASSIGN wg_split to <f_wg_dyntable>.
APPEND <f_wg_dyntable> to <f_dyntable>.
endif.
here i am geeting dump as "MOVE src TO dst" ... i can get the data in the work area FSymbol but cannot append it in Internal table Field Symbol.. Please help..
<Added code tags>
Edited by: Suhas Saha on Aug 3, 2011 10:52 AMHello Sandra,
Thanks for the reply..
First i tried appending the normal work area to the fieldsymbol internal table.
append wg_split to <f_dyntable>
This is hiting dump the same dump and so i created a fieldsymbol work area. ( <f_wg_dyntable>.)and tried to append the field symbol internal table with this work area. which is again giving the dump
APPEND <f_wg_dyntable> to <f_dyntable>. ( Again a Dump)
Edited by: Charan-SAP on Aug 2, 2011 9:40 PM
Edited by: Charan-SAP on Aug 2, 2011 9:42 PM -
How to ADD rows to a dynamic internal table??
My question is simple.
I have a dynamic internal table and I need to ADD rows to if.
I read this thread How to modify a dynamic internal table from dynamic work area but they are modifying existing data.
My internal table is EMPTY and I need to ADD new rows, so I can't use LOOP ASSIGNING.
How can I do that?
Any help is welcome!
Thanks!
BettinaHi,
try something similar.
FIELD-SYMBOLS: <fs> type any.
FIELD-SYMBOLS: <f1> type any.
ASSIGN INITIAL LINE TO lo_data ASSIGNING <fs>. " or <f_tab> - not sure w/o editor :-)
assigning component 1 of structure <fs> to <f1>.
<f1> = 'aaa'.
I write it from memory so there can be some syntax errors but focus to command APPEND INITIAL LINE ...
Regards,
Karol -
How To Read Field Values Form Dynamic Internal Table
Hi,
I Created a dynamic internal table using.
FIELD-SYMBOLS: <gt_table> TYPE STANDARD TABLE,
<wa_gt_table>,
<l_fvalue> TYPE ANY.
This Interanl table is working well, and all values are populated to an ALV.
Now I try to set a link
for that I am using below code
READ TABLE <gt_table> ASSIGNING <l_fvalue> index rs_selfield-tabindex.
IF sy-subrc EQ 0.
insplot = <l_fvalue>-prueflos.
Now it is showing a syntax error :
the data object <l_fvalue> has no structure and there for no component called prueflos
Regards
NausalHi,
Refere following code
Local Field Symbol
FIELD-SYMBOLS: <lf_any> TYPE ANY. "Changed data
LOOP AT <gf_dyna_table> ASSIGNING <gf_dyna>.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE <gf_dyna> TO <lf_any>.
IF sy-subrc NE 0.
EXIT.
ENDIF.
IF ls_attach-line IS INITIAL.
ls_attach-line = <lf_any>.
ELSE.
CONCATENATE ls_attach-line <lf_any> INTO ls_attach-line
SEPARATED BY lc_tab.
ENDIF.
ENDDO.
CONCATENATE lc_cret ls_attach-line INTO ls_attach-line.
Append Changed Data to attachement table
APPEND ls_attach TO gt_attach.
Clear
CLEAR : ls_attach.
ENDLOOP.
Regards,
Prashant -
Coloring an ALV Cell with DYNAMIC INTERNAL TABLES
Hello Gurus,
I need your help regarding coloring of a cell in my ALV Grid report with DYNAMIC tables.
I have used the call method in calling my ALV. (CALL METHOD gr_alvgrid->set_table_for_first_display).
Now my problem is, I can not bring out the cellcolor succesfully, I always ended up to dump (GETWA_NOT_ASSIGNED = You attempted to access an unassigned field symbol
(data segment 32807).
What I have done:
I've created 2 internal tables:
*1st table
*After appended all of my columns to gt_fieldcat
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = gt_fieldcat
IMPORTING
ep_table = gp_both.
ASSIGN gp_both->* TO <i_xtab1>.
*2nd table
Appended these column for CellColor
CLEAR wa_gtfldcat.
wa_gtfldcat-fieldname = 'CELLCOLOR'.
wa_gtfldcat-ref_table = 'CALENDAR_TYPE'.
wa_gtfldcat-ref_field = 'COLTAB'.
APPEND wa_gtfldcat TO gt_fieldcat.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = gt_fieldcat
IMPORTING
ep_table = gp_alvgrid.
ASSIGN gp_alvgrid->* TO <i_xtab2>.
*Work Areas for tab1 and tab2
CREATE DATA dref1 LIKE LINE OF <i_xtab1>.
ASSIGN dref1->* TO <wa_xtab1>.
CREATE DATA dref2 LIKE LINE OF <i_xtab2>.
ASSIGN dref2->* TO <wa_xtab2>.
*Move contents of table1 to table2 and modify cellcolor column
LOOP AT <i_xtab1> ASSIGNING <wa_xtab1>.
*-----Cell color assignment
DESCRIBE TABLE gt_fieldcat.
DO sy-tfill TIMES.
READ TABLE gt_fieldcat INTO wa_gtfldcat INDEX sy-index.
ASSIGN COMPONENT wa_gtfldcat-fieldname
OF STRUCTURE <wa_xtab1> TO <fs4>.
IF sy-subrc NE 0. EXIT .ENDIF.
ASSIGN COMPONENT wa_gtfldcat-fieldname
OF STRUCTURE <wa_xtab2> TO <fs3>.
IF sy-subrc NE 0. EXIT .ENDIF.
<fs3> = <fs4>.
ENDDO.
ASSIGN COMPONENT 'CELLCOLOR' OF STRUCTURE <wa_xtab2> TO <fs3>.
IF sy-subrc = 0.
PERFORM modify_cell_color USING 'ZZMATNR' <fs3>.
ENDIF.
APPEND <wa_xtab1> TO <i_xtab2>.
ENDLOOP.
*Call ALV
gs_layout-ctab_fname = 'COLORCELL'
CALL METHOD gr_alvgrid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = <i_xtab2d>[]
it_fieldcatalog = gt_fieldcat
it_sort = lt_sort
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
*--->Exception handling
ENDIF.
FORM modify_cell_color USING p_fieldname TYPE lvc_fname
pt_cellcolor TYPE table.
DATA l_cellcolor TYPE lvc_s_scol.
CLEAR l_cellcolor.
l_cellcolor-fname = p_fieldname.
l_cellcolor-color-col = 6. " Red.
l_cellcolor-color-int = 0.
l_cellcolor-color-inv = 0.
INSERT l_cellcolor INTO TABLE pt_cellcolor.
ENDFORM. " MODIFY_CELL_COLORHi,
The internal tabl which you are using to display the output should have one column in the end.
The cell in this column will contain an internal table of type 'lvc_s_scol'.
The contents of this internal table will be the field names of all other columns of your main internal table in the field FNAME and the required color in the field COLOR.
Please note that the field COLOR will have a hex value for different colors.
In the stucture is_layout whihc you pass to the method 'set_table_for_first_display'
the name of this last column should be given to the field 'ctab_fname'.
This will help you to give the colors to each cell.
for example
I have my data table as follows:-
ITAB1
MATNR MAKTX COLOR_TAB
1 ABC FNAME COLOR NOKEYCOL
MATNR 8000
MAKTX 8000
2 XYZ MATNR 10000
MAKTX 10000
So my internal table ITAB1 had 3 columns MATNR MAKTX and COLOR_TAB.
And COLOR_TAB will contain an internal table with 3 columns FNAME COLOR and NOKEYCOL.
The value to importing parameter IS_LAYOUT-CTAB_FNAME will be COLOR_TAB.
This will help you to assign various colors to the cell of the internal table ITAB.
When you have to change any color, then you will have to just change the entries in cell COLOR_TAB for the particular row and cell.
Regards,
Ankur Parab -
How to decompose a string with ';' into Internal table
Hello all,
I need your help for find a Function module or Abap code.
I have a file with the separator is the ';'
Example of the contains of my file :
521010;16;46048,00;;*Soucet*Odmena za
524012;41;103807,00;;Zdrav.p.organizace
524012;42;;18332,00;Zdrav.p.organizace
I want a module function which can separate all the String separate by a ';' into a internal table :
for example my internal table have 5 column :
Num......|.....CC.....|............Credit....|...........Debit........|.....Label
521010....|.....16.....|......46048,00.....|...........................|.....Soucet**Odmena za
524012....|.....41.....|......103807,00...|...........................|.....Zdrav.p.organizace
524012....|.....42.....|..........................|........18332,00....|.....Zdrav.p.organizace
For read the date of my file is not a problem with ABAP Code :
DO.
CLEAR : ws_facm.
break epetrini.
READ DATASET myFile INTO test.
IF sy-subrc EQ 0.
IF ws_facm-codenreg = 'D'.
APPEND ws_facm TO wt_facm.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
Thank you for your helps.
Best regards Emilien
Edited by: Emilien P. on Mar 31, 2010 4:30 PM
Edited by: Emilien P. on Mar 31, 2010 4:34 PM
Edited by: Emilien P. on Mar 31, 2010 4:35 PM
Edited by: Emilien P. on Mar 31, 2010 4:36 PMHi,
Try whith this:
DATA: str1 TYPE string,
str2 TYPE string,
str3 TYPE string,
itab TYPE TABLE OF string,
text TYPE string.
text = `What a drag it is getting old`.
SPLIT text AT space INTO: str1 str2 str3,
TABLE itab.
Let me know if it works.
Regards,
Moh. -
How to delete records from dynamic internal table.
Hi Experts,
Need urgent help!!!
Issue is with Dynamic internal tables.
Below is code written by me :
FORM select_query USING Lw_tabnam
TYPE t682i-kotabnr.
DATA : lw_line TYPE REF TO data,
lw_line1 TYPE REF TO data.
CREATE DATA Lw_line TYPE (lw_TABNAM).
ASSIGN Lw_line->* TO <WA_tbl>.
CREATE DATA LW_LINE TYPE STANDARD TABLE OF (Lw_tabnam)
WITH NON-UNIQUE DEFAULT KEY.
ASSIGN Lw_line->* TO <TBL>.
SELECT * FROM (Lw_tabnam)
INTO CORRESPONDING FIELDS OF TABLE <TBL>
WHERE (t_keys).
Endform.
code is working fine.
here even the table name and where condition are dynamic,everything is fine upto this point.
Now i have to delete some record from <TBL> based on some conditons.
for ex : ( here lc_fieldname is KUNNR)
loop at t_kunnr.
lw_tabix = sy-tabix.
Read table <tbl>
with key (lc_fieldname) = t_kunnr-kunnr ASSIGNING <wa_tbl>.
If sy-subrc = 0.
*Delete
delete <tbl> from <wa_tbl>
delete <tbl> index lw_tabix.
Endif.
Endloop.
The above delete statement doesn't work ,even we can't use index as it gives a syntax error " something related to "index is not allowed in standard table or hash table.
Can you help me ab't how to delete records in Dynamic internal table?
Other option that i am thinking of is to create a static table of type dynamic table.
means, data itab type standard table of <tbl> .I know the syntax is wrong ,however is there any way to do this?
Thanks in advance ,
If you have any suggestion ab't this then do let me know.
bye,
Gaurav.Hi
I wrote this code and it works fine:
DATA LW_TABNAM(10) VALUE 'LFA1'.
DATA : LW_LINES TYPE REF TO DATA,
LW_LINE TYPE REF TO DATA.
FIELD-SYMBOLS: <TABLE> TYPE TABLE,
<WA> TYPE ANY.
CREATE DATA LW_LINES TYPE TABLE OF (LW_TABNAM)
WITH NON-UNIQUE DEFAULT KEY.
ASSIGN LW_LINES->* TO <TABLE>.
CREATE DATA LW_LINE TYPE (LW_TABNAM).
ASSIGN LW_LINE->* TO <WA>.
DO 10 TIMES.
APPEND INITIAL LINE TO <TABLE>.
ENDDO.
SY-TABIX = 4.
DELETE <TABLE> INDEX SY-TABIX.
WRITE SY-SUBRC.
I hope it help you
Max -
Distinct values from dynamic internal tabls
Hi All,
I have a dynamic internal tables like <dy_table> , i want to get distinct values from this internal tables,
how to do that, structure of dynamic internal tables is dynamic acc. to user conditions.
regards,
AnujHi Anuj
Just try this,
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = tb_fields_for_it
IMPORTING
ep_table = gp_dyn_table.
ASSIGN gp_dyn_table->* TO <gt_table>.
ASSIGN LOCAL COPY OF INITIAL LINE OF <gt_table> TO <fs_table>.
LOOP AT tb_output.
*To assign value for serial number.
ASSIGN COMPONENT 1 OF STRUCTURE <fs_table> TO <ls_field>.
<ls_field> = tb_output-sno.
UNASSIGN <ls_field>.
*To assign value for Sales Organization.
ASSIGN COMPONENT 2 OF STRUCTURE <fs_table> TO <ls_field>.
<ls_field> = tb_output-vkorg.
UNASSIGN <ls_field>.
*To assign Rate for its respective Condition type.
LOOP AT tb_konp WHERE knumh = tb_output-knumh.
READ TABLE tb_fieldcat1 WITH KEY fieldname = tb_output-kschl.
IF sy-subrc EQ 0.
lv_count = tb_fieldcat1-col_pos.
ASSIGN COMPONENT lv_count OF STRUCTURE <fs_table> TO <ls_field>.
IF tb_konp-konwa EQ '%'.
tb_konp-kbetr = tb_konp-kbetr / co_10.
<ls_field> = tb_konp-kbetr.
ELSE.
<ls_field> = tb_konp-kbetr.
ENDIF.
ENDIF.
ENDLOOP.
lv_count = lv_count + 1.
APPEND <fs_table> TO <gt_table>.
CLEAR <fs_table>.
ENDLOOP.
Hope this proves helpful to you. -
Hi all,
I have created 2 tabstrip screns which contain ALV GRID DISPLAY in a container with dynamic internal table and editable columns .I want to capture the edited value from this ALV GRID display.I have used SET_TABLE_FOR_DISPLAY and for this dynamc internal table is passed which is Field symbol and editable columns have to be captured for further updation into another ztable.
When i used check_changed_data i am getting dump as field symbol not assigned.
Below is the code : How can i get edited column value from below code
call method alv_list->set_table_for_first_display
exporting
is_layout = gs_layout
changing
it_outtab = <fs_dynamic_table>
it_fieldcatalog = it_fieldcat[]
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
if sy-subrc <> 0.
* Implement suitable error handling here
endif.
Kindly help me to solve this.
With Thanks,
Dina.please provide more info about the dump to try to help you
as max said, it could be because the field symbol is not global and if its global maybe you are not refering well to the column
i assume that you are using "ASSIGN COMPONENT comp OF STRUCTURE struc TO <fs>" to capture the value changed
validate always the sy-subrc after the assignment.
but the check changed data have parameters that have the old and new values
please provide more info...
Regards
Maybe you are looking for
-
Why isn't my ipod connecting to itunes?
Why wont my ipod connect to itunes? id rather not restore it so any suggestions?
-
Creative Cloud app won't stay signed in. Windows 8.1.
I have researched this over and over. It seems like a lot of people have this problem, but never any official answer. No solution. I log into the Creative Cloud app. About 5 minutes later, sometimes 10 or 15 if I'm lucky, I get signed out. I've signe
-
I can't start listener in the Control Painel/Admin Tools/ Services
Windows XP - Home Edition (I know it´s not the better but came with my laptop) I installed the Oracle 10g and I don't know why I have 3 listener as services. Its services showed me different messages when I tried start it: 1. OracleOraDb10g_home1TNSL
-
Invalid Report File Path (URGENT)
Post Author: a_Mohammad CA Forum: Publishing Im using CR which came as a bundle with VS2005. I deployed my ASP.NET project on online server. Sometimes, When users try to load the reports, they got an error says "Invalid Report File Path" appears at t
-
Microsoft TTF Fonts package needed for commercial use in portable application
Hello there i am designing an application in java which is based on being a portable application of pdf converter. My design needs to have the ttf Fonts independently present in the application. Is there any way or agreement to buy the Microsoft ttf