‎2007 Jun 13 1:17 PM
what should we do if a problem occurs in executing a bdc program
‎2007 Jun 13 1:20 PM
‎2007 Jun 13 2:25 PM
‎2007 Jun 14 1:42 AM
Hi sandeep
If any problem occurs in executing a BDC , you simply have to capture all the errors.
1. If you are using a CALL TRANSACTION method in mode 'E' then capture the messages into tbl_bdcmsgcoll and after that check for sy-subrc.
CALL TRANSACTION c_tcode USING tbl_bdcdata
MODE 'E'
UPDATE 'S'
MESSAGES INTO tbl_bdcmsgs.
Here c_tcode is a transaction code you are calling.
Now check for sy-subrc and if it is not 0 it means you have encountered errors. So you can process table tbl_bdcmsgcoll to see what all errors have occured and then rectify those and execute the BDC again.
You can use FM 'FORMAT_MESSAGE' to get the error message and build an internal table with such error messages.
2.If you are going in for a batch input session then when you run it in sm35 , if at all you encounter errors , you will see it in the session there and then rectify those and process the session again.
Hope this helps.
cheers
Shivika
‎2007 Jun 14 4:07 AM
Some of the steps to <b>create a BDC program</b> ..... <b>how to execute ... to to track the errors ..... when error come what has to be done ...everthing it is there .</b>
Steps:
1. Work out the transaction you would use to create the data manually.
2. Use transaction SHDB to record the creation of one material master data.
Click the New recording button or the Menu - Recording - Create
3. Save the recording, and then go back a screen and go to the overview.
4. Select the recording and click on Edit - Create Program. Give the program a Z name, and select transfer from recording.
5. Edit the program. You will see that all the data you entered is hard-coded into the program. You need to make the following changes:
5.1 After the start-of-selection, Call ws_upload to upload the file (the excel file needs to be saved as TAB separated).
5.2 After the open-group, Loop on the uploaded data. For each line, perform validation checks on the data, then modify the perform bdc_field commands to use the file data.
5.3. After perform bdc_transaction, add the endloop.
Execute the program. It will have options to create a batch session or to process directly.
These are all my finds . Might be it will be useful to you.
Direct call of transactions, session handling:
/nxxxx This terminates the current transaction, and starts transaction xxxx
/n This terminates the transaction. This generally corresponds to pressing F15 to go back.
/nend This termiantes all separate sessions and logs off (corresponds to System - Logoff).
/nex This terminates all separate sessions and logs off immediately (without any warning!).
/oxxxx This opens a new session and starts transaction xxxx in This session.
/o This lists existing sessions and allows deletion or opening of a new session.
/i This terminates the current session (corresponds to System End
/i1, /i2,... This terminates the session with the number given.
.xyzw Fast path: 'xyzw' refers to the underlined letters in the menus. This type of navigation is uncommon and is provided more for emergencies (such as a defective mouse).
Batch
The following commands can be entered in correction mode ('Process in foreground' or 'Display errors only') when processing a batch input session:
/n This terminates the current batch input transaction and characterizes it as
/bdel This deletes the current batch input transaction.
/bend This terminates batch input processing and sets the session to Failed
/bda This switches from Display errors only to Process in foreground
/bde This switches from Process in foreground to Display errors only
ABAP/4
/h This switches into debugging mode.
/hs This switches into debugging mode and activates the debugging of system functions.
Buffer
WARNING: Resetting buffers can significantly change the performance of the entire system for a long time.
It should therefore only be used where there is a good reason tdso. As of release 3.0B system administator authorization is required (authorization object (S_ADMI_FCD). The action is noted in the system log.
/$SYNC This resets all buffers of the application server
/$CUA This resets the CUA buffer of the application server
/$TAB This resets the TABLE buffers of the application server
/$NAM This resets the nametab buffer of the application server
/$DYNP This resets the screen buffer of the application server
Reward Points if it is usefull ...
Girish
‎2007 Jun 14 7:38 AM
hi,
any problem means I think errors
If u use Session method ERROR LOG IS PROVIDED DEFAULTLY we can check those in SM35.click log in toll bar.
If you are using a CALL TRANSACTION method we have to use bdcmsgcoll and FORMAT_MESSAGE to capture errors.after call transactoin systaxcheck for sy-subrc = 0
0-successful else loopbdcmsgcoll and provide error messages..
CALL TRANSACTION 'XK01' USING BDCTAB MODE 'A' UPDATE 'A' MESSAGES INTO BDCMSG.
*LOOP AT BDCMSG.
if sy-subrc <> 0.
move-corresponding itab to it_error.
endif.
READ TABLE BDCMSG WITH KEY MSGTYP = 'E'.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = BDCMSG-MSGID
LANG = 'EN'
NO = BDCMSG-MSGNR
V1 = BDCMSG-MSGV1
V2 = BDCMSG-MSGV2
V3 = BDCMSG-MSGV3
V4 = BDCMSG-MSGV4
IMPORTING
MSG = BDCMSG-MSGV1
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.
WRITE 😕 BDCMSG-MSGNR,BDCMSG-MSGV1.
ENDLOOP.
we can download the record sinto another flat file and we can reprocess it