‎2007 Jun 27 11:15 AM
How can we see the transaction log when we use call transation method for transferring the data
‎2007 Jun 27 11:32 AM
HI.
Use this code to job log.
ws_grp_opened TYPE c,
loop
PERFORM bdc_transaction USING 'XK15'. "This is last statement after all field mapping
endloop.
If a session was created during call transaction,give a message
IF ws_grp_opened = 'X'.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
CONCATENATE 'Error session' ws_group_id 'created'
INTO error_messtab-message SEPARATED BY space.
CONDENSE error_messtab-message.
APPEND error_messtab.
WRITE: /5 'Error Session', ws_group_id,
'created... Please review using SM35'.
FORM bdc_transaction USING tcode.
DATA: l_mstring(480).
DATA: l_subrc LIKE sy-subrc.
DATA: l_process_mode LIKE ctu_params-dismode VALUE 'N'.
A: show all dynpros, E: show dynpro on error, N: dont display dynpro
DATA: l_update_mode LIKE ctu_params-updmode VALUE 'S'.
S: synchronously, A: asynchronously, L: local
break blsr. "CHG0019519
REFRESH messtab.
CALL TRANSACTION tcode USING bdcdata
MODE l_process_mode
UPDATE l_update_mode
MESSAGES INTO messtab.
IF sy-subrc = 0.
ADD 1 TO ws_succ_rows.
ENDIF.
l_subrc = sy-subrc.
Process BDC messages during the call transaction
LOOP AT messtab.
SELECT SINGLE text FROM t100 INTO t100-text
WHERE sprsl = messtab-msgspra
AND arbgb = messtab-msgid
AND msgnr = messtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH messtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH messtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH messtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH messtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH messtab-msgv1 INTO l_mstring.
REPLACE '&' WITH messtab-msgv2 INTO l_mstring.
REPLACE '&' WITH messtab-msgv3 INTO l_mstring.
REPLACE '&' WITH messtab-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
error_messtab-message = l_mstring.
APPEND error_messtab.
ELSE.
CONDENSE messtab.
error_messtab-message = messtab.
APPEND error_messtab.
ENDIF.
ENDLOOP.
There was error in call Transaction, all records are put in sessions
IF l_subrc <> 0.
IF ws_grp_opened = ' '.
ws_group_id = 'ERR_PRICES'.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = ws_group_id
user = sy-uname
keep = ' '.
ws_grp_opened = 'X'.
ENDIF.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = tcode
TABLES
dynprotab = bdcdata.
ENDIF.
REFRESH bdcdata.
ENDFORM. " BDC_TRANSACTION
Reward all helpfull answers.
Regards.
Jay
‎2007 Jun 27 11:29 AM
HI MAHESH
USE THE STRUCTURE BDCMSGCOLL.
IT WILL HAVE MESSAGE ID AND MESSAGE CLASS FOR ALL THE RECORDS (WHAT U HAVE UPLOADED USING CALL TRANSACTION METHOD).
U JUST PRINT IT. AND EXPLORE THOSE MESSAGE ID AND MESSAGE CLASS TO CHECK WHETHER IT IS UPLOADED SUCCESSFULLY OR NOT.
REWARD IF USEFUL.
‎2007 Jun 27 11:32 AM
HI.
Use this code to job log.
ws_grp_opened TYPE c,
loop
PERFORM bdc_transaction USING 'XK15'. "This is last statement after all field mapping
endloop.
If a session was created during call transaction,give a message
IF ws_grp_opened = 'X'.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
CONCATENATE 'Error session' ws_group_id 'created'
INTO error_messtab-message SEPARATED BY space.
CONDENSE error_messtab-message.
APPEND error_messtab.
WRITE: /5 'Error Session', ws_group_id,
'created... Please review using SM35'.
FORM bdc_transaction USING tcode.
DATA: l_mstring(480).
DATA: l_subrc LIKE sy-subrc.
DATA: l_process_mode LIKE ctu_params-dismode VALUE 'N'.
A: show all dynpros, E: show dynpro on error, N: dont display dynpro
DATA: l_update_mode LIKE ctu_params-updmode VALUE 'S'.
S: synchronously, A: asynchronously, L: local
break blsr. "CHG0019519
REFRESH messtab.
CALL TRANSACTION tcode USING bdcdata
MODE l_process_mode
UPDATE l_update_mode
MESSAGES INTO messtab.
IF sy-subrc = 0.
ADD 1 TO ws_succ_rows.
ENDIF.
l_subrc = sy-subrc.
Process BDC messages during the call transaction
LOOP AT messtab.
SELECT SINGLE text FROM t100 INTO t100-text
WHERE sprsl = messtab-msgspra
AND arbgb = messtab-msgid
AND msgnr = messtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH messtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH messtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH messtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH messtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH messtab-msgv1 INTO l_mstring.
REPLACE '&' WITH messtab-msgv2 INTO l_mstring.
REPLACE '&' WITH messtab-msgv3 INTO l_mstring.
REPLACE '&' WITH messtab-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
error_messtab-message = l_mstring.
APPEND error_messtab.
ELSE.
CONDENSE messtab.
error_messtab-message = messtab.
APPEND error_messtab.
ENDIF.
ENDLOOP.
There was error in call Transaction, all records are put in sessions
IF l_subrc <> 0.
IF ws_grp_opened = ' '.
ws_group_id = 'ERR_PRICES'.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = ws_group_id
user = sy-uname
keep = ' '.
ws_grp_opened = 'X'.
ENDIF.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = tcode
TABLES
dynprotab = bdcdata.
ENDIF.
REFRESH bdcdata.
ENDFORM. " BDC_TRANSACTION
Reward all helpfull answers.
Regards.
Jay
‎2007 Jun 27 11:34 AM
No error logs are created in call Transaction ..
it has to be handled explicitly.
dont forget to give points if its helpfull
regards
suprith
‎2007 Jun 27 11:44 AM