Create Bdc Program Sap Abap
Create Bdc Program Sap Abap InterviewObjectify ABAP Objects Model for BDCUpdate 6 May 2. Updated method parameters following Objectifys naming convention. Updated Github repository link to Project Objectify. This an Object Oriented approach for BDC processing. What happens if you create the BDC recording in a system where you cannot modify programs directly, how can you create the ABAP code to modify in another system What are the possible values for BDCOKCODE How are they determined Object Oriented ABAP is taking slow phase in adoption for Pure ABAPersNot working in Webdynpro or other object oriented space even I took a yearlong to completely. Dear SAP Community Member, In order to fully benefit from what the SAP Community has to offer, please register at http Thank you, The SAP Community team. Create Bdc Program Sap Abap Jobs' title='Create Bdc Program Sap Abap Jobs' />
Im aware that there is already a model published here but this is my own attempt at the design which includes the functionality to process the BDC via Call Transaction or Batch Input Session. I develop in ABAP Objects wherever I can, so this is one of the classes where I bring along to every new project I start on as it is highly reusable. I am aware of the never ending debate between developing ABAP in OO vs. SCN, but I will not get into that here. Please feel free to reuse this model andor leave any comments if it can be improved any further. The corresponding objects and code for this article can be found in the following public repository on Github. The design of the class is based on the Singleton pattern whereby there can be only 1 active instance of the class in a single session. The screenshot below displays the methods available in the class. Instantiation of the class is via static method SINSTANTIATE, whereby the type of processing CT Call Transaction, BI Batch Input and related T Code are mandatory inputs. Additionally, other parameters are available for finer control of the BDC processing. All the input values are stored into the instances private attributes. Once the class is instantiated, instance methods ADDFIELD and ADDSCREEN are used to construct the BDC table. After the BDC table has been fully populated, instance method PROCESS is used to process that data. Depending on the processing type CTBI, private methods CALLTRANSACTION or CREATEBATCHINPUTSESS will be executed. If there is a need to execute the same BDC T Code multiple times i. CLEARBDCDATA can be used to clear the BDC table so that it can be reconstructed again. Finally, if the BDC instance is no longer required during an internal session, static method SFREEINSTANCE can be used to free the instance of the singleton, which then allows the memory to be freed during the next run of the garbage collector. Below is an example of a simple report program to illustrate the usage of the class. It shows both processing by Call Transaction and Batch Input Session. Report ZESYCALLOOBDCamp amp EPORT zesycalloobdc. Selection Screen ARAMETER pkunnr TYPE kna. DEFAULT 2. 40. 0, pvkorg TYPE knvv vkorg DEFAULT 1. TYPE knvv vtweg DEFAULT 1. TYPE knvv spart DEFAULT 0. SELECTION SCREEN SKIP 1. PARAMETER pdelblk TYPE kna. DEFAULT 0. 1, pbilblk TYPE kna. DEFAULT 0. 1. SELECTION SCREEN SKIP 1. PARAMETER ptran RADIOBUTTON GROUP r. DEFAULT X, psess RADIOBUTTON GROUP r. Data Declarations ATA gbdc TYPE REF TO zclbcbdc, gmessages TYPE tabbdcmsgcoll, gmessage LIKE LINE OF gmessages, gsubrc TYPE sy subrc, gexception TYPE REF TO zcxbatchinputerror, gerror TYPE string. Initialization INITIALIZATION. Start of Selection TART OF SELECTION. Create an object for BDC IF ptran X. CT imtcode VD0. ELSEIF psess X. gbdc zclbcbdc sinstantiate imbdctype BI imtcode VD0. MYSESSION imkeep X imholddate 2. ENDIF. Populate first screen gbdc addscreen imrepid SAPMF0. D imdynnr 0. BDCOKCODE imval 0. RF0. 2D KUNNR imval pkunnr. RF0. D VKORG imval pvkorg. RF0. D VTWEG imval pvtweg. RF0. D SPART imval pspart. Populate second screen gbdc addscreen imrepid SAPMF0. D imdynnr 0. BDCOKCODE imval UPDA. KNA1 LIFSD imval pdelblk. KNA1 FAKSD imval pbilblk. End of Selection ND OF SELECTION. Download Free Minecraft Hack Client Venom Costume. IF ptran X. gbdc process IMPORTING exsubrc gsubrc exmessages gmessages. Display processing status IF gsubrc 0. WRITE Success. ELSE. WRITE Error. Display messages in list LOOP AT gmessages INTO gmessage. MESSAGE ID gmessage msgid TYPE gmessage msgtyp NUMBER gmessage msgnr WITH gmessage msgv. INTO gerror. WRITE gerror. ENDLOOP. ENDIF. ELSEIF psess X. TRY. WRITE Success Check session in SM3. CATCH zcxbatchinputerror INTO gexception. WRITE Error creating batch input session. MESSAGE ID gexception msgid TYPE E NUMBER gexception msgno WITH gexception msgv. INTO gerror. WRITE gerror.