Posted: Mon Sep 10, 2007 8:18 pm Post subject: BDC Processing & Idoc status update
Code:
**********************************************************************
*---- Data definition -------------------------------------------------
DATA: BEGIN OF BDCDATA OCCURS 5.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.
DATA: C_TCODE LIKE BKPF-TCODE VALUE 'FB01'.
DATA BEGIN OF MESSTAB OCCURS 10.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA END OF MESSTAB.
**********************************************************************
*---- Call transaction ------------------------------------------------
FORM Main_Program
REFRESH BDCDATA.
PERFORM APPEND_BDC USING 'SAPMF05A' '0100' ' ' ' '.
PERFORM APPEND_BDC USING ' ' ' ' 'BKPF-BLDAT' '09031998'.
PERFORM APPEND_BDC USING ' ' ' ' 'BDC_OKCODE' '/00'.
PERFORM APPEND_BDC USING 'SAPMF05A' '0300' ' ' ' '.
PERFORM APPEND_BDC USING ' ' ' ' 'BSEG-WRBTR' '*'.
PERFORM APPEND_BDC USING ' ' ' ' 'BDC_OKCODE' 'BU'.
*--- Here we check the return code, if there was an error, we put the
* transaction in a BDC session for the user to review and correct.
IF RETURN_CODE NE 0.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'ZKJW'
USER = SY-UNAME
KEEP = 'X'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = C_TCODE
TABLES
DYNPROTAB = BDCDATA.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
ENDIF.
**********************************************************************
*--- Append BDCDATA internal table ------------------------------------
FORM APPEND_BDC USING VALUE(P_PROG)
VALUE(P_SCREEN)
VALUE(P_NAM)
VALUE(P_VAL).
CLEAR BDCDATA.
*&---------------------------------------------------------------------*
*& Form UPDATE_IDOC_STATUS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM UPDATE_IDOC_STATUS.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.