About BDC"S?

Hi,
I want to know the differences between Call Transcation and session Input methods in BDC ?

Hi Friend,
  if help full to u please reward me.
Difference Between Batch Input and Call Transaction in BDC
What is the difference between batch input and call transaction in BDC?
Session method.
1) synchronous processing.
2) can tranfer large amount of data.
3) processing is slower.
4) error log is created
5) data is not updated until session is processed.
Call transaction.
1) asynchronous processing
2) can transfer small amount of data
3) processing is faster.
4) errors need to be handled explicitly
5) data is updated automatically
Batch Data Communication (BDC) is the oldest batch interfacing technique that SAP provided since the early versions of R/3.   BDC is not a typical integration tool, in the sense that, it can be only be used for uploading data into R/3 and so it is
not bi-directional. 
BDC works on the principle of simulating user input for transactional screen, via an ABAP program.
Typically the input comes in the form of a flat file. The ABAP program reads this file and formats the input data screen by screen into an internal table (BDCDATA). The transaction is then started using this internal table as the input and executed in the background. 
In ‘Call Transaction’, the transactions are triggered at the time of processing itself and so the ABAP program must do the error handling.  It can also be used for real-time interfaces and custom error handling & logging features. Whereas in
Batch Input Sessions, the ABAP program creates a session with all the transactional data, and this session can be viewed, scheduled and processed (using Transaction SM35) at a later time. The latter technique has a built-in error processing mechanism too. 
Batch Input (BI) programs still use the classical BDC approach but doesn’t require an ABAP program to be written to format the BDCDATA. The user has to format the data using predefined structures and store it in a flat file. The BI program then reads this and invokes the transaction mentioned in the header record of the file. 
Direct Input (DI) programs work exactly similar to BI programs. But the only difference is, instead of processing screens they validate fields and directly load the data into tables using standard function modules. For this reason, DI programs are much faster (RMDATIND - Material Master DI program works at least 5 times faster) than the BDC counterpart and so ideally suited for loading large volume data. DI programs are not available for all application areas. 
Differences between bdc session method and call transaction method.
The most important aspects of the batch session interface are: - Asynchronous processing - Transfers data for multiple transactions - Synchronous database update During processing, no transaction is started until the previous transaction has been written to the database. - A batch input processing log is generated for each session - Sessions cannot be generated in parallel 
The most important aspects of the CALL TRANSACTION USING interface are: - Synchronous processing - Transfers data for a single transaction - Synchronous and asynchronous database updating both possible The program specifies which kind of updating is desired. - Separate LUW for the transaction The system performs a database commit immediately before and after the CALL TRANSACTION USING statement.  - No batch input processing log is generated.

