Modify Syntax on Internal table of type ANY TABLE
Hi,
I have declared one internal table which is of type ANY TABLE.
In the Loop statement, I am trying to Modify that Internal table from WA.
Then I am getting one Error message
"You cannot use explicit or implicit index operations on tables with types "HASHED TABLE" or "ANY TABLE". "C_T_DATA" has the type "ANY TABLE".
Above code I have placed in method of a corresponding Class.
Can u please advise me on this..How to modify the Intenal table .
Thanks and Regards,
K.Krishna Chaitanya.
Hi Krishna,
the modify statement is obsolete.
You can always LOOP AT [itab] ASSIGNING <field-symbol>.
This makes the loop never slower, depending on the table structure faster or much faster.
If you know the table structure at run time, you can use a field-symbol of that type. If not, you can use a field-symbol TYPE any. Then you have to assign the components to field-symbol to modify them, i.e.
field-symbols:
<table_line> type any,
<matnr> type mara-matnr.
loop at itab assigning <table_line>.
assign component 'MATNR' of structure <table_line> to <matnr>.
clear <matnr>.
endloop.
This technique (available more than ten years) works incredibly fast. My estimate is that if SAP would change all the old standard programs that way and use it consequently in the new ones, the whole system would be 20 % faster because myriads of unnecessary copy operations of LOOP INTO would not happen.
Regards,
Clemens.
Similar Messages
-
Problem in modifying the main internal table gt_data
Hello i have written code for modifying the main internal table. i have read data from ausp table and put into the internal table gt_ausp. now i want to modify my main table GT-DATA with gt_ausp. i am not able to do this.
LOOP AT gt_data INTO ls_list.
lt_temp-objek = ls_list-matnr.
APPEND lt_temp. " 특성값 발췌용도로 저장
APPEND ls_list TO lt_work. " 핵심작업용도로 저장
ENDLOOP.
DESCRIBE TABLE lt_temp.
IF sy-tfill EQ 0.
pv_flg = 'X'.
EXIT.
ENDIF.
Get 제품인증(플랜트별).....
DESCRIBE TABLE lt_cetino_tp.
플랜트 자재번호
카타로그-인증 코드그룹-인증 인증코드
Certi. No.
Get 자재별 특성값..........
오브젝트 특성이름 내부특성 내부카운터 특성값
SELECT aobjek batnam aatinn aatzhl a~atwrt
INTO CORRESPONDING FIELDS OF TABLE lt_ausp_tp
FROM ausp AS a INNER JOIN cabn AS b
ON aatinn = batinn
FOR ALL ENTRIES IN lt_temp
WHERE a~objek EQ lt_temp-objek " 오브젝트키(자재번호)
AND a~klart EQ '001' " 클래스유형
AND a~atzhl EQ '001' " 특성값카운터(최종건만 존재)
자재특성 변경시 변경됨
AND b~adzhl EQ '0000'.
IF sy-subrc EQ 0.
DELETE ADJACENT DUPLICATES FROM lt_ausp_tp.
lt_ausp[] = lt_ausp_tp[].
lt_ausp_tp2[] = lt_ausp_tp[].
DELETE ADJACENT DUPLICATES FROM lt_ausp_tp2.
Get 특성내역
내부특성 " 내부카운터
특성값 특성값내역
SELECT aatinn " aatzhl
aatwrt batwtb
INTO CORRESPONDING FIELDS OF TABLE lt_cawn
FROM cawn AS a INNER JOIN cawnt AS b
ON aatinn = batinn AND
aatzhl = batzhl AND
aadzhl = badzhl
FOR ALL ENTRIES IN lt_ausp_tp2
WHERE a~atinn EQ lt_ausp_tp2-atinn " 내부특성
AND b~spras EQ sy-langu.
ENDIF.
SORT lt_work BY matnr .
BREAK-POINT.
LOOP AT lt_work INTO ls_list.
특성내역
READ TABLE lt_ausp WITH TABLE KEY objek = ls_list-matnr
atnam = 'SECTION_WIDTH'.
수출자재가 아닌 것은 제외
LS_LIST-SECTION_WIDTH = LT_AUSP-ATWRT.
MODIFY TABLE GT_DATA FROM LS_LIST TRANSPORTING SECTION_WIDTH.Hi,
Question before: why dont you just use the std.API for reading the classification data?
e.g. "BAPI_OBJCL_GETDETAIL"
Second: a DELETE DELETE ADJACENT DUPLICATES works only only sorted tables.
Doing this after a select will only succeed randomly depending on the buffers of your data based below.
( 90% chance if it is an oracle system)
To your question:
Just replace your LOOP AT gt_data into ls_list
by a LOOP AT gt_data ASSIGNING <current_list_record>.
then you can access the fields directly:
<current_list_record>-SECTION_WIDTH = LT_AUSP-ATWRT.
Cause of your issue:
"MODIFY" needs a key to to find the record to be updated.
If your gt_data ist referencing a DDIC table type with a key or a local type with a key
it has no chance to do it.
Hope that helps.
br, -
Modify ztable from internal table
Hi,
I have a Ztable in which i have 4 diff fields....1 2 3 4
and an internal table in whch i have same number of fields...
Internal table :
1 2 3 4
a w x 9
a w x 10
a w x 11
a w x 13
a w x 12
When I am using Modify it only appends last record into ztable as below:
Ztable : 1 2 3 4
a w x 12
Internal table has 6 records and z table should be appended with 6 records too...
if varid-report = 'ZFINRR1001' and
varid-VARIANT = 'CITI - ZBA' or
varid-VARIANT = 'WACHOVIA - ZBA'.
Modify ZV12_SWEEP from t_data_new.
endif.
Any suggestions will be aprreciated!
Regards,
Kittu>
Kittu wrote:
> When I am using Modify it only appends last record into ztable
>
> Modify ZV12_SWEEP from t_data_new.
Hi,
You only get last record appended because your MODIFY statement uses t_data_new as a working area and not as a table.
To append the content of your internal table, use the FROM TABLE option as below :
MODIFY zv12_sweep FROM TABLE t_data_new.
Regards.
Nicolas -
I need insert /update/modify ztable from internal table or work area
I have one simple problem.
TYPES: BEGIN OF t_account,
acc_no LIKE zztaccountheader-acc_no,
cust_id LIKE zztaccountheader-cust_id,
acc_type LIKE zztaccountheader-acc_type,
od_option LIKE zztaccountheader-od_option,
od_limit LIKE zztaccountheader-od_limit,
od_issue_date LIKE zztaccountheader-od_issue_date,
END OF t_account.
data: lwa_account TYPE t_account,
li_account TYPE STANDARD TABLE OF t_account,
bu scerrin i am inputing data :
i want modify updare or insert record into ztable by work area i put following thing
MOVE : zztaccountheader-acc_no TO lwa_account-acc_no,
zztcustomer-cust_id TO lwa_account-cust_id,
zztaccountheader-acc_type TO lwa_account-acc_type,
zztaccountheader-od_option TO lwa_account-od_option,
zztaccountheader-od_limit TO lwa_account-od_limit,
zztaccountheader-od_issue_date TO lwa_account-od_issue_date.
INSERT zztaccountheader CLIENT SPECIFIED FROM lwa_account .
CLEAR lwa_account.
ENDIF.
i am etting error
The type of the database table and work area (or internal table)
"LWA_ACCOUNT" are not Unicode convertible.
please solve ithi,
decalre like this.
tables : zztaccountheader.
data : t_account like zztaccountheader occurs 0 with header line.
data: lwa_account TYPE t_account,
li_account TYPE STANDARD TABLE OF t_account,
MOVE : zztaccountheader-acc_no TO lwa_account-acc_no,
zztcustomer-cust_id TO lwa_account-cust_id,
zztaccountheader-acc_type TO lwa_account-acc_type,
zztaccountheader-od_option TO lwa_account-od_option,
zztaccountheader-od_limit TO lwa_account-od_limit,
zztaccountheader-od_issue_date TO lwa_account-od_issue_date.
INSERT zztaccountheader CLIENT SPECIFIED FROM lwa_account .
CLEAR lwa_account.
ENDIF.
rgss
anver
if hlped mark points -
Unable to modify the final internal table with month field
hi everybody
I am having one material which has a qty in different months lets say that jan feb mar apr may june..... now i have caluculated the total of the material monthly wise and i have to display in the output. if the material of the first month displayed and then again the same material comes in the loop and that matrial is going to be checked by the month wise and has to diaplyed in the corresponding month fied in the output. so i am using the index in the loop using the AT new command for the matnr and appending the final output structure and now if the same matrial comes again with different month the final output internal table should modify. but the statement is executing but the value is not coming in the final output structure.
the syntax which i am using is
MODIFY GT_OUTPUT FROM WA_OUTPUT INDEX lv_index TRANSPORTING MATNR.
OUTPUT FORMAT IS
MATERIAL NO : JANQTY : FEBQTY : MARQTY : ...... :DECQTY.
THANKS IN ADVANCEmy issue is....
lets say that i am having three materials now
381, 391, 401. and the material 381 has used in jan month 5 times and feb month 6 times like that. each material is used in different months. now i have calculated all the matrerials qty monthly wise and i have to display the material one time only the qty's in jan feb mar and so on....
material no 383
jan 31064
feb 67312
mar 65107
apr 31222
material no 391
jan 74677
feb 8952
mar 75501
so my output should be like this
OUTPUT FORMAT IS
MATERIAL NO : JANQTY : FEBQTY : MARQTY
381 31064 67312 65107
391 74677 8952 75501
now i have written the code like this
LOOP AT GT_OUTPUT1 INTO WA_OUTPUT1.
WA_OUTPUT-MATNR = WA_OUTPUT1-MATNR.
WA_OUTPUT-MJAHR = WA_OUTPUT1-MJAHR.
at NEW matnr.
l_matnr = 'X'.
lv_index = sy-tabix.
endat.
IF L_MATNR = 'X'.
PERFORM CASE_STATEMENT.
append wa_OUTPUT to gt_OUTPUT.
clear : wa_OUTPUT, l_matnr, WA_OUTPUT1, WA_ZQCALWT.
ELSE.
PERFORM CASE_STATEMENT.
MODIFY GT_OUTPUT FROM WA_OUTPUT. " INDEX lv_index TRANSPORTING MAR. " EQ WA_OUTPUT1-MATNR.
clear : wa_OUTPUT, l_matnr, WA_OUTPUT1, WA_ZQCALWT.
ENDIF.
endloop. -
Insert or Modify statement from internal table to database table
Hi All,
I have three tables wakh, wrf and wakp. I have an internal table with 5 columns col1, col2, col3, col4 and col5.
The value in Col1 is my article no and the articleno. is in the table wakh. The value in col2 is my ccode and it is in the table wrf. The rest three columns col3, col4 and col5 are unit, qty and price and they are in the wakp table. Now when my articleno is equal to ccode I need to update the col3, col4 and col5 values in the wakp. wakp has around 20 columns.
Can anyone of you guys please give me the code for this issue. Your help is highly appreciated and thanks for all for your time.
Cheers,
ChengHi Rob,
let me explain you the whole process what i am trying to do. I have a screen where there are 3 fields. In my first field I have a promoiton no. As soon as the user enters the promotion no. its description will be populated in my second field. If the promotion is not maintained then it will throw an error. In my third field User will upload an excel sheet which has 5 columns articleno, colorcode, salesunit, qty, mdprice. Here articleno is coming from wakh and colorcode is in wrf_charval table and the rest three fields are coming from wakp table. So for the article no. which is in col1. and for its corresponding colorcode which is in col3 i need to update col3, col4, col5 values.
With my below code I am able to upload the excel into internal table and display it. So instead of displaying I need to update in the database. Can you please let me know how I need to attach the function module within my code and update accordingly.
REPORT ZTest.
tables : wakh, wakt.
Parameter: PromoID type wakh-aktnr, PromoDec type wakt-aktkt, p_file LIKE rlgrap-filename
DEFAULT 'c:\test.xls' OBLIGATORY. " File Name
*FileName type string.
*file_nm type localfile.
TYPES: BEGIN OF t_datatab,
col1(25) TYPE c,
col2(30) TYPE c,
col3(30) TYPE c,
col4(30) TYPE c,
col5(30) TYPE c,
END OF t_datatab.
DATA: it_datatab TYPE STANDARD TABLE OF t_datatab INITIAL SIZE 0,
wa_datatab TYPE t_datatab.
Data : p_table type t_datatab occurs 0 with header line.
DATA : gd_scol TYPE i VALUE '1',
gd_srow TYPE i VALUE '2',
gd_ecol TYPE i VALUE '5',
gd_erow TYPE i VALUE '65536'.
DATA: it_tab TYPE filetable,
gd_subrc TYPE i.
field-symbols : <fs>.
AT selection-screen on PromoID.
select single * from wakh where aktnr = PromoID.
if sy-subrc EQ 0.
select aktkt from wakt into PromoDec where aktnr eq PromoID.
endselect.
else.
message A000(ZI) with 'Promotion ID is not Maintained.'.
endif.
*Title : Excel Uploading
*Selection screen definition
*SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
*PARAMETERS: p_file LIKE rlgrap-filename
DEFAULT 'c:\test.xls' OBLIGATORY. " File Name
*SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
REFRESH: it_tab.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select File'
default_filename = '*.xls'
multiselection = ' '
CHANGING
file_table = it_tab
rc = gd_subrc.
LOOP AT it_tab INTO p_file.
so_fpath-sign = 'I'.
so_fpath-option = 'EQ'.
append so_fpath.
ENDLOOP.
START-OF-SELECTION.
PERFORM upload_excel_file TABLES it_datatab
USING p_file
gd_scol
gd_srow
gd_ecol
gd_erow.
END-OF-SELECTION.
END-OF-SELECTION.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/ wa_datatab-col1,
wa_datatab-col2,
wa_datatab-col3,
wa_datatab-col4,
wa_datatab-col5.
ENDLOOP.
*& Form UPLOAD_EXCEL_FILE
upload excel spreadsheet into internal table
-->P_TABLE Table to return excel data into
-->P_FILE file name and path
-->P_SCOL start column
-->P_SROW start row
-->P_ECOL end column
-->P_EROW end row
FORM upload_excel_file TABLES p_table
USING p_file
p_scol
p_srow
p_ecol
p_erow.
DATA : lt_intern TYPE kcde_cells OCCURS 0 WITH HEADER LINE.
Has the following format:
Row number | Colum Number | Value
i.e. 1 1 Name1
2 1 Joe
DATA : ld_index TYPE i.
Note: Alternative function module - 'ALSM_EXCEL_TO_INTERNAL_TABLE'
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename = p_file
i_begin_col = p_scol
i_begin_row = p_srow
i_end_col = p_ecol
i_end_row = p_erow
TABLES
intern = LT_INTERN
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
FORMAT COLOR COL_BACKGROUND INTENSIFIED.
WRITE:/ 'Error Uploading file'.
EXIT.
ENDIF.
IF lt_intern[] IS INITIAL.
FORMAT COLOR COL_BACKGROUND INTENSIFIED.
WRITE:/ 'No Data Uploaded'.
EXIT.
ELSE.
SORT lt_intern BY row col.
LOOP AT lt_intern.
MOVE lt_intern-col TO ld_index.
assign component ld_index of structure
p_table to <fs>.
move : lt_intern-value to <fs>.
MOVE lt_intern-value TO p_table.
AT END OF row.
APPEND p_table.
CLEAR p_table.
ENDAT.
ENDLOOP.
ENDIF.
ENDFORM.
Thanks for your valuable time.
Cheng -
Copy and Modify from one internal table to another.Please help.
Hi,
I have an internal table having a structure like below.
Account Entity Category period1value pd2value
10 A C 100 200.
where account corresponds to 10
entity A
category C
period1 value = 100
period2 value = 200.
Now I need to populate it into another table having structure like
Account Entity Category period Value
10 A C 1 100
10 A C 2 200.
If u see this carefully a new column, period is added in the database table and thus for each row there will be only 1value.
Instead of period1 value and period2 value being in the same row they will come in different rows.One row will be like the value for period1 and next for value like period2.
Pleadse help
AnkitHi,
u can do as follows,
LOOP AT itab1 into wa_itab1.
wa_itab2-account = wa_itab1-account.
wa_itab2-entity = wa_itab1-entity.
wa_itab2-category = wa_itab1-category.
if not wa_itab1-period1 is initial.
wa_itab2-period = wa_itab1-period1.
endif.
if not wa_itab1-period2 is intial.
wa_itab2-period = wa_itab1-period2.
endif.
wa_itab2-value = wa_itab1-value.
append wa_tab2 to itab2.
clear:wa_itab1-period1 ,
wa_itab2-period .
endloop. -
Regarding modifying database from internal table
Hi ABAP Experts,
I am facing an issue regarding modifying DB table from itab.
All the records of itab are not getting reflected in DB table using Modify statement.
Syntax is as follows -
Locking DB table using enque FM
MODIFY abc FROM TABLE i_abc.
Unlocking DB table using deques FM
Please suggest what could be wrong with this. Helpful suggestion will be appreciated.
Thanks in adv,
AkashHi,
First Delete entries from the table(hope it is a custom table),
for example
DELETE FROM <DatabaseTable name> WHERE <primarykey = 'somevalue'>.
'After deleting those records.....then use insert statement
IF sy-subrc = 0.
INSERT <DatabaseTable name> FROM TABLE <InternalTable name> ACCEPTING DUPLICATE KEYS.
ENDIF.
Thanks & REgards -
Syntax for internal tables with same structure
Hi,
I would like to knwo what is the syntax to declare a table that has the same structure as the exisiting one?
Say for example:
Begin of it_tab,
Data (1000) type c,
End of it_tab.
Now I would like to declare IT_Tab2 with the structure of it_tab, how should I do that? Thanks!HI Anyi,
DATA <itab> TYPE|LIKE <tabkind> OF <linetype> WITH <key>
[INITIAL SIZE <n>]
[WITH HEADER LINE].
Regards,
Laxmi. -
How to update/modify the ALV internal table once it is displayed
Hi All,
I have a alv grid report using fm reuse_alv_grid_dispaly. My requirement is to create sales order using bapi (up to here it is working fine) and once the SO is created update the function module tables field with the created sales order.
Example:
My alv grid display before creating SO:
Customer Material SalesOrder
1000001 material1
My alv grid display after creating SO:
Customer Material SalesOrder
1000001 material1 3025642
How can I achieve this functionality. Because the field catalog is already displayed, how can I modify/update it by adding the sales order number to it. Experts, suggest me.
Thanks.FORM callback_ucomm USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
CASE ucomm.
WHEN 'CRE'.
* Logic to create sales order here...
* Show the Sales order column
CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
IMPORTING
et_fieldcat = gt_fieldcat
EXCEPTIONS
no_infos = 1
program_error = 2
OTHERS = 3.
if sy-subrc eq 0.
read table gt_fieldcat into gs_fieldcat with key fieldname = 'VBELN'.
if sy-subrc eq 0.
gs_fieldcat-no_out = space.
gs_fieldcat-tech = space.
modify gt_fieldcat from gs_fieldcat index sy-tabix transporting no_out tech.
endif.
CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
EXPORTING
it_fieldcat = gt_fieldcat[].
endif.
ENDFORM. -
Modify statement in internal table
Hi Gurus,
LOOP AT gi_coas.
READ TABLE gi_ekkn WITH KEY aufnr = gi_coas-aufnr
BINARY SEARCH.
IF sy-subrc EQ 0.
gi_ekkn-kostl = gi_coas-kostv.
MODIFY gi_ekkn TRANSPORTING kostl.
ENDIF.
ENDLOOP.
Will this code work or not let me know.
its giving short dump for me.
is there anything wrong in it.Hi
Hi which table you have to modify?
gi_ekkn or gi_coas?
Only you can modify gi_coas with the value read from gi_ekkn.
LOOP AT gi_coas.
READ TABLE gi_ekkn WITH KEY aufnr = gi_coas-aufnr
BINARY SEARCH.
IF sy-subrc EQ 0.
gi_ekkn-kostl = gi_coas-kostv.
MODIFY <b>gi_coas</b> <b> index sy-tabix</b> TRANSPORTING kostl.
ENDIF.
ENDLOOP.
Reward points if useful
Regards
Anji
Message was edited by:
Anji Reddy Vangala -
Modify database table from internal table
Hi All,
I need to update database table from internal table which is having around 30000 records.
I am using MODIFY tabname FROM TABLE int_tabname...
Using this statement, I can modify the databse records very well. But user has some additional requirement.
He wants that the table should be modified from the internal table and after modification we should have the erroneous records to be displayed if any.
e.g. if 1500 records out of 30000 are erroneous then only 28500 records should be updated and 1500 records should be displayed as erroneous records so that the user can correct them and use them again for executing the program.
Is there any FM which imports the database table name and internal table, modifies the database and exports an internal tanle with erroneous records?
Any help will be appriciated,
Regards,
NehaHi
modifying datbase table useing internal table
<b>advises</b> before updating this datbase table plz lock that table to avoid incosistency
write the logic for modifying
Modify the database table as per new dunning procedure
MODIFY fkkvkp FROM TABLE lt_fkkvkp .
and finally unlock the table
<b>example</b>
*To lock table for further operations
constants: lc_tabname TYPE rstable-tabname VALUE 'FKKVKP' . "FKKVKP
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = lc_tabname
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc EQ 0.
To fetch all the contract accounts for customers of the segment
Households/SME.
PERFORM fetch_contract_accounts using lc_tabname .
ENDIF. " IF sy-subrc EQ 0.
*wrote the logic
Modify the database table as per new dunning procedure from internal table
MODIFY fkkvkp FROM TABLE lt_fkkvkp .
*unlock the tbale
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
TABNAME = uc_tabname .
<b>Reward if usefull</b> -
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 -
Dynamic internal table and dynamic read statements.
Hi,
My Scenario :
I have two dynamic internal tables.
I am looping at one internal table and trying to read another table.
In the read statement how do I mention the key dyamically.
Example code below :
LOOP AT <dyn_table> ASSIGNING <dyn_wa>.
read second dynamic internal table.
enloop.
The key which I want use for reading say it is keyed in the selection criteria....
Also based on the value I read I want to modify the first internal table field value.
Remember I dont want to explicity mention the key
How do I do that?
Thanks
Krishna.Hi
U need to use the field-symbol, but u can't use a WHERE option, but u need to use the CHECK statament into the second loop:
LOOP AT <dyn_table> ASSIGNING <dyn_wa>.
LOOP AT <DYN_TABLE2> ASSIGNING <DYN_WA2>.
ASSIGN COMPONENT <COMPONENT> OF STRUCTURE <DYN_WA2> TO <FS>.
CHECK <FS> IN (=) .......
ASSIGN COMPONENT <COMPONENT> OF STRUCTURE <DYN_WA> TO <FS2>.
<FS2> = .......
EXIT.
ENDLOOP.
ENDLOOP.
Max -
How to modify a data base table ?
Hi,
i am working on a list output where if user is editing a field and that field need to be updated in the data base. table is a z table .
the table has 5 fields .
mandt key field
matnr key field
werks key field
charg key field
lgpla key field
usnam
edate
in the list output , the user will change the values in the lgpla field and that field need to be changed in the data base table.
i have used the stmt :
modify< table> from <internal table> ,
but a new record is added in the data base instead of overwriting the existing one.
but the record can be seen modified in the internal table.
kinldy let me know the method of updating or modifying the existing value in the data base.
thanks and regards,
vikram.Hi,
Its not possible to change Primary Key contents in the database.
it mention in documentation of MODIFY Statement,
a line is searched for in the database table that has the same content
in the primary key as the corresponding beginning part of the work area.
If such a line is not found,
a new line is inserted according to the same rules as for the INSERT statement.
If such a line is found,
this line is overwritten according to the same rules as for the UPDATE statement
if you want insert the modified line first Delete from database,Then Use Modify Statement
Regards,
Raghava Channooru
Maybe you are looking for
-
I was having a problem with a site my son uses that requires the Unity Web Player. I wrote to them and got a fix. Tried it out and it works but only using IE. :-( So, I went to check my plugins and the one for the Unity Web Player was disabled, I don
-
E/O Line - No Hope in Central London?
So I live in SE16 and recently reached out (pun intended) to Openreach regarding the status of FTTC in my area. This is the response I received: Thank you for sending your details, you are connected directly to Bermondsey exchange, this is called an
-
Problems downloading from marketplace
Lately when I either download something new from the market place or try to update an existing app I get an error message that states that file to large and that I need to download with WIFI, I have an unlimited data plan and am at 4gb so far this mo
-
Mail Group addresses not the same as Address Book contact group addresses.
A group in my Address Book does not show up in my Mail address book the same. The Mail addresses for my group includes ALL my contacts. How do we fix this problem? I am afraid to send a group e-mail in case it goes to everyone else in my address book
-
Insertion of Record using GRID
Hello Sir, This is Debasish here.Using Flex Grid I want to insert a record in backend resource i.e. database.So how I can create a blank editable row in flex grid. Please provide me support.