Modifying ztable
hi
i m having itab with vbeln
and ztable with objnr and ordsent.
where objnr and vbeln are equal
so now when i find objnr EQ vbeln i have to modify the ztable-ordsent = ' '.
plz can any one can tell me can i modify the ztable directly if yes then how?
hi neha,
1. do like this.
2.
LOOP AT ZTABLE.
READ TABLE ITAB WITH KEY VBLEN = ZTABLE-OBJNR.
<b> IF SY-SUBRC = 0.
ZTABLE-ORDSENT = ''.
MODIFY ZTABLE FROM ZTABLE.
ENDIF.</b>
ENDLOOP.
ENDLOOP.
3. Ztable (internal table)
and Actual ZTABLE should be same structure.
regards,
amit m.
Similar Messages
-
Getting error Uni code check when modifying Ztable from work area?
Hi all,
Getting error Uni code check when modifying Ztable from work area?
and how to increment counter when data modified?
FM 'popup_to_confirm'.
IMPORTING
answer = RES.
CHECK
RES = '1'.
WRITE :/ 'UPDATE'.
MODIFY ZPPT_PPDPLAN FROM GWA_FIN_PROD.
thanks in advance..what error you are getting. make sure source and Target are of similar sturcture.
-
Dialogue program for modifying ztable
hi experts,
i want to create a ztable. After creating the ztable i want to create an dialogue program using that dialogue program i have to create/modify entries of that ztable using text box and push button options.
can anybody having sample coding pls send me.....
thanks in advance,
raviHI,
chek this sample code
data: begin of itab occurs 0.
include structure ZTESTVENKATESH.
data: end of itab.
call screen 100.
*& Module STATUS_0100 OUTPUT
text
module STATUS_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
module USER_COMMAND_0100 input.
if sy-ucomm = 'HAI'.
APPEND ITAB.
modify ZTESTVENKATESH from table itab.
ENDIF.
thanks & regards,
venkatesh -
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 -
SORT gt_tabsum.
DESCRIBE TABLE gt_tabsum LINES gv_tabsum_entries.
MODIFY ztabsum FROM TABLE gt_tabsum.
IF SY_SUBRC = 0.
COMMIT WORK.
ENDIF.
Do i have any problem with my modify statement?
The issue is - the number of entries in internal table gv_tabsum_entries = 1630000
However after Modifying it to database table. I can see only 1140000 entries. Some entries are missing.
I am not sure if it has duplicate entries. Do you this it is becase of duplicates or something else.
Regds,
SenthilYes Senthil, You are right some of the entries must be already present there in the table so MODIFY just ignores them & updates only the new entries unless there is no change in the already present entries.
Hope this clears your dobut.
Regards
Abhii -
What is difference between modify and update i am using
hi
what is difference between mofify and update
my requiremen is to have three condition checkec while mofifying or updating from a internal table
the three fields are
cus no
status
date these all are primary key in the database table
so which sould i use modify or update
there might be entry already existing in database table or new entry to be created if already existin it should check on the primary keys and updatat if not it should add a record
pls suggest whihc to use and how to implement the check on teh threee primary key
like if modify ztable from table it_test
now where condition ? can be used or not with modify? and if yes how
if not should i use update will update create a new entry if no entry is there and please give syntex
regards
AroraHi Nishant Arora,
Modify: It works in performing two actions.
They are: Insert + Update.
For Example If a record that is exited in database, so you are modifying that record, it updates that particular record.
Similarly, If the is not existed in the database, you are modifying it, it inserts a new record.
Update: Update means just it updates the status, I mean it only updates the record. It doesn't inserts any new record if that particular record is not present in the database.
These are the cases you need to write these statements.
Syntaxes: :
Go through this links please.,
http://help.sap.com/saphelp_nw04/helpdata/en/e7/968aa8b2384dd9835f91e7f8470064/content.htm
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm
Reward points if useful
Cheers,
Swamy Kunche
Edited by: Swamy Kunche on Jun 11, 2008 2:41 PM -
How to enter values in ztable from screen painter
Hi guys,
I have a scenario,where i have to enter values in ztable for the values entered in screen painter.The screen painter is supposedly having 10 columns. i enter the value in the grid(table) and when i save, the records have to be inserted into ztable created by me. how to go through the problem. kindly help in giving a flow for the problem .If anybody has gone through this scenario please help out.
Thankx in advance
Regards
Navinif ur entering one record at a time from sreen to table then
u have to use ,
in pai module of the screen u have to code,
case sy-ucomm.
when 'SAVE'.
ztable-roll = ztable-roll.
ztable-name = ztable-name.
insert ztable/modify ztable.
ENDCASE.
if ur screen is having a table control
then u have to create a loop inside a module.
like
loop at tabcontrol_name
module insert_data.
endloop.
and in the doubleclked module,
move-corresponding ztable to ztable.
insert ztable.
Note : in both cases u have selected input fields as from
table/dictionary in the screen.
Regards -
How to upload 15 lakhs of record onto ztable with performance
I have 15 to 20 lakhs of records in my internal table. I'm uploading it onto ztable in se11.
While doing so, it's taking lot of time.
I'm writing the following query:
MODIFY ZTABLE FROM TABLE ITAB(INTERNAL TABLE NAME).
Please let me know if there is any other alternative which gives better performance.
Moderator message - Moved to the correct forum
Edited by: Rob Burbank on Feb 2, 2010 11:59 AMHi Rob,
just trace a
MODIFY ZTABLE FROM TABLE ITAB
with ST05 and you will see what the DBI / DB does with this statement.
If i remember right you are on DB6. Given current releases it migth be possible
that a MERGE (which can handle arrays) will be used instead of UPDATE / INSERT on
a row by row basis.
On most platforms the modify from table is done row by row like this:
UPDATE dbtab_row.
IF sy-subrc NE 0.
INSERT dbtab_row.
IF sy-subrc NE 0.
UPDATE dbtab_row.
ENDIF.
ENDIF.
if the rows exist you will only see updates.
if the rows don't exist you will see updates (no record) followed by an insert (1 record).
In rare cases you might see update (no record), insert (no record, somebody else inserted this record after the first update), update (1 record).
Kind regards,
Hermann -
Insert Multiple Records into Multiple ZTABLEs inside the BAPI
Hi,
I have a requirement to Insert or Update Multiple Records into a ZTABLE inside the BAPI. Is there any special approach inside the BAPI to insert or update ZTABLEs with multiple records. It looks like the simple INSERT Statement is not working. Can you please suggest me a Suitable solution for this req?
Thanks and Regards,
KannanHi,
INSERT ZTABLE FROM TABLE ITAB.
The itab structure should be of the structure ZTABLE..
Same for MODIFY and update.
MODIFY ZTABLE FROM TABLE ITAB..
Thanks,
Naren -
Database Updation and Insertion using Modify Statement
Hi All,
I am using Modify statment for data insertion and updation
MODIFY zmpit_ven_bgg_rg FROM TABLE t_ven_bgg .
But I am getting error
The type of the database table and work area (or internal table) "T_VEN_BGG" are not compatible.
I have defined my internal table of below type :
TYPES : BEGIN OF ty_ven_bgg,
mandt TYPE mandt,
lifnr TYPE lfa1-lifnr,
bgg TYPE zmpit_ven_bgg_rg-matkl,
ind TYPE zmpit_ven_bgg_rg-active_ind,
created_by TYPE zmpit_ven_bgg_rg-created_by,
created_on TYPE zmpit_ven_bgg_rg-created_on,
last_changed_by TYPE zmpit_ven_bgg_rg-last_changed_by,
last_changed_on TYPE zmpit_ven_bgg_rg-last_changed_on,
remarks TYPE zmpit_ven_bgg_rg-remarks,
ind1(1) TYPE c,
END OF ty_ven_bgg.
Here, ind1 is not field of the table.
I have added a new field Remarks in the table and thus i included it in the Internal table also.
Above Modify statement was working fine without Remarks field. I am not able to understand the error
as work area is also of type ty_ven_bgg.
Please suggest some solution.
Regards,
NibhaHi,
Though you have creaated one more internal tsble without the indc field, but you can do it using the same intrenal table by simply using
1. MOVE-CORRESPONDING <internal table> to <ztable>.
2.MODIFY <ztable>.
will solve your problem
Secondly declare the internal table using DATA after structure has been declared using TYPES.
This is better approach to follow.
Pooja -
Hi,
I am trying to move Internal table contents to Z TABLE.
I am having data issue. In debugging I see ITAB enteries say for example 100
all are not getting in to ZTABLE.
I am not filtering anywhere
I have 100 records in itab with fld1 = 'ZBC'.
LOOP AT t_data WHERE fld1= 'ABC'.
ZTAB-FLD1 = t_data-FLD1.
ZTAB-FLD2 = t_data-FLD2.
ZTAB-FLD3 = t_data-FLD3.
ZTAB-FLD4 = t_data-FLD4.
modify ZTAB .
commit work.
endloop.
Anything wrong in my code?
Rgds
PraveenHi, First try using the INSERT statement and then check sy-subrc. If sy-subrc <> 0, then go for the MODIFY statement.
Eg:
ztable-fld 1 = t_itab-fld1.
ztable-fld 2 = t_itab-fld2.
ztable-fld 3 = t_itab-fld3.
ztable-fld 4 = t_itab-fld4.
insert ztable.
if sy-subrc <> 0.
modify ztable.
endif.
Try this code, it should work. -
How to compare a ztable and an internal table
Hi, experts.
I have a transparent table ztable and an internal table itab, with same fields. What I need to do is: if those records in itab are not existing in ztable, append them to ztable; if these records in itab has been existing in ztable, update them in ztable.
How to write codes to do above task in ABAP program?
Thank you very much.
TomHi
DATA : itab1 type ztable.
if values in itab not in itab1.
append itab values to itab1.
endif.
if values exist in itab and itab1.
modify itab1 with respect to itab
endif.
finally
modify ztable from itab1. -
Dear Experts
In a RFC, our codes are as follows:
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
MODIFY Ztable FROM TABLE it_ztable.
COMMIT WORK.
We wonder to know that how do we pack above actions into a LUW for the consistency of commit or rollback.Hi Custodio de Oliveira
I have followed your suggestion and written sample codes to create sales order.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = lt_order_header
TABLES
return = lt_return
order_items_in = lt_order_item
order_partners = lt_order_partner
order_schedules_in = lt_order_schdl.
READ TABLE lt_return WITH KEY TYPE = 'S'
ID = 'V1'
NUMBER = '311'.
IF SY-SUBRC EQ 0.
MODIFY ZT_PROG_MSG FROM TABLE lt_msg.
IF SY-SUBRC EQ 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = lt_return2.
ELSE.
IF SY-SUBRC NE 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ENDIF.
ENDIF.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ENDIF.
And I manually adjust duplication number range for causing an update error.
In debug mode, I check the return type in "lt_return", and then I can get 'S'.
However, after BAPI_TRANSACTION_COMMIT, there is update error for sales order creation, but our Ztable(ZT_PROG_MSG)is still updated successfully. How can we assure consistency, if there is any system error making bapi commit failure? -
Ztable records modification with key
Hi friends,
how to modify the ztable records with key,my problem is am having 3 records for the key field.when ever am try to change these reocrds using
modify ztable from wa_Itab.
without taking any key referenece it is creating a new record,here want to modify the same record which having the record no as 1 .
next time record no2...like that.
loop itab into wa_tab.
modify ztable from wa_tab with reference..................
endloop.
if possible any one can provide the solution.
Thanks in advance,
sai.Hi ,
Modify will insert a new record into ur Ztable whenever there is no record exist with same key combination in ur table,. so...
try like this....
loop at itab into wa.
modify ZTABLE from wa where k1 = wa-k1 and
k2 = wa-k2 and
k3 = wa-k3.
endloop.
here k1,k2 and k3 are key fiekds of ur ztable...
Maybe you are looking for
-
Help!! I need to recover my photos on my failed iMac hard disk
I need some help in recovering my photo's on a failed imac hard disk...... The history to this is that I received the cursed flashing folder with a question mark (?) when I tried to boot into my normal OSX Maverck on my imac - I researched this and t
-
I have a Macbook Pro running Mavericks 10.9.1 and an Iphone 5S on IOS 7.0.4 and I can't sync my calendar from the phone to the Macbook. It works the other way, Macbook to Iphone. There used to be a tab under Itunes that allowed you to select to sync
-
Heterogeneous system copy from MSSQL to Oracle
Dear Experts, I have performed ABAP+JAVA system copy R3load based from Oracle to Oracle and MSSQL to MSSQL platform. Homogeneous system copy many times. But this is first time i am perfoming an Export from MSSQL source system with r3load Export metho
-
Data Flow Task problems after installing SQL Server 2014 SSIS
I can't create any Data Flow Task. Once I create (tested and working) Connection (it doesn't matter if it is Excel, Flat File or other) and try to use it with a Source Assistant, I get the following messages: =================================== The c
-
Hi all, I'm using the following code to bring in external images, however, I would like the images to come in and be behind everything else instead of placing themselves on top of everything. var l:Loader; roll_btn.addEventListener(MouseEvent.ROLL_OV