Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Upload , Error File

Former Member
0 Likes
523

Hi,

I want to generate the Error Log for the Upload File , Uploaded from desktop.

I have 4 fields in the upload itab.

I am using the the Function Module

NUMBER_GET_NEXT, to generate the next field, this happens to be the key filed in the table.

The other fileds are pa0001-bukrs, pa0008-TRFGR, character filed.

I want to have error log for upload file,which fails to update the database table.

In the z table I have given check table for Bukrs & TRFGR, will it serve the purpose.

Experts please advice.

Thanks in Advance,

IFF

1 ACCEPTED SOLUTION
Read only

dev_parbutteea
Active Contributor
0 Likes
497

Hi.

If you insert directly and if there are duplicates you will get runtime errors.

so, here , is a simple way to do this.

do :

select *

from ztable into itab_temp

ffor all entries in upload itab

where <b>conditions</b>.

if sy-subrc = 0.

loop at itab_temp into wa_temp.

read upload itab into wa_2 where key fields..

if sy-subrc <> 0.

append wa_temp into temp_upload_itab

endif.

endloop.

INSERT ztable FROM TABLE temp_upload_itab.

else.

INSERT ztable FROM TABLE upload itab.

endif.

the idea here is to do a select for all entries in z_table in order to

1.eliminate all existing entries in one table and use this table to do error reporting.

2. put non-existing records in another table and then insert in ztable.

thus, avoiding individual inseting in a loop.

note that all temporary tables should be of same structure.

revert back in case of doubts

Regards,

Sooness.

3 REPLIES 3
Read only

Former Member
0 Likes
497

Hi,

How you are inserting the data in the table? if direct insert then you will get the error message if the entry you are trying to upload is not there in ur check table.

It will not return the error log.

You can create the TMG for your table and then upload the data using BDC recording. The recording will return you all the data in BDCMSGCOL table.

then you can print the data in this table which will genearate the error log.

for the error records you can create sessions also. so that u can process the error records next time using the session. Use BDC_INSERT, BDC_opengroup and

bdc_closegroup fm to create session.

Hope this will help.

Rewars points if useful.

Thanks,

Vijay

Read only

0 Likes
497

Hi Vijay,

I am doing Simple Upload Program, I am not using BDC.

I am using Insert Statemetn for inserting into database table.

Thanks in Advance,

Iff

Read only

dev_parbutteea
Active Contributor
0 Likes
498

Hi.

If you insert directly and if there are duplicates you will get runtime errors.

so, here , is a simple way to do this.

do :

select *

from ztable into itab_temp

ffor all entries in upload itab

where <b>conditions</b>.

if sy-subrc = 0.

loop at itab_temp into wa_temp.

read upload itab into wa_2 where key fields..

if sy-subrc <> 0.

append wa_temp into temp_upload_itab

endif.

endloop.

INSERT ztable FROM TABLE temp_upload_itab.

else.

INSERT ztable FROM TABLE upload itab.

endif.

the idea here is to do a select for all entries in z_table in order to

1.eliminate all existing entries in one table and use this table to do error reporting.

2. put non-existing records in another table and then insert in ztable.

thus, avoiding individual inseting in a loop.

note that all temporary tables should be of same structure.

revert back in case of doubts

Regards,

Sooness.