‎2006 Nov 01 3:17 PM
Hi experts,
I want to send the error records from BDC Call transaction method to a BDC session.Can any body tell me How can we send ..with an example if possible?
Regards
Ravi.
‎2006 Nov 01 3:28 PM
Ravi,
follow these steps.
1. bdc_open_group.
2. call transaction.
if sy-subrc <> 0.
bdc_insert.
endif.
3. bdc_close_group.
-Anu
‎2006 Nov 01 3:21 PM
‎2006 Nov 01 3:23 PM
‎2006 Nov 01 3:28 PM
Ravi,
follow these steps.
1. bdc_open_group.
2. call transaction.
if sy-subrc <> 0.
bdc_insert.
endif.
3. bdc_close_group.
-Anu
‎2006 Nov 01 4:20 PM
‎2006 Nov 01 4:23 PM
‎2006 Nov 01 4:25 PM
You can use this as an idea:
*& call transaction and capture results
CLEAR sy_int.
CALL TRANSACTION 'FM27' USING bdcdata MODE p_dmode UPDATE 'S'.
MOVE-CORRESPONDING sy TO sy_int.
IF p_test NE 'X'.
MOVE sy-msgv1 TO bppe_fund_ver-doc#.
ENDIF.
PERFORM get_message USING sy_int
CHANGING bppe_fund_ver-text.
IF ( p_test = 'X' AND bppe_fund_ver-text(14) = 'Check complete' ) OR
( p_test = ' ' AND bppe_fund_ver-text(08) = 'Document' ) .
bppe_fund_ver-subrc = 0.
ELSE.
IF p_test = 'X'.
bppe_fund_ver-subrc = 1.
ELSE.
PERFORM batch_input USING 'FM27'.
bppe_fund_ver-subrc = 1.
ENDIF.
ENDIF.
Rob
‎2006 Nov 01 4:38 PM
Hi,
u can see the below code -
Open session
form open_session .
data: lv_sess type apqi-groupid value 'ZNAME'.
call function 'BDC_OPEN_GROUP'
exporting
client = sy-mandt
group = lv_sess
keep = 'X'
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.
message i999 with ' Error in opening session'.
endif.
endform. " open_session
*-- Insert
form insert_session using tcode type tstc-tcode .
call function 'BDC_INSERT'
exporting
tcode = tcode
tables
dynprotab = tb_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 i999 with ' Error in inserting the records'.
endif.
endform. " insert_session
Close
form close_session .
call function 'BDC_CLOSE_GROUP'
exceptions
not_open = 1
queue_error = 2
others = 3.
if sy-subrc <> 0.
message i999 with ' Error in closing the session'.
endif.
endform. " close_session