2009 Mar 14 12:53 PM
Hi,
I am new to ABAP. I checked the forum but did not find relevant solutions.
I have 2 z tables - ZFLIGHT and ZCUSTOMER. I have a few entries in each table.
I want to write a report to update the entries in the table using function modules. For that I have created a function module - zflight_fm and also a function group- zflight_fg and assigned the function group to the Fm. I do not know how to proceed further, what to put as import, export parameters, tables, changing etc. Further I want exceptions to handle the successful update of the entries.
Thanks and regards,
Smruthi
2009 Mar 14 1:00 PM
Hi,
just pass the tables parameter with the respective tables....
and also pass the exceptions parameters...
with the help of the table you receive in the function module use the
insert statement to insert into database Z tables
now once this insert statement is executed
check if sy-subrc = 0.
if not then raise exception <exception_name>.
Regards,
Siddarth
Hi,
I am new to ABAP. I checked the forum but did not find relevant solutions.
I have 2 z tables - ZFLIGHT and ZCUSTOMER. I have a few entries in each table.
I want to write a report to update the entries in the table using function modules. For that I have created a function module - zflight_fm and also a function group- zflight_fg and assigned the function group to the Fm. I do not know how to proceed further, what to put as import, export parameters, tables, changing etc. Further I want exceptions to handle the successful update of the entries.
Thanks and regards,
Smruthi
2009 Mar 14 1:00 PM
Hi,
just pass the tables parameter with the respective tables....
and also pass the exceptions parameters...
with the help of the table you receive in the function module use the
insert statement to insert into database Z tables
now once this insert statement is executed
check if sy-subrc = 0.
if not then raise exception <exception_name>.
Regards,
Siddarth
2009 Mar 14 3:49 PM
hi do like this ..
first we have to know that on what condition you want to update the table fields. suppose if you are inputting 2 fields ( for the condition ) and checking them inside , then write these in the import statement . if you want only update there is no export parametes..
if p_imp1 eq '1000' and p_imp2 = 'TEST'.
update ztable set field1 = p_imp1
field2 = p_imp2.
else.
raise exception.
endif.
2009 Mar 14 7:40 PM
Steps:
1) Changing --->a) Zflight TYPE ZFLIGHT(DDIC Ref) OR Zflight TYPE ANY TABLE
b) ZCustomer TYPE ZFLIGHT(DDIC Ref) OR ZCustomer TYPE ANY TABLE
2) Execptions:
a) Upload_failed_Flight
b) Upload_Failed_Customer
3) Exporting ---> a) Information what rows are uploaded
Source Code:
Insert Zflight from Zflight(changing parameter).
If insert failed
RAISE Upload_failed_Flight.
endif.
Insert ZCustomer from ZCustomer(changing parameter).
If insert failed
RAISE Upload_failed_Customer.
endif.
Regards,
Gurpreet
2009 Apr 06 4:31 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |