How to populate data in dynamic internal table
Hi Expert,
fyi. My dynamic internal table field is created base on data selected. Eg. select table qpcd has 5 records. These 5 recods will become fieldname to my dynamic internal table. My dynamic internal table will be
...itab
01
02
03
04
05
The 5 records from qpcd is populated in another table call viqmel. I need to find the occurance of each code in viqmel and populate the number of occurance in itab in each of column. The final dynamic itab will be like this
table itab
01 02 03 04 05 -
> field name
2 0 1 0 1 -
> data
my source code like below
Report ZPLYGRND2.
TABLES: mara, makt.
TYPE-POOLS: slis, sydes.
DATA:it_fcat TYPE slis_t_fieldcat_alv,
is_fcat LIKE LINE OF it_fcat,
ls_layout TYPE slis_layout_alv.
DATA: it_fieldcat TYPE lvc_t_fcat,
is_fieldcat LIKE LINE OF it_fieldcat.
DATA: new_table TYPE REF TO data,
new_line TYPE REF TO data,
ob_cont_alv TYPE REF TO cl_gui_custom_container,
ob_alv TYPE REF TO cl_gui_alv_grid,
vg_campos(255) TYPE c,
i_campos LIKE TABLE OF vg_campos,
vg_campo(30) TYPE c,
vg_tables(60) TYPE c.
types : begin of t_qpcd,
codegruppe like qpcd-codegruppe,
code like qpcd-code,
end of t_qpcd.
data:wa_qpcd type t_qpcd,
i_qpcd type standard table of t_qpcd initial size 0.
FIELD-SYMBOLS: <l_table> TYPE table,
<l_line> TYPE ANY,
<l_field> TYPE ANY.
select * into corresponding fields of wa_qpcd from qpcd
where katalogart = 'D'
and codegruppe = 'OOT01'.
append wa_qpcd to i_qpcd.
endselect.
loop at i_qpcd into wa_qpcd.
is_fcat-fieldname = wa_qpcd-code.
APPEND is_fcat TO it_fcat.
endloop.
LOOP AT it_fcat INTO is_fcat.
is_fieldcat-fieldname = is_fcat-fieldname.
is_fieldcat-ref_field = is_fcat-ref_fieldname.
is_fieldcat-ref_table = is_fcat-ref_tabname.
APPEND is_fieldcat TO it_fieldcat.
ENDLOOP.
*... Create the dynamic internal table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fieldcat
IMPORTING
ep_table = new_table.
if sy-subrc = 0.
endif.
*... Create a new line
ASSIGN new_table->* TO <l_table>.
CREATE DATA new_line LIKE LINE OF <l_table>.
ASSIGN new_line->* TO <l_line>.
LOOP AT <l_table> INTO <l_line>.
ENDLOOP.
hello dear i m giving u a code in this a dynamic table is made on the basis of table in database , and u can download this data correct it , see it, or even change it....and upload in tht table help full if u dont know the table name...in advance.
also the code to populate data in dynamic table is in this code like:
SELECT * FROM (MTABLE_N)
INTO CORRESPONDING FIELDS OF TABLE <FS_ITAB> .
look at the whole program .hope this solve ur problem thanks.
REPORT ZTESTA MESSAGE-ID ZIMM .
TYPES : DATA_OBJECT TYPE REF TO DATA.
DATA : MITAB TYPE REF TO DATA .
TYPE-POOLS : SLIS .
DATA : IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV
WITH HEADER LINE .
DATA : IT_FIELDCATALOG TYPE LVC_T_FCAT .
DATA : WA_FIELDCATALOG TYPE LVC_S_FCAT .
DATA : I_STRUCTURE_NAME LIKE DD02L-TABNAME .
DATA : I_CALLBACK_PROGRAM LIKE SY-REPID .
DATA : DYN_LINE TYPE DATA_OBJECT .
FIELD-SYMBOLS : <FS_ITAB> TYPE STANDARD TABLE .
DATA : TABLE_NAME_IS_VALID TYPE C .
DATA : DYNAMIC_IT_INSTANTIATED TYPE C .
CONSTANTS BUTTONSELECTED TYPE C VALUE 'X' .
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_TABL.
PARAMETERS : MTABLE_N LIKE RSRD1-TBMA_VAL
MATCHCODE OBJECT DD_DBTB_16 OBLIGATORY .
DATA CHECKTABLED.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_FILE.
PARAMETERS : MFILENAM LIKE RLGRAP-FILENAME .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_DOWN.
PARAMETERS : P_DOWNLD RADIOBUTTON GROUP GRP1
USER-COMMAND M_UCOMM .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_CHKF.
PARAMETERS : P_CHKFIL RADIOBUTTON GROUP GRP1 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_UPLD.
PARAMETERS : P_UPLOAD RADIOBUTTON GROUP GRP1 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) T_SHOW.
PARAMETERS : P_SHOW_T RADIOBUTTON GROUP GRP1 .
SELECTION-SCREEN END OF LINE.
AT SELECTION-SCREEN OUTPUT .
PERFORM CHECK_FILENAME .
AT SELECTION-SCREEN.
IF SY-UCOMM = 'ONLI'.
CHECKTABLED = MTABLE_N+0(1).
IF CHECKTABLED NE 'Z'.
MESSAGE I017.
LEAVE TO SCREEN 1000.
ENDIF.
IF SY-UNAME NE 'KAMESH.K'.
MESSAGE I023 WITH SY-UNAME.
LEAVE TO SCREEN 1000.
ENDIF.
ENDIF.
IF SY-UCOMM = 'PRIN'.
CHECKTABLED = MTABLE_N+0(1).
IF CHECKTABLED NE 'Z'.
MESSAGE I017.
LEAVE TO SCREEN 1000.
ENDIF.
IF SY-UNAME NE 'KAMESH.K'.
MESSAGE I023 WITH SY-UNAME.
LEAVE TO SCREEN 1000.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR MFILENAM .
PERFORM F4_FOR_FILENAME .
INITIALIZATION .
T_TABL = 'Table Name' .
T_FILE = 'File Name' .
T_DOWN = 'Download Table' .
T_CHKF = 'Check File to Upload' .
T_UPLD = 'Upload File' .
T_SHOW = 'Show Table Contents' .
START-OF-SELECTION .
PERFORM CHECK_TABLE_NAME_IS_VALID .
END-OF-SELECTION .
IF TABLE_NAME_IS_VALID EQ ' ' .
MESSAGE I398(00) WITH 'INVALID TABLE NAME' .
ELSE .
PERFORM INSTANTIATE_DYNAMIC_INTERNAL_T .
CHECK DYNAMIC_IT_INSTANTIATED = 'X' .
CASE BUTTONSELECTED .
WHEN P_DOWNLD .
PERFORM SELECT_AND_DOWNLOAD .
WHEN P_CHKFIL .
PERFORM CHECK_FILE_TO_UPLOAD .
WHEN P_UPLOAD .
PERFORM UPLOAD_FROM_FILE .
WHEN P_SHOW_T .
PERFORM SHOW_CONTENTS .
ENDCASE .
ENDIF .
FORM CHECK_TABLE_NAME_IS_VALID.
DATA MCOUNT TYPE I .
TABLES DD02L .
CLEAR TABLE_NAME_IS_VALID .
SELECT COUNT(*) INTO MCOUNT FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'TABL'
AND OBJ_NAME = MTABLE_N .
IF MCOUNT EQ 1 .
CLEAR DD02L .
SELECT SINGLE * FROM DD02L WHERE TABNAME = MTABLE_N .
IF SY-SUBRC EQ 0.
IF DD02L-TABCLASS = 'TRANSP' .
TABLE_NAME_IS_VALID = 'X' .
ENDIF .
ENDIF.
ENDIF .
ENDFORM. " CHECK_TABLE_NAME_IS_VALID
FORM SELECT_AND_DOWNLOAD.
CLEAR : <FS_ITAB> .
SELECT * FROM (MTABLE_N)
INTO CORRESPONDING FIELDS OF TABLE <FS_ITAB> .
PERFORM CHECK_FILENAME.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = MFILENAM
FILETYPE = 'DAT'
TABLES
DATA_TAB = <FS_ITAB>
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC EQ 0.
MESSAGE I398(00) WITH 'Table' MTABLE_N
'successfully downloaded to '
MFILENAM .
ENDIF.
ENDFORM. " SELECT_AND_DOWNLOAD
FORM UPLOAD_FROM_FILE.
DATA : ANS TYPE C .
DATA : LINES_OF_ITAB TYPE I .
DATA : MSY_SUBRC TYPE I .
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
TEXTLINE1 = 'Are you sure you wish to upload'
TEXTLINE2 = 'data from ASCII File to DB table '
TITEL = 'Confirmation of Data Upload'
IMPORTING
ANSWER = ANS.
IF ANS = 'J' .
PERFORM CHECK_FILENAME.
CLEAR MSY_SUBRC .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = MFILENAM
FILETYPE = 'DAT'
TABLES
DATA_TAB = <FS_ITAB>
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
MSY_SUBRC = MSY_SUBRC + SY-SUBRC .
IF SY-SUBRC EQ 0.
DESCRIBE TABLE <FS_ITAB> LINES LINES_OF_ITAB .
IF LINES_OF_ITAB GT 0 .
MODIFY (MTABLE_N) FROM TABLE <FS_ITAB> .
MSY_SUBRC = MSY_SUBRC + SY-SUBRC .
ENDIF .
ENDIF.
IF MSY_SUBRC EQ 0 .
MESSAGE I398(00) WITH LINES_OF_ITAB
'Record(s) inserted in table'
MTABLE_N .
ELSE .
MESSAGE I398(00) WITH
'Errors occurred No Records inserted in table'
MTABLE_N .
ENDIF .
ENDIF .
ENDFORM. " UPLOAD_FROM_FILE
FORM F4_FOR_FILENAME.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_PATH = 'C:\'
MASK = ',.,..'
MODE = '0'
IMPORTING
FILENAME = MFILENAM
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
ENDFORM. " F4_FOR_FILENAME
FORM CHECK_FILENAME.
IF MFILENAM IS INITIAL
AND NOT ( MTABLE_N IS INITIAL )
AND P_SHOW_T NE BUTTONSELECTED.
CONCATENATE 'C:\'
MTABLE_N '.TXT' INTO MFILENAM.
ENDIF .
ENDFORM. " CHECK_FILENAME
FORM INSTANTIATE_DYNAMIC_INTERNAL_T.
CLEAR DYNAMIC_IT_INSTANTIATED .
I_STRUCTURE_NAME = MTABLE_N .
CLEAR IT_FIELDCAT[] .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = I_STRUCTURE_NAME
CHANGING
CT_FIELDCAT = IT_FIELDCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC EQ 0.
LOOP AT IT_FIELDCAT .
CLEAR WA_FIELDCATALOG .
MOVE-CORRESPONDING IT_FIELDCAT TO WA_FIELDCATALOG .
WA_FIELDCATALOG-REF_FIELD = IT_FIELDCAT-FIELDNAME .
WA_FIELDCATALOG-REF_TABLE = MTABLE_N .
APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG .
ENDLOOP .
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = IT_FIELDCATALOG
IMPORTING
EP_TABLE = MITAB .
ASSIGN MITAB->* TO <FS_ITAB> .
DYNAMIC_IT_INSTANTIATED = 'X' .
ENDIF.
ENDFORM. " INSTANTIATE_DYNAMIC_INTERNAL_T
FORM SHOW_CONTENTS.
CLEAR : <FS_ITAB> .
SELECT * FROM (MTABLE_N)
INTO CORRESPONDING FIELDS OF TABLE <FS_ITAB> .
I_CALLBACK_PROGRAM = SY-REPID .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = I_CALLBACK_PROGRAM
IT_FIELDCAT = IT_FIELDCAT[]
TABLES
T_OUTTAB = <FS_ITAB>
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM. " SHOW_CONTENTS
FORM CHECK_FILE_TO_UPLOAD.
PERFORM CHECK_FILENAME.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = MFILENAM
FILETYPE = 'DAT'
TABLES
DATA_TAB = <FS_ITAB>
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC EQ 0.
I_CALLBACK_PROGRAM = SY-REPID .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = I_CALLBACK_PROGRAM
IT_FIELDCAT = IT_FIELDCAT[]
TABLES
T_OUTTAB = <FS_ITAB>
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDIF .
ENDFORM. " CHECK_FILE_TO_UPLOAD
Message was edited by:
SAURABH SINGH
SENIOR EXECUTIVE
SAMSUNG INDIA ELECTRONICS LTD.,NOIDA
Similar Messages
-
How to populate data into Dynamic Internal Table.
Hi Experts,
I had created one Dynamic Internal table and one static internal table.I want to move data from Static Internal table to Dynamic interal table.And aslo the number of coloum of these two tables are not same.
So please help me for solving this issue.
Thanks,
<u><i><b>Seema.</b></i></u>Hi,
Check out this sample program for dynamictable report.
REPORT YMS_DYNAMICDEMO
NO STANDARD PAGE HEADING
MESSAGE-ID zcs_c2c_001.
type-pools : abap.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: dy_table type ref to data,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
selection-screen begin of block b1 with frame.
parameters: p_table(30) type c default 'T001'.
selection-screen end of block b1.
start-of-selection.
perform get_structure.
perform create_dynamic_itab.
perform get_data.
perform write_out.
form get_structure.
data : idetails type abap_compdescr_tab,
xdetails type abap_compdescr.
data : ref_table_des type ref to cl_abap_structdescr.
Get the structure of the table.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_table_des->components[].
loop at idetails into xdetails.
clear xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
append xfc to ifc.
endloop.
endform.
form create_dynamic_itab.
Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = ifc
importing
ep_table = dy_table.
assign dy_table->* to <dyn_table>.
Create dynamic work area and assign to FS
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
endform.
form get_data.
Select Data from table.
select * into table <dyn_table>
from (p_table).
endform.
form write_out.
Write out data from table.
loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index
of structure <dyn_wa> to <dyn_field>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
endform.
Thanks,
Shankar -
How to delete data from dynamic internal table
Hi,
I have dynamic internal table and I have some slection screen fields , using these selection screen fields
(select -options), I have to filter the data? assigning will work with READ , but I have select options not the parametre,
and also delete will not work for dynamic table..
as we cannot use assigning with delete..
So how to do this?
and one more thing is , I cannot filter the data while selection( in select, I cannot filter the data-> as it's not coming directly from table, it's coming from buffer),
so now after selection of data, I need to filter the data from dynamic table.
Is there any way to do this?
Regards,
MrunalHi matt,
I tried with below code as you said. But I am getting dump. can you help?
here is my piece of code.
FIELD-SYMBOLS: <LS_DATA> type any,
<LT_DATA> TYPE table,
<L_FIELD> type any.
ASSIGN <l_buffer_entry>-dataptr->* TO <LS_DATA>.
ASSIGN <l_buffer_entry>-dataptr->* TO <LT_DATA>.
LOOP AT <LT_DATA> ASSIGNING <LS_DATA>.
ASSIGN COMPONENT 'BUKRS' OF STRUCTURE <LS_DATA> TO <L_FIELD>.
IF <L_FIELD> NOT IN SO_BUKRS.
DELETE <LT_DATA>.
ENDIF.
UNASSIGN <L_FIELD>.
ASSIGN COMPONENT 'BELNR' OF STRUCTURE <LS_DATA> TO <L_FIELD>.
IF <L_FIELD> NOT IN SO_BELNR.
DELETE <LT_DATA>.
ENDIF.
UNASSIGN <L_FIELD>.
ENDLOOP.
and here is the description of my dump:->>>
You attempted to access an unassigned field symbol
(data segment 32772).
This error may occur for any of the following reasons:
- You address a typed field symbol before it is set using ASSIGN
- You address a field symbol that points to a line in an internal table
that has been deleted
- You address a field symbol that had previously been reset using
UNASSIGN, or that pointed to a local field that no longer exists
- You address a global function interface parameter, even
though the relevant function module is not active,
that is it is not in the list of active calls. You can get the list
of active calls from the this short dump. -
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. -
Populate data from dynamic internal table
Hi
I have dynamic internal table <lt_paxxxx>. Iam fillling <lt_paxxxx> in the following way.
select * into table <lt_paxxxx> from (infty-dbname).
I have to pass data of <lt_paxxxx> to another internal table lt_final.
'lt_final' should contain fields like <lt_paxxxx>, infty name, DB name.
Could you please help me out how to pass <lt_paxxxx> data to 'LT_FINAL'.loop at <it_table>
into <is_table>.
loop at it_fieldcatalog
into is_fieldcatalog.
assign component is_fieldcatalog-fieldname
of structure <is_table>
to <field1>.
concatenate 'IT_TABLE-'
is_fieldcatalog-fieldname
into w_field.
assign (w_field) to <field2>.
check sy-subrc eq space.
move <field1> to <field2>.
endloop.
append it_table
endloop.
regards -
How to pass data from dynamic internal table to standard internal table
hi experts,
below is the piece of code which i have used in my requirement but the data is not moved.
LOOP AT <tab> ASSIGNING <tab1>.
MOVE-CORRESPONDING <tab1> TO wa.
append wa TO gt_outtab.
ENDLOOP.
here
<tab> - dynamic internal table.
<tab1>-dynamic internal table work area.
gt_outtab - standard internal table.
wa- standard internal table work area.
i am not getting what additional thing i have to write.
pls help me in this regard.
thankx in advance.
soham.p.Hello soham p ,
I am also using the same logic but in my program it is working fine so you declare the fieldsymols like this and try and also check the dynamic internal contain the data or not.
FIELD-SYMBOLS : <y_i_table> TYPE STANDARD TABLE,
<y_wa_table> TYPE ANY.
LOOP AT <y_i_table> ASSIGNING <y_wa_table>.
MOVE-CORRESPONDING <y_wa_table> TO y_wa_vfscaid.
APPEND y_wa_vfscaid TO y_i_vfscaid.
CLEAR y_wa_vfscaid.
ENDLOOP. -
Populate data in dynamic internal table
Hi ppl,
I have a requirement where I need to display certain fields in the report output.
The output contains 8 fixed fields (common for all rows in output) and some dynamic fields (number of column varies with rows) which will be determined at runtime.
I am able to create the dunamic internal table....and at runtime I see the fields created in the internal table correctly.
Now my requirement is to fill this table with the data from 2 internal tables.
The values for the 8 common fields comes from the internal table t_output and the values for dynamic fields come from t_dynamic.
Please let me know the logic to merge these 2 internal tables into the dynamic internal table <dyn_table>.
Regards.Hello David,
This has been discussed many times before in this forum. Since the table structure is dynamic the fields are determined at runtime.
To assign data to this table you have to use [ASSIGN COMPONENT ... |http://help.sap.com/abapdocu_70/en/ABAPASSIGN_MEM_AREA_DYNAMIC_DOBJ.htm#!ABAP_ALTERNATIVE_4@4@] variant.
Please refer to the example provided in the documentation for details.
BR,
Suhas -
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 -
How to read data from an internal table into a real table?
Hello experts,
I'm relatively new to ABAP and I'm trying to figure out how to read data from an internal table into a table that I created. I'm trying to use the RRW3_GET_QUERY_VIEW_DATA function module to read data from a multiprovider. I'm trying to read data from the e_cell_data and e_axis_data tables into a table that I've already created. Please see code below.
TABLES MULTITAB.
DATA:
query_name TYPE RSZCOMPID,
s_cubename TYPE RSINFOPROV,
t_cell_data TYPE RRWS_T_CELL,
t_axis_data TYPE RRWS_THX_AXIS_DATA,
t_axis_info TYPE RRWS_THX_AXIS_INFO,
wa_t_cell_data like line of t_cell_data,
wa_t_axis_data like line of t_axis_data,
w_corp_tab like line of t_cell_data.
s_cubename = 'CORP_MPO1'.
query_name = 'Z_corp_test'.
CALL FUNCTION 'RRW3_GET_QUERY_VIEW_DATA'
EXPORTING
i_infoprovider = s_cubename
i_query = query_name
i_t_parameter = query_string_tab
IMPORTING
e_cell_data = t_cell_data
e_axis_data = t_axis_data
e_axis_info = t_axis_info.
If anyone has any information to help me, I would greatly appreciate it. Thanks.Hi,
<li>Once you call the function module RRW3_GET_QUERY_VIEW_DATA, lets say data is available in the corresponding tables e_cell_data e_axis_data which you have mentioned.
<li>Modify your internal table defined for other purpose, with data from e_cell_data e_axis_data like below.
LOOP AT t_cell_data INTO wa_t_cell_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_cell_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
LOOP AT t_axis_data INTO wa_t_axis_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_axis_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
Thanks
Venkat.O -
How to move data from 2 internal table to 1 internal table
Can any body send me code that how to move data from 2 internal table into one internal table.
Moderator message : Read ABAP documentation. Thread locked.
Edited by: Vinod Kumar on Jun 13, 2011 11:45 AMHi Mohdarif92;
I don't know your full needs. But general method should be as below code.
Please check exam below code.
Best regards.
data : begin of gt_result.
... like mkpf-...
... like mkpf-...
... like mseg-...
... like mseg-...
end of gt_result
select *
into table gt_mkpf
from mkpf where ...
select *
into table mseg
from mseg where ...
loop at gt_mkpf.
loop at gt_mseg where ... = mkpf-...
move-corresponding gt_mkpf to gt_result.
move-corresponding gt_mseg to gt_result.
append gt_result
endloop.
endloop. -
Popualting data into dynamic internal table
Hi all,
I am working on Dynamic internal tables.I have created the structure of internal table but i am unable to populate data into it.Though i have seen some of the forums but those didn't help me. please provide me the solution. Here is my code what i did.I have the data in itab and itab1.
My requirement is meinh fileds are dynamic.thie meinh and umren are two fileds in mvke table.for one record ihave to populate umren value for that particular meinh value.Pls help me.
mtart vkorg werks mtanr Meinh(kg) Meinh(gl)
fert 0353 0303 3231 Umren value Umren value
REPORT z123.
T Y P E - P O O L S
TYPE-POOLS :slis,abap.
T A B L E S
*Tables
TABLES: mara,marm,mvke,marc.
F I E L D - S Y M B O L S
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa> ,
<dyn_field>.
I N T E R N A L T A B L E S
Internal Tables declaration for ALV GRID/LIST
DATA: ls_fieldcat TYPE slis_fieldcat_alv, "FIELD CATALOG LIST
tb_uom_cat TYPE slis_t_fieldcat_alv, "FIELD CATALOG
ls_fieldcat1 TYPE lvc_s_fcat,
tb_dy_cat TYPE lvc_t_fcat, "FIELD CATALOG
tb_outputcat TYPE slis_t_fieldcat_alv,
tb_events TYPE slis_t_event,
ref_grid TYPE REF TO cl_gui_alv_grid,
t_events LIKE LINE OF tb_events.
DATA: BEGIN OF itab OCCURS 0,
mtart LIKE mara-mtart,
vkorg LIKE mvke-vkorg,
werks LIKE marc-werks,
matnr TYPE mara-matnr,
END OF itab.
DATA: BEGIN OF itab1 OCCURS 0,
matnr TYPE marm-matnr,
umren TYPE marm-umren,
meinh TYPE marm-meinh,
END OF itab1.
V A R I A B L E S
Global Variables
DATA: g_repid LIKE sy-repid. "Report ID
DATA: dy_table TYPE REF TO data,
dy_line TYPE REF TO data.
S E L E C T I O N S C R E E N
For User Input(Selection Criteria)
SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME TITLE text-001.
SELECT-OPTIONS :
s_mtart FOR mara-mtart OBLIGATORY, " Material type
s_vkorg FOR mvke-vkorg OBLIGATORY, " Sales Organization
s_plant FOR marc-werks, " Plant
s_meinh FOR marm-meinh. " Unit of Measure
SELECTION-SCREEN END OF BLOCK b0.
I N I T I A L I Z A T I O N
INITIALIZATION.
Program ID
g_repid = sy-repid. " Prog ID
A T S E L E C T I O N - S C R E E N
AT SELECTION-SCREEN.
Validate Material Type
PERFORM check_mtart.
Validate Sales Organization
PERFORM check_vkorg.
Validate Plant
PERFORM check_werks.
Validate Unit of Measure (UOM)
PERFORM check_meinh.
S T A R T - O F - S E L E C T I O N
START-OF-SELECTION.
Get Data
PERFORM get_data.
FIELD CATALOG FOR ALV
PERFORM fill_field_catalog_uom USING tb_uom_cat.
FIELD CATALOG FOR CREATING DYNAMIC INTERNAL TABLE
PERFORM fill_field_catalog_dy USING tb_dy_cat.
CREATING DYNAMIC INTERNAL TABLE
PERFORM dy_tab_create.
End of selection *
F O R M S
*& Form CHECK_MTART
Validate Material Type
FORM check_mtart .
Material Type
DATA :l_mtart LIKE t134-mtart.
CHECK NOT s_mtart IS INITIAL.
SELECT mtart UP TO 1 ROWS
INTO l_mtart
FROM t134
WHERE mtart IN s_mtart.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e899(mm) WITH 'Invalid Material Type'(002).
ENDIF.
ENDFORM. " CHECK_MTART
*& Form CHECK_VKORG
Validate Sales Organization
FORM check_vkorg .
Sales Oraganization
DATA :l_vkorg LIKE tvko-vkorg.
CHECK NOT s_vkorg IS INITIAL.
SELECT vkorg UP TO 1 ROWS
INTO l_vkorg
FROM tvko
WHERE vkorg IN s_vkorg.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e899(mm) WITH 'Invalid Sales Organization'(003).
ENDIF.
ENDFORM. " CHECK_VKORG
*& Form CHECK_WERKS
Validate Plant
FORM check_werks .
Plant
DATA :l_werks LIKE t001w-werks.
CHECK NOT s_plant IS INITIAL.
SELECT werks UP TO 1 ROWS
INTO l_werks
FROM t001w
WHERE werks IN s_plant.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e899(mm) WITH 'Invalid Plant'(004).
ENDIF.
ENDFORM. " CHECK_WERKS
*& Form CHECK_MEINH
Validate Unit of Measure (UOM)
FORM check_meinh .
Unit of Measure (UOM)
DATA :l_meinh LIKE t006-msehi.
CHECK NOT s_meinh IS INITIAL.
SELECT msehi UP TO 1 ROWS
INTO l_meinh
FROM t006
WHERE msehi IN s_meinh.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e899(mm) WITH 'Invalid Unit of Measure'(005).
ENDIF.
ENDFORM. " CHECK_MEINH
*& Form FILL_FIELD_CATALOG_UOM
text
FIELD CATALOG FOR ALV
FORM fill_field_catalog_uom USING l_fieldcat TYPE slis_t_fieldcat_alv.
DATA: BEGIN OF l_itab OCCURS 0,
meinh TYPE marm-meinh,
END OF l_itab.
DATA: l_count TYPE i.
DATA: l_fieldcat_col_pos TYPE i.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'MTART'.
ls_fieldcat-key = ''.
ls_fieldcat-col_pos = 1.
ls_fieldcat-ref_fieldname = 'MTART'.
ls_fieldcat-ref_tabname = 'MARA'.
APPEND ls_fieldcat TO l_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'VKORG'.
ls_fieldcat-key = ''.
ls_fieldcat-col_pos = 2.
ls_fieldcat-ref_fieldname = 'VKORG'.
ls_fieldcat-ref_tabname = 'MVKE'.
APPEND ls_fieldcat TO l_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'WERKS'.
ls_fieldcat-key = ''.
ls_fieldcat-col_pos = 3.
ls_fieldcat-ref_fieldname = 'WERKS'.
ls_fieldcat-ref_tabname = 'MARC'.
APPEND ls_fieldcat TO l_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-key = 'x'.
ls_fieldcat-col_pos = 4.
ls_fieldcat-ref_fieldname = 'MATNR'.
ls_fieldcat-ref_tabname = 'MARA'.
APPEND ls_fieldcat TO l_fieldcat.
CLEAR ls_fieldcat.
l_fieldcat_col_pos = 5.
Getting the UOM as per user selection
SELECT msehi FROM t006
INTO TABLE l_itab
WHERE msehi IN s_meinh.
LOOP AT l_itab.
ls_fieldcat-fieldname = l_itab-meinh.
ls_fieldcat-key = ''.
ls_fieldcat-col_pos = l_fieldcat_col_pos.
ls_fieldcat-ref_fieldname = 'MSEHI'.
ls_fieldcat-ref_tabname = 'T006'.
APPEND ls_fieldcat TO l_fieldcat.
CLEAR ls_fieldcat.
l_fieldcat_col_pos = l_fieldcat_col_pos + 1.
ENDLOOP.
ENDFORM. " FILL_FIELD_CATALOG_UOM
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
FORM display_data .
ENDFORM. " DISPLAY_DATAENDFORM. " FILL_FIELD_CATALOG_UOM
*& Form DY_TAB_CREATE
text
--> p1 text
<-- p2 text
FORM dy_tab_create .
CREATE DYNAMIC INTERNAL TABLE AND ASSIGN TO FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = tb_dy_cat
IMPORTING
ep_table = dy_table.
ASSIGN dy_table->* TO <dyn_table>.
*CREATE DYNAMIC WORK AREA AND AASIGN TO FS
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
ENDFORM. " DY_TAB_CREATE
*& Form FILL_FIELD_CATALOG_DY
text
FIELD CATALOG FOR CREATING A DYNAMIC TABLE
FORM fill_field_catalog_dy USING l_fieldcat TYPE lvc_t_fcat.
DATA: BEGIN OF l_itab OCCURS 0,
meinh TYPE marm-meinh,
END OF l_itab.
DATA: l_count TYPE i.
DATA: l_fieldcat_col_pos TYPE i.
DATA: l_umren TYPE string.
DATA: l_var TYPE string.
CLEAR ls_fieldcat.
ls_fieldcat1-fieldname = 'MTART'.
ls_fieldcat1-key = ''.
ls_fieldcat1-col_pos = 1.
ls_fieldcat1-datatype = 'char'.
ls_fieldcat1-intlen = 4.
APPEND ls_fieldcat1 TO l_fieldcat.
CLEAR ls_fieldcat1.
ls_fieldcat1-fieldname = 'VKORG'.
ls_fieldcat1-key = ''.
ls_fieldcat1-col_pos = 2.
ls_fieldcat1-datatype = 'char'.
ls_fieldcat1-intlen = 4.
APPEND ls_fieldcat1 TO l_fieldcat.
CLEAR ls_fieldcat1.
ls_fieldcat1-fieldname = 'WERKS'.
ls_fieldcat1-key = ''.
ls_fieldcat1-col_pos = 3.
ls_fieldcat1-datatype = 'char'.
ls_fieldcat1-intlen = 4.
APPEND ls_fieldcat1 TO l_fieldcat.
CLEAR ls_fieldcat1.
ls_fieldcat1-fieldname = 'MATNR'.
ls_fieldcat1-key = 'x'.
ls_fieldcat1-col_pos = 4.
ls_fieldcat1-datatype = 'char'.
ls_fieldcat1-intlen = 18.
APPEND ls_fieldcat1 TO l_fieldcat.
CLEAR ls_fieldcat1.
l_fieldcat_col_pos = 5.
Getting the UOM as per user selection
SELECT msehi FROM t006
INTO TABLE l_itab
WHERE msehi IN s_meinh.
SORT l_itab ASCENDING.
DESCRIBE TABLE l_itab LINES l_count.
LOOP AT l_itab.
ls_fieldcat1-fieldname = l_itab-meinh.
ls_fieldcat1-key = ''.
ls_fieldcat1-col_pos = l_fieldcat_col_pos.
ls_fieldcat1-datatype = 'dec'.
ls_fieldcat1-intlen = 5.
APPEND ls_fieldcat1 TO l_fieldcat.
CLEAR ls_fieldcat1.
l_fieldcat_col_pos = l_fieldcat_col_pos + 1.
ENDLOOP.
ENDFORM. " FILL_FIELD_CATALOG_DY
*& Form GET_DATA
text
--> p1 text
<-- p2 text
FORM get_data .
SELECT
amtart bvkorg cwerks amatnr
INTO TABLE itab
FROM mara AS a
JOIN mvke AS b ON bmatnr = amatnr
JOIN marc AS c ON cmatnr = bmatnr
JOIN marm AS d ON dmatnr = cmatnr
WHERE a~mtart IN s_mtart
AND b~vkorg IN s_vkorg
AND c~werks IN s_plant.
SORT itab ASCENDING.
DELETE ADJACENT DUPLICATES FROM itab.
SELECT matnr umren meinh FROM marm
APPENDING TABLE itab1
FOR ALL ENTRIES IN itab
WHERE matnr = itab-matnr
AND meinh IN s_meinh .
ENDFORM. " GET_DATAcan you check this for creation of dynamic table
******DATA DECLARATION*****************************
FIELD-SYMBOLS : <it_final> TYPE STANDARD TABLE,
<wa_final> TYPE ANY,
<w_field> TYPE ANY.
***DYNAMIC CREATION OF FIELDCATALOG****************
*FIRST 2 FIELDS FIELDS FIELD1 AND FIELD2 ARE CONSTANT, FIELDS OBTAINED IN THE LOOP ENDLOOP ARE DYNAMIC,
*LIKEWISE DYNAMIC FIELDCATALOG IS CREATED
wa_fieldcatalog-fieldname = 'FIELD1'.
wa_fieldcatalog-ref_table = 'E070'.
wa_fieldcatalog-outputlen = '13'.
wa_fieldcatalog-reptext = 'Created On'.
wa_fieldcatalog-seltext = 'Created On'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'FIELD1'.
wa_fieldcatalog-ref_table = 'E070'.
wa_fieldcatalog-outputlen = '13'.
wa_fieldcatalog-reptext = 'Created On'.
wa_fieldcatalog-seltext = 'Created On'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
LOOP AT it_mandt WHERE mandt IN s_mandt.
CONCATENATE 'CLNT' it_mandt INTO wa_fieldcatalog-fieldname.
wa_fieldcatalog-inttype = 'NUMC'.
wa_fieldcatalog-outputlen = '14'.
wa_fieldcatalog-reptext = it_mandt.
wa_fieldcatalog-seltext = it_mandt.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR :wa_fieldcatalog ,it_mandt.
ENDLOOP.
********CREATE DYNAMIC TABLE************************
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fieldcatalog
IMPORTING
ep_table = new_table
EXCEPTIONS
generate_subpool_dir_full = 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.
ASSIGN new_table->* TO <it_final>.
*********CREATE WORK AREA****************************
CREATE DATA new_line LIKE LINE OF <it_final>.
ASSIGN new_line->* TO <wa_final>.
*********INSERTTING WORK AREAR TO INTERNAL TABLE******
INSERT <wa_final> INTO TABLE <it_final>.
*******POPULATING DATA*******************************
LOOP.
ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_final> TO <w_field>.
<w_field> = '12345'.
ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_final> TO <w_field>.
<w_field> = '21453DD'.
FIELD1 AND FIELD2 ARE COMPONENTS OF FIELDCATALOG.
ENDLOOP.
ENDLOOP. -
How to populate data in the same table based on different links/buttons
Hi
I'm using jdeveloper 11.1.4. I have a use case in which i need to populate data in the same table based on click of different links.
Can anyone please suggest how can this be achieved.
ThanksI have a use case in which i need to populate data in the same table based on click of different linksDo you mean that you need to edit existing rows ?
What format do you have the date in - table / form ? -
How to populate data from dynamic drop down list to the text field
Hi,
I tried to populate data from dynamic drop down list to city field. I would like to concat data from drop down list.When selecting add button to add the item and select item from drop down list, data should be displayed in the text field. However, Please help. I spent alot of time to make it works I am not successful.
Please see the link below.
https://acrobat.com/#d=SCPS0eVi6yz13ENV0cnUdw
Thanks for your help
CindyHi Rosalin,
Loop the hidden table, get the values and populate drop down in each iteration.
DropDownList1.addItem("Text","Value");
You can use one more solution for this scenario. If it is a matter of 2,3 dropdowns, put three dropDowns in the form layout and give seperate static data binding to them. At run time make the dropDowns hide/visible as per the requirement.
Hope this helps.
Thanks & Regards,
Sanoosh -
How to copy data from one internal table to another
i am using some function module to get some data for my function module
and the retrieved data is not getting populated in mu fumctional module
i am sucessful in getting the data to an internal table in my function module but dont know how to pass it to my table parameter
thanks in advanceHi Naval,
Declare an internal table of type table parameter structure and pass it the table parameters of the Function module.
Check the code for this function module.
DATA IT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
SELECT * FROM MARA UP TO 10 ROWS INTO TABLE IT_MARA.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:\TEST.TXT'. FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
<b> TABLES
DATA_TAB = IT_MARA</b>
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks,
Vinay -
How to insert data from different internal table into a data base table
hi all,
I want to insert a particular field in an internal table to a field in a data base table.Note that the fields in the internal table and database table are not of the same name since i need to insert data from different internal tables.can some one tell me how to do this?
in short i want to do something like the foll:
INSERT INTO ZMIS_CODES-CODE VALUE '1'.
*INSERT INTO ZMIS_CODES-COL1 VALUE DATA_MTD-AUFNR .(zmis_codes is the db table and data_mtd is the int.table)REPORT ZINSERT.
tables kna1.
data: itab LIKE KNA1.
data lv_kUNAG LIKE KNA1-KUNNR.
lv_kuNAG = '0000010223'.
ITAB-kuNNR = lv_kuNAG.
ITAB-name1 = 'XYZ'.
INSERT INTO KNA1 VALUES ITAB.
IF SY-SUBRC = 0.
WRITE:/ 'SUCCESS'.
ELSE.
WRITE:/ 'FAILED'.
ENDIF.
Here lv_kunag is ref to kna1 kunnr passed in different name
In internal table .
Try and let me know if this logic dint work.
Maybe you are looking for
-
I installed IOS 7 and now it won't accept my password. How do i fix it?
I finally got around to installing IOS 7 and now my phone won't accept the 4 digit passcode. I didn't think about disabling that feature before the upgrade. Never had a problem before. And yes, I'm sure I'm using the right code. I use it many times p
-
I can't get my new iPad to record a video I see the video right above camera but it is not active yet I can't touch it to activate it.
-
Trouble converting powerpoint files with png images to pdf-Can someone help?
Hello all, In my line of work, I create and modify large sized posters that are created in powerpoint. I would have the files print ready by converting them to pdf. I usually have little to no issues executing this. However, I have been dealing with
-
Will webutil work with internetexplorer
Hi, Everyone I heard that forms 10g application using webutil will not work with Internet Explorer is it true ???
-
ADF: Exception at running page
Hi Everyone, im using Jdev 11G release 1. i have developed a simple ADF Page with some VOs. while running page the output is not displaying instead im getting one Exception: <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives