Werner Thanks for your time.
In the DF there are no lookups and there are no multiple queries as well.
I tried caching the table also but got the same results.
So the point about the ITABS, I saw it in there but could not exactly place where you were going with it, hence have attached the ABAP generated with the flow.
Our SAP Basis guys here have been pretty clueless on the this and the option of getting a patch to upgrade R/3 is not going to happen.
So is there any work around for this maybe the ABAP can be modified??
Hopefully the attached ABAP helps.
Thanks again
REPORT ZAL_ABAP message-id 26 line-size 255
no standard page heading.
- ZCDCODA.
PARAMETER DOWNLOAD(1) DEFAULT ‘N’ lower case. "N-svr,Y-clnt
PARAMETER EXECMODE(1) DEFAULT ‘B’ lower case. "D-dlg,B-btch
PARAMETER OUT_DIR(48) DEFAULT "output file dir
‘/sapcd/temp_report’ lower case.
PARAMETER IN_DIR(48) DEFAULT "input file dir
‘/sapcd/temp_report’ lower case.
PARAMETER P_DF_VK(40) DEFAULT "R/3 Dataflow object key
‘’ lower case.
PARAMETER P_DI_GEN(40) DEFAULT "DI version that generated ABAP
‘’ lower case.
*** Machine generated ABAP. Do not modify. ***
*** Copyright Business Objects Data Integration, Inc. ***
*
- Date Time:
- 01/26/09 11:04:29
- SAP used for generated this ABAP:
- Release: 620
- Host : cdsap6d
-
- R3 Dataflow Name:
- R3_CD_Conditionstransdata
- R3 Dataflow comments:
- Extracts general material data from TVFST SAP R/3 source sys
*tem
- table with descriptions in default language (full extract)
- ABAP program name in R3:
- ZCDCODA
- Generated ABAP file name:
- D:/DI/ABAP/Conditionstransdata.aba
TABLES KONV.
DATA: begin of ITAB2 occurs 0,
STUNR(3) TYPE N,
ZAEHK(2) TYPE N,
KPOSN(6) TYPE N,
KNUMV(10) TYPE C,
KSCHL(4) TYPE C,
KPEIN(16) TYPE P DECIMALS 0,
KVSL1(3) TYPE C,
KUMZA(16) TYPE P DECIMALS 0,
KUMNE(16) TYPE P DECIMALS 0,
KWERT(16) TYPE P DECIMALS 2,
KNUMH(10) TYPE C,
KOPOS(2) TYPE N,
KBETR(16) TYPE P DECIMALS 2.
DATA: end of ITAB2.
DATA: begin of ITAB3 occurs 0,
STUNR(3) TYPE N,
ZAEHK(2) TYPE N,
KPOSN(6) TYPE N,
KNUMV(10) TYPE C,
KSCHL(4) TYPE C,
KPEIN(16) TYPE P DECIMALS 0,
KVSL1(3) TYPE C,
KUMZA(16) TYPE P DECIMALS 0,
KUMNE(16) TYPE P DECIMALS 0,
KWERT(16) TYPE P DECIMALS 2,
KNUMH(10) TYPE C,
KOPOS(2) TYPE N,
KBETR(16) TYPE P DECIMALS 2.
DATA: end of ITAB3.
data: append_flag(1) value ’ ',
cntbuf type i,
delimleng type i.
CONSTANTS C_DF_VK(40) VALUE ‘1621’.
CONSTANTS C_DI_GEN(40) VALUE ‘12.1.0.0’.
DATA WARN_MSG(50).
start-of-selection.
PERFORM FORM2.
PERFORM FORM4.
FREE ITAB3.
PERFORM FORM3.
FREE ITAB2.
end-of-selection.
CLEAR WARN_MSG.
IF NOT P_DF_VK IS INITIAL.
IF P_DF_VK <> C_DF_VK.
CONCATENATE ‘$$Warning$’
C_DF_VK
‘$’ INTO WARN_MSG.
ENDIF.
ENDIF.
IF NOT P_DI_GEN IS INITIAL.
IF P_DI_GEN <> C_DI_GEN.
IF WARN_MSG IS INITIAL.
CONCATENATE ‘$$Warning$$’
C_DI_GEN
INTO WARN_MSG.
ELSE.
CONCATENATE WARN_MSG
C_DI_GEN
INTO WARN_MSG.
ENDIF.
ENDIF.
ENDIF.
IF NOT WARN_MSG IS INITIAL.
IF EXECMODE = ‘D’.
WRITE WARN_MSG.
NEW-LINE.
ELSE.
MESSAGE S000 with WARN_MSG.
ENDIF.
ENDIF.
write ‘* Program Complete *’.
write ‘Copyright Business Objects Data Integration, Inc.’.
FORM FORM2.
DATA ALTMP1(3) TYPE N.
DATA ALTMP2(2) TYPE N.
DATA ALTMP3(6) TYPE N.
DATA ALTMP4(10) TYPE C.
DATA ALTMP5(4) TYPE C.
DATA ALTMP6(16) TYPE P DECIMALS 0.
DATA ALTMP7(3) TYPE C.
DATA ALTMP8(16) TYPE P DECIMALS 0.
DATA ALTMP9(16) TYPE P DECIMALS 0.
DATA ALTMP10(16) TYPE P DECIMALS 2.
DATA ALTMP11(10) TYPE C.
DATA ALTMP12(2) TYPE N.
DATA ALTMP13(16) TYPE P DECIMALS 2.
SELECT
STUNR
ZAEHK
KPOSN
KNUMV
KSCHL
KPEIN
KVSL1
KUMZA
KUMNE
KWERT
KNUMH
KOPOS
KBETR
INTO CORRESPONDING FIELDS OF KONV
FROM KONV
.
ALTMP1 = KONV-STUNR.
ALTMP2 = KONV-ZAEHK.
ALTMP3 = KONV-KPOSN.
ALTMP4 = KONV-KNUMV.
ALTMP5 = KONV-KSCHL.
ALTMP6 = KONV-KPEIN.
ALTMP7 = KONV-KVSL1.
ALTMP8 = KONV-KUMZA.
ALTMP9 = KONV-KUMNE.
ALTMP10 = KONV-KWERT.
ALTMP11 = KONV-KNUMH.
ALTMP12 = KONV-KOPOS.
ALTMP13 = KONV-KBETR.
move ALTMP1 to ITAB3-STUNR.
move ALTMP2 to ITAB3-ZAEHK.
move ALTMP3 to ITAB3-KPOSN.
move ALTMP4 to ITAB3-KNUMV.
move ALTMP5 to ITAB3-KSCHL.
move ALTMP6 to ITAB3-KPEIN.
move ALTMP7 to ITAB3-KVSL1.
move ALTMP8 to ITAB3-KUMZA.
move ALTMP9 to ITAB3-KUMNE.
move ALTMP10 to ITAB3-KWERT.
move ALTMP11 to ITAB3-KNUMH.
move ALTMP12 to ITAB3-KOPOS.
move ALTMP13 to ITAB3-KBETR.
append ITAB3.
ENDSELECT.
ENDFORM.
FORM FORM4.
SORT ITAB3 BY
STUNR
ZAEHK
KPOSN
KNUMV
KSCHL
KPEIN
KVSL1
KUMZA
KUMNE
KWERT
KNUMH
KOPOS
KBETR.
delete adjacent duplicates from ITAB3 comparing all fields.
ITAB2[] = ITAB3[].
ENDFORM.
FORM FORM3.
data: outfile(128), ldfile(50).
ldfile = ‘Conditionsdata.dat’.
concatenate out_dir ldfile into outfile
separated by ‘/’.
data dlmtlen type i value ‘1’.
data ht(1) type x value ‘7F’.
data return_code type i.
perform write_delimited_file
tables ITAB2
using outfile
append_flag
ht
dlmtlen
download
changing return_code.
case return_code.
when 1.
IF EXECMODE = ‘D’.
WRITE: /5 ‘No line selected’.
ELSE.
MESSAGE E098.
ENDIF.
when 2.
IF EXECMODE = ‘D’.
WRITE: /5 'Open File Error – ', 25 OUTFILE.
ELSE.
MESSAGE E107 WITH OUTFILE.
ENDIF.
when 3.
IF EXECMODE = ‘D’.
WRITE: /5 'Data exceed length limit (8192) '.
ELSE.
MESSAGE E000 WITH
'Data exceed length limit (8192) '.
ENDIF.
when 4.
IF EXECMODE = ‘D’.
WRITE: /5 ‘Call function WS_DOWNLOAD error’.
ELSE.
MESSAGE E000 WITH
‘Call function WS_DOWNLOAD error’.
ENDIF.
endcase.
ENDFORM.
FORM SUBSTRING USING SRC BEG LEN CHANGING RET.
DATA: VA1 TYPE I.
DATA: VA2 TYPE I.
DATA: VA3 TYPE I.
VA3 = STRLEN( SRC ).
IF BEG = 0. VA1 = 0.
ELSE.
IF BEG < 0.
VA1 = VA3 + BEG.
IF VA1 < 0. VA1 = 0.
ENDIF.
ELSE. VA1 = BEG - 1.
ENDIF.
ENDIF.
IF LEN < 0. VA2 = 0.
ELSE. VA2 = VA3 - VA1.
ENDIF.
IF VA2 > LEN. VA2 = LEN.
ENDIF.
IF VA2 < 1. MOVE ‘’ TO RET.
ELSE. MOVE SRC+VA1(VA2) TO RET.
ENDIF.
ENDFORM.
form write_delimited_file
tables datatab
using file
append
delimit
dlength
dwnload
changing rc.
data: type1,
appd(1),
temp(32),
time1(8),
date1(10),
output(8192),
rcount type i,
offset type i,
tablen type i,
maxlen type i value ‘8192’.
data: begin of clientab occurs 0,
output(8192),
end of clientab.
field-symbols: .
field-symbols .
data delim2(16).
data l_filename type string.
appd = append.
if appd is not initial.
appd = ‘X’.
endif.
move file to l_filename.
describe table datatab lines tablen.
if dwnload = ‘Y’.
clear clientab. refresh clientab.
rcount = 0.
else.
if appd = space.
open dataset file for output in text mode ENCODING
DEFAULT.
else.
open dataset file for appending in text mode ENCODING
DEFAULT.
endif.
if sy-subrc <> 0.
rc = 2. exit.
endif.
endif.
loop at datatab.
clear: tablen, offset, output.
do.
assign component sy-index of
structure datatab to .
if sy-subrc <> 0. exit. endif.
if sy-index > 1.
assign delimit(dlength) TO CASTING TYPE C.
delim2 = .
write delim2(dlength) to output+offset(dlength).
add dlength to offset.
endif.
describe field <f> type type1.
if type1 = 'I' or type1 = 'N'.
type1 = 'P'.
endif.
case type1.
when 'D'.
if <f> = '00000000'.
<f> = ' '.
else.
move <f> to time1.
assign time1 to <f>.
endif.
when 'F'.
if <f> = '0.0'.
temp = '0.0'.
else.
write <f> to temp exponent 0.
endif.
condense temp no-gaps.
translate temp using ',.'.
assign temp to <f>.
when 'P'.
if <f> < 0.
write '-' to output+offset(1).
add 1 to offset.
<f> = <f> * ( -1 ).
endif.
move <f> to temp.
condense temp no-gaps.
translate temp using ',.'.
assign temp to <f>.
endcase.
sy-fdpos = strlen( <f> ).
tablen = offset + sy-fdpos.
if tablen > maxlen.
rc = 3. exit.
endif.
write <f> to output+offset(sy-fdpos).
add sy-fdpos to offset.
enddo.
if dwnload = 'Y'.
clientab-output = output.
append clientab.
rcount = rcount + 1.
if rcount >= 50.
SY-BATCH = SPACE.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = l_filename
FILETYPE = 'ASC'
APPEND = appd
WRITE_FIELD_SEPARATOR = 'X'
-
IMPORTING
-
FILELENGTH =
TABLES
DATA_TAB = clientab
EXCEPTIONS
OTHERS = 1.
if sy-subrc <> 0.
rc = 4.
endif.
clear clientab. refresh clientab.
rcount = 0. appd = 'A'.
endif.
else.
transfer output to file.
endif.
endloop.
if dwnload = ‘Y’.
SY-BATCH = SPACE.
CALL FUNCTION ‘GUI_DOWNLOAD’
EXPORTING
FILENAME = l_filename
FILETYPE = ‘ASC’
APPEND = appd
WRITE_FIELD_SEPARATOR = ‘X’
-
IMPORTING
-
FILELENGTH =
TABLES
DATA_TAB = clientab
EXCEPTIONS
OTHERS = 1.
if sy-subrc <> 0.
rc = 4.
endif.
else.
close dataset file.
endif.
endform.
zohebmu (BOB member since 2009-01-08)