Processing the processed sessionwith error record
hi
how to reprocess the processed session which has 500 erroneous records
in batch input method
regards
sami
we have to collect this records in a separate file and run it again.
we cant re-porcess once if session is processed, so change the file with error free and run again.
u can do in this way , if u want to run whole file again
just go for Change Transaction Tcode and use the file previous one with error free records,
May i know for which transaction ur working for
and which tool ur using
Thanks
Message was edited by:
Pattan Naveen
Similar Messages
-
MDIS processing of error records
Dear MDM experts,
If we are using MDIS,say our import file has 25 records and there are problems with 5 records with regards to its "VALUE MAPPING" does MDIS write these 5 records into the VALUEX folder or only the first occurence of the value mapping error i.e. only the first error record ?
asuming the import file format is xml
Thanks.
AshishHi,
When the Import Manager encounters an exception, it handles the exception according to its type.
Value and Import Exceptions
Value and import exceptions prevent MDIS from importing a specific record. When such exceptions are encountered, an exception file for the offending record is copied to the ValueX or ImportX folder, respectively. MDIS then continues processing the import file and all other, non-exceptional records are imported as normal.
MDIS only logs the first exception it encounters in a record.
Reward points if helpful
Regards
Nisha
Edited by: Nisha Lalwani on Feb 4, 2008 5:51 AM -
Post processing of defect records from automatic Goods movement
During the run of COGI transaction, we got the List of all goods movements with errors.The list of errors can be <b>saved at once</b> and the other option is <b>save for background</b> (when we choose option List-> Save-> Save at once or Save for Background).In save at once option it saves the error & save for background shows the message "goods movements were entered as a background job".
Now my question is 1)What is the use of Save for BAckground? 2)If there are are multiple errors for a single raw material (say 7 errors)associated with different Process orders in COGI output.When we choose two or more error(say five errors we selected check boxes) the exercised option <b>save for background</b> the displayed message is self explainatory & it should have created a background job.But when I checked the SM37 (Simple Job Selection) it did not show us the Background Job details.
3)When I exercised the option of <b>Save for Background</b> & processed five error records, how can I find which I processed & where they gone?This cannot happen that u dotn see in SM37
May be u r using wrong username there.Just recheck it with your username
or check for BACKFLUSH* Jobs
Confirm if it resolves
Reward points if useful
Regards
Manish -
Copying the error records in a custom table
Hi,
I have a report program which is fetching Invoice header and line items . I need to copy the error records (records having a custom field ZZKUNNR as blank) in a custom table . I am executing this report in background daily .
The records in the custom table can be corrected by functional guys
Daily the report should fetch the data from SAP and also it should check whether there are correct records in the custom table .
If the records are found from custom table then those records also must be fetched.
Finally the output is stored in an application server .
Kindly help how to write the code for error records.Hang on a moment here... I am sure we deleted your user ID a few months ago for ponits gaming!
Did it "pay off" somehow and now you have a "real job" but don't have a clue what you are doing?
Doesn't that make you feel just a little bit unconfident about life, the universe and ABAP?
Cheers,
Julius -
How to print the error records and success records in bdc
how to print the number of error records and success records in bdc
hai,
plz refer this program,
Z_130399130271_A
REPORT Z_130399130271_A
NO STANDARD PAGE HEADING LINE-SIZE 325.
*INCLUDE YVALIDATE.
*include bdcrecx1.
INCLUDE YINCLUDE399.
DATA ITAB LIKE TABLE OF FILE_TABLE WITH HEADER LINE.
PARAMETERS: DATASET(132) LOWER CASE.
DATA : RC TYPE I,
ERR(40) TYPE C,
SUCCESSCNT TYPE I VALUE 0,
FAILCOUNT TYPE I VALUE 0.
DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
If it is nessesary to change the data section use the rules:
1.) Each definition of a field exists of two lines
2.) The first line shows exactly the comment
'* data element: ' followed with the data element
which describes the field.
If you don't have a data element use the
comment without a data element name
3.) The second line shows the fieldname of the
structure, the fieldname must consist of
a fieldname and optional the character '_' and
three numbers and the field length in brackets
4.) Each field must be type C.
Generated data section with specific formatting - DO NOT CHANGE ***
DATA: BEGIN OF RECORD OCCURS 0,
data element: LIF16
LIFNR_001(016),
data element: KTOKK
KTOKK_002(004),
data element: ANRED
ANRED_003(015),
data element: NAME1_GP
NAME1_004(035),
data element: SORTL
SORTL_005(010),
data element: STRAS_GP
STRAS_006(035),
data element: PFACH
PFACH_007(010),
data element: ORT01_GP
ORT01_008(035),
data element: ORT02_GP
ORT02_009(035),
data element: LAND1_GP
LAND1_010(003),
data element: REGIO
REGIO_011(003),
data element: SPRAS
SPRAS_012(002),
data element: TELF1
TELF1_013(016),
data element: TELF2
TELF2_014(016),
data element: BANKS
BANKS_01_015(003),
data element: BANKK
BANKL_01_016(015),
data element: BANKN
BANKN_01_017(018),
END OF RECORD.
DATA: BEGIN OF ERRORITAB OCCURS 0,
LIFNR_001 LIKE LFA1-LIFNR,
KTOKK_002 LIKE LFA1-KTOKK,
ANRED_003 LIKE LFA1-ANRED,
NAME1_004 LIKE LFA1-NAME1,
SORTL_005 LIKE LFA1-SORTL,
STRAS_006 LIKE LFA1-STRAS,
PFACH_007 LIKE LFA1-PFACH,
ORT01_008 LIKE LFA1-ORT01,
ORT02_009 LIKE LFA1-ORT02,
LAND1_010 LIKE LFA1-LAND1,
REGIO_011 LIKE LFA1-REGIO,
SPRAS_012 LIKE LFA1-SPRAS,
TELF1_013 LIKE LFA1-TELF1,
TELF2_014 LIKE LFA1-TELF2,
BANKS_01_015 LIKE LFBK-BANKS,
BANKL_01_016 LIKE LFBK-BANKL,
BANKN_01_017 LIKE LFBK-BANKN,
ERRORMSG(60) TYPE C,
SERIAL TYPE I VALUE '1',
END OF ERRORITAB.
End generated data section ***
AT SELECTION-SCREEN ON VALUE-REQUEST FOR DATASET.
CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
EXPORTING
WINDOW_TITLE = 'select a file '
DEFAULT_EXTENSION = 'TXT'
DEFAULT_FILENAME = 'ASSIGN5.TXT'
FILE_FILTER =
INIT_DIRECTORY =
MULTISELECTION =
IMPORTING
RC =
TABLES
FILE_TABLE = ITAB
EXCEPTIONS
CNTL_ERROR = 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.
READ TABLE ITAB INDEX 1.
DATASET = ITAB-FILENAME.
WRITE DATASET.
START-OF-SELECTION.
*perform open_dataset using dataset.
*perform open_group.
DATA T TYPE STRING.
T = DATASET.
IF T EQ ' '.
MESSAGE E110(ZX).
ENDIF.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = T
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = RECORD
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT RECORD.
CLEAR RC.
CLEAR ERR.
*read dataset dataset into record.
IF SY-SUBRC <> 0. EXIT. ENDIF.
RECORD-KTOKK_002 = '0001'.
PERFORM BDC_DYNPRO USING 'SAPMF02K' '0100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'RF02K-LIFNR'
RECORD-LIFNR_001.
PERFORM BDC_FIELD USING 'RF02K-KTOKK'
RECORD-KTOKK_002.
PERFORM BDC_DYNPRO USING 'SAPMF02K' '0110'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LFA1-TELX1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'LFA1-ANRED'
RECORD-ANRED_003.
PERFORM BDC_FIELD USING 'LFA1-NAME1'
RECORD-NAME1_004.
PERFORM BDC_FIELD USING 'LFA1-SORTL'
RECORD-SORTL_005.
PERFORM BDC_FIELD USING 'LFA1-STRAS'
RECORD-STRAS_006.
PERFORM BDC_FIELD USING 'LFA1-PFACH'
RECORD-PFACH_007.
PERFORM BDC_FIELD USING 'LFA1-ORT01'
RECORD-ORT01_008.
PERFORM BDC_FIELD USING 'LFA1-ORT02'
RECORD-ORT02_009.
PERFORM BDC_FIELD USING 'LFA1-LAND1'
RECORD-LAND1_010.
PERFORM BDC_FIELD USING 'LFA1-REGIO'
RECORD-REGIO_011.
PERFORM BDC_FIELD USING 'LFA1-SPRAS'
RECORD-SPRAS_012.
PERFORM BDC_FIELD USING 'LFA1-TELF1'
RECORD-TELF1_013.
PERFORM BDC_FIELD USING 'LFA1-TELF2'
RECORD-TELF2_014.
PERFORM BDC_DYNPRO USING 'SAPMF02K' '0120'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LFA1-KUNNR'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=VW'.
PERFORM BDC_DYNPRO USING 'SAPMF02K' '0130'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LFBK-BANKN(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
PERFORM BDC_FIELD USING 'LFBK-BANKS(01)'
RECORD-BANKS_01_015.
PERFORM BDC_FIELD USING 'LFBK-BANKL(01)'
RECORD-BANKL_01_016.
PERFORM BDC_FIELD USING 'LFBK-BANKN(01)'
RECORD-BANKN_01_017.
PERFORM BDC_DYNPRO USING 'SAPMF02K' '0130'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=UPDA'.
PERFORM BDC_TRANSACTION USING 'XK01' CHANGING ERR RC.
DATA: SERIAL TYPE I VALUE 1.
IF RC <> 0.
FAILCOUNT = FAILCOUNT + 1.
CLEAR ERRORITAB.
ERRORITAB-SERIAL = SERIAL.
ERRORITAB-LIFNR_001 = RECORD-LIFNR_001.
ERRORITAB-KTOKK_002 = RECORD-KTOKK_002.
ERRORITAB-ANRED_003 = RECORD-ANRED_003.
ERRORITAB-NAME1_004 = RECORD-NAME1_004.
ERRORITAB-SORTL_005 = RECORD-SORTL_005.
ERRORITAB-STRAS_006 = RECORD-STRAS_006.
ERRORITAB-PFACH_007 = RECORD-PFACH_007.
ERRORITAB-ORT01_008 = RECORD-ORT01_008.
ERRORITAB-ORT02_009 = RECORD-ORT02_009.
ERRORITAB-LAND1_010 = RECORD-LAND1_010.
ERRORITAB-REGIO_011 = RECORD-REGIO_011.
ERRORITAB-SPRAS_012 = RECORD-SPRAS_012.
ERRORITAB-TELF1_013 = RECORD-TELF1_013.
ERRORITAB-TELF2_014 = RECORD-TELF2_014.
ERRORITAB-BANKS_01_015 = RECORD-BANKS_01_015.
ERRORITAB-BANKL_01_016 = RECORD-BANKL_01_016.
ERRORITAB-BANKN_01_017 = RECORD-BANKN_01_017.
ERRORITAB-ERRORMSG = ERR.
SERIAL = SERIAL + 1.
APPEND ERRORITAB.
MODIFY RECORD TRANSPORTING KTOKK_002.
DELETE RECORD WHERE KTOKK_002 = '0001'.
ELSE.
SUCCESSCNT = SUCCESSCNT + 1.
ENDIF.
ENDLOOP.
display output********************************************************
SKIP.
FORMAT COLOR 5 INTENSIFIED OFF.
WRITE:/ 'No. of records successfully uploaded: '.
FORMAT COLOR 4 INTENSIFIED OFF.
WRITE: SUCCESSCNT.
Displaying the success table******************************************
IF SUCCESSCNT <> 0.
SKIP.
FORMAT COLOR 4 INTENSIFIED OFF.
WRITE:/ 'Successful Records'.
FORMAT COLOR 7 INTENSIFIED ON.
WRITE:/(261) SY-ULINE,
/ SY-VLINE,
'S.NO', 007 SY-VLINE,
'VENDOR ACC.NUM', 023 SY-VLINE,
'VENDOR ACC GROUP', 041 SY-VLINE,
'TITLE', 048 SY-VLINE,
'VENDOR NAME', 064 SY-VLINE,
'SORT FIELD', 076 SY-VLINE,
'HOUSE NO.& STREET', 101 SY-VLINE,
'PO.BOX NO', 116 SY-VLINE,
'CITY', 129 SY-VLINE,
'DISTRICT', 141 SY-VLINE,
'COUNTRY KEY', 156 SY-VLINE,
'REGION', 166 SY-VLINE,
'LANGUAGE KEY', 180 SY-VLINE,
'TELEPHONE NO 1', 196 SY-VLINE,
'TELEPHONE NO 2', 213 SY-VLINE,
'BANK COUNTRY KEY', 231 SY-VLINE,
'BANK KEY', 241 SY-VLINE,
'BANK ACC.NO', 261 SY-VLINE,
/1(261) SY-ULINE.
FORMAT COLOR 4 INTENSIFIED ON.
SERIAL = 1.
SORT RECORD BY LIFNR_001.
LOOP AT RECORD.
WRITE:/ SY-VLINE,
SERIAL LEFT-JUSTIFIED, 007 SY-VLINE,
RECORD-LIFNR_001(016), 023 SY-VLINE,
RECORD-KTOKK_002(004), 041 SY-VLINE,
RECORD-ANRED_003(015), 048 SY-VLINE,
RECORD-NAME1_004(035), 064 SY-VLINE,
RECORD-SORTL_005(010), 076 SY-VLINE,
RECORD-STRAS_006(035), 101 SY-VLINE,
RECORD-PFACH_007(010), 116 SY-VLINE,
RECORD-ORT01_008(035), 129 SY-VLINE,
RECORD-ORT02_009(035), 141 SY-VLINE,
RECORD-LAND1_010(003), 156 SY-VLINE,
RECORD-REGIO_011(003), 166 SY-VLINE,
RECORD-SPRAS_012(002), 180 SY-VLINE,
RECORD-TELF1_013(016), 196 SY-VLINE,
RECORD-TELF2_014(016), 213 SY-VLINE,
RECORD-BANKS_01_015(003), 231 SY-VLINE,
RECORD-BANKL_01_016(015), 241 SY-VLINE,
RECORD-BANKN_01_017(018), 261 SY-VLINE.
WRITE:/(261) SY-ULINE.
SERIAL = SERIAL + 1.
ENDLOOP.
WRITE:/1(261) SY-ULINE.
ENDIF.
SKIP.
FORMAT COLOR 5 INTENSIFIED OFF.
WRITE:/ 'No. of records not uploaded: '.
FORMAT COLOR 4 INTENSIFIED OFF.
WRITE: FAILCOUNT.
*Displaying the error table
IF FAILCOUNT <> 0.
SKIP.
FORMAT COLOR 4 INTENSIFIED OFF.
WRITE:/(320) SY-ULINE,
'Error Records'.
FORMAT COLOR 7 INTENSIFIED ON.
WRITE:/ SY-ULINE, SY-VLINE,
'S.NO', 007 SY-VLINE,
'VENDOR ACC.NUM', 023 SY-VLINE,
'VENDOR ACC GROUP', 041 SY-VLINE,
'TITLE', 048 SY-VLINE,
'VENDOR NAME', 064 SY-VLINE,
'SORT FIELD', 076 SY-VLINE,
'HOUSE NO.& STREET', 101 SY-VLINE,
'PO.BOX NO', 116 SY-VLINE,
'CITY', 129 SY-VLINE,
'DISTRICT', 141 SY-VLINE,
'COUNTRY KEY', 156 SY-VLINE,
'REGION', 166 SY-VLINE,
'LANGUAGE KEY', 180 SY-VLINE,
'TELEPHONE NO 1', 196 SY-VLINE,
'TELEPHONE NO 2', 213 SY-VLINE,
'BANK COUNTRY KEY', 231 SY-VLINE,
'BANK KEY', 241 SY-VLINE,
'BANK ACC.NO', 261 SY-VLINE,
'ERROR MESSAGE', 320 SY-VLINE.
WRITE:/(320) SY-ULINE.
FORMAT COLOR 4 INTENSIFIED ON.
SORT ERRORITAB BY LIFNR_001.
LOOP AT ERRORITAB.
WRITE:/ SY-VLINE,
ERRORITAB-SERIAL LEFT-JUSTIFIED, 007 SY-VLINE,
ERRORITAB-LIFNR_001 , 023 SY-VLINE,
ERRORITAB-KTOKK_002, 041 SY-VLINE,
ERRORITAB-ANRED_003, 048 SY-VLINE,
ERRORITAB-NAME1_004, 064 SY-VLINE,
ERRORITAB-SORTL_005, 076 SY-VLINE,
ERRORITAB-STRAS_006, 101 SY-VLINE,
ERRORITAB-PFACH_007, 116 SY-VLINE,
ERRORITAB-ORT01_008, 129 SY-VLINE,
ERRORITAB-ORT02_009, 141 SY-VLINE,
ERRORITAB-LAND1_010, 156 SY-VLINE,
ERRORITAB-REGIO_011, 166 SY-VLINE,
ERRORITAB-SPRAS_012, 180 SY-VLINE,
ERRORITAB-TELF1_013, 196 SY-VLINE,
ERRORITAB-TELF2_014, 213 SY-VLINE,
ERRORITAB-BANKS_01_015, 231 SY-VLINE,
ERRORITAB-BANKL_01_016, 241 SY-VLINE,
ERRORITAB-BANKN_01_017, 261 SY-VLINE,
ERRORITAB-ERRORMSG, 320 SY-VLINE.
WRITE:/(320) SY-ULINE.
ENDLOOP.
WRITE:/ SY-ULINE.
ENDIF.
hope this ll help you..
regards,
prema.A -
How to handle Error Records in BDC
Dear All,
I have 100 records in flat file but 10 records have error record.
Use on the BDC method, error records should be move to session and remaining process through call Transaction .
Any one help to me.
With Regards,
BaskaranHi,
Do it like this:
Loop at itab into wa.
gv_flag = 'N'.
If gv_flag = 'N'.
Perform...
wa_opts-dismode = 'N'. "for background
wa_opts-updmode ='S'.
wa_opts-defsize = 'X'.
wa_opts-nobinpt = 'X'.
Where wa_opts TYPE ctu_params.
*Call transaction
CALL TRANSACTION 'PA30' USING gi_bdcdata
OPTIONS FROM wa_opts
MESSAGES INTO gi_messtab.
IF sy-subrc EQ 0.
COMMIT WORK.
ELSE.
IF NOT gi_messtab[] IS INITIAL.
LOOP AT gi_messtab INTO wa_messtab.
IF wa_messtab-msgtyp EQ 'E' OR
wa_messtab-msgtyp EQ 'A' OR
wa_messtab-msgtyp EQ 'X' OR
wa_messtab-msgid EQ 'PBAS_SERVICE'.
CLEAR gv_msg.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = wa_messtab-msgid
lang = sy-langu
no = wa_messtab-msgnr
v1 = wa_messtab-msgv1
v2 = wa_messtab-msgv2
v3 = wa_messtab-msgv3
v4 = wa_messtab-msgv4
IMPORTING
msg = gv_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
*In case of no error message returned by BDC
IF sy-subrc = 0.
Sending errors stating which infotypes are not updated.
gv_error_flag = 'Y'.
do th required proccesing here.
ELSE.
gv_error_flag = 'Y'.
statements.
ENDIF.
ENDIF.
CLEAR wa_messtab.
ENDLOOP.
endloop.
Regards,
Rajesh Kumar
Edited by: Rajesh Kumar on Sep 17, 2009 7:58 AM -
How to upload error records in call transaction method
Hi all,
While uploading data by using call transaction. If any errors occured, how can we process that error records to database.
If all records are processed. How can we display the recent records which where uploaded.
AdvanceThanks for all.Hi Bharath
You can handle this in many ways. But the easiest option to do is as below,
once the call transaction ends in error, move that particular upload data to a separate internal table. Then finally download all these data to an error file.
Besides this after processing all the records diplay the log for error. So that users can modify the error in the file and can use the same for uploading again. For the data that has been processed successfully you can display the log similarly.
The error as well as sucess messages can be obtained from the messages table.
CALL TRANSACTION TCODE USING BDCDATA
MODE CTUMODE
UPDATE CUPDATE
MESSAGES INTO MESSTAB.
Regards
Kathirvel -
How to find the job which created the session with errors ?
Hi,
I am going to transaction SM35 to see the sessions which has errors. Now if I want to see, what Job was responsible to create that session, how can I see that ?
Regards,
Rajesh.hi Rajesh,
Refer to this code to create a session for the erroreneous records
REPORT ztest_report
NO STANDARD PAGE HEADING
LINE-SIZE 255
MESSAGE-ID ZRASH.
* Internal Table Declarations *
*--Internal Table for Data Uploading.
DATA : BEGIN OF IT_FFCUST OCCURS 0,
KUNNR(10),
BUKRS(4),
KTOKD(4),
ANRED(15),
NAME1(35),
SORTL(10),
STRAS(35),
ORT01(35),
PSTLZ(10),
LAND1(3),
SPRAS(2),
AKONT(10),
END OF IT_FFCUST.
*--Internal Table to Store Error Records.
DATA : BEGIN OF IT_ERRCUST OCCURS 0,
KUNNR(10),
EMSG(255),
END OF IT_ERRCUST.
*--Internal Table to Store Successful Records.
DATA : BEGIN OF IT_SUCCUST OCCURS 0,
KUNNR(10),
SMSG(255),
END OF IT_SUCCUST.
*--Internal Table for Storing the BDC data.
DATA : IT_CUSTBDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
*--Internal Table for storing the messages.
DATA : IT_CUSTMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA : V_FLAG1(1) VALUE ' ',
"Flag used for opening session.
V_TLINES LIKE SY-TABIX,
"For storing total records processed.
V_ELINES LIKE SY-TABIX,
"For storing the no of error records.
V_SLINES LIKE SY-TABIX.
"For storing the no of success records.
* Selection screen *
SELECTION-SCREEN BEGIN OF BLOCK B1.
PARAMETERS : V_FNAME LIKE RLGRAP-FILENAME,
V_SESNAM LIKE RLGRAP-FILENAME.
SELECTION-SCREEN END OF BLOCK B1.
* Start-of-selection *
START-OF-SELECTION.
*-- Form to upload flatfile data into the internal table.
PERFORM FORM_UPLOADFF.
* TOP-OF-PAGE *
TOP-OF-PAGE.
WRITE:/ 'Details of the error and success records for the transaction'
ULINE.
SKIP.
* End of Selection *
END-OF-SELECTION.
*-- Form to Generate a BDC from the Uploaded Internal table
PERFORM FORM_BDCGENERATE.
*--To write the totals and the session name.
PERFORM FORM_WRITEOP.
*& Form form_uploadff
* Form to upload flatfile data into the internal table.
FORM FORM_UPLOADFF .
*--Variable to change the type of the parameter file name.
DATA : LV_FILE TYPE STRING.
LV_FILE = V_FNAME.
*--Function to upload the flat file to the internal table.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = LV_FILE
* FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = IT_FFCUST
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC = 0.
*--Deleting the headings from the internal table.
DELETE IT_FFCUST INDEX 1.
*--Getting the total number of records uploaded.
DESCRIBE TABLE IT_FFCUST LINES V_TLINES.
ENDIF.
ENDFORM. " form_uploadff
*& Form Form_bdcgenerate
* Form to Generate a BDC from the Uploaded Internal table
FORM FORM_BDCGENERATE .
*--Generating the BDC table for the fields of the internal table.
LOOP AT IT_FFCUST.
PERFORM POPULATEBDC USING :
'X' 'SAPMF02D' '0105',
' ' 'BDC_OKCODE' '/00' ,
' ' 'RF02D-KUNNR' IT_FFCUST-KUNNR,
' ' 'RF02D-BUKRS' IT_FFCUST-BUKRS,
' ' 'RF02D-KTOKD' IT_FFCUST-KTOKD,
'X' 'SAPMF02D' '0110' ,
' ' 'BDC_OKCODE' '/00',
' ' 'KNA1-ANRED' IT_FFCUST-ANRED,
' ' 'KNA1-NAME1' IT_FFCUST-NAME1,
' ' 'KNA1-SORTL' IT_FFCUST-SORTL,
' ' 'KNA1-STRAS' IT_FFCUST-STRAS,
' ' 'KNA1-ORT01' IT_FFCUST-ORT01,
' ' 'KNA1-PSTLZ' IT_FFCUST-PSTLZ,
' ' 'KNA1-LAND1' IT_FFCUST-LAND1,
' ' 'KNA1-SPRAS' IT_FFCUST-SPRAS,
'X' 'SAPMFO2D' '0120',
' ' 'BDC_OKCODE' '/00',
'X' 'SAPMF02D' '0125',
' ' 'BDC_OKCODE' '/00',
'X' 'SAPMF02D' '0130',
' ' 'BDC_OKCODE' '=ENTR',
'X' 'SAPMF02D' '0340',
' ' 'BDC_OKCODE' '=ENTR',
'X' 'SAPMF02D' '0360',
' ' 'BDC_OKCODE' '=ENTR',
'X' 'SAPMF02D' '0210',
' ' 'KNB1-AKONT' IT_FFCUST-AKONT,
' ' 'BDC_OKCODE' '/00',
'X' 'SAPMF02D' '0215',
' ' 'BDC_OKCODE' '/00',
'X' 'SAPMF02D' '0220',
' ' 'BDC_OKCODE' '/00',
'X' 'SAPMF02D' '0230',
' ' 'BDC_OKCODE' '=UPDA'.
*--Calling the transaction 'fd01'.
CALL TRANSACTION 'FD01' USING IT_CUSTBDC MODE 'N' UPDATE 'S'
MESSAGES INTO IT_CUSTMSG.
IF SY-SUBRC <> 0.
*--Populating the error records internal table.
IT_ERRCUST-KUNNR = IT_FFCUST-KUNNR.
APPEND IT_ERRCUST.
CLEAR IT_ERRCUST.
*--Opening a session if there is an error record.
IF V_FLAG1 = ' '.
PERFORM FORM_OPENSESSION.
V_FLAG1 = 'X'.
ENDIF.
*--Inserting the error records into already open session.
IF V_FLAG1 = 'X'.
PERFORM FORM_INSERT.
ENDIF.
*--Populating the Success records internal table.
ELSE.
IT_SUCCUST-KUNNR = IT_FFCUST-KUNNR.
APPEND IT_SUCCUST.
CLEAR IT_SUCCUST.
ENDIF.
*--Displaying the messages.
IF NOT IT_CUSTMSG[] IS INITIAL.
PERFORM FORM_FORMATMSG.
ENDIF.
*--Clearing the message and bdc tables.
CLEAR : IT_CUSTBDC[],IT_CUSTMSG[].
ENDLOOP.
*--Getting the total no of error records.
DESCRIBE TABLE IT_ERRCUST LINES V_ELINES.
*--Getting the total no of successful records.
DESCRIBE TABLE IT_SUCCUST LINES V_SLINES.
*--Closing the session only if it is open.
IF V_FLAG1 = 'X'.
PERFORM FORM_CLOSESESS.
ENDIF.
ENDFORM. " Form_bdcgenerate
*& Form populatebdc
* FOrm to Populate the BDC table.
FORM POPULATEBDC USING VALUE(P_0178)
VALUE(P_0179)
VALUE(P_0180).
IF P_0178 = 'X'.
IT_CUSTBDC-PROGRAM = P_0179.
IT_CUSTBDC-DYNPRO = P_0180.
IT_CUSTBDC-DYNBEGIN = 'X'.
ELSE.
IT_CUSTBDC-FNAM = P_0179.
IT_CUSTBDC-FVAL = P_0180.
ENDIF.
APPEND IT_CUSTBDC.
CLEAR IT_CUSTBDC.
ENDFORM. " populatebdc
*& Form FORM_OPENSESSION
* Form to Open a session.
FORM FORM_OPENSESSION .
*--Variable to convert the given session name into reqd type.
DATA : LV_SESNAM(12).
LV_SESNAM = V_SESNAM.
*--Opening a session.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = LV_SESNAM
HOLDDATE = '20040805'
KEEP = 'X'
USER = SY-UNAME
PROG = SY-CPROG
* IMPORTING
* QID =
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11
IF SY-SUBRC <> 0.
WRITE :/ 'Session not open'.
ENDIF.
ENDFORM. " FORM_OPENSESSION
*& Form FORM_INSERT
* fORM TO INSERT ERROR RECOED INTO A SESSION.
FORM FORM_INSERT .
*--Inserting the record into session.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'FD01'
* POST_LOCAL = NOVBLOCAL
* PRINTING = NOPRINT
* SIMUBATCH = ' '
* CTUPARAMS = ' '
TABLES
DYNPROTAB = IT_CUSTBDC
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.
WRITE :/ 'Unable to insert the record'.
ENDIF.
ENDFORM. " FORM_INSERT
*& Form FORM_CLOSESESS
* Form to Close the Open Session.
FORM FORM_CLOSESESS .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " FORM_CLOSESESS
*& Form FORM_FORMATMSG
* Form to format messages.
FORM FORM_FORMATMSG .
*--Var to store the formatted msg.
DATA : LV_MSG(255).
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = SY-MSGID
LANG = SY-LANGU
NO = SY-MSGNO
V1 = SY-MSGV1
V2 = SY-MSGV2
V3 = SY-MSGV3
V4 = SY-MSGV4
IMPORTING
MSG = LV_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WRITE :/ LV_MSG.
ENDIF.
ULINE.
ENDFORM. " FORM_FORMATMSG
*& Form form_writeop
* To write the totals and the session name.
FORM FORM_WRITEOP .
WRITE :/ 'Total Records Uploaded :',V_TLINES,
/ 'No of Error Records :',V_ELINES,
/ 'No of Success Records :',V_SLINES,
/ 'Name of the Session :',V_SESNAM.
ULINE.
ENDFORM. " form_writeop -
how to get the list of error records from batch input method.
u can record them using bdcmsgcoll and also in t100 table.
*& Form prepare_bdc_tab
Prepare BDC Table for updating Copack Purchase Prices
FORM prepare_bdc_tab .
REFRESH gv_bdc_tab.
*MEK1 intial screen
PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RV13A-KSCHL'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RV13A-KSCHL' 'PB00'.
PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RV130-SELKZ(03)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=WEIT'.
PERFORM bdc_field USING 'RV130-SELKZ(01)' ''.
PERFORM bdc_field USING 'RV130-SELKZ(03)' 'X'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1018'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RV13A-DATBI(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'KOMG-LIFNR' gs_data-lifnr.
PERFORM bdc_field USING 'KOMG-MATNR' gs_data-matnr.
PERFORM bdc_field USING 'KOMG-EKORG' gs_data-ekorg.
PERFORM bdc_field USING 'KOMG-ESOKZ(01)' '0'.
PERFORM bdc_field USING 'KONP-KBETR(01)' gs_data-kbetr.
PERFORM bdc_field USING 'KONP-KONWA(01)' 'USD'.
PERFORM bdc_field USING 'KONP-KPEIN(01)' gs_data-peinh.
PERFORM bdc_field USING 'RV13A-DATAB(01)' gs_data-datab.
PERFORM bdc_field USING 'RV13A-DATBI(01)' gs_data-datbi.
PERFORM bdc_dynpro USING 'SAPMV13A' '1018'.
PERFORM bdc_field USING 'BDC_CURSOR' 'KOMG-ESOKZ(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SICH'.
ENDFORM. " prepare_bdc_tab
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR: gs_bdc_tab.
gs_bdc_tab-program = program.
gs_bdc_tab-dynpro = dynpro.
gs_bdc_tab-dynbegin = gc_x.
APPEND gs_bdc_tab TO gv_bdc_tab.
ENDFORM. "bdc_dynpro
Insert field
FORM bdc_field USING fnam fval.
CLEAR: gs_bdc_tab.
gs_bdc_tab-fnam = fnam.
gs_bdc_tab-fval = fval.
APPEND gs_bdc_tab TO gv_bdc_tab.
ENDFORM. "bdc_field
*& Form call_transaction_mek1
Call Transaction for updating CoPack Price entries
FORM call_transaction_mek1 .
*Local Data Declaration
CONSTANTS:lc_e TYPE c VALUE 'E',
lc_mek1(4) TYPE c VALUE 'MEK1',
lc_mode(1) TYPE c VALUE 'N',
lc_update(1) TYPE c VALUE 'U'.
REFRESH: gv_bdc_msg.
*Call MEK1 Transaction
CALL TRANSACTION lc_mek1
USING gv_bdc_tab
MODE lc_mode
UPDATE lc_update
MESSAGES INTO gv_bdc_msg.
IF sy-subrc NE 0.
IF gv_bdc_open_flag IS INITIAL.
PERFORM bdc_open_group.
gv_bdc_open_flag = gc_x.
ENDIF.
PERFORM bdc_insert_group.
DELETE gv_bdc_msg WHERE msgtyp NE lc_e.
REFRESH:gv_bdc_msg,
gv_bdc_tab.
ENDIF.
CLEAR:gs_data.
ENDFORM. " call_transaction_mek1
*& Form bdc_open_group
Subroutine for Open BDC Group
FORM bdc_open_group .
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = p_esnm
user = sy-uname
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
OTHERS = 11.
IF sy-subrc <> 0.
WRITE :/ text-040. "Error in BDC_OPEN_GROUP
EXIT.
ENDIF.
ENDFORM. " bdc_open_group
*& Form BDC_INSERT_GROUP
Subroutine for calling BDC_INSERT for inserting BDC Table
FORM bdc_insert_group .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'MEK1'
TABLES
dynprotab = gv_bdc_tab
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.
WRITE :/ text-041. "Error in BDC_INSERT
EXIT.
ENDIF.
ENDFORM. " BDC_INSERT_GROUP
*& Form BDC_CLOSE_GROUP
Subroutine for Closeing of BDC group
FORM bdc_close_group .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE :/ text-042. "Error in BDC_CLOSE_GROUP.
EXIT.
ENDIF.
ENDFORM. " BDC_CLOSE_GROUP
if u can see gv_bdc_msg is holding the messages
hope this helps
dont go through the code as it is ...it is only part of it
Message was edited by:
Durgaprasad Kare -
Processing BDocs Errors in the background
Hi,
I was wondering whether the following is possible.
We currently have BDocs errors in SMW01 on a regular basis. This is because our users are opening the BP record in CRM and R/3. There the BDoc error will have a message saying that the business partner is currently being processed by XXXX. We can reprocess these BDocs and they are processed successfully. What we would like to do is process these BUPA_MAIN BDoc errors in the background so we don't need to go into them manually. I understand the program for transaction SMW01 is RSMW_SHOW_BDOC. Has anyone ever taken a copy of this program and modified it so that it can process the above BDoc errors automatically in the background? We are looking into this as our business process allows the user to launch a record in both CRM and R/3. (Don't ask)
Anyway if anyone has done anything similar - any tips would be much appreciated.
Thanks in advance.
Regards
JoJoHi Jojo,
I have not done anything similar but can point you in right direction.
You can refer to class cl_smw_mflow which handles the middleware for messaging bdoc's. You can write a bespoek program from scratch with some selection parameters and process the messaging bdocs by looking at the status of bdoc's. There is a function module 'SMW3_MFLOW_QPROCESSMBDOC' which allows to process the bdoc's by passing the header information.
You can read the status of bdoc's & other header infromation from table SMW3_BDOC.
Hope this helps.
Surendar -
I'm a seasoned Photoshop/Bridge CS5 user who recently upgraded to CS6. In Bridge I just ran my first Image Processor batch, trying to convert a set of RAW .NEF files to .PSD files with a basic editing action I created applied to them. Photoshop CS6 opens the files from Bridge and applies the actions, but then I get the "Script alert" error message "Sorry I could not process the following files" and a list of all of the files in the batch I was trying to run the script on. The files all remain open and are saved on my hard drive in a folder created by the Image Processor script, but do not close unless I manually close them. I never had this problem in CS5 where the image processor would apply the desired actions to the batch of photos one at a time, then save and close. Thoughts on how I can fix this bug?
Hey Jeff--
No specific action steps to make the image safe - no flattening, etc. Had problems narrowing down the specific action step causing the problem. So I ran the Image Processor script in the ExtendScript ToolKit and debugged in. (I'm using the version that shipped with CS4.)
Turns out what was happening is that the app.activeDocument.close() command on line 1490 was never getting called, because the this.SaveFile() above it was throwing an exception. More debugging got me to the problem - SaveFile() tries to restore the history state after making a doc safe for saving as a JPEG. This causes an exception. So I commented out line 1571:
// app.activeDocument.ativeHistoryState = historyState;
The script runs just fine after this. I commented out the close to see what history states got added to the doc, but no new states are recorded, so commenting out the restore line should not cause any problems.
Of course, my solution does not solve the problem and I may need to comment out all the saveFile() lines that does this. Not sure why some actions have this problem and others don't. The actions I am running have about 25 steps. Perhaps PS is not catching up quick enough. I added a $.sleep(2500) after the restore history but that didn't help.
So, not sure where this gets us. I will check about posting an action set with just one of the actions that cause the problem. But I may also have our customer comment out that line of the Image Processor script.
Hope this helps. May post more next week. -
What are some of the process chain errors one comes across?
hi friends
What are some of the process chain errors one comes across?Hello Kiran,
Here are some of the errors that come across...
-> Rollup not possible, no filled aggregates available
-> Error when starting the extraction program
-> The process step locked by another changerun
-> Info objet does not contain alpha confirming values
-> Errors due to non activated objects
-> Errors due to duplicate records
-> Errors due to locking
-> Problems because of connection problem between source and bw systems
-> Problems due to RFC
Hope this helps you
Cheers
SRS -
We installed WebLogic Portal. We were able to bring up the webpage while we were configured on port 80. As soon as we wired the portal for port 443, it would not display page. Error: Invalid at the top level of the document. Error processing resource...
We are on a VM with Redhat Linux 5. Oracle Weblogic portal 10.3.5
Has anyone had this issue in the past and was able to resolve it?Did you upgrade your Portal to 10.1.4? Are you using the Web Cache port # or the HTTP Server port #? You can get this error message if you use the HTTP Server port # on Portal 10.1.4.
-
while installing adobe creative cloud , getting the following error msg " There seems to be a problem with the download process. Error code:201"
Creative Cloud Help / Error downloading Creative Cloud applications
http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html -
Today is April 10, 2013. I try to login to iTunes connect and I keep getting the message "An error has occurred processing your request. Please try again later or send an email for assistance." It never tells us what email address we need to write to.
The problem was solved by Apple Technical Help. The process is as flollows:
1. Open Safari
2. Menu item Safari-Reset Safari - remove all website data - reset
3. Now if you try to login on iTunes connect it will work.
Maybe you are looking for
-
Is there a way of knowing about these IMG upgrades ahead of time?
Seriously, I did not receive any notification about this 1.9.1 upgrade in a Verizon Spotlight magazine and I have looked through each of them before throwing them out. It could have been in the message box on my TV. Is that how I would know about a
-
Hi Experts i have a reuirement where i have to add custom field in delivery address/performance location tab in SRM shopping cart and Ship to address Pop-up in SRM PO i am doing below steps for this. 1. Adding custom field ZZfield in structure INCL_E
-
Adapter development: binary data and adapter specific properties?
Hi, We have succesfully developed our own SFTP adapter based on the J2SSH Maverick library (http://www.sshtools.com/showMaverick.do) and the sample file adapter that comes with XI. There are 2 features we would like to implement as well, but lack the
-
How to connect 27" imac to a hdtv (samaung UN55B7000) and use it as a second monitor?
-
CIN Detials tab in Vendor Master
Hi, We require the CIN tab to maintain the PAN, GST and VAT no. in the vendor master data to get the same in the withholding tax form no.16A. How do I get the CIN Details tab in the vendor master? Thanks & Regards Ramki