Hi
U can use both method, so insert a radiobutton in the selection-screen in order to decide which method to be used.
The ABAP code is the same, the only difference is you have to use CALL TRANSACTION statament or fm BDC_OPEN_GROUP, BDC_INSERT, BDC_CLOSE_GROUP.
IF P_SESS = 'X'. CALL FUNCTION 'BDC_OPEN_GROUP' ................. FL_OPEN = 'X'. ENDIF. *---> Here fill BDC table IF P_CALL = 'X'. CALL TRANSACTION <TCODE> .... ELSE. IF FL_OPEN = 'X'. CALL FUNCTION 'BDC_INSERT' .................... ENDIF. ENDIF. IF FL_OPEN = 'X'. CALL FUNCTION 'BDC_CLOSE_GROUP' ............................. ENDIF.
you can prepare your program to create a BI session if CALL TRANSACTION fails
Max
Hi,
It is better to use the Call transaction method, for this if any error records found, you can create the session for this one.
Call Transaction 'TCODE' using BDCDATA MODE 'N' UPDATE 'S' messages into BDCMSGCOLL
if sy-subrc <> 0.
Call transaction 'BDC_OPEN_GROUP'
CALL TRANSACTIOn 'BDC_INSERT'.
CALL TRANSACTION 'BDC_CLOSE_GROUP'
endif.
Regards
Sudheer
Add a comment