Similar Messages

  • Re: about BDC

    Hi ..
       by using BDC how to upload flat file(legacy system) to sap System..in BDC which method is mainly using in real time..can you please send me some FAQs for me about Reports,smart forms,BDC,LSMW,ALV(ABAP List viewer),sap scripts,Module pool.a

    Hi
    Call Transaction method makes an immediate call on the transaction and upload starts immediately.,
    Session method only creates a session of the whole recording including all the values that have to be inserted,it does not insert values into the system. This session can be invoked anytime to upload values
    In short call transaction is immediates
    session is not immediate
    Session method is faster
    Synchronous is simoultaneous upload
    Asynchornous is non-simultaneous upload
    Start with this.Refer this
    For BDC:
    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.****************/InterviewQ/interviewQ.htm
    http://help.sap.com/saphelp_46c/helpdata/en/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Reports
    http://www.sapgenie.com/abap/reports.htm
    http://www.allsaplinks.com/material.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    ALE/ IDOC
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    Check these step-by-step links
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    for Smartforms material
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    SAPScripts
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    SAP SCRIPT FIELDS
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm
    scripts easy material
    http://www.allsaplinks.com/sap_script_made_easy.html
    Debugging Document.
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/84/1f624f4505144199e3d570cf7a9225/frameset.htm
    http://help.sap.com/saphelp_bw30b/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    BAPI
    http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    List of all BAPIs
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    Simple ALV report
    http://www.sapgenie.com/abap/controls/alvgrid.htm
    http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
    ALV
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    Go thru these programs they may help u to try on some hands on
    ALV Demo program
    BCALV_DEMO_HTML
    BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
    BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
    BCALV_GRID_DEMO Simple ALV Control Call Demo Program
    BCALV_TREE_DEMO Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO
    BC_ALV_DEMO_HTML_D0100
    Remote Function Call:
    RFC is an SAP interface protocol. Based on CPI-C, it considerably simplifies the programming of communication processes between systems.
    RFCs enable you to call and execute predefined functions in a remote system - or even in the same system.
    RFCs manage the communication process, parameter transfer and error handling.
    http://help.sap.com/saphelp_47x200/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm.
    ALE/ IDOC
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    Refer this
    http://www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_DATADICTIONARY_FAQ.html
    http://www.****************/InterviewQ/interviewQ.htm
    http://help.sap.com/saphelp_46c/helpdata/en/35/2cd77bd7705394e10000009b387c12/frameset.htm
    http://www.techinterviews.com/?p=198
    http://www.techinterviews.com/?p=326
    http://www.sap-img.com/abap/answers-to-some-abap-interview-questions.htm
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.geekinterview.com/Interview-Questions/SAP-R-3/ABAP
    http://sap.ittoolbox.com/documents/popular-q-and-a/abap-sample-interview-questions-3240
    http://www.sap-img.com/abap/abap-interview-question.htm
    http://www.allinterview.com/Interview-Questions/ABAP.html

  • All About BDC

    Hi Folks,
    Can anyone here please provide me some links through which I can know more about BDC.
    Thanks.
    K.Kiran.

    kiran,
    chk this pdf file
    http://www.sappoint.com/abap/bdcconcept.pdf
    chk this for FAQs on BDC
    http://www.sap-img.com/abap/question-about-bdc-program.htm
    sample code for call transaction method
    http://www.sapdevelopment.co.uk/bdc/bdc_ctcode.htm
    chk this for BDC recording with screen shots
    http://www.sapdevelopment.co.uk/bdc/bdc_recording.htm
    Hi refer the following links,
    http://www.sappoint.com/abap/bdcconcept.pdf
    http://www.planetsap.com/bdc_main_page.htm
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://www.sappoint.com/abap/files.pdf
    http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc
    http://searchsap.techtarget.com/ateQuestionNResponse/0,289625,sid21_gci1068429_tax293481,00.html
    Please find the same
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d62292b3-0301-0010-df98-aaac31cd4a41
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d62292b3-0301-0010-df98-aaac31cd4a41
    Pls. Mark for all useful answers.

  • About BDC Programming.

    Hi to all...
           I have a doubt in BDC Programming, I have a sample program of a BDC and i have executed it by uploading a .txt File.. But i
    can't able to know that whether the values are uploaded into the transaction or not. I also Like to Know about the Further
    Process  after executing the BDC report.. I don't Know how to View it in my transaction.. Can anyone Explain and Clear my
    Doubt.
    Moderator message: sorry, these forums cannot replace proper training, please search for available documentation or attend classes.
    locked by: Thomas Zloch on Sep 29, 2010 3:36 PM

    Hi..
    Basically I trying to Learn the BDC Programming now... I got an idea about BDC, But i can't able to know what is happening in it..
    Can You Have any sample Program With any comments Means Pls can you post it...

  • Want to learn more about BDC.

    Hi all,
             I am new to BDC and want o learn more about it and how it works. Can you please help me out in these.
             Please send any docs if any in [email protected]
          With regards,
            Abir.

    Hi,
       Have a look at these links-
    BDC
    http://www.sap-img.com/bdc.htm
    www.sappoint.com/abap/bdcconcept.pdf
    www.sap-img.com/abap/learning-bdc-programming.htm
    www.sap-img.com/abap/question-about-bdc-program.htm
    www.sapdevelopment.co.uk/bdc/bdchome.htm
    www.planetsap.com/bdc_main_page.htm
    Re: bdc mm01
    Table control in BDC
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    Mark helpful answers.
    Regards,
    Tanuja.

  • DETAILS ABOUT BDC

    Hello Sir ,
    This the second time i am asking u the question
      I am new to <b>ABAP</b> ,so please consider my request
    Please send me the details related to Programming in<b>BDC</b> ie
    session method and call transaction method
    and<b> complete details about BDC</b>
    urs faithfully
    Basavraj <b></b>

    Basavraj,
    Sorry to say, but the Discovery System experts are not equipped to support detail questions such as yours.  If you use the forums or OSS Notes for particular components, they will be more timely and reliable.
    In your case, I recommend you either search SDN such as as this:
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=bdc%20programming&cat=sdn_all
    Or, seach OSS Notes within component BC-ABA-SC or generally, search within all components for "BCD programming" say within the past year.
    Best,
    Rick

  • Can u send me the link which describes me in about bdc with direct method

    Can u send me the link which describes me in about bdc with direct method with examples in detail

    Hi,
    http://help.sap.com/saphelp_nw04/helpdata/en/eb/3e7cf7940e11d295df0000e82de14a/frameset.htm
    and
    http://help.sap.com/saphelp_nw04/helpdata/en/eb/3e7cf7940e11d295df0000e82de14a/frameset.htm
    For BDC:
    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
    reward if useful
    regards,
    Anji

  • I Need Navigation about BDC Upload

    Need Navigation about BDC Upload

    Hi
    <b>the BDC program should be in this format</b>
    Transaction Recorder (SHDB)
    How to Upload Presentation Server Flat file to SAP R/3 system???
    How to upload application server file to R/3 system?
    Definition
    <b>Example - Call Transaction Method</b>
    <b>Transaction Recorder (SHDB)</b>
    Before you work with the Batch Input methods, you should know the purpose of the tool
    Transaction Recorder.
    <b>Use:</b>
    You can use the transaction recorder to record a series of transactions and their screens.
    <b>Features:</b>
    You can use the recording to create
    Data transfer programs that use batch input or CALL TRANSACTION
    Batch input sessions
    Test data
    Function modules.
    Note: It doesn’t record F1, F4 and Scrollbar movements
    <b>Upload Flat file from Presentation Server to SAP R/3</b>
    CALL FUNCTION ‘GUI_UPLOAD'
    EXPORTING
    CODEPAGE = ‘IBM'
    FILENAME = P_UFILE
    FILETYPE = 'DAT'
    TABLES
    DATA_TAB = INT_TAB
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_WIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    OTHERS = 10 .
    IF SY-SUBRC NE 0.
    MESSAGE E999(FR) WITH 'ERROR IN FILE UPLOAD'.
    ENDIF.
    <b>Upload file from application server to SAP R/3</b>
    Open the the application server file
    OPEN DATASET <dsn> FOR INPUT <mode>
    Read the data from application server file
    READ DATASET <dsn> INTO <wa>
    And then close the application server file
    CLOSE DATASET <dsn>
    Definition- Declaring BDC Table
    DATA: BDC_TAB LIKE STANDARD TABLE OF
    BDCDATA INITIAL SIZE 6
    WITH HEADER LINE .
    The internal table used to collect the transaction’s information must be declared “LIKE BDCDATA”.
    <b>Filling BDC Table – Method #1</b>
    FORM FILL_BDC_TAB.
    REFRESH BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-PROGRAM = ‘SAPMF02K’.
    BDC_TAB-DYNPRO = ‘01016’.
    BDC_TAB-DYNBEGIN = ‘X’.
    APPEND BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = ‘RF02K-LIFNR’.
    BDC_TAB-FVAL = ‘TEST1’.
    APPEND BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = ‘RF02K-D0010’.
    BDC_TAB-FVAL = ‘X’.
    APPEND BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-PROGRAM = ‘SAPMF02K’.
    BDC_TAB-DYNPRO = ‘0110’.
    BDC_TAB-DYNBEGIN = ‘X’.
    APPEND BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = ‘LFA1-STRAS’.
    BDC_TAB-FVAL = ‘123 Main St.’.
    APPEND BDC_TAB.
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = ‘BDC_OKCODE’.
    BDC_TAB-FVAL = ‘/11’.
    APPEND BDC_TAB.
    ENDFORM.
    <b>Filling BDC Table – Method #2</b>
    FORM FILL_BDC_TAB.
    REFRESH BDC_TAB.
    PERFORM POPULATE_BDC_TAB
    USING:
    ‘1’ ‘SAPMF02K’ ‘0106’,
    ‘ ‘ ‘RF02K-LIFNR’ ‘TEST1’,
    ‘ ‘ ‘RF02K-D0010’ ‘X’,
    ‘1’ ‘SAPMF02K’ ‘0110’,
    ‘ ‘ ‘LFA1-STRAS’, ‘123 Main St.’,
    ‘ ‘ ‘BDC_OKCODE’, ‘/11’.
    ENDFORM.
    FORM POPULATE_BDC_TAB USING FLAG VAR1 VAR2.
    CLEAR BDC_TAB.
    IF FLAG = ‘1’.
    BDC_TAB-PROGRAM = VAR1.
    BDC_TAB-DYNPRO = VAR2..
    BDC_TAB-DYNBEGIN = ‘X’.
    ELSE.
    BDC_TAB-FNAM = VAR1.
    BDC_TAB-FVAL = VAR2.
    ENDIF.
    APPEND BDC_TAB.
    ENDFORM.
    This two subroutine method to fill the BDC table is preferable because the “POPULATE_BDC_TABLE” subroutine is reusable throughout all batch input programs.
    Example #1 - Change Vendor (Call Transaction Method)
    <b>Example #1- Declaration Section</b>
    REPORT Y180DM10.
    DATA: BDC_TAB LIKE STANDARD TABLE OF
    BDCDATA INITIAL SIZE 6 WITH HEADER LINE.
    INFILE(20) VALUE ‘/tmp/bc180_file4’.
    DATA: BEGIN OF INREC.
    VENDNUM LIKE LFA1-LIFNR.
    STREET LIKE LFA1-STRAS.
    END OF INREC.
    PARAMETERS: DISPMODE DEFAULT ‘A’,
    UPDAMODE DEFAULT ‘S’.
    START-OF-SELECTION.
    OPEN DATASET INFILE
    FOR INPUT IN TEXT MODE.
    DO.
    READ DATASET INFILE INTO INREC.
    IF SY-SUBRC < > 0. EXIT. ENDIF.
    PERFORM FILL_BDC_TAB.
    CALL TRANSACTION ‘FK02’
    USING BDC_TAB
    MODE DISPMODE
    UPDATE UPDAMODE.
    IF SY-SUBRC < > 0.
    WRITE: /‘ERROR’.
    ENDIF.
    ENDDO.
    CLOSE DATASET INFILE.
    <b>synchronous updating</b>
    DO.
    PERFORM FILL_BDC_TAB.
    CALL TRANSACTION ‘FK02’
    USING BDC_TAB
    MODE ‘N’
    UPDATE ‘S’.
    IF SY-SUBRC < > 0.
    WRITE: /‘ERROR’.
    ENDIF.
    ENDDO.
    With synchronous updating, we can check SY-SUBRC to determine the success of the transaction and the actual update to the database.
    <b>asynchronous updating</b>
    DO.
    PERFORM FILL_BDC_TAB.
    CALL TRANSACTION ‘FK02’
    USING BDC_TAB
    MODE ‘N’
    UPDATE ‘A’.
    IF SY-SUBRC < > 0.
    WRITE: /‘ERROR’.
    ENDIF.
    ENDDO.
    With asynchronous updating, we can check SY-SUBRC to determine the success of the transaction only, not the actual update to the database.
    <b>Error Handling</b>
    Write an error report.
    Send the record(s) in error to an error file.
    Create a batch input session with the record(s) in error.
    To store error messages ( CALL TRANSACTION )
    data: begin of Tab_Mess occurs 0.
    include structure bdcmsgcoll.
    data : end of Tab_Mess,
    CALL TRANSACTION ‘FK02’ USING BDC_TAB MODE ‘N’ UPDATE ‘S’
    MESSAGES INTO TAB_MESS.
    IF SY-SUBRC NE 0.
    WRITE: / Tab_MESS-TCODE, Tab_MESS-DYNUMB, Tab_MESS-MSGTYP ,
    Tab_MESS-MSGID.
    ENDIF.
    <b>i am giving you example for Change Vendor you practice for ur tcode</b>
    For our example, we will use the “Change Vendor” transaction (“FK02”) to add a street address to an already existing vendor.
    <b>Step #1</b>
    Use “System&#61664;Status” menu path to determine online program name (SAPMF02K), screen number (0110)
    <b>Step #2</b>
    Use “F1” key and “Technical Info” pushbutton in each screen field to be filled to determine the field name.
    <b>Step #3</b>
    Determine how to proceed in the transaction
    (save the record by clicking on the ‘Save’ pushbutton or pressing the ‘F11’ key).
    <b>BDC Table Contents</b>
    After researching the transaction we can determine the contents of the BDC table.
    PROGRAM DYNPRO DYNBEGIN FNAM FVAL
    SAMPF02K 0106 X
    RF02K-LIFNR TEST1
    RF02K-D0110 X
    SAMPF02K 0110 X
    LFA1-STRAS 123 Main St.
    BDC_OKCODE /11
    <b>Batch Input Methods</b>
    “CALL TRANSACTION USING”
    STATEMENT
    <b>Call transaction - for data transfer</b>Processing batch input data with CALL TRANSACTION USING is the faster of the two recommended data transfer methods. In this method, legacy data is processed inline in your data transfer program.
    Syntax:
    CALL TRANSACTION <tcode>
    USING <bdc_tab>
    MODE <mode>
    UPDATE <update>
    A Display all
    E Display errors only
    N No display
    S Synchronous
    A Asynchronous
    L Local update
    <b>The process flow of CALL TRANSACTION</b>
    A program that uses CALL TRANSACTION USING to process legacy data should execute thefollowing steps:
    Prepare a BDCDATA structure for the transaction that you wish to run.
    Prepare a internal table to store error messages Tab_Mess like structure of BDCMSGCOLL.
    With a CALL TRANSACTION USING statement, call the transaction and prepare the BDCDATA structure. For example:
    CALL TRANSACTION ‘MM01' USING BDCDATA MODE 'A' UPDATE 'S'. MESSAGES INTO TAB_MESS.
    IF SY-SUBRC <> 0.
    <Error_handling>.
    ENDIF.
    <b>Overview of Batch Input Session</b>
    The first batch input method is to create a batch input session. It is the processing of this batch input session that updates the database, not the execution of the batch input program.
    <b>Reward if usefull</b>

  • Need Navigation about BDC Upload (Diagramitacal way)

    Need Navigation about BDC Upload (Diagramitacal way) for easy understand.

    Hi
    file:///C:/Documents%20and%20Settings/nnelapat/Desktop/New%20Microsoft%20PowerPoint%20Presentation.ppt#259,4,Slide 4
    <b>Reward if usefull</b>

  • About bdc

    how to handle table control in bdc. plz also provide some real time issues regardind bdc,  an abaper have to go through.
    thanks

    Hi
    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.
    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.
    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.
    Error Handling in CALL TRANSACTION
    When Session Method updates the records in database table, error records are stored in the log file. In Call transaction there is no such log file available and error record is lost unless handled. Usually you need to give report of all the error records i.e., records which are not inserted or updated in the database table. This can be done by the following method:
    Steps for the error handling in CALL TRANSACTION
    1. Internal table for the data (structure similar to your local file)
    2. BDCTAB like BDCDATA
    3. Internal table BDCMSG like BDCMSGCOLL
    4. Internal table similar to Ist internal table
    (Third and fourth steps are for error handling)
    5. UPLOAD or WS_UPLOAD function to upload the data from the local file to itab. (Considering file is local file)
    6. Loop at itab.
    Populate BDCTAB table.
    Call transaction <tr.code> using <Bdctab>
    Mode <A/N/E>
    Update <S/A>
    Messages <BDCMSG>.
    Perform check.
    Refresh BDCTAB.
    Endloop.
    7 Form check.
    IF sy-subrc <> 0. (Call transaction returns the sy-subrc if updating is not successful).
    Call function Format_message.
    (This function is called to store the message given by system and to display it along with record)
    Append itab2.
    Display the record and message.
    DIRECT INPUT
    About Direct Input
    In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not simulate the online transaction. To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to be able to activate the restart mechanism, direct input programs must be executed in the background only. Direct input checks the data thoroughly and then updates the database directly.
    You can start a Direct Input program in two ways;
    Start the program directly
    This is the quickest way to see if the program works with your flat file. This option is possible with all direct input programs. If the program ends abnormally, you will not have any logs telling you what has or has not been posted. To minimize the chance of this happening, always use the check file option for the first run with your flat file. This allows you to detect format errors before transfer.
    Starting the program via the DI administration transaction
    This transaction restarts the processing, if the data transfer program aborts. Since DI document are immediately posted into the SAP D/B, the restart option prevents the duplicate document posting that occurs during a program restart (i.e., without adjusting your flat file).
    Direct input is usually done for standard data like material master, FI accounting document, SD sales order and Classification for which SAP has provided standard programs.
    First time you work with the Direct Input administration program, you will need to do some preparation before you can transfer data:
    - Create variant
    - Define job
    - Start job
    - Restart job
    Common batch input errors
    - The batch input BDCDATA structure tries to assign values to fields which do not exist in the current transaction screen.
    - The screen in the BDCDATA structure does not match the right sequence, or an intermediate screen is missing.
    - On exceptional occasions, the logic flow of batch input session does not exactly match that of manual online processing. Testing the sessions online can discover by this.
    - The BDCDATA structure contains fields, which are longer than the actual definition.
    - Authorization problems.
    RECORDING A BATCH INPUT
    A B recording allows you to record a R/3 transaction and generate a program that contains all screens and field information in the required BDC-DATA format.
    You can either use SHDB transaction for recording or
    SYSTEM ? SERVICES ? BATCH INPUT ? EDIT
    And from here click recording.
    Enter name for the recording.
    (Dates are optional)
    Click recording.
    Enter transaction code.
    Enter.
    Click Save button.
    You finally come to a screen where, you have all the information for each screen including BDC_OKCODE.
    • Click Get Transaction.
    • Return to BI.
    • Click overview.
    • Position the cursor on the just recorded entry and click generate program.
    • Enter program name.
    • Click enter
    The program is generated for the particular transaction.
    BACKGROUND PROCESSING
    Need for Background processing
    When a large volume of data is involved, usually all batch inputs are done in background.
    The R/3 system includes functions that allow users to work non-interactively or offline. The background processing systems handle these functions.
    Non-interactively means that instead of executing the ABAP/4 programs and waiting for an answer, user can submit those programs for execution at a more convenient planned time.
    There are several reasons to submit programs for background execution.
    • The maximum time allowed for online execution should not exceed 300 seconds. User gets TIMEOUT error and an aborted transaction, if time for execution exceeds 300 seconds. To avoid these types of error, you can submit jobs for background processing.
    • You can use the system while your program is executing.
    This does not mean that interactive or online work is not useful. Both type of processing have their own purposes. Online work is the most common one entering business data, displaying information, printing small reports, managing the system and so on. Background jobs are mainly used for the following tasks; to process large amount of data, to execute periodic jobs without human intervention, to run program at a more convenient, planned time other than during normal working hours i.e., Nights or weekends.
    The transaction for background processing is SM36.
    Or
    Tools ? Administration ? Jobs ? Define jobs
    Or
    System ? services ? Jobs
    Components of the background jobs
    A job in Background processing is a series of steps that can be scheduled and step is a program for background processing.
    • Job name. Define the name of assigned to the job. It identifies the job. You can specify up to 32 characters for the name.
    • Job class. Indicates the type of background processing priority assigned to the job.
    The job class determines the priority of a job. The background system admits three types of job classes: A B & C, which correspond to job priority.
    • Job steps. Parameters to be passed for this screen are as follows:
    Program name.
    Variant if it is report program
    Start criteria for the job: Option available for this are as follows:
    Immediate - allows you to start a job immediately.
    Date/Time - allows you to start a job at a specific name.
    After job - you can start a job after a particular job.
    After event - allows you to start a job after a particular event.
    At operation mode - allows you to start a job when the system switches to a particular operation mode.
    Defining Background jobs
    It is two step process: Firstly, you define the job and then release it.
    When users define a job and save it, they are actually scheduling the report i.e., specifying the job components, the steps, the start time.
    When users schedule program for background processing, they are instructing the system to execute an ABAP/4 report or an external program in the background. Scheduled jobs are not executed until they are released. When jobs are released, they are sent for execution to the background processing system at the specified start time. Both scheduling and releasing of jobs require authorizations.
    HANDLING OF POP UP SCREEN IN BDC
    Many times in transaction pop up screen appears and for this screen you don’t pass any record but some indication to system telling it to proceed further. For example: The following screen
    To handle such screen, system has provided a variable called BDC_CURSOR. You pass this variable to BDCDATA and process the screen.
    Usually such screen appears in many transactions, in this case you are just passing information, that YES you want to save the information, that means YES should be clicked. So you are transferring this information to BDCDATA i.e., field name of YES which is usually SPOT_OPTION. Instead of BDC_OKCODE, you are passing BDC_CURSOR.
    BDC_CURSOR is also used to place cursor on particular field.
    AN EXAMPLE WITH SESSION METHOD
    Following program demonstrates how data is passed from flat file to SAP transaction and further to database table by using SESSION method.
    The transaction is TFBA (to change customer).
    A simple transaction where you are entering customer number on first screen and on next screen data is displayed for the particular customer number. Field, which we are changing here, are name and city. When you click on save, the changed record gets saved.
    Prerequisite to write this BDC interface as indicated earlier is:
    1. To find screen number
    2. To find screen field names, type of the field and length of the field.
    3. To find BDC_OKCODE for each screen
    4. Create flat file.
    Flat file can be created in your hard disk as follows:
    1 Vinod Krishna Hyderabad
    2 Kavitha Secunderabad
    3 Kishore Hyderabad
    (Where 1st character field is Customer number, 2nd field is Customer name and 3rd field is City.)
    To transfer this data to database table SCUSTOM following interface can be used.
    REPORT DEMO1.
    Following internal table is to upload flat file.
    DATA: BEGIN OF ITAB OCCURS 0,
    ID(10),
    NAME(25),
    CITY(25),
    END OF ITAB.
    *Following internal table BDCDATA is to pass date from internal table to session.
    DATA: BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    Variables
    DATA: DATE1 LIKE SY-DATUM. DATE1 = SY-DATUM - 1. “ This is for Hold Date
    To upload flat file to internal table.
    CALL FUNCTION UPLOAD
    EXPORTING
    FILE NAME = ‘C:\FF.TXT’
    FILE TYPE = ‘ASC”
    TABLES
    DATA_TAB = ITAB
    EXCEPTIONS
    CONVERSION_ERROR = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    OTHERS = 6.
    If sy-subrc = 0.
    Calling Function to Create a Session
    CALL FUNCTION ‘BDC_OPEN_GROUP’
    EXPORTING
    CLIENT = SY-MANDT
    GROUP = ‘POTHURI’
    HOLDDATE = DATE1
    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.
    *-- MAIN Logic--
    LOOP AT ITAB
    PERFORM GENERATE_DATA. “ Populating BDCDATA Table
    CALL FUNCTION ‘BDC_INSERT’
    EXPORTING
    TCODE = ‘TFBA’
    TABLES
    DYNPROTAB = BDCTAB
    EXCEPTIONS
    INTERNAL_ERROR = 1
    NOT_OPEN = 2
    QUEUE_ERROR = 3
    TCODE_INVALID = 4
    PRINTING_INVALID = 5
    POSTING_INVALID = 6
    OTHERS = 7.
    REFRESH BDCTAB
    ENDLOOP.
    Calling function to close the session
    CALL FUNCTION ‘BDC_CLOSE_GROUP’
    EXCEPTIONS
    NOT_OPEN = 1
    QUEUE_ERROR = 2
    OTHERS = 3.
    Endif.
    Endif.
    *& Form GENERATE_DATA
    Create BDC Data
    FORM GENERATE_DATA
    Passing information for 1st screen on BDCDATA
    BDCTAB-PROGRAM = ‘SAPMTFBA’.
    BDCTAX-DYNPRO = 100.
    BDCTAP-DYNBEGIN = ‘X’.
    APPEND BCDTAB.CLEAR BDCTAB.
    Passing field information to BDCDATA
    BDCTAB-FNAM = ‘SCUSTOM-ID’
    BDCTAB-FVAL = ITAB-ID.
    APPEND BDCTAB.CLEAR BDCTAB.
    Passing BDC_OKCODE to BDCDATA
    BDCTAB-FNAM = ‘BDC_OKCODE’.
    BDCTAB-FVAL = ‘/5’.
    APPEND BDCTAB.CLEAR BDCTAB.
    Passing screen information for next screen to BDCDATA
    BDCTAB-PROGRAM = ‘SAPMTFBA’.
    BDCTAB-DYNPRO = 200.
    BDCTAB-DYNBEGIN = ‘X’.
    APPEND BDCTAB.CLEAR BDCTAB.
    Passing screen information to BDCDATA
    BDCTAB-FNAM = ‘SCUSTOM-NAME’.
    BDCTAB-FVAL = ITAB-NAME.
    APPEND BDCTAB.CLEAR BDCTAB.
    Passing screen information to BDCDATA
    BDCTAB-FNAM = ‘SCUSTOM-CITY’.
    BDCTAB-FVAL = ITAB-CITY.
    APPEND BDCTAB.CLEAR BDCTAB.
    Passing BDC_OKCODE to BDCDATA
    BDCTAB-FNAM = ‘BDC_OKCODE’.
    BDCTAB-FVAL = ‘SAVE’.
    APPEND BDCTAB.CLEAR BDCTAB.
    ENDFORM. “GENERATE_DATA
    AN EXAMPLE WITH CALL TRANSACTION
    Same steps to be repeated for CALL TRANSACTION
    The only difference between the two types of interface is in Session method, you create session and store information about screen and data into session. When session is processed the data is transferred to database. While in CALL TRANSACTION, data is transferred directly to database table.
    REPORT DEMO1.
    Follow above Code till MAIN Logic. Even the Subroutine should be copied
    LOOP AT ITAB
    PERFORM GENERATE_DATA, “Populating BDCDATA Table
    Call transaction ‘TFBA’ using BCDDATA Mode ‘A’ Update ‘S’.
    REFRESH BDCTAB
    ENDLOOP.
    How to deal with table control / step loop in BDC
    Steploop and table contol is inevitable in certain transactions. When we run BDC for such transactions, we will face the situation: how many visible lines of steploop/tablecontrol are on the screen? Although we can always find certain method to deal with it, such as function code 'NP', 'POPO', considering some extreme situation: there is only one line visible one the screen, our BDC program should display an error message. (See transaction 'ME21', we you resize your screen to let only one row visible, you can not enter mutiple lines on this screen even you use 'NP')
    Now with the help of Poonam on sapfans.com developement forum, I find a method with which we can determine the number of visible lines on Transaction Screen from our Calling BDC program. Maybe it is useless to you, but I think it will give your some idea.
    Demo ABAP code has two purposes:
    1. how to determine number of visible lines and how to calculte page number;
    (the 'calpage' routine has been modify to meet general purpose usage)
    2. using field symbol in BDC program, please pay special attention to the difference in Static ASSIGN and Dynamic ASSIGN.
    Now I begin to describe the step to implement my method:
    (I use transaction 'ME21', screen 121 for sample,
    the method using is Call Transation Using..)
    Step1: go to screen painter to display the screen 121, then we can count the fixed line on this screen, there is 7 lines above the steploop and 2 lines below the steploop, so there are total 9 fixed lines on this screen. This means except these 9 lines, all the other line is for step loop. Then have a look at steploop itselp, one entry of it will occupy two lines.
    (Be careful, for table control, the head and the bottom scroll bar will possess another two fixed lines, and there is a maximum number for table line)
    Now we have : FixedLine = 9
    LoopLine = 2(for table control, LoopLine is always equal to 1)
    Step2: go to transaction itself(ME21) to see how it roll page, in ME21, the first line of new page is always occupied by the last line of last page, so it begin with index '02', but in some other case, fisrt line is empty and ready for input.
    Now we have: FirstLine = 0
    or FirstLine = 1 ( in our case, FirstLine is 1 because the first line of new page is fulfilled)
    Step3: write a subroutine calcalculating number of pages
    (here, the name of actual parameter is the same as formal parameter)
    global data: FixedLine type i, " number of fixed line on a certain screen
    LoopLine type i, " the number of lines occupied by one steploop item
    FirstLine type i, " possbile value 0 or 1, 0 stand for the first line of new " scrolling screen is empty, otherwise is 1
    Dataline type i, " number of items you will use in BDC, using DESCRIBE to get
    pageno type i, " you need to scroll screen how many times.
    line type i, " number of lines appears on the screen.
    index(2) type N, " the screen index for certain item
    begin type i, " from parameter of loop
    end type i. " to parameter of loop
    *in code sample, the DataTable-linindex stands for the table index number of this line
    form calpage using FixedLine type i (see step 1)
    LoopLine type i (see step 1)
    FirstLine type i (see step 2)
    DataLine type i ( this is the item number you will enter in transaction)
    changing pageno type i (return the number of page, depends on run-time visible line in table control/ Step Loop)
    changing line type i.(visible lines one the screen)
    data: midd type i,
    vline type i, "visible lines
    if DataLine eq 0.
    Message eXXX.
    endif.
    vline = ( sy-srows - FixedLine ) div LoopLine.
    *for table control, you should compare vline with maximum line of
    *table control, then take the small one that is min(vline, maximum)
    *here only illustrate step loop
    if FirstLine eq 0.
    pageno = DataLine div vline.
    if pageno eq 0.
    pageno = pageno + 1.
    endif.
    elseif FirstLine eq 1.
    pageno = ( DataLine - 1 ) div ( vline - 1 ) + 1.
    midd = ( DataLine - 1 ) mod ( vline - 1).
    if midd = 0 and DataLine gt 1.
    pageno = pageno - 1.
    endif.
    endif.
    line = vline.
    endform.
    Step4 write a subroutine to calculate the line index for each item.
    form calindex using Line type i (visible lines on the screen)
    FirstLine type i(see step 2)
    LineIndex type i(item index)
    changing Index type n. (index on the screen)
    if FirstLine = 0.
    index = LineIndex mod Line.
    if index = '00'.
    index = Line.
    endif.
    elseif FirstLine = 1.
    index = LineIndex mod ( Line - 1 ).
    if ( index between 1 and 0 ) and LineIndex gt 1.
    index = index + Line - 1.
    endif.
    if Line = 2.
    index = index + Line - 1.
    endif.
    endif.
    endform.
    Step5 write a subroutine to calculate the loop range.
    form calrange using Line type i ( visible lines on the screen)
    DataLine type i
    FirstLine type i
    loopindex like sy-index
    changing begin type i
    end type i.
    If FirstLine = 0.
    if loopindex = 1.
    begin = 1.
    if DataLine <= Line.
    end = DataLine.
    else.
    end = Line.
    endif.
    elseif loopindex gt 1.
    begin = Line * ( loopindex - 1 ) + 1.
    end = Line * loopindex.
    if end gt DataLine.
    end = DataLine.
    endif.
    endif.
    elseif FirstLine = 1.
    if loopindex = 1.
    begin = 1.
    if DataLine <= Line.
    end = DataLine.
    else.
    end = Line.
    endif.
    elseif loop index gt 1.
    begin = ( Line - 1 ) * ( loopindex - 1 ) + 2.
    end = ( Line - 1 ) * ( loopindex - 1 ) + Line.
    if end gt DataLine.
    end = DataLine.
    endif.
    endif.
    endif.
    endform.
    Step6 using field sysbol in your BDC, for example: in ME21, but you should calculate each item will correponding to which index in steploop/Table Control
    form creat_bdc.
    field-symbols: <material>, <quan>, <indicator>.
    data: name1(14) value 'EKPO-EMATN(XX)',
    name2(14) value 'EKPO-MENGE(XX)',
    name3(15) value 'RM06E-SELKZ(XX)'.
    assign: name1 to <material>,
    name2 to <quan>,
    name3 to <indicator>.
    do pageno times.
    if sy-index gt 1
    *insert scroll page ok_code"
    endif.
    perform calrange using Line DataLine FirstLine sy-index
    changing begin end.
    loop at DataTable from begin to end.
    perform calindex using Line FirstLine DataTable-LineIndex changing Index.
    name1+11(2) = Index.
    name2+11(2) = Index.
    name3+12(2) = Index.
    perform bdcfield using <material> DataTable-matnr.
    perform bdcfield using <quan> DataTable-menge.
    perform bdcfield using <indicator> DataTable-indicator.
    endloop.
    enddo.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • About bdc rec & usage in target prog

    hi guru's,
    after the bdc recording is done, ihave got it in to a new program. can u give how to proceed further.
    where to insert the forms & code of this bdc_rec in my target program.
    please, can u give me a step wise like u did earlier for recording.
    i would be thankful to u for this detailed help.
    regards,
    chaitu

    Hi,
    You can see that there are two types of performs in the BDC recorded program
    Perform for screen, Perform for fields and Perform for transaction.
    After the recorded program is created.
    1. copy all performs into new program.
    2. write the FORM...ENDFORM for the given performs (as given at end of sample program below).
    3. Now for those fields where you have entered the values at the time of recording, replace the screen fields in the perform by values which you want to pass.
    Eg: PERFORM bdc_field         USING 'RL02B-MBLNR'
                                               gt_headret-mat_doc.
    Above step indicates that material document number from internal table gt_headret is passed to screen field 'RL02B-MBLNR'.
    similarly replace all the other fields accept those which capture the events like 'enter pressed'.
    Refer below program:
    REFRESH itab_bdcdata.
        PERFORM bdc_dynpro      USING 'SAPML02B' '0203'.
        PERFORM bdc_field          USING 'BDC_CURSOR'
                                                'RL02B-LGNUM'.
        PERFORM bdc_field          USING 'BDC_OKCODE'
                                                '/00'.
        PERFORM bdc_field         USING 'RL02B-MBLNR'
                                               gt_headret-mat_doc.
        PERFORM bdc_field        USING 'RL02B-MJAHR'
                                              gt_headret-doc_year.
        PERFORM bdc_field       USING 'RL02B-LGNUM'
                                             wa_mseg-lgnum.
        PERFORM bdc_field       USING 'RL02B-DUNKL'
                                             'H'.
        PERFORM bdc_dynpro     USING 'SAPML03T' '0132'.
        PERFORM bdc_field         USING 'BDC_OKCODE'
                                               '=TPAL'.
        PERFORM bdc_field         USING 'BDC_CURSOR'
                                               'LTBP1-OFMEA(01)'.
        PERFORM bdc_dynpro     USING 'SAPML03T' '0104'.
        PERFORM bdc_field         USING 'BDC_CURSOR'
                                               'RL03T-ANZL1'.
        PERFORM bdc_field         USING 'BDC_OKCODE'
                                               '=TAH1'.
        PERFORM bdc_field        USING 'LTAP-WDATU'
                                              lv_date.
          PERFORM bdc_field       USING 'RL03T-LMEN1'
                                               lv_lhmg1.
        PERFORM bdc_field       USING 'RL03T-LETY1'
                                             'IP'.
        PERFORM bdc_field       USING 'RL03T-ANZL2'
                                             '1'.
        PERFORM bdc_field       USING 'RL03T-LMEN2'
                                      wa_mseg-menge.
        PERFORM bdc_field       USING 'RL03T-LETY2'
                                              'IP'.
        PERFORM bdc_dynpro      USING 'SAPML03T' '0102'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                             'LTAP-NLENR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                              '/00'.
        PERFORM bdc_field       USING 'LTAP-LETYP'
                                              'IP'.
        PERFORM bdc_field       USING 'LTAP-WDATU'
                                              lv_date.
        PERFORM bdc_field       USING 'LTAP-NLTYP'
                                              v_stotyp.
        PERFORM bdc_field       USING 'LTAP-NLPLA'
                                              wa_mlgt-lgpla.
        PERFORM bdc_field       USING 'LTAP-NLENR'
                                             it_ft_mb31-lenum.
        PERFORM bdc_dynpro      USING 'SAPML03T' '0104'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                           'RL03T-ANZL1'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                             '=BU'.
        PERFORM bdc_field       USING 'LTAP-WDATU'
                                             lv_date.
          PERFORM bdc_field       USING 'RL03T-LMEN1'
                                               lv_lhmg1.
        PERFORM bdc_field       USING 'RL03T-LETY1'
                                             'IP'.
        PERFORM bdc_field       USING 'RL03T-LMEN2'
                                            wa_mseg-menge.
        PERFORM bdc_field       USING 'RL03T-LETY2'
                                             'IP'.
    *&      Form  bdc_dynpro
          text
    FORM bdc_dynpro USING program dynpro.
      itab_bdcdata-program  = program.
      itab_bdcdata-dynpro   = dynpro.
      itab_bdcdata-dynbegin = 'X'.
      APPEND itab_bdcdata.
      CLEAR itab_bdcdata.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
          text
    FORM bdc_field USING fnam fval.
      itab_bdcdata-fnam = fnam.
      itab_bdcdata-fval = fval.
      CONDENSE itab_bdcdata-fval.
      APPEND itab_bdcdata.
      CLEAR itab_bdcdata.
    ENDFORM.                    " bdc_field
    &      Form  bdc_transaction
    FORM bdc_transaction USING tcode.
    CALL TRANSACTION tcode USING bdcdata
                       MODE   'A'
                       UPDATE 'S'.
    ENDFORM.                    " bdc_transaction

  • About bdc call transaction and session method

    hi,
    can i know whether we could proceed with the bdc techniques without even copying and pasting in our program the perform statements from the recording process that we do for the particular transaction in TC SHDB.
    if we can pls send me a code for example.
    thanks in advance

    hi,
    check this example.
    For doing BDc Manually we have to analyse the transaction i.e. ex-XK01 we have to know the Screen numbers and screen fileds.
    first analyse the transaction and then write performs for bdc_filed and bdc_dynpro.
    REPORT  ZSR_BDC_CT_ERROR.
    DATA: BEGIN OF ITAB OCCURS 0,
             LIFNR LIKE RF02K-LIFNR,
             KTOKK LIKE RF02K-KTOKK,
             NAME1 LIKE LFA1-NAME1,
             SORTL LIKE LFA1-SORTL,
             LAND1 LIKE LFA1-LAND1,
             SPRAS LIKE LFA1-SPRAS,
          END OF ITAB.
    DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           it_error like itab occurs 0 with header line,
           BDCMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'z:\ct.txt'
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    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.
    LOOP AT ITAB.
    REFRESH BDCTAB.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0100'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'RF02K-KTOKK'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'RF02K-LIFNR'
                                  ITAB-LIFNR.
    PERFORM BDC_FIELD       USING 'RF02K-KTOKK'
                                  ITAB-KTOKK.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0110'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-SPRAS'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'LFA1-NAME1'
                                  ITAB-NAME1.
    PERFORM BDC_FIELD       USING 'LFA1-SORTL'
                                  ITAB-SORTL.
    PERFORM BDC_FIELD       USING 'LFA1-LAND1'
                                  ITAB-LAND1.
    PERFORM BDC_FIELD       USING 'LFA1-SPRAS'
                                  ITAB-SPRAS.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0120'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0130'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFBK-BANKS(01)'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=ENTR'.
    PERFORM BDC_DYNPRO      USING 'SAPLSPO1' '0300'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=YES'.
    CALL TRANSACTION 'XK01' USING BDCTAB MODE 'A' UPDATE 'A' MESSAGES INTO BDCMSG.
    *LOOP AT BDCMSG.
    if sy-subrc <> 0.
    move-corresponding itab to it_error.
    endif.
    READ TABLE BDCMSG WITH KEY MSGTYP = 'E'.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
       ID              = BDCMSG-MSGID
       LANG            = 'EN'
       NO              = BDCMSG-MSGNR
       V1              = BDCMSG-MSGV1
       V2              = BDCMSG-MSGV2
       V3              = BDCMSG-MSGV3
       V4              = BDCMSG-MSGV4
    IMPORTING
       MSG             = BDCMSG-MSGV1
    EXCEPTIONS
      NOT_FOUND       = 1
      OTHERS          = 2
    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 :/ BDCMSG-MSGNR,BDCMSG-MSGV1.
    ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    = BIN_FILESIZE
        filename                        = 'z:\cerror.txt'
       FILETYPE                        = 'ASC'
      APPEND                          = ' '
       WRITE_FIELD_SEPARATOR           = 'X'
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      = FILELENGTH
      TABLES
        data_tab                        = it_error
      FIELDNAMES                      = FIELDNAMES
    EXCEPTIONS
      FILE_WRITE_ERROR                = 1
      NO_BATCH                        = 2
      GUI_REFUSE_FILETRANSFER         = 3
      INVALID_TYPE                    = 4
      NO_AUTHORITY                    = 5
      UNKNOWN_ERROR                   = 6
      HEADER_NOT_ALLOWED              = 7
      SEPARATOR_NOT_ALLOWED           = 8
      FILESIZE_NOT_ALLOWED            = 9
      HEADER_TOO_LONG                 = 10
      DP_ERROR_CREATE                 = 11
      DP_ERROR_SEND                   = 12
      DP_ERROR_WRITE                  = 13
      UNKNOWN_DP_ERROR                = 14
      ACCESS_DENIED                   = 15
      DP_OUT_OF_MEMORY                = 16
      DISK_FULL                       = 17
      DP_TIMEOUT                      = 18
      FILE_NOT_FOUND                  = 19
      DATAPROVIDER_EXCEPTION          = 20
      CONTROL_FLUSH_ERROR             = 21
      OTHERS                          = 22
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *&      Form  dynpro
    FORM BDC_DYNPRO  USING    P_P1
                          P_P2.
      CLEAR BDCTAB.
      BDCTAB-PROGRAM  = P_P1.
      BDCTAB-DYNPRO   = P_P2.
      BDCTAB-DYNBEGIN = 'X'.
      APPEND BDCTAB.
    ENDFORM.                    " dynpro
    *&      Form  bdc_field
          text
         -->P_P3  text
         -->P_P4  text
    FORM BDC_FIELD  USING    P_P3
                             P_P4.
      CLEAR BDCTAB.
      BDCTAB-FNAM = P_P3.
      BDCTAB-FVAL = P_P4.
      APPEND BDCTAB.
    ENDFORM.                    " bdc_field
    Session:
    REPORT  ZSR_BDC_SESSION.
    DATA: BEGIN OF ITAB OCCURS 0,
             LIFNR LIKE RF02K-LIFNR,
             KTOKK LIKE RF02K-KTOKK,
             NAME1 LIKE LFA1-NAME1,
             SORTL LIKE LFA1-SORTL,
             LAND1 LIKE LFA1-LAND1,
             SPRAS LIKE LFA1-SPRAS,
          END OF ITAB.
    DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           BDCMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    *include bdcrecx1.
    START-OF-SELECTION.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'z:\flatfiles\sr1.txt'
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    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.
    *perform open_group.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
       CLIENT                    = SY-MANDT
      DEST                      = FILLER8
       GROUP                     = 'SR'
      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.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0100'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'RF02K-KTOKK'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'RF02K-LIFNR'
                                  ITAB-LIFNR.
    PERFORM BDC_FIELD       USING 'RF02K-KTOKK'
                                  ITAB-KTOKK.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0110'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-SPRAS'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'LFA1-NAME1'
                                  ITAB-NAME1.
    PERFORM BDC_FIELD       USING 'LFA1-SORTL'
                                  ITAB-SORTL.
    PERFORM BDC_FIELD       USING 'LFA1-LAND1'
                                  ITAB-LAND1.
    PERFORM BDC_FIELD       USING 'LFA1-SPRAS'
                                  ITAB-SPRAS.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0120'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0130'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFBK-BANKS(01)'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=ENTR'.
    PERFORM BDC_DYNPRO      USING 'SAPLSPO1' '0300'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=YES'.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
       TCODE                  = 'XK01'
      POST_LOCAL             = NOVBLOCAL
      PRINTING               = NOPRINT
      SIMUBATCH              = ' '
      CTUPARAMS              = ' '
      TABLES
        DYNPROTAB              = BDCTAB
    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.
    *perform bdc_transaction using 'XK01'.
    CALL FUNCTION 'BDC_CLOSE_GROUP'.
    *perform close_group.
    FORM BDC_DYNPRO  USING    VALUE(P_0069)
                              VALUE(P_0070).
      CLEAR BDCTAB.
      BDCTAB-PROGRAM  = P_0069.
      BDCTAB-DYNPRO   = P_0070.
      BDCTAB-DYNBEGIN = 'X'.
      APPEND BDCTAB.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
    FORM BDC_FIELD  USING    VALUE(P_0074)
                             VALUE(P_0075).
    IF P_0075 IS NOT INITIAL.
        CLEAR BDCTAB.
        BDCTAB-FNAM = P_0074.
        BDCTAB-FVAL = P_0075.
        APPEND BDCTAB.
      ENDIF.
    ENDFORM.                    " bdc_field

  • About bdc using session method

    how to update mm thru mk01. please provide the source code with a flat file to be updated.
    it's urgent.

    Well, you can go do the following steps:
    1. Go to SHDB, create a new recording session for the t-code mk01.
    2. Go though the t-code and create an entry and complete the transaction.
    3. Once that's done, it will record everthing, save and transfer it to a program.
    4. Go to the program in change mode, upload the flat file into a internal table using FM 'upload' or 'gui_upload'.
    5. Use the internal table to populate further interies into the tcode.
    Please go through the following link to understand the process better:
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    Please go through the following code also:
    report ZABC_BDC
           no standard page heading line-size 255.
    include bdcrecx1.
    *parameters: dataset(132) lower case.
       DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
      If it is nessesary to change the data section use the rules:
      1.) Each definition of a field exists of two lines
      2.) The first line shows exactly the comment
          '* data element: ' followed with the data element
          which describes the field.
          If you don't have a data element use the
          comment without a data element name
      3.) The second line shows the fieldname of the
          structure, the fieldname must consist of
          a fieldname and optional the character '_' and
          three numbers and the field length in brackets
      4.) Each field must be type C.
    Generated data section with specific formatting - DO NOT CHANGE  ***
    data: begin of record,
    data element: MATNR
            MATNR_001(018),
    data element: MBRSH
            MBRSH_002(001),
    data element: MTART
            MTART_003(004),
    data element: XFELD
            KZSEL_01_004(001),
    data element: MAKTX
            MAKTX_005(040),
    data element: MEINS
            MEINS_006(003),
          end of record.
    End generated data section ***
    DATA : ITAB LIKE TABLE OF RECORD WITH HEADER LINE.
    start-of-selection.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
       FILENAME                      = 'C:\Documents and Settings\sa01.indelgpttrg\Desktop'
       FILETYPE                      = 'DAT'
      ITEM                          = ' '
      FILEMASK_MASK                 = ' '
      FILEMASK_TEXT                 = ' '
      FILETYPE_NO_CHANGE            = ' '
      FILEMASK_ALL                  = ' '
      FILETYPE_NO_SHOW              = ' '
      LINE_EXIT                     = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      SILENT                        = 'S'
    IMPORTING
      FILESIZE                      =
      CANCEL                        =
      ACT_FILENAME                  =
      ACT_FILETYPE                  =
      TABLES
        DATA_TAB                      = ITAB
    EXCEPTIONS
      CONVERSION_ERROR              = 1
      INVALID_TABLE_WIDTH           = 2
      INVALID_TYPE                  = 3
      NO_BATCH                      = 4
      UNKNOWN_ERROR                 = 5
      GUI_REFUSE_FILETRANSFER       = 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.
    *perform open_dataset using dataset.
    perform open_group.
    *do.
    *read dataset dataset into record.
    *do.
    LOOP AT ITAB.
    if sy-subrc <> 0. exit. endif.
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MTART'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=AUSW'.
    perform bdc_field       using 'RMMG1-MATNR'
                                  ITAB-MATNR_001.
    perform bdc_field       using 'RMMG1-MBRSH'
                                  ITAB-MBRSH_002.
    perform bdc_field       using 'RMMG1-MTART'
                                  ITAB-MTART_003.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                  ITAB-KZSEL_01_004.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  ITAB-MAKTX_005.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-MEINS'.
    perform bdc_field       using 'MARA-MEINS'
                                  ITAB-MEINS_006.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    perform bdc_transaction using 'MM01'.
    *enddo.
    ENDLOOP.
    perform close_group.
    *perform close_dataset using dataset.
    <b>Please reward the helpful entries.</b>
    Regards,
    Raman.

  • About bdc recording

    Hi Experts,
                        i am working with " ZTOOLREV ' transaction code. i filled all the mandatory fields. which is required. i have done the recording.  i maintain one function module in se37. and converted this fm to web service.  that i have to send to my client
    he will send the data through same web service.              here i maintain internal table mess_tab. here
    i used EXPORT mess_tab TO MEMORY ID 'TOLLDATA'.
    so i will use IMPORT mess_tab TO MEMORY ID 'TOLLDATA'.  i think data is in internal table.     so what to do after. how the data comes in ztoolrev after recording. using bdc call transaction.
    i mean to say that the mandatory fields given by my client. how it is going to come in recording time. after that i am using save_text fm to save data.
    Please guide me.

    My 'expert opinion? What are you doing?
    You created a BDC recording, fm (for web service), IMPORT TO MEMORY ID, EXPORT TO MEMORY ID, SAVE_TEXT....Why?
    1. Are you providing a web service or consuming one? I guess both according to you post:
    he will send the data through same web service
    Same webservice?
    2. What does this mean? Where and why did you use this and why would you want to use both?
    i used EXPORT mess_tab TO MEMORY ID 'TOLLDATA'. so i will use IMPORT mess_tab TO MEMORY ID 'TOLLDATA'.
    3.
    i think data is in internal table.
    . You think? If you don't even know, why would any 'outsider' do?
    4. Where does the bdc fit into this 'picture'?
    5. FM SAVE_TEXT......, again why, what is it for?
    For you the expect any kind of answer, first make clear what it is you are trying to do here. Next ask a specific question. According to your posts you have been working on this ZTOOLREV transaction for quite some time now. So I guess, the requirement should be more than clear to you, correct? Explain it to us.
    The way I see it now, it should be something like this:
    1. You created a BDC recording for your ZTOOLREV transaction.
    2. This BDC recording is called from within the webservice which is being called from an external application from your client (or is this 'client' the client you are now working for?).
    3. One of the parameters is an internal table called MESS_TAB.  My guess is that this is the internal table used in CALL TRANSACTION for storing all messages in BDC recording. But where is the data for starting your BDC recording?
    4. Data from the calling application (mess_tab) is used to fill the BDC recording.
    5. At end of BDC recording you are doing a CALL TRANSACTION and return messages (MESS_TAB).
    Leaves us with some unanswered questions like EXPORT and IMPORT TO MEMORY ID and FM SAVE_TEXT.

  • Urgent question about BDC

    hi ,
    actualy in bdc recording , double click is not recorded through shdb,  and no other option we have , what should i do to record the double clik.........
    plz help its urgent
    pankaj gupta

    Hi,
    I donno y the double click is not captured for u in SHDB. I have done a recording where i am double clicking a record and it is captured in shdb.
    However i am giving u the ok-code for double clicking. u can use it in the bdc and check.
    ok-code  '=PICK'.
    perform bdc_field       using 'BDC_OKCODE' '=PICK'.
    Regards,
    Asif Ali Khan

