‎2007 Feb 21 2:17 AM
HI Guru's,
I created this programm for document attachments. IN this programm from table SOOD filelds not displayins the result.plz update this programm Urgent.
&----
*& Report ZAAAA45678 *
*& *
&----
*& *
*& *
&----
REPORT ZAAAA45678 .
tables: bkpf,sood.
DATA: BEGIN OF itab OCCURS 0,
bukrs TYPE bkpf-bukrs,
belnr TYPE bkpf-belnr,
gjahr TYPE bkpf-gjahr,
bktxt TYPE bkpf-bktxt,
BLDAT type bkpf-BLDAT,
blart type bkpf-blart,
objdes type sood-objdes,
file_ext type sood-file_ext,
objlen type sood-objlen,
enccnt type sood-enccnt,
attlen type sood-attlen,
END OF itab.
DATA: wa TYPE SRGBTBREL,
*objdes TYPE sood-objdes,
*file_ext TYPE sood-file_ext,
*objlen TYPE sood-objlen,
*enccnt TYPE sood-enccnt,
*attlen TYPE sood-attlen,
bdate TYPE bkpf-budat,
btime TYPE sy-uzeit,
tzone TYPE ttzz-tzone value 'UTC+1'.
data: g_instance like SRGBTBREL-INSTID_A, SOOD-INSTID_A.
data: g_attachment(20) type c.
SELECT-OPTIONS: bukrs FOR bkpf-bukrs OBLIGATORY,
gjahr FOR bkpf-gjahr OBLIGATORY DEFAULT sy-datum(4),
belnr FOR bkpf-belnr OBLIGATORY.
START-OF-SELECTION.
SELECT bukrs belnr gjahr bldat blart FROM bkpf INTO corresponding
fields of table itab
WHERE bukrs IN bukrs
AND belnr IN belnr
AND gjahr IN gjahr.
IF sy-subrc <> 0.
MESSAGE e001(00) WITH 'no data found!'.
ENDIF.
LOOP AT itab.
CLEAR wa.
concatenate itab-bukrs itab-belnr itab-gjahr into g_instance.
select single * from SRGBTBREL into wa
where INSTID_A = g_instance.
IF sy-subrc = 0.
g_attachment = 'Contains Attach.'.
CONVERT TIME STAMP wa-UTCTIME
TIME ZONE tzone
INTO DATE bdate TIME btime.
*WRITE : 'Contains Attachment', bdate, btime.
ELSE.
g_attachment = 'No Attachment'.
FORMAT INTENSIFIED OFF.
*WRITE: 'no attachment' .
FORMAT INTENSIFIED ON.
ENDIF.
FORMAT COLOR 2 ON.
WRITE : /2 itab-bldat ,
15 itab-bukrs,
30 itab-belnr,
40 itab-bktxt,
50 g_attachment,
65 sy-uname,
75 itab-blart,
85 itab-objdes,
95 itab-file_ext,
110 itab-objlen,
125 itab-enccnt,
135 itab-attlen.
*HIDE ITAB
ENDLOOP.
TOP-OF-PAGE.
FORMAT COLOR 1 ON.
WRITE:/2 'Doc Date:'(T01),
15 'Comany Code:',
30 'Doc No:',
40 'Header Text:',
50 'Status:',
65 'User Name:',
75 'Doc Type:',
<b> 85'Doc Title:',
95 Ext Type:',
110 'Document Size:',
120'No of Attach.:',
135 'Size of All Atach.:'.</b>
AT LINE-SELECTION.
SET PARAMETER ID 'BUK' FIELD itab-bukrs.
SET PARAMETER ID 'BLN' FIELD itab-belnr.
SET PARAMETER ID 'GJR' FIELD itab-gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
regards
JK Rao
‎2007 Feb 21 5:14 AM
hello JK,
can u give the relationship between the table SRGBTBREL,BKPF,SOOD?
i mean u r not selecting data into your internal table itab for fields coming from SOOD table those are,objdes,file_ext,objlen,enccnt,attlen
i guess u need to fecth these records then only u'll b able to display them,
c if u can do dat or else let me know the selection criteria n relationships i'll do it..
‎2007 Feb 21 6:11 AM
HI,
TQ for ur reply.
here for some important documents we will give attachments like word, excel etc.,. that attachments stored in internal tables. in bkpf doc no,comp code,fiscal year. will stored. for every attachment objkey will stored in table SRGBTBREL. in table SOOD attachment documents details will stored. requirement is to check which documents having documents attachments.
reagrds
JK Rao
‎2007 Feb 21 6:42 AM
try the following code .. as i donthav sufficient amount of data to chk it cldnt test it trhoughly but c if gives u proper results....
tables: bkpf,sood.
data: begin of itab occurs 0,
bukrs type bkpf-bukrs,
belnr type bkpf-belnr,
gjahr type bkpf-gjahr,
bktxt type bkpf-bktxt,
bldat type bkpf-bldat,
blart type bkpf-blart,
objdes type sood-objdes,
file_ext type sood-file_ext,
objlen type sood-objlen,
enccnt type sood-enccnt,
attlen type sood-attlen,
end of itab.
data : it_sood type sood.
data: wa type srgbtbrel,
bdate type bkpf-budat,
btime type sy-uzeit,
tzone type ttzz-tzone value 'UTC+1'.
data: g_instance like srgbtbrel-instid_a. "SOOD-INSTID_A.
data: g_attachment(20) type c.
select-options: bukrs for bkpf-bukrs obligatory,
gjahr for bkpf-gjahr obligatory default sy-datum(4),
belnr for bkpf-belnr obligatory.
start-of-selection.
select bukrs
belnr
gjahr
bldat
blart
from bkpf
into corresponding fields of table itab
where bukrs in bukrs
and belnr in belnr
and gjahr in gjahr.
if sy-subrc <> 0.
message e001(00) with 'no data found!'.
endif.
loop at itab.
clear wa.
concatenate itab-bukrs
itab-belnr
itab-gjahr
into g_instance.
select single *
from srgbtbrel
into wa
where instid_a = g_instance.
if sy-subrc = 0.
g_attachment = 'Contains Attach.'.
convert time stamp wa-utctime
time zone tzone
into date bdate time btime.
select objdes
file_ext
objlen
enccnt
attlen
into corresponding fields of it_sood
from sood
where IF_DOC_BCS = wa-BRELGUID.
endselect.
WRITE : 'Contains Attachment', bdate, btime.
else.
g_attachment = 'No Attachment'.
format intensified off.
WRITE: 'no attachment' .
format intensified on.
endif.
format color 2 on.
write : /2 itab-bldat ,
15 itab-bukrs,
30 itab-belnr,
40 itab-bktxt,
50 g_attachment,
65 sy-uname,
75 itab-blart,
85 it_sood-objdes,
95 it_sood-file_ext,
110 it_sood-objlen,
125 it_sood-enccnt,
135 it_sood-attlen.
endloop.
top-of-page.
format color 1 on.
write:/2 'Doc Date:'(t01),
15 'Comany Code:',
30 'Doc No:',
40 'Header Text:',
50 'Status:',
65 'User Name:',
75 'Doc Type:',
85 'Doc Title:',
95 'Ext Type:',
110 'Document Size:',
120'No of Attach.:',
135 'Size of All Atach.:'.
at line-selection.
set parameter id 'BUK' field itab-bukrs.
set parameter id 'BLN' field itab-belnr.
set parameter id 'GJR' field itab-gjahr.
call transaction 'FB03' and skip first screen.
plz reward points if u find dis is helpful...
‎2007 Feb 21 7:03 AM
HI,
Thanks for ur reply. using FB03>documentlist>Documents Overiew>system>Service for object : here we will give the attachment for document. check it.
regards
JK Rao