‎2006 Sep 28 4:51 PM
I want to update a z custom table with a set of new rows and also modify some of the rows. Do you have any sample code for this?
Also can you tell me what is the check table for states in usa?
Thanks,
Krishen
‎2006 Sep 28 4:52 PM
Hi
DATA: T_DATA TYPE STANDARD TABLE OF ZTABLE WITH HEADER
LINE.
MODIFY ZTABLE FROM TABLE T_DATA.
INSERT ZTABLE FROM TABLE T_DATA.
The check table for state for US is T005S..
Thanks,
Naren
‎2006 Sep 28 4:52 PM
U can use MODIFY ZTABLE to either insert/update the row in your custom ztable.
‎2006 Sep 28 4:52 PM
Hi
DATA: T_DATA TYPE STANDARD TABLE OF ZTABLE WITH HEADER
LINE.
MODIFY ZTABLE FROM TABLE T_DATA.
INSERT ZTABLE FROM TABLE T_DATA.
The check table for state for US is T005S..
Thanks,
Naren
‎2006 Sep 28 4:55 PM
Hi naren,
I understand. But i am just looking for states. That T005S has the details about land1 also. So, I could not figure out how to attach just the 'states' part of that check table to my 'state' field in custom table.
Any input?
Thanks a lot
‎2006 Sep 28 4:54 PM
HI KRISHEN,
do this way ..
it_zprtow-own_balance = it_zprtow-own_balance
+ it_ossl-gl_trans_am.
IF NOT it_zprtow[] IS INITIAL.
MODIFY zprtow_eom_babal FROM TABLE it_zprtow.
IF sy-subrc = 0.
COMMIT WORK.
WRITE : 'Number of Entries Updated', sy-dbcnt.
ENDIF.Regards,
Santosh
‎2006 Sep 28 4:56 PM
Do I always have to 'commit' when I insert/modify databse tables?
Thanks.
‎2006 Sep 28 4:57 PM
Hi,
If you have land1 in your table while defining the foreign key, it will automatically take the value based on the field land1..Since the states is dependant in country..
Thanks,
Naren
‎2006 Sep 28 5:03 PM
Naren,
I don't have land1 field. I just have states field. The problem is when I am attaching this check table, and when I select the value from F4, only the land1 value is coming in my states field. What I am looking is just the state to come into that field. Any idea?
Thanks for your input.
‎2006 Sep 28 4:58 PM
‎2006 Sep 28 5:10 PM
Hi,
You can add a field for country in the table..
For more details check the table ADRC for the fields COUNTRY and REGION...You need to have the same setup in your custom table..
GOTO SE16 for ADRC..in the country field enter US and press F4 on the region field...you will get the states only for US...
Thanks,
Naren