Maybe you are looking for

  • PDF export problem in Pages/Keynote/Preview

    I am having some problems with PDF exports (and "Print as PDF")  from Pages (as well as Keynote and Preview).  Here is my situation: I am creating a PDF of a barchart+legend from the program Mathematica.  I suspect the way the exported PDF is formatt

  • Mail merge options

    I have a data base in bento and can export to many formats but I want to use pages to make a newsletter and mail merge names & address with out having to make sticky address labels, in other words print to the document. any ideas? thanks

  • Why is my iphone 4 deleting contacts automatically? They sometimes re-appear later but not always. My phone lost 1000 or so contacts today alone!

    Why is my iphone 4 deleting contacts automatically? They sometimes re-appear but not always. The phone deleted 1000 or so contacts today alone! Any suggestions?

  • Issue adding Query to My Menu

    I am trying to add a Query to a user's My Menu and I get an error The procedure I am using to add the Query is 1) Open Query Manager 2) Select the query I want to add to the menu 3) Go to Tools > My Menu > Add to My Menu > Highlight the Folder I want

  • How to config or start Intelligent Agents for OEM

    I have install the ORACLE 8.1.7 on redhat 7 successfully. Then I start the "o8ibegin" database instance, start the Oracle Management Server successfully. But, when I start the OEM by using "oemapp console", I could not discover the nodes, it tells me