Skip to Content
avatar image
Former Member

abap

Hiii everybody,

Can anyone tell me in detail why we need BDC?what is the session?

Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 17, 2007 at 05:44 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 06:02 AM

    Hi,

    Batch Data Communication or BDC is a batch interfacing technique that SAP developed. It is mainly used for uploading data into the SAP R/3 system. BDC works by simulating the user input from transactional screen via an ABAP program.

    The data input data file will come in the form of a flat file which the user save as file type txt file or prn file from the Microsoft Excel program. An Abaper will create a program to read the text file and upload into the SAP system.

    Normally, the tcode SHDB will be used to record the transaction code the user used. After, the simulation, the Abaper can generate a sample program and modify from there. It makes the programming easier and faster.

    For more information check the following links:

    http://sap-img.com/bdc.htm

    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/BDC_tutorial.html

    Regards,

    Bhaskar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 05:55 AM

    BDC means Batch Data Communication.

    What happens is that if we have got 1000s of records to be inserted into the database and if we use normal Online entry (insertion of record through a screen,each record Individually) then just imagine the amount of time it will take to insert say 10,000 records with an online entry through a transaction like MM01(with so many screens to be filled).It will take ages.

    What BDC does is that it carries it data entry automatically from say an internal table batch wise.

    That way the data from another system can be put into a flat file and then the data from this flat file can be transfered into an internal table using fuction GUI_UPLOAD

    and then using BDC can be left to get transfered into the respective tables.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 06:12 AM

    Hi,

    BDC is used to transfer data from SAP to SAP systems or from non-SAP to SAP system.It uses the normal Transaction codes to transfer data.

    This method is used to transfer large amount data thai available in electronic form.

    there are two types of methods offered by SAP for BDC.

    First method is called 'Classical' method.In this method, the data that is read by the BDC program from a sequential dataset file is storedd in the batch-input session. To run the transactions in the session,you need to execute the session.

    You can start and monitor the session from system->Services->Batch Input or have the session run in the back ground.

    This method uses the function module BDC_OPEN,BDC_INSERT and BDC_CLOSE to generate sessions.

    In the second method ,BDC uses the ABAP statement CALL TRANSACTION USING statement to run a transaction.

    In this method BDC does not create a session.

    Both the above methods needa common data structure for storing the instructions and data for SAP transactions. This structure is defiened as BDCDATA in the dictionary.

    To transfer the data from non-SAP to SAP system ,you would have to write a ABAP program that would export the data to a sequential dataset file.The data in this file should be stored in a format acceptable to SAP batch input program.

    To transfer data from SAP to another SAP system you may use RFC or CPI-C.

    The data transfer program should be able to export the data in SAP format to a sequential file.The BDC program reads the data from this file during the upload of data into the SAP system.

    I think now you may got an idea of BDC.

    reward points to all helpful answers

    Regards,

    Sreeja

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 07:41 AM

    Hi

    BDC allows you to perform database updates in the background using standard SAP transactions. The resultant entries will be as if the user had manually entered the data via SAP. This means that you do not bypass any of the standard SAP consistency checks, authorisations etc. There are two main methods of ABAP BDC, these are Call Transaction and Batch Input.

    Through session method, the data can be read by the BDC program from a sequential dataset file. This sequential dataset file is stored in batch-input session. In order to run the transaction in this session, one needs to execute the session. For this, follow these few steps: you can start and subsequently monitor the session firstly from – System ->Services -> Batch Input or have the session run in the background. In this method to generate the required session, you have to use the function module BDC _ INSERT and BDC _CLOSE.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 07:48 AM

    Hello Jyo...

    Here i'm giving entaire concept... U can get ur answer and remaining also will helps u...

    BATCH DATA COMMUNICATION

    About Data Transfer In R/3 System

    When a company decides to implement the SAP R/3 to manage business-critical data, it usually does not start from a no-data situation. Normally, a SAP R/3 project comes into replace or complement existing application.

    In the process of replacing current applications and transferring application data, two situations might occur:

    • The first is when application data to be replaced is transferred at once, and only once.

    • The second situation is to transfer data periodically from external systems to SAP and vice versa.

    • There is a period of time when information has to be transferred from existing application, to SAP R/3, and often this process will be repetitive.

    The SAP system offers two primary methods for transferring data into SAP systems. From non-SAP systems or legacy system. These two methods are collectively called “batch input” or “batch data communication”.

    1. SESSION METHOD

    2. CALL TRANSACTION

    3. DIRECT INPUT

    Advantages offered by BATCH INPUT method:

    1. Can process large data volumes in batch.

    2. Can be planned and submitted in the background.

    3. No manual interaction is required when data is transferred.

    4. Data integrity is maintained as whatever data is transferred to the table is through transaction. Hence batch input data is submitted to all the checks and validations.

    To implement one of the supported data transfers, you must often write the program that exports the data from your non-SAP system. This program, known as a “data transfer” program must map the data from the external system into the data structure required by the SAP batch input program.

    The batch input program must build all of the input to execute the SAP transaction.

    Two main steps are required:

    • To build an internal table containing every screen and every field to be filled in during the execution of an SAP transaction.

    • To pass the table to SAP for processing.

    Prerequisite for Data Transfer Program

    Writing a Data Transfer Program involves following prerequisites:

    Analyzing data from local file

    Analyzing transaction

    Analyzing transaction involves following steps:

    • The transaction code, if you do not already know it.

    • Which fields require input i.e., mandatory.

    • Which fields can you allow to default to standard values.

    • The names, types, and lengths of the fields that are used by a transaction.

    • Screen number and Name of module pool program behind a particular transaction.

    To analyze a transaction::

    • Start the transaction by menu or by entering the transaction code in the command box.

    (You can determine the transaction name by choosing System – Status.)

    • Step through the transaction, entering the data will be required for processing your batch input data.

    • On each screen, note the program name and screen (dynpro) number.

    (dynpro = dyn + pro. Dyn = screen, pro = number)

    • Display these by choosing System – Status. The relevant fields are Program (dynpro) and Dynpro number. If pop-up windows occur during execution, you can get the program name and screen number by pressing F1 on any field or button on the screen.

    The technical info pop-up shows not only the field information but also the program and screen.

    • For each field, check box, and radio button on each screen, press F1 (help) and then choose Technical Info.

    Note the following information:

    - The field name for batch input, which you’ll find in its own box.

    - The length and data type of the field. You can display this information by double clicking on the Data Element field.

    • Find out the identification code for each function (button or menu) that you must execute to process the batch-input data (or to go to new screen).

    Place the cursor on the button or menu entry while holding down the left mouse button. Then press F1.

    In the pop-up window that follows, choose Technical info and note the code that is shown in the Function field.

    You can also run any function that is assigned to a function key by way of the function key number. To display the list of available function keys, click on the right mouse button. Note the key number that is assigned to the functions you want to run.

    Once you have program name, screen number, field name (screen field name), you can start writing.

    DATA TRANSFER program.

    Declaring internal table

    First Integral Table similar to structure like local file.

    Declaring internal table like BDCDATA

    The data from internal table is not transferred directly to database table, it has to go through transaction. You need to pass data to particular screen and to particular screen-field. Data is passed to transaction in particular format, hence there is a need for batch input structure.

    The batch input structure stores the data that is to be entered into SAP system and the actions that are necessary to process the data. The batch input structure is used by all of the batch input methods. You can use the same structure for all types of batch input, regardless of whether you are creating a session in the batch input queue or using CALL TRANSACTION.

    This structure is BDCDATA, which can contain the batch input data for only a single run of a transaction. The typical processing loop in a program is as follows:

    • Create a BDCDATA structure

    • Write the structure out to a session or process it with CALL TRANSACTION USING; and then

    • Create a BDCDATA structure for the next transaction that is to be processed.

    Within a BDCDATA structure, organize the data of screens in a transaction. Each screen that is processed in the course of a transaction must be identified with a BDCDATA record. This record uses the Program, Dynpro, and Dynbegin fields of the structure.

    The screen identifier record is followed by a separate BDCDATA record for each value, to be entered into a field. These records use the FNAM and FVAL fields of the BDCDATA structure. Values to be entered in a field can be any of the following:

    • Data that is entered into screen fields.

    • Function codes that are entered into the command field. Such function codes execute functions in a transaction, such as Save or Enter.

    The BDCDATA structure contains the following fields:

    • PROGRAM: Name of module pool program associated with the screen. Set this field only for the first record for the screen.

    • DYNPRO: Screen Number. Set this field only in the first record for the screen.

    • DYNBEGIN: Indicates the first record for the screen. Set this field to X, only for the first record for the screen. (Reset to ‘ ‘ (blank) for all other records.)

    • FNAM: Field Name. The FNAM field is not case-sensitive.

    • FVAL: Value for the field named in FNAM. The FVAL field is case-sensitive. Values assigned to this field are always padded on the right, if they are less than 132 characters. Values must be in character format.

    Transferring data from local file to internal table

    Data is uploaded to internal table by UPLOAD of WS_UPLOAD function.

    Population of BDCDATA

    For each record of internal table, you need to populate Internal table, which is similar to BDCDATA structure.

    All these five initial steps are necessary for any type of BDC interface.

    DATA TRANSFER program can call SESSION METHOD or CALL TRANSACTION. The initial steps for both the methods are same.

    First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.

    <u><b>SESSION METHOD</b></u>

    About Session method

    In this method you transfer data from internal table to database table through sessions.

    In this method, an ABAP/4 program reads the external data that is to be entered in the SAP System and stores the data in session. A session stores the actions that are required to enter your data using normal SAP transaction i.e., Data is transferred to session which in turn transfers data to database table.

    Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.

    When the program has finished generating the session, you can run the session to execute the SAP transactions in it. You can either explicitly start and monitor a session or have the session run in the background processing system.

    Unless session is processed, the data is not transferred to database table.

    BDC_OPEN_GROUP

    You create the session through program by BDC_OPEN_GROUP function.

    Parameters to this function are:

    • User Name: User name

    • Group: Name of the session

    • Lock Date: The date on which you want to process the session.

    • Keep: This parameter is passed as ‘X’ when you want to retain session after

    processing it or ‘ ‘ to delete it after processing.

    BDC_INSERT

    This function creates the session & data is transferred to Session.

    Parameters to this function are:

    • Tcode: Transaction Name

    • Dynprotab: BDC Data

    BDC_CLOSE_GROUP

    This function closes the BDC Group. No Parameters.

    Some additional information for session processing

    When the session is generated using the KEEP option within the BDC_OPEN_GROUP, the system always keeps the sessions in the queue, whether it has been processed successfully or not.

    However, if the session is processed, you have to delete it manually. When session processing is completed successfully while KEEP option was not set, it will be removed automatically from the session queue. Log is not removed for that session.

    If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.

    CALL TRANSACTION

    About CALL TRANSACTION

    A technique similar to SESSION method, while batch input is a two-step procedure, Call Transaction does both steps online, one after the other. In this method, you call a transaction from your program by

    Call transaction <tcode> using <BDCTAB>

    Mode <A/N/E>

    Update <S/A>

    Messages into <MSGTAB>.

    Parameter – 1 is transaction code.

    Parameter – 2 is name of BDCTAB table.

    Parameter – 3 here you are specifying mode in which you execute transaction

    A is all screen mode. All the screen of transaction are displayed.

    N is no screen mode. No screen is displayed when you execute the transaction.

    E is error screen. Only those screens are displayed wherein you have error record.

    Parameter – 4 here you are specifying update type by which database table is updated.

    S is for Synchronous update in which if you change data of one table then all the related Tables gets updated. And sy-subrc is returned i.e., sy-subrc is returned for once and all.

    A is for Asynchronous update. When you change data of one table, the sy-subrc is returned. And then updating of other affected tables takes place. So if system fails to update other tables, still sy-subrc returned is 0 (i.e., when first table gets updated).

    Parameter – 5 when you update database table, operation is either successful or unsuccessful or operation is successful with some warning. These messages are stored in internal table, which you specify along with MESSAGE statement. This internal table should be declared like BDCMSGCOLL, a structure available in ABAP/4. It contains the following fields:

    1. Tcode: Transaction code

    2. Dyname: Batch point module name

    3. Dynumb: Batch input Dyn number

    4. Msgtyp: Batch input message type (A/E/W/I/S)

    5. Msgspra: Batch input Lang, id of message

    6. Msgid: Message id

    7. MsgvN: Message variables (N = 1 - 4)

    For each entry, which is updated in database, table message is available in BDCMSGCOLL. As BDCMSGCOLL is structure, you need to declare a internal table which can contain multiple records (unlike structure).

    Steps for CALL TRANSACTION method

    1. Internal table for the data (structure similar to your local file)

    2. BDCTAB like BDCDATA

    3. UPLOAD or WS_UPLOAD function to upload the data from local file to itab. (Considering file is local file)

    4. Loop at itab.

    Populate BDCTAB table.

    Call transaction <tcode> using <BDCTAB>

    Mode <A/N/E>

    Update <S/A>.

    Refresh BDCTAB.

    Endloop.

    (To populate BDCTAB, You need to transfer each and every field)

    The major differences between Session method and Call transaction are as follows:

    SESSION METHOD CALL TRANSACTION

    1. Data is not updated in database table unless Session is processed. Immediate updation in database table.

    2. No sy-subrc is returned. Sy-subrc is returned.

    3. Error log is created for error records. Errors need to be handled explicitly

    4. Updation in database table is always synchronous Updation in database table can be synchronous Or Asynchronous.

    Reward If Helpful.

    Regards

    --

    Sasidhar Reddy Matli.

    Message was edited by:

    Sasidhar Reddy Matli

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 08:13 AM

    SESSION METHOD

    About Session method

    In this method you transfer data from internal table to database table through sessions.

    In this method, an ABAP/4 program reads the external data that is to be entered in the SAP System and stores the data in session. A session stores the actions that are required to enter your data using normal SAP transaction i.e., Data is transferred to session which in turn transfers data to database table.

    Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.

    When the program has finished generating the session, you can run the session to execute the SAP transactions in it. You can either explicitly start and monitor a session or have the session run in the background processing system.

    Unless session is processed, the data is not transferred to database table.

    BDC_OPEN_GROUP

    You create the session through program by BDC_OPEN_GROUP function.

    Parameters to this function are:

    • User Name: User name

    • Group: Name of the session

    • Lock Date: The date on which you want to process the session.

    • Keep: This parameter is passed as ‘X’ when you want to retain session after

    processing it or ‘ ‘ to delete it after processing.

    BDC_INSERT

    This function creates the session & data is transferred to Session.

    Parameters to this function are:

    • Tcode: Transaction Name

    • Dynprotab: BDC Data

    BDC_CLOSE_GROUP

    This function closes the BDC Group. No Parameters.

    Some additional information for session processing

    When the session is generated using the KEEP option within the BDC_OPEN_GROUP, the system always keeps the sessions in the queue, whether it has been processed successfully or not.

    However, if the session is processed, you have to delete it manually. When session processing is completed successfully while KEEP option was not set, it will be removed automatically from the session queue. Log is not removed for that session.

    If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.

    For a BDC upload you need to write a program which created BDC sessions.

    Steps:

    1. Work out the transaction you would use to create the data manually.

    2. Use transaction SHDB to record the creation of one material master data.

    Click the New recording button or the Menu - Recording - Create

    3. Save the recording, and then go back a screen and go to the overview.

    4. Select the recording and click on Edit - Create Program. Give the program a Z name, and select transfer from recording.

    5. Edit the program. You will see that all the data you entered is hard-coded into the program. You need to make the following changes:

    5.1 After the start-of-selection, Call ws_upload to upload the file (the excel file needs to be saved as TAB separated).

    5.2 After the open-group, Loop on the uploaded data. For each line, perform validation checks on the data, then modify the perform bdc_field commands to use the file data.

    5.3. After perform bdc_transaction, add the endloop.

    Execute the program. It will have options to create a batch session or to process directly.

    These are all my finds . Might be it will be useful to you.

    Direct call of transactions, session handling:

    /nxxxx This terminates the current transaction, and starts transaction xxxx

    /n This terminates the transaction. This generally corresponds to pressing F15 to go back.

    /nend This termiantes all separate sessions and logs off (corresponds to System - Logoff).

    /nex This terminates all separate sessions and logs off immediately (without any warning!).

    /oxxxx This opens a new session and starts transaction xxxx in This session.

    /o This lists existing sessions and allows deletion or opening of a new session.

    /i This terminates the current session (corresponds to System End

    /i1, /i2,... This terminates the session with the number given.

    .xyzw Fast path: 'xyzw' refers to the underlined letters in the menus. This type of navigation is uncommon and is provided more for emergencies (such as a defective mouse).

    Batch

    The following commands can be entered in correction mode ('Process in foreground' or 'Display errors only') when processing a batch input session:

    /n This terminates the current batch input transaction and characterizes it as

    /bdel This deletes the current batch input transaction.

    /bend This terminates batch input processing and sets the session to Failed

    /bda This switches from Display errors only to Process in foreground

    /bde This switches from Process in foreground to Display errors only

    ABAP/4

    /h This switches into debugging mode.

    /hs This switches into debugging mode and activates the debugging of system functions.

    Buffer

    WARNING: Resetting buffers can significantly change the performance of the entire system for a long time.

    It should therefore only be used where there is a good reason tdso. As of release 3.0B system administator authorization is required (authorization object (S_ADMI_FCD). The action is noted in the system log.

    /$SYNC This resets all buffers of the application server

    /$CUA This resets the CUA buffer of the application server

    /$TAB This resets the TABLE buffers of the application server

    /$NAM This resets the nametab buffer of the application server

    /$DYNP This resets the screen buffer of the application server

    Also check

    http://myweb.dal.ca/hchinni/sap/bdc_home.htm

    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&

    http://www.sap-img.com/abap/learning-bdc-programming.htm

    http://www.sapdevelopment.co.uk/bdc/bdchome.htm

    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm

    http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm

    http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html

    Check these link:

    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm

    http://www.sap-img.com/abap/question-about-bdc-program.htm

    http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/

    http://www.planetsap.com/bdc_main_page.htm

    call-transaction-or-session-method

    http://www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_DATADICTIONARY_FAQ.html

    http://www.saptechnical.com/InterviewQ/interviewQ.htm

    http://help.sap.com/saphelp_46c/helpdata/en/35/2cd77bd7705394e10000009b387c12/frameset.htm

    <b>see this sample code where session and transaction method are both used at once</b>

    DATA : BEGIN OF ITAB OCCURS 0,

    EMPID LIKE ZNNR-EMPID,

    EMPNAME LIKE ZNNR-EMPNAME,

    EMPADR LIKE ZNNR-EMPADR,

    END OF ITAB.

    DATA : BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    FILENAME = 'C:NARESHNARESH.TXT'

    • FILETYPE = 'ASC'

    HAS_FIELD_SEPARATOR = 'X'

    • HEADER_LENGTH = 0

    • READ_BY_LINE = 'X'

    • DAT_MODE = ' '

    • CODEPAGE = ' '

    • IGNORE_CERR = ABAP_TRUE

    • REPLACEMENT = '#'

    • CHECK_BOM = ' '

    • VIRUS_SCAN_PROFILE =

    • NO_AUTH_CHECK = ' '

    • IMPORTING

    • FILELENGTH =

    • HEADER =

    TABLES

    DATA_TAB = ITAB

    EXCEPTIONS

    FILE_OPEN_ERROR = 1

    FILE_READ_ERROR = 2

    NO_BATCH = 3

    GUI_REFUSE_FILETRANSFER = 4

    INVALID_TYPE = 5

    NO_AUTHORITY = 6

    UNKNOWN_ERROR = 7

    BAD_DATA_FORMAT = 8

    HEADER_NOT_ALLOWED = 9

    SEPARATOR_NOT_ALLOWED = 10

    HEADER_TOO_LONG = 11

    UNKNOWN_DP_ERROR = 12

    ACCESS_DENIED = 13

    DP_OUT_OF_MEMORY = 14

    DISK_FULL = 15

    DP_TIMEOUT = 16

    OTHERS = 17

    .

    IF SY-SUBRC <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    CALL FUNCTION 'BDC_OPEN_GROUP'

    EXPORTING

    CLIENT = SY-MANDT

    • DEST = FILLER8

    GROUP = 'NARESH'

    • HOLDDATE = FILLER8

    KEEP = 'X'

    USER = SY-UNAME

    • RECORD = FILLER1

    • PROG = SY-CPROG

    • IMPORTING

    • QID =

    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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    LOOP AT ITAB.

    REFRESH BDCDATA.

    PERFORM BDC_DYNPRO USING 'ZNNR_MODULE' '0100'.

    PERFORM BDC_FIELD USING 'BDC_CURSOR'

    'ZNNR-EMPADR'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE'

    '=CRT'.

    PERFORM BDC_FIELD USING 'ZNNR-EMPID'

    ITAB-EMPID.

    PERFORM BDC_FIELD USING 'ZNNR-EMPNAME'

    ITAB-EMPNAME.

    PERFORM BDC_FIELD USING 'ZNNR-EMPADR'

    ITAB-EMPADR.

    • PERFORM BDC_TRANSACTION USING 'ZNNC'.

    CALL FUNCTION 'BDC_INSERT'

    EXPORTING

    TCODE = 'ZNNC'

    • POST_LOCAL = NOVBLOCAL

    • PRINTING = NOPRINT

    • SIMUBATCH = ' '

    • CTUPARAMS = ' '

    TABLES

    DYNPROTAB = 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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    ENDLOOP.

    CALL FUNCTION 'BDC_CLOSE_GROUP'

    EXCEPTIONS

    NOT_OPEN = 1

    QUEUE_ERROR = 2

    OTHERS = 3

    .

    IF SY-SUBRC <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    WRITE :/ 'SESSION CREATED SUCCESSFULLY'.

    FORM BDC_DYNPRO USING PROGRAM DYNPRO.

    CLEAR BDCDATA.

    BDCDATA-PROGRAM = PROGRAM.

    BDCDATA-DYNPRO = DYNPRO.

    BDCDATA-DYNBEGIN = 'X'.

    APPEND BDCDATA.

    ENDFORM.

    FORM BDC_FIELD USING FNAM FVAL.

    • IF FVAL <> NODATA.

    CLEAR BDCDATA.

    BDCDATA-FNAM = FNAM.

    BDCDATA-FVAL = FVAL.

    APPEND BDCDATA.

    • ENDIF.

    ENDFORM.

    Regards,

    srinivas

    <b>*reward for useful answers*</b>

    Add comment
    10|10000 characters needed characters exceeded