Reg : Error in flat file in BDC
hi friends...
let consider 10 records in my flat file...
suppose 5th record is error means
In BDC Session method, what happen records before and after the error record, its get update or not ? like
In BDC Call Transaction method, what happen records before and after the error record, its get update or not ?
please give me some detail...
Regards
Selva
Hi,
In call transaction method you will have an option of Displaying No screens, all screens and Error screens,
If you select No screens all other records except error records will be process and messages will be collected by an internal table of type bdcmsgcoll.
In all screens you need to process each screen manually yourself by selecting the OK code. It is kinda like debugging. So when you encounter the error screen you can change the error data and proceed.
When you select error screens it will stop when the error occurs. So you need to correct the error and continue with the further processing.
Regards,
Pramod
Similar Messages
-
Reg error in flat file to flat file scenario
Hi techies,
Iam just starting working with XI scenarios.
In base flat file to flat file scenario which is mentioned in wiki.sdn
http://wiki.sdn.sap.com/wiki/display/XI/FLATFILETOFLATFILE
I had completed entire scenario. After generating sender file. Iam getting this error in runtime work bench.
Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter 'CONTACTS.EMP.fieldFixedLengths' or 'CONTACTS.EMP.fieldSeparator' is missing
Please suggest how to resolve this error.
Thanks in advance,
Regards,
KiranHi,
From your error description,
Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter 'CONTACTS.EMP.fieldFixedLengths' or 'CONTACTS.EMP.fieldSeparator' is missing
it is clear that you have missed out either or both the 2 parameters in receiver file adapter content conversion, namely EMP.fieldFixedLengths and EMP.fieldSeparator.
From the example that you followed, use the following values for the 2 parameteres is the output file is a comma separated file:
EMP.fieldFixedLengths: 8,10,10
EMP.fieldSeparator: ,
I have assumed that the lengths of the fields NAME,ADD,MOBILE are 8,10 and 10 respectively. Change them according to your requirement.
Use any other value in place of comma(,) in EMP.fieldSeparator according to the requirement.
Hope it helps you buddy!!!
Thanks
Biswajit
Edited by: 007biswa on Feb 22, 2011 9:25 AM
Edited by: 007biswa on Feb 22, 2011 9:28 AM -
hi,
in BDC,
after uploading data from flat file,
how to find if there are any errors in flat file,
before starting the session.Hi,
You have to create internal tables for all the mandatory fields. see the following code :
I am giving an example for XK01 Transaction.
TYPES:BEGIN OF TY_XK01,
LIFNR(10) TYPE C , "VENDOR'S ACCOUNT NUMBER
BUKRS(4) TYPE C , "COMPANY CODE
EKORG(4) TYPE C , "PURCHASING ORGANISATION
KTOKK(4) TYPE C , "VENDOR ACCOUNT GROUP
NAME1(35) TYPE C , "NAME1
SORTL(10) TYPE C , "SORT FIELD
STRAS(35) TYPE C , "STREET
PSTLZ(10) TYPE C , "POSTAL CODE
ORT01(35) TYPE C , "CITY
LAND1(3) TYPE C , "COUNTRY KEY
REGIO(3) TYPE C , "REGION
TIME_ZONE(6) TYPE C , "ADDRESS TIME ZONE
LANGU(1) TYPE C , "LANGUAGE KEY
TELF1(16) TYPE C , "TELEPHONE NUMBER
TELFX(31) TYPE C , "FAX NUMBER
SMTP_ADDR(241) TYPE C , "E-MAIL ADDRESS
URI_SCREEN(132) TYPE C , "UNIFORM RESOURCE LOCATOR
AKONT(10) TYPE C , "RECONCILITATION ACCOUNT
ZUAWA(3) TYPE C , "KEY FOR SORTING ACCORDING TO ASSIGNMENT NUMBERS
MINDK(3) TYPE C , "MINORITY INDICATORS
ALTKN(10) TYPE C , "PREVIOUS MASTER RECORD NUMBER
ZTERM(4) TYPE C , "TERMS OF PAYMENT KEY
ZWELS(10) TYPE C , "LIST OF THE PAYMENT METHODS
WAERS(5) TYPE C , "PURCHASE ORDER CURRENCY
END OF TY_XK01,
BEGIN OF TY_LIFNR,
LIFNR(10) TYPE C ,
END OF TY_LIFNR,
BEGIN OF TY_BUKRS,
BUKRS(4) TYPE C ,
END OF TY_BUKRS,
BEGIN OF TY_EKORG,
EKORG(4) TYPE C ,
END OF TY_EKORG,
BEGIN OF TY_KTOKK,
KTOKK(4) TYPE C ,
END OF TY_KTOKK,
BEGIN OF TY_LAND1,
LAND1(3) TYPE C ,
END OF TY_LAND1,
BEGIN OF TY_LANGU,
LANGU(1) TYPE C ,
END OF TY_LANGU,
BEGIN OF TY_AKONT,
AKONT(10) TYPE C ,
END OF TY_AKONT,
BEGIN OF TY_ZUAWA,
ZUAWA(3) TYPE C ,
END OF TY_ZUAWA,
BEGIN OF TY_MINDK,
MINDK(3) TYPE C ,
END OF TY_MINDK,
BEGIN OF TY_WAERS,
WAERS(5) TYPE C ,
END OF TY_WAERS.
DATA : I_XK01 TYPE TABLE OF TY_XK01, "FOR HOLDING DATA FROM FLAT FILE
I_SUCCMESG TYPE TABLE OF TY_MESG, "FOR SUCCESS RECORDS DETAILS
I_ERRMESG TYPE TABLE OF TY_MESG, "FOR ERROR RECORDS DETAILS
I_ERROR TYPE TABLE OF TY_ERROR,
I_LIFNR TYPE TABLE OF TY_LIFNR,
I_BUKRS TYPE TABLE OF TY_BUKRS,
I_EKORG TYPE TABLE OF TY_EKORG,
I_KTOKK TYPE TABLE OF TY_KTOKK,
I_LAND1 TYPE TABLE OF TY_LAND1,
I_LANGU TYPE TABLE OF TY_LANGU,
I_AKONT TYPE TABLE OF TY_AKONT,
I_ZUAWA TYPE TABLE OF TY_ZUAWA,
I_MINDK TYPE TABLE OF TY_MINDK,
I_WAERS TYPE TABLE OF TY_WAERS,
I_FINALMESG TYPE TABLE OF TY_ERROR,
I_MESG TYPE TABLE OF TY_MESG.
*& WORK AREA DECLARATION
DATA: WA_XK01 TYPE TY_XK01, "FOR HOLDING DATA FROM FLAT FILE
WA_SUCCMESG TYPE TY_MESG, "FOR SUCCESS RECORDS DETAILS
WA_ERRMESG TYPE TY_MESG, "FOR ERROR RECORDS DETAILS
WA_ERROR TYPE TY_ERROR,
WA_LIFNR TYPE TY_LIFNR,
WA_BUKRS TYPE TY_BUKRS,
WA_EKORG TYPE TY_EKORG,
WA_KTOKK TYPE TY_KTOKK,
WA_LAND1 TYPE TY_LAND1,
WA_LANGU TYPE TY_LANGU,
WA_AKONT TYPE TY_AKONT,
WA_ZUAWA TYPE TY_ZUAWA,
WA_MINDK TYPE TY_MINDK,
WA_WAERS TYPE TY_WAERS,
WA_MESG TYPE TY_MESG,
WA_FINALMESG TYPE TY_ERROR.
INITIALIZATION.
SELECT LIFNR FROM LFA1 INTO TABLE I_LIFNR.
SELECT BUKRS FROM T001 INTO TABLE I_BUKRS .
SELECT EKORG FROM T024E INTO TABLE I_EKORG .
SELECT KTOKK FROM T077K INTO TABLE I_KTOKK .
SELECT LAND1 FROM T005 INTO TABLE I_LAND1.
SELECT SPRAS FROM T002 INTO TABLE I_LANGU.
SELECT SAKNR FROM SKA1 INTO TABLE I_AKONT .
SELECT ZUAWA FROM TZUN INTO TABLE I_ZUAWA .
SELECT MINDK FROM T059M INTO TABLE I_MINDK .
SELECT WAERS FROM TCURC INTO TABLE I_WAERS.
LOOP AT I_XK01 INTO WA_XK01.
TRANSLATE WA_XK01-LIFNR TO UPPER CASE.
READ TABLE I_LIFNR INTO WA_LIFNR WITH KEY LIFNR = WA_XK01-LIFNR.
IF SY-SUBRC = 0 .
CONCATENATE WA_MESG-MESG TEXT-100 WA_XK01-LIFNR TEXT-101 ' , ' INTO WA_MESG-MESG.
ENDIF.
TRANSLATE WA_XK01-BUKRS TO UPPER CASE.
READ TABLE I_BUKRS INTO WA_BUKRS WITH KEY BUKRS = WA_XK01-BUKRS.
IF SY-SUBRC <> 0 .
CONCATENATE WA_MESG-MESG TEXT-102 WA_XK01-BUKRS TEXT-103 ' , ' INTO WA_MESG-MESG.
ENDIF.
TRANSLATE WA_XK01-EKORG TO UPPER CASE.
READ TABLE I_EKORG INTO WA_EKORG WITH KEY EKORG = WA_XK01-EKORG.
IF SY-SUBRC <> 0 .
CONCATENATE WA_MESG-MESG TEXT-104 WA_XK01-EKORG TEXT-103 ',' INTO WA_MESG-MESG.
ENDIF.
TRANSLATE WA_XK01-KTOKK TO UPPER CASE.
READ TABLE I_KTOKK INTO WA_KTOKK WITH KEY KTOKK = WA_XK01-KTOKK.
IF SY-SUBRC <> 0 .
CONCATENATE WA_MESG-MESG TEXT-105 WA_XK01-KTOKK TEXT-103 ',' INTO WA_MESG-MESG.
ENDIF.
TRANSLATE WA_XK01-LAND1 TO UPPER CASE.
READ TABLE I_LAND1 INTO WA_LAND1 WITH KEY LAND1 = WA_XK01-LAND1.
IF SY-SUBRC <> 0 .
CONCATENATE WA_MESG-MESG TEXT-106 WA_XK01-LAND1 TEXT-103 ',' INTO WA_MESG-MESG.
ENDIF.
TRANSLATE WA_XK01-LANGU TO UPPER CASE.
READ TABLE I_LANGU INTO WA_LANGU WITH KEY LANGU = WA_XK01-LANGU.
IF SY-SUBRC <> 0 .
CONCATENATE WA_MESG-MESG TEXT-107 WA_XK01-LANGU TEXT-103 ',' INTO WA_MESG-MESG.
ENDIF.
READ TABLE I_AKONT INTO WA_AKONT WITH KEY AKONT = WA_XK01-AKONT.
IF SY-SUBRC <> 0 .
CONCATENATE WA_MESG-MESG TEXT-108 WA_XK01-AKONT TEXT-103 ',' INTO WA_MESG-MESG.
ENDIF.
READ TABLE I_ZUAWA INTO WA_ZUAWA WITH KEY ZUAWA = WA_XK01-ZUAWA.
IF SY-SUBRC <> 0 .
CONCATENATE WA_MESG-MESG TEXT-109 WA_XK01-ZUAWA TEXT-103 ',' INTO WA_MESG-MESG.
ENDIF.
READ TABLE I_MINDK INTO WA_MINDK WITH KEY MINDK = WA_XK01-MINDK.
IF SY-SUBRC <> 0 .
CONCATENATE WA_MESG-MESG TEXT-110 WA_XK01-MINDK TEXT-103 ',' INTO WA_MESG-MESG.
ENDIF.
TRANSLATE WA_XK01-WAERS TO UPPER CASE.
READ TABLE I_WAERS INTO WA_WAERS WITH KEY WAERS = WA_XK01-WAERS.
IF SY-SUBRC <> 0 .
CONCATENATE WA_MESG-MESG TEXT-111 WA_XK01-WAERS TEXT-103 ',' INTO WA_MESG-MESG.
ENDIF.
append wa_mesg to err_mesg.
endloop.
I am populating the error messages into workarea using concatenate statement.
Hope this solves the problem.
Reward points if helpful.
Thanks and Regards,
Narayana. -
How to capture errors records in flat file in BDC
hi ,
i would like to know how to capture error records while uploading a flat file to screen through BDC .
appreciatable solutions are rewarded.
thanks,
shanHi shan,
write this code, it will solve your problem.
DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA : I_MSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF I_ERR OCCURS 0,
MATNR(18),
FLAG(1),
MSG(100),
END OF I_ERR.
DATA :V_LINES TYPE I.
LOOP AT ITAB.
REFRESH BDCTAB.
PERFORM SCREEN USING: 'SAPLMGMM' '0060'.
PERFORM FIELD USING: 'RMMG1-MATNR' ITAB-MATNR,
'RMMG1-MBRSH' ITAB-MBRSH ,
'RMMG1-MTART' ITAB-MTART,
'BDC_OKCODE' '/00'.
PERFORM SCREEN USING: 'SAPLMGMM' '0070'.
PERFORM FIELD USING: 'MSICHTAUSW-KZSEL(01)' 'X' ,
'MSICHTAUSW-KZSEL(02)' 'X' ,
'MSICHTAUSW-KZSEL(09)' 'X' ,
'BDC_OKCODE' '=ENTR'.
PERFORM SCREEN USING: 'SAPLMGMM' '0080'.
PERFORM FIELD USING: 'RMMG1-WERKS' ITAB-WERKS,
'BDC_OKCODE' '=ENTR'.
PERFORM SCREEN USING: 'SAPLMGMM' '4004'.
PERFORM FIELD USING: 'MAKT-MAKTX' ITAB-MAKTX,
'MARA-MEINS' 'EA' ,
'MARA-MATKL' '001',
'BDC_OKCODE' '/00'.
PERFORM SCREEN USING: 'SAPLMGMM' '4004'.
PERFORM FIELD USING: 'BDC_OKCODE' '/00'.
PERFORM SCREEN USING: 'SAPLMGMM' '4000'.
PERFORM FIELD USING: 'MAKT-MAKTX' ITAB-MAKTX,
'MARA-MEINS' 'EA',
'MARC-EKGRP' '001',
'MARA-MATKL' '001',
'BDC_OKCODE' '=BU'.
CALL TRANSACTION 'MM01' USING BDCTAB
MODE 'A'
MESSAGES INTO I_MSG.
FINDING LAST MESSAGE IN THE I_MSG TABLE*****
DESCRIBE TABLE I_MSG LINES V_LINES.
ACCORDING TO THE V_LINES NUMBER TABLE WILL BE READ****
READ TABLE I_MSG INDEX V_LINES.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = I_MSG-MSGID
LANG = '-D'
NO = I_MSG-MSGNR
V1 = I_MSG-MSGV1
V2 = I_MSG-MSGV2
V3 = I_MSG-MSGV3
V4 = I_MSG-MSGV4
IMPORTING
MSG = I_ERR-MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF I_MSG-MSGID EQ 'M3' AND I_MSG-MSGNR EQ '800'.
I_ERR-FLAG = 'S'.
ELSE.
I_ERR-FLAG = 'E'.
ENDIF.
I_ERR-MATNR = ITAB-MATNR.
APPEND I_ERR.
CLEAR I_ERR.
ENDLOOP.
WRITE:/ 'SUCCESS RECORDS' COLOR COL_POSITIVE.
SKIP.
WRITE:/ 'MATERIAL' COLOR COL_HEADING, 20 'MESSAGE' COLOR COL_HEADING.
LOOP AT I_ERR WHERE FLAG EQ 'S'.
WRITE:/ I_ERR-MATNR, 20 I_ERR-MSG.
ENDLOOP.
SKIP 2.
WRITE:/ 'ERROR RECORDS' COLOR COL_NEGATIVE.
SKIP.
WRITE:/ 'MATERIAL' COLOR COL_HEADING, 20 'MESSAGE' COLOR COL_HEADING.
LOOP AT I_ERR WHERE FLAG EQ 'E'.
WRITE:/ I_ERR-MATNR, 20 I_ERR-MSG.
ENDLOOP.
*& Form SCREEN
SCREEN
form SCREEN using P_PROG P_SCREEN.
BDCTAB-PROGRAM = P_PROG.
BDCTAB-DYNPRO = P_SCREEN.
BDCTAB-DYNBEGIN = 'X'.
APPEND BDCTAB.
CLEAR BDCTAB.
endform. " SCREEN
*& Form FIELD
FIELD
form FIELD using FNAME FVAL .
BDCTAB-FNAM = FNAME.
BDCTAB-FVAL = FVAL.
APPEND BDCTAB.
CLEAR BDCTAB.
endform. " FIELD
Thanks,
Murali -
Date format in flat file of bdc
Hi Folks,
In BDC I have a flat file which has to be uploaded from a flat file and 4 users are using each of one has their date format.
so inorder to get their required date format what i need to do .Hi,
use the below logic in your code.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-031.
PARAMETERS: date1 RADIOBUTTON GROUP rad1 DEFAULT 'X', "SAP date format YYYYDDMM
date2 RADIOBUTTON GROUP rad1, "Date format like aprial31, 2006
date3 RADIOBUTTON GROUP rad1, "Date format like 31 apr,2006
date4 RADIOBUTTON GROUP rad1, "Date format like DD/MM/YYYY
date5 RADIOBUTTON GROUP rad1. "Date format like DD.MM.YYYY
SELECTION-SCREEN END OF BLOCK b2
FORM getmonth .
SELECT mnr
ktx
ltx
INTO TABLE T_month
FROM t247
WHERE spras = 'EN'.
IF sy-subrc NE '0'.
MESSAGE I "Message - Not able to get month values from the table T247
ENDIF.
ENDFORM.
DATA : temp_date(16) TYPE c,
temp1_date(60) TYPE c,
year(4) TYPE c,
daymonth(11) TYPE c,
daymonth1(11) TYPE c,
month(9) TYPE c,
day(2) TYPE c,
mon LIKE t247-ktx,
len TYPE i .
MOVE date TO temp1_date .
CONDENSE temp1_date NO-GAPS.
MOVE temp1_date TO temp_date .
IF date2 EQ 'X'. "The date format is like Aprial 31, 2007
CONDENSE temp_date NO-GAPS.
SPLIT date AT ',' INTO daymonth year.
IF STRLEN( year ) NE '4'.
error = 'X'.
WRITE : 'Invalid date format.'.
ELSE.
daymonth1 = daymonth.
CONDENSE daymonth1 NO-GAPS.
_len = STRLEN( _daymonth1 ).
l_len = 13 - len.
SHIFT daymonth1 RIGHT BY len PLACES.
CONDENSE daymonth1 NO-GAPS.
month = daymonth1.
CONDENSE month NO-GAPS.
SORT t_month BY monthltx.
READ TABLE t_month WITH KEY monthltx = month.
IF sy-subrc <> 0.
error = 'X'.
WRITE : 'Invalid date format.' .
ELSE.
len = STRLEN( month ).
CONDENSE daymonth NO-GAPS.
SHIFT daymonth LEFT BY len PLACES.
day = daymonth.
CONDENSE day NO-GAPS.
CONCATENATE year t_month-monthnumber day INTO o_date.
ENDIF.
ENDIF.
ELSEIF p_date3 EQ 'X'. "The date format is like 31 apr, 2007
CONDENSE temp_date NO-GAPS.
SPLIT i_date AT ',' INTO daymonth year.
IF STRLEN( year ) NE '4'.
error = 'X'.
WRITE : 'Invalid date format.'.
ELSE.
daymonth1 = daymonth.
CONDENSE daymonth1 NO-GAPS.
SHIFT daymonth1 LEFT BY 2 PLACES.
CONDENSE daymonth1 NO-GAPS.
month = daymonth1.
CONDENSE month NO-GAPS.
TRANSLATE month TO UPPER CASE.
SORT t_month BY monthstx.
MOVE month to mon.
READ TABLE t_month WITH KEY monthstx = mon.
IF sy-subrc <> 0.
error = 'X'.
WRITE : 'Invalid date format.' .
ELSE.
CONDENSE daymonth NO-GAPS.
day = daymonth+0(2).
CONDENSE day NO-GAPS.
CONCATENATE year t_month-monthnumber day INTO o_date.
ENDIF.
ENDIF.
ELSEIF p_date4 EQ 'X' OR p_date5 EQ 'X'. "Date format is like DD.MM.YYYY or DD/MM/YYYY
CONDENSE temp_date NO-GAPS.
IF STRLEN( temp_date ) EQ 10.
o_date0(4) = temp_date6(4).
o_date4(2) = temp_date3(2).
o_date6(2) = temp_date0(2).
ELSE.
error = 'X'.
WRITE : 'Invalid date format.' .
ENDIF.
ENDIF.
IF STRLEN( o_date ) NE '8'.
error = 'X'.
WRITE : 'Invalid date format.'.
ENDIf.
ENDFORM.
regards -
in bdc we have to save the flat file in desktop or c drive?plz tell
Edited by: Alvaro Tejada Galindo on Feb 7, 2008 10:15 AMHi,
check the code for better understanding.
Regards
Bala.M
REPORT zi_flatfile_zisobj.
* Data Declaration
* Internal Tables
DATA : BEGIN OF itd_zisobj OCCURS 0 ,
zinref LIKE zisobj-zinref,
ziaccomtype LIKE zisobj-ziaccomtype,
zietgnr LIKE zisobj-zietgnr,
zioldnref LIKE zisobj-zioldnref,
zicnttyp LIKE zisobjcnt-zicnttyp,
END OF itd_zisobj.
DATA : file_length TYPE i.
START-OF-SELECTION.
PERFORM data_selection_join.
PERFORM gui_download_file.
END-OF-SELECTION.
*& Form data_selection_join
* text
* --> p1 text
* <-- p2 text
FORM data_selection_join .
* Data selection and Inner join based on Contract Type Eq 'U'.
SELECT a~zinref
a~ziaccomtype
a~zietgnr
a~zioldnref
b~zicnttyp
INTO CORRESPONDING FIELDS OF TABLE itd_zisobj
FROM ( zisobj AS a INNER JOIN zisobjcnt AS b ON a~zicountry = b~zicountry
AND a~ziplace = b~ziplace
AND a~zihouse = b~zihouse
AND a~ziaccom = b~ziaccom
AND b~zicnttyp = 'U' ) .
ENDFORM. " data_selection_join
*& Form gui_download_file
* text
* --> p1 text
* <-- p2 text
FORM gui_download_file .
* FM to download to the presentation server
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = 'H:\TEST1.TXT'
filetype = 'ASC'
append = ' '
write_field_separator = ','
header = '00'
trunc_trailing_blanks = ' '
write_lf = 'X'
col_select = ' '
col_select_mask = ' '
dat_mode = ' '
confirm_overwrite = ' '
no_auth_check = ' '
codepage = ' '
* IGNORE_CERR = ABAP_TRUE
replacement = '#'
write_bom = ' '
trunc_trailing_blanks_eol = 'X'
wk1_n_format = ' '
wk1_n_size = ' '
wk1_t_format = ' '
wk1_t_size = ' '
* WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
* SHOW_TRANSFER_STATUS = ABAP_TRUE
IMPORTING
filelength = file_length
TABLES
data_tab = itd_zisobj
* FIELDNAMES =
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22
IF sy-subrc NE 0.
MESSAGE e398(00) WITH 'Error in Downloading File' 'TEST1.TXT' 'Retry'.
ENDIF.
ENDFORM. " gui_download_file -
Errors in flat file records? how can i handle them?
Hi All,
I am new for BDC. I am uploading customer(XD01) records using BDC caltransaction method.my problem is when i am running the program, some times my program is not updating the records because of my flat file errors. after i correcting the error records and if i run the same program already updated records not processing. my program not running. what i need to do? how can i handle the flat file for reprocessing the error records?
i have around 50,000 records in my flat file.your program accepts a flat file say the structure of it is structure_load and you create another structure similar to structure_load and name it structure_error.
loop at itab_load.
call transactions...
if success..
commit work and wait X sec.
else.
move-corresponding field to structure_error
append structure_error.
endif.
endloop.
write the file stru_error to PC or app server and make the changes to the data and use the str_error as input to your code again.. -
Errors in flat file extraction
Experts pls ans
what R the possible ERRORS while extracting data from flat file to SAP BW 3.5
thanks in advance
ramakrishnaHi,
possibel errors:
You have to select as csv file in info package selection, while loading.
Path of the File.
If your File is open then also you can get error.
If DS structure different to Flat File, when you do scheduling then also you will get error.
Hope it helps you.
Reg
Pra -
hi......to everybody.....
i am working on session method with two application(transaction)s.
i have the data in two flat files separate related to those applications in presentation server.
how to update the data into the data base?
Message was edited by:
Alvaro Tejada GalindoHI,
there is no difference as far as the code is concerned for the BDC.. only change is u use bdc_open_group,bdc_insert and bdc_close_group function modules instead of call transaction..
See the example
REPORT Z_PCA_PL
MESSAGE-ID ZYFI
NO STANDARD PAGE HEADING
LINE-SIZE 100.
Progname : ZF_BDCP_PCPLANE_01 *
Request no : RTDK905785
Description : Profit center plan data upload for KIMO dates
LOGICAL DB : VERSION OF : *
AUTHOR : Krishna M
DATE : 28/04/2004
MODIFICATION LOG (latest change first): *
TABLES
*-- Imternal table declaration.
DATA : BEGIN OF IT_UPLOAD OCCURS 0,
YEAR(4), " Year Variable
PROFIT(10), " Profit Center Variable
GLACCOUNT(13), " GL account Variable
AMOUNT(10), " Amount Variable
END OF IT_UPLOAD.
*-- Declaration of bdc data.
DATA: IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
*-Internal table for message control
*data : msgtab like bdcmsgcoll occurs 0 with header line.
*--Selection screen declaration
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
A T S E L E C T I O N - S C R E E N .
*--Value request for the file.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
PERFORM VALUE_REQUEST.
S T A R T - O F - S E L E C T I O N
START-OF-SELECTION.
*-- Upload data into internal table it_upload.
PERFORM UPLOAD.
PERFORM PROFIT_CENTER.
PERFORM BDC_OPEN_GROUP.
PERFORM CALL_TRANSACTION.
*-- Close the bdc group
PERFORM BDC_CLOSE_GROUP.
*& Form upload
Uploading of the flat file into the internal table
FORM UPLOAD.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = IT_UPLOAD
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8.
IF SY-SUBRC <> 0 .
MESSAGE E999 WITH TEXT-002. "File cannot be Uploaded
ENDIF.
ENDFORM. " upload
*& Form value_request
IN PUT HEPL REQUEST
FORM VALUE_REQUEST.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = 'C:\'
MASK = ',.txt,.*.'
MODE = 'S'
TITLE = TEXT-003 "'Upload'
IMPORTING
FILENAME = P_FILE
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
CASE SY-SUBRC.
WHEN 3.
MESSAGE I999 WITH TEXT-004. "Selection Cancel
WHEN 4.
MESSAGE I999 WITH TEXT-005. "Selection Error'.
ENDCASE.
ENDFORM. " value_request
form call_transaction.
FORM CALL_TRANSACTION.
IF NOT IT_UPLOAD[] IS INITIAL.
LOOP AT IT_UPLOAD. " loop at it_upload
PERFORM FILL_BDC.
ENDLOOP.
ELSE.
MESSAGE E999 WITH TEXT-010. " 'No records found'.
ENDIF.
ENDFORM.
*& Form fill_bdc
This form is used to fill the bdcdata & call the transaction *
FORM FILL_BDC.
PERFORM PROFIT_CENTER_UPLOAD.
ENDFORM.
*& Form Profit_Center_Upload.
FORM PROFIT_CENTER_UPLOAD.
PERFORM FILL_BDCDATA USING:
'SAPLKPP0' '1000' 'X',
'bdc_cursor' 'kpp0b-value(03)' ' ',
'kpp0b-value(03)' IT_UPLOAD-YEAR ' ',
'bdc_cursor' 'kpp0b-value(06)' ' ',
'kpp0b-value(06)' IT_UPLOAD-PROFIT ' ',
'bdc_cursor' 'kpp0b-value(09)' ' ',
'kpp0b-value(09)' IT_UPLOAD-GLACCOUNT ' ',
'bdc_okcode' '/00' ' ',
'BDC_OKCODE' '=CSUB' ' ',
'SAPLKPP2' '0103' 'X',
'bdc_cursor' 'BDC03(01)' ' ',
'BDC03(01)' IT_UPLOAD-AMOUNT ' ',
'BDC_OKCODE' '/00' ' ',
'BDC_OKCODE' '=CBUC' ' '.
PERFORM BDC_INSERT.
ENDFORM.
*& Form fill_bdcdata
This form is used to fill the IT_BDCDATA table *
FORM FILL_BDCDATA USING PROGRAM TYPE C
DYNPRO TYPE ANY
DYNBEGIN TYPE C.
IF DYNBEGIN = 'X'.
IT_BDCDATA-PROGRAM = PROGRAM.
IT_BDCDATA-DYNPRO = DYNPRO.
IT_BDCDATA-DYNBEGIN = DYNBEGIN.
ELSE.
IT_BDCDATA-FNAM = PROGRAM.
IT_BDCDATA-FVAL = DYNPRO.
ENDIF.
APPEND IT_BDCDATA.
CLEAR IT_BDCDATA.
ENDFORM. " fill_bdcdata
form profit_center
FORM PROFIT_CENTER.
PERFORM FILL_BDCDATA USING:
'SAPLSPO4' '0300' 'X',
'SVALD-VALUE(01)' '0100' ' ',
'BDC_OKCODE' '=FURT' ' ',
'SAPLKPP6' '1007' 'X',
'RKPP6-PLPROF' 'RTA-PC-K' ' ',
'BDC_OKCODE' '=CWEI' ' '.
ENDFORM.
form bdc_open_group.
FORM BDC_OPEN_GROUP.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = '7KE1'
KEEP = 'X'
USER = SY-UNAME.
IF SY-SUBRC NE 0. "Error in Opening error session
MESSAGE E999 WITH TEXT-007. "'Unable to open BDC Group'.
ELSE.
MESSAGE S999 WITH TEXT-008. "Session created successfully"
ENDIF.
ENDFORM.
form bdc_insert
FORM BDC_INSERT.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = '7KE1'
TABLES
DYNPROTAB = IT_BDCDATA[]
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
MESSAGE E999 WITH TEXT-006.
'Unable to Insert using Transaction 7KE1'.
ENDIF.
REFRESH IT_BDCDATA.
CLEAR IT_BDCDATA.
ENDFORM.
*& Form BDC_CLOSE_GROUP
This form is used to close the group that is opend.
FORM BDC_CLOSE_GROUP.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
ENDFORM. " BDC_CLOSE_GROUP
Thanks
Mahesh -
hai...........
If there is a error in 5 th record of flat file.
what happens if we upload that data through session method, whether it stops at 4 th record or except 4 th record all r updated........
and what happens with call transaction .
plz any body give me clear explanation.....?Dear Satheesh,
If there is error in 4th record,....in (1) Session method:- it skips that records, and all remaining records get uploaded into the system...and u have to go the log thr' SM35, then either u can see error to what screen and to what field by Analyze ro Statistics or Log options from Application Tool bar buttons...and do correction and process them again.......While as in (2) Call Transaction method:- screen gets stucks immediately at the point of error. In this situation, u have to do corrections manually to process that screen ( means u have to filled data for those fields,where error occurs)....I think that this info. will sufficient for you.
Sanjay Bhalerao -
I am using flat file as source ,and when i am trying to validate the mapping i am getting the following error:
No data file specified
I tried to configure the mapping,I did not find any option asking source file name.
Can you please help me...
KiranHi Kiran
As far as I remember...when you configure the map, the map configuration property inspector has a tree in the lhs if you navigate to the flat file operator, and right click on that node you should be able to add a data file. The properties for the data file are shown on the rhs when selected in tree.
Cheers
David -
Error in Flat File to XML conversion
Hi all,
I am trying to convert a flat file to XML using the Sender File Adapter and I am getting the following error message.
2006-01-23 17:23:00 EST: Error: Conversion of complete file content to XML format failed around position 0: Exception: ERROR converting document line no. 2 according to structure 'GL_FileUpload_SAPECC_Header_DT1':java.lang.Exception: ERROR in configuration: more elements in file csv structure than field names specified!
My flat file looks like this,
--Start
GL,GLI,1,RefTest,4011,Test,1234567890,12032005,12032005,GL,RK
GL,GLI,4011,3011,,,,,,AU,600,7000,8000,9000,5000,RK,,,,,,,,,,,,,,,,,,,,
---End
The adapter configuration is like this:
Document Name: GL_FileUpload_SAPECC_Item_MT1
Document Namespace: urn:corptech.qld.gov.au:sss_std_offering:gl
RecordSet Name: GL_FileUpload_SAPECC_Record_DT1
RecordSet Namespace: urn:corptech.qld.gov.au:sss_std_offering:gl
RecordSet Structure: GL_FileUpload_SAPECC_Header_DT1,1,GL_FileUpload_SAPECC_Item_DT1,*
RecordSet Sequence: Ascending
Key FieldName: TransType
On the Adapter Properties, I have got:
--Start
GL_FileUpload_SAPECC_Header_DT1.fieldNames: TransType,RowType,SequenceNo,ReferenceKey,SenderSystem,HeaderText,CompanyCode,DocumentDate,PostingDate,DocumentType,ReferenceNo
GL_FileUpload_SAPECC_Header_DT1.fieldSeparator: ,
GL_FileUpload_SAPECC_Item_DT1.fieldNames: TransType,RowType,SequenceNo,GLAccount,CostCentre,ProfitCentre,InternalOrder,WBSElement,TaxCode,Currency,GLAmount,VendorAmount,CustomerAmount,AssetAmount,DRCR,ItemText,VendorNo,CustomerNo,Name,Street,City,PostCode,PoBox,State,Country,BankKey,BankAccount,BankCountry,CalcTax,PaymentTerms,BaseDate,PaymentBlock,PaymentMethod,Assignment,AssetNo,AssetSubNo,AssetTransaction
GL_FileUpload_SAPECC_Item_DT1.fieldSeparator: ,
ignoreRecordsetName: true
GL_FileUpload_SAPECC_Header_DT1.keyFieldValue: GL
GL_FileUpload_SAPECC_Item_DT1.keyFieldValue: GL
---End
The structure defined on the data type looks like this,
--Start
GL_FileUpload_SAPECC_Record_DT1 Complex Type
GL_FileUpload_SAPECC_Header_DT1 Element
TransType Element
RowType Element
Sequence Number Element
GL_FileUpload_SAPECC_Item_DT1 Element
TransType Element
RowType Element
Sequence Number Element
GLAccount Element
---End
Any help or suggestion please.
Thank you.
Warm Regards,
RanjanHi, Ranjan.
First of all, let's look at the meaning of the error.
> ...Exception: ERROR converting document line no. 2 according to
> structure 'GL_FileUpload_SAPECC_Header_DT1':java.lang.Exception:
> ERROR in configuration: more elements in file csv structure than
> field names specified!
It seems that XI interpreted 2nd line as
Header_DT1 not as Item_DT1 that you meant.
> GL,GLI,4011,3011,,,,,,AU,600,7000,8000,9000,5000,RK,,,,,,,,,,,,,,,,,,,,
That's why it says this line has more elements than the structure
defined(Header_DT1)
And the reason why XI misinterpreted the above as Header is that
you used keyFieldValue with the same value.
> ...Header_DT1.keyFieldValue: GL
> ...Item_DT1.keyFieldValue: GL
According to the following help,
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
it says like the following.
Key Field Name
If you specified a variable number of substructures for Recordset
Structure, in other words, at least one substructure has the value
*, then the substructures must be identified by the parser from
their content. This means that a key field must be set with different
constants for the substructures. In this case, you must specify a key
field and the field name must occur in all substructures.
How about using different constants for header and item if possible?
Good luck. -
Error in flat file loading in data targets
Hi,
when im loading the data from flat file
"information missing for currency translation into internal format" this error is coming when doing schedule.
can anyone pls help me,im new to SAP BW.
Thanks,
sitaHi Guptha,
I took 0AMOUNT so 0CURRENCY is assigned automatically.
0currency I kept GBP, INR.
If any solution pls help.
Thanks,
sita
Message was edited by: sita yerram -
Error in Flat file loading....
Hi All,
I tried to load data from a flat file, I got the following error :
u201CError in conversion exit CONVERSION_EXIT_CUNIT_INPUTu201D
What does that mean?
Actually when i used ; as the separator it loaded few data fieds, rest all were blank.
and when i used , as separator it was showing the above error.
So i think the problem is in the format of the file.
Can anyone tell me how can i format to overcome this error.?
Thanks in Advance.
Regards,
Chitra.hi,
check this threads,
Hi, See below link
https://www.sdn.sap.com/irj/sdn/directforumsearch?threadid=&q=conversion_exit_cunit_input&objid=c4&daterange=all&numresults=15&rankby=10001
hope this helps you ..
reagrds,
shikha -
How To handle complex Flat File in BDC( V.V. Urgent)
Hi All,
Anybody help in these case.
I have to write the BDC for a complex File.
Here is the Scenario
I An recording for Tcode CN21.
1network -> many activities
1 Activity ->many components
Any body Help ifor this case,
Points will be awarded.
Regards,
JayasimhaHi Jayasimha
Can u explain what is the problem that u are facing? we will be able to help u if u let u know what is the problem.
as far as what u have mentioned, first do a recording in SHDB for the transaction CN21 and then in the program get all the data from the flat file into an internal table. then build a BDC.
Cheers
Maybe you are looking for
-
How to get previous member of current member..
Hi , I have a period dimension like below. in the calculation script , I calculate each month and to do that I need to use previous member. I used @MEMBER(@PREVSIBLING(@CURRMBR("period"))) syntax. But this syntax does not work for apri, july and octo
-
Macbook has the folder with flashing question mark
Yesterday as I was watching Netflix my Mac froze. I was skipping around an episode and then started opening a folder to do something else while it loaded and then it just froze. I thought maybe I was clicking on too many things at once or whatever an
-
DPM 2012 R2 agent update on Windows 2003 server x64
Hi, I have an old windows 2003 server x64 protected by DPM 2012 Sp1. After DPM upgrade to 2012 R2 I cannot update DPM Agent on server. If I try to update agent manually error message is : agentsetup.exe is not a valid win32 application. Mihai
-
I am currently taking PDFs, opening them in Illustrator, and then saving as SVG to convert some files that have text and vector graphics. I would like to be able to not only automate this process, but do it on a web-server. Can anyone help me underst
-
Sound from video plays after video player removed from stage
I have a website http://www.droolpigs.com when I go there if I click the video archives button then play a video then click on the home or photos button or one of the alternate background buttons on the left the video goes away as it should but not