Creation Dynamic session name using BDC session Method

Hi All,
I have one typical BDC problem. If the number of records in file are crossing 80,my bdc is giving problem .So I need to split total records into sets of 80 and submit them. So I need to create the session name dynamically, pass the data dynamically. IF you have example code  or know the procedure as how to proceed kindly inform me
Regards
Praveen

Hi Rob,
Please find my code below..
Part of the variables are in Polish since the original developer is a polish guy..
Praveen
Code.
*& Report  ZCO_I025_WSKAZNIKI_STAT_DEV                                 *
*& Interfejs wczytywania wskaźników statystycznych                     *
REPORT  zco_i025_wskazniki_stat_dev                                 .
TYPES:
  BEGIN OF l_tab_dane,
    indic LIKE rk23f-stagr,
    quant LIKE rk23f-mbgbtr,
    mpk LIKE rk23f-ekostl,
    order LIKE rk23f-eaufnr,
    text LIKE rk23f-sgtxt,
  END OF l_tab_dane.
DATA:
  it_excel TYPE TABLE OF alsmex_tabline,
  wa_excel TYPE alsmex_tabline,
  it_data TYPE TABLE OF l_tab_dane,
  wa_data TYPE l_tab_dane,
  error  TYPE C,
  msg TYPE string.
DATA:
  iv_pole TYPE string,
  ddatum(10),
  kdatum(10),
*Inserted By satyam Developer
   filelist    TYPE filetable,
        rc          TYPE i.
DATA: BEGIN OF bdctab OCCURS 5.
        INCLUDE STRUCTURE bdcdata.
DATA: END OF bdctab.
SELECTION-SCREEN BEGIN OF BLOCK p1 WITH FRAME TITLE text-001.
PARAMETERS:
  p_zakla LIKE tka01-kokrs DEFAULT '1000',
  p_ddate LIKE sy-datum DEFAULT sy-datum,
  p_kdate LIKE sy-datum DEFAULT sy-datum.
SELECTION-SCREEN ULINE.
PARAMETERS:
  p_fname LIKE rlgrap-filename.  " DEFAULT 'd:dane.xls'.
SELECTION-SCREEN END OF BLOCK p1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      file_filter       = cl_gui_frontend_services=>filetype_excel
     multiselection    = 'X'
    CHANGING
      file_table        = filelist
      rc                = rc.
  IF LINES( filelist ) IS INITIAL.
    EXIT.
  ENDIF.
  READ TABLE filelist INDEX 1 INTO p_fname.
START-OF-SELECTION.
AUTHORITY-CHECK OBJECT 'TKA01'
  ID 'KOKRS' FIELD p_zakla.
CONCATENATE p_ddate6(2) '.' p_ddate4(2) '.' p_ddate(4) INTO ddatum.
CONCATENATE p_kdate6(2) '.' p_kdate4(2) '.' p_kdate(4) INTO kdatum.
error = '0'.
PERFORM wczytaj_dane.
IF error = '0'.
  PERFORM utworz_sesje.
  PERFORM wprowadz_dane.
   PERFORM zamknij_sesje.   "comment by prav
ENDIF.
  PERFORM zamknij_sesje.        "add by prav
IF error = '1'.
  WRITE: msg, /.
ENDIF.
WRITE: 'Wykonano', /.
*&      Form  wczytaj_dane
      text
FORM wczytaj_dane.
  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      filename                = p_fname
      i_begin_col             = 1
      i_begin_row             = 1
      i_end_col               = 8
      i_end_row               = 65000
    TABLES
      intern                  = it_excel
    EXCEPTIONS
      inconsistent_parameters = 1
      upload_ole              = 2
      OTHERS                  = 3.
  IF sy-subrc <> 0.
    WRITE: / 'B&#322;ad importu pliku wejsciowego: ', p_fname, ' - ',
    sy-subrc.
  ELSE.
    SORT it_excel BY row col.
    LOOP AT it_excel INTO wa_excel.
      IF wa_excel-row = 1.
        CONTINUE.
      ENDIF.
      iv_pole = wa_excel-value.
      CASE wa_excel-col.
        WHEN 1. wa_data-indic = iv_pole.
        WHEN 2.
          REPLACE ',' WITH '.' INTO iv_pole.
          wa_data-quant = iv_pole.
        WHEN 3. wa_data-mpk = iv_pole.
        WHEN 4. wa_data-order = iv_pole.
        WHEN 5. wa_data-text = iv_pole.
      ENDCASE.
      AT END OF row.
        IF wa_data-mpk IS INITIAL AND wa_data-order IS INITIAL.
          error = '1'.
          WRITE:
'Musi by&#263; podane Stanowisko kosztów lub Zlecenie wewn&#281;trzne. Rekord: ',
          wa_excel-row, /.
          EXIT.
        ENDIF.
        IF wa_data-mpk IS NOT INITIAL AND wa_data-order IS NOT INITIAL.
          error = '1'.
          WRITE:
'Musi by&#263; podane Stanowisko kosztów lub Zlecenie wewn&#281;trzne. Rekord: ',
          wa_excel-row, /.
          EXIT.
        ENDIF.
        IF wa_data-indic IS INITIAL.
          error = '1'.
          WRITE: 'Brak identyfikatora wska&#378;nika. Rekord: ', wa_excel-row
          EXIT.
        ENDIF.
        IF wa_data-quant IS INITIAL.
          error = '1'.
          WRITE: 'Brak informacji o ilo&#347;ci. Rekord: ', wa_excel-row, /.
          EXIT.
        ENDIF.
        APPEND wa_data TO it_data.
        CLEAR wa_data.
      ENDAT.
    ENDLOOP.
  ENDIF.
ENDFORM.                    "wczytaj_dane
*&      Form  wprowadz_dane
      text
FORM wprowadz_dane.
  DATA:
    licznik TYPE i,
    l_txt TYPE string,
    pole(30) TYPE c,
    liczba(15) TYPE c.
  LOOP AT it_data into wa_data.
  PERFORM bdc_dynpro      USING 'SAPLSPO4' '0300'.
  PERFORM bdc_field       USING 'BDC_CURSOR' 'SVALD-VALUE(01)'.
  PERFORM bdc_field       USING 'BDC_OKCODE' '=FURT'.
  PERFORM bdc_field       USING 'SVALD-VALUE(01)' p_zakla.
  PERFORM bdc_dynpro      USING 'SAPLK23F1' '1200'.
  PERFORM bdc_field       USING 'BDC_OKCODE' '/00'.
  PERFORM bdc_field       USING 'COHEADER-SEND_REC_REL' '03SAP'.
  PERFORM bdc_field       USING 'RK23F-STATUS' 'L'.
  PERFORM bdc_field       USING 'COHEADER-BLDAT' ddatum.
  PERFORM bdc_field       USING 'COHEADER-BUDAT' kdatum.
  PERFORM bdc_field       USING 'BDC_CURSOR' 'EKOSTL(1)'.
  licznik = 0.
LOOP AT it_data into wa_data.
    ADD 1 TO licznik.
    l_txt = licznik.
    CONCATENATE 'EL4(' l_txt ')' INTO pole.
    condense pole no-gaps.
    PERFORM bdc_field USING pole wa_data-indic.
    CONCATENATE 'ELR1(' l_txt ')' INTO pole.
       condense pole no-gaps.
      liczba = wa_data-quant.
      if liczba <  0.
          shift liczba circular  left up to '-'.
      endif.
        condense liczba no-gaps.
    PERFORM bdc_field USING pole liczba.
    IF NOT wa_data-mpk IS INITIAL.
      CONCATENATE 'EL2(' l_txt ')' INTO pole.
         condense pole no-gaps.
      PERFORM bdc_field USING pole wa_data-mpk.
    ENDIF.
    IF NOT wa_data-order IS INITIAL.
      CONCATENATE 'EL3(' l_txt ')' INTO pole.
         condense pole no-gaps.
      PERFORM bdc_field USING pole wa_data-order.
    ENDIF.
    CONCATENATE 'EL8(' l_txt ')' INTO pole.
       condense pole no-gaps.
    PERFORM bdc_field USING pole wa_data-text.
call transaction 'KB31N' using bdctab mode 'A'.
refresh:bdctab.
clear bdctab.
  ENDLOOP.
CALL FUNCTION 'BDC_INSERT'
   EXPORTING
     tcode            = 'KB31N'
   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.
   WRITE: / text-010 .
ENDIF.
call transaction 'KB31N' using bdctab mode 'A'.
REFRESH bdctab.
clear:bdctab.        "by praveen
ENDFORM.                    "wprowadz_dane
*&      Form  bdc_dynpro
      text
     -->PROGRAM    text
     -->DYNPRO     text
FORM bdc_dynpro USING program dynpro.
  CLEAR bdctab.
  MOVE:
    program   TO bdctab-program,
    dynpro    TO bdctab-dynpro,
    'X'       TO bdctab-dynbegin.
  APPEND bdctab.
ENDFORM.                    "bdc_dynpro
*&      Form  bdc_field
      text
     -->POLE       text
     -->WARTOSC    text
FORM bdc_field USING pole wartosc.
  CLEAR bdctab.
  MOVE:
    pole     TO bdctab-fnam,
    wartosc  TO bdctab-fval.
  APPEND bdctab.
ENDFORM.                    "bdc_field
*&      Form  utworz_sesje
      text
FORM utworz_sesje.
  CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
      client = sy-mandt
      group  = 'WSKASTAT'
      user   = sy-uname
      keep   = 'X'.
**begin  of praveen
*if sy-subrc ne 0.
write 'hai'.
endif.
**end of praveen
ENDFORM.                    "utworz_sesje
*&      Form  zamknij_sesje
      text
FORM zamknij_sesje.
  CALL FUNCTION 'BDC_CLOSE_GROUP'.
  IF sy-subrc NE 0.
    WRITE: /, 'B&#322;ad podczas zamykania sesji'.
    EXIT.
  ENDIF.
ENDFORM.                    "zamknij_sesje

Similar Messages

  • Creation of Material using BDC Session method & global class

    Hi
    Creation of Material using BDC Session method & global class by using oops.
    can anyone plz help me out

    Hi,
    it looks like it's not possible to call this BAPI wihtout material number. Here is a quote from BAPI documentation.
    When creating material master data, you must transfer the material
    number, the material type, and the industry sector to the method. You
    must also enter a material description and its language.
    Cheers

  • Creating Sales order texts while using BDC session method is not working

    Hi All,
    I have an existing program which creates sales order using BDC session method.( Actual program uses BAPI to create sales order and in case if any error occurs during creation of sales order BDC session is generated so that user can process it later and i am facing issues in this part of code where it uses BDC)
    I wanted to modify this BDC sesion  to update the sales order text also. I tried recording VA01 for creationg sales order text unfortunatly it is not capturing the data i am entering in the text fields.
    Please suggest if there is any way to create sales order using BDC.
    Regards
    Sheeba

    Hi Madhu,
    '=TP_CREATE' is the OK code i am getting for creating TEXTS. But the text entered are not captured in BDC.
    Part of BDC program generated for cretaing sales order texts.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=%_GC 128 22'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TP_CREATE'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=%_GC 128 22'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TP_CREATE'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EBACK'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SICH'.
    Regards,
    Sheeba

  • I am posting data for va01 and va02 using BDC session,what happens if

    Hi,
    I am posting some data for va01 and va02 using BDC session,but what happens  if i try to post same data using call transaction.

    Hi,
    That is just another method. You can post the data using Call Transaction as well.
    Just give it a try and in case you face some problem revert back with your issue.
    We will help you to solve the same.
    Hope this helps!!!
    Regards,
    Lalit

  • Dynamic file name using FTP adapter

    I was trying the dynamic filename scenario taking help from Michal's blog https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2664. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    If I check the 'adapter specific properties' in both sender and receiver file adapter,then in output I am getting the output filename as same as input filename without using the UDF.
    When I used the UDF in mapping,it had absolutely no effect. I am not clear what is the use of the UDF. please let me know where to use the UDF and how to use it.
    Thanks
    Smith

    1. In the mapping program that you are using populate the filename coming from the source into the target in any of the fileds.
    2.Sender adapters can write adapter-specific attributes to the message header; these can then be evaluated at configuration time.You can get dynamic filename in UDF in msg mapping....just in ID in comm channel select adapter specific attributes -> filename.....then whatever dynamic name you will create in UDF will be the target filename.....
    3. To change the adapter-specific attributes of the message header by using message mappings, you access the <b>required classes of the mapping API by using a mapping runtime constant.</b>
    To access the classes DynamicConfiguration and DynamicConfigurationKey by using the mapping runtime constant DYNAMIC_CONFIGURATION, use the method getTransformationParameters() of the container object.
    You donot need to hard code the value of the filename in the file adapter for your interface.
    In SXMB_MONI, when you see the pipeline services you would see that the value of the filename is populated in the message payload.

  • Dynamic Column Names using Refcursors

    Hi,
    I have a stored procedure which returns a refcursor. The refcursor contains a SQL query in which the column names and number of columns vary dynamically based on the date parameters passed.
    "My objective is to return certain XYZ details of employees for a certain month range."
    For ex: For the month of Aug-2011, the column names would be '1-AUG-11' to '31-AUG-11 and for Feb-2011 '1-FEB-11' to '28-FEB-11'
    My issue is, when I execute the refcursor query using "EXEC", my column names/headings are preserved.
    FIELD NAMES: EMPLOYEE_CODE XYZ_TYPE *1-AUG-11* *2-AUG-11* ... *31-AUG-11*
    DATA: EMPCODE_Z TYPE1 VALUE_1 VALUE_1 ... VALUE_31
    Whereas when I fetch the refcursor into a collection of nested table and display, my column names are lost.
    DATA: EMPCODE_Z TYPE1 VALUE_1 VALUE_1 ... VALUE_31
    Is there a way where I can preserve the column names from the refcursor after fetching into pl/sql collections?
    Any help would be highly appreciated.
    Thank you.
    Edited by: 867622 on Nov 11, 2011 4:38 PM

    867622 wrote:
    If not dynamic SQL, how can the number of columns be altered based on the input parameters?Cannot. A dynamic SQL projection means dynamic SQL (there's an exception to this, and despite interesting is not relevant to 99.99% of problems dealing with dynamic SQL projections).
    You can however still use a dynamic projection and wrap that into a user defined type interface.
    Here's the basic approach:
    // create a user define type that will provide the wrapper for the SQL projection
    create or replace type TString as table of varchar2(4000);
    // build dynamic SQL projections via this type, e.g.
    select
      TStrings( object_id, object_name, created )
    from user_objects
    select
      TStrings( emp_id, dept_id, salary, commission )
    from employeesDespite the SQL cursors being different and the columns and number of columns being selected different, the SQL projection of both are the same. The Count method tells you the number of columns in the projection. Referencing an applicable column is simply done by using the column's sequential number in the projection.
    You also do not have to use a collection or varchar2 as the wrapper type - you can create complex user objects and use the collection type for that, as the SQL projection.
    Another alternative is converting the ref cursor into a DBMS_SQL cursor and using the latter's describe interface to dynamically determine the structure of the SQL projection and fetching the column values from it. But 11gr1 or later is needed for doing this.

  • Get/put dynamic file name using FTP

    Hi Friends,
      I am currently using FTP_Connect, FTP_command and FTP_disconnect to get/put a file from a remote server.
    But the file name was changed to add a date/time stamp.
    So the filename became dynamic (example from 'test.txt' to 'test_200512160800.txt').
    I tried using get test. but my FTP command failed. Do you know anyway of doing this?
    Thanks.

    Hi Lego,
    here's another sample for the fm:
    REPORT ztest_epsf.
    PARAMETERS: date LIKE sy-datum,
                dir  TYPE epsf-epsdirnam,
                pattern TYPE epsf-epsfilnam,
                zid   LIKE vers_dest-rfcdest.
    DATA dir_list LIKE epsfili OCCURS 0 WITH HEADER LINE.
    DATA cnt_file TYPE epsf-epsfilsiz.
    DATA err_file TYPE epsf-epsfilsiz.
    START-OF-SELECTION.
      IF date IS INITIAL.
        date = sy-datum.
      ENDIF.
    *build pattern with input-pattern and date
      CONCATENATE pattern date '*' INTO pattern.
    *search for files in foreign system
      CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
           DESTINATION                   zid
           EXPORTING
                dir_name               = dir
                file_mask              = pattern
           IMPORTING
                file_counter           = cnt_file
                error_counter          = err_file
           TABLES
                dir_list               = dir_list
           EXCEPTIONS
                invalid_eps_subdir     = 1
                sapgparam_failed       = 2
                build_directory_failed = 3
                no_authorization       = 4
                read_directory_failed  = 5
                too_many_read_errors   = 6
                empty_directory_list   = 7
                OTHERS                 = 8.
      WRITE: / pattern.
      ULINE.
      LOOP AT dir_list.
        WRITE: / dir_list-name.
      ENDLOOP.
      ULINE.
      WRITE: / cnt_file.
      WRITE: / err_file.
    pls reward points for useful hints.
    thanks and
    regards Andreas

  • Dynamic file name using reciver file adpater if no Mapping  involved

    Hi XI/PI experts,
    I am working on one scenerion where I have to poll the files from one server and send them to target FTP server with no content conversion( no Mapping involved).
    for example:
    if the source file is ABC_Invoice_item.csv
    then the target file is expected as  invoice_YYYYMMDD.csv
    Please advise how we can acchive this?
    Many Thanks in advance for your valuable inputs.
    Cheers,
    Mohan

    Hi,
          You can refer the following link for selecting additional files using a single comm channel :
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/692ab8a4b633eae10000000a1553f6/content.htm
    You can also use a Java mapping instead of adapter module to store the filename dynamically in the message header. In this case, use a data type that has just one field under it. Use the same data type for both sender and receiver.
    In your Java mapping, use the code for dynamic configuration to retrieve the sender filename, alter it and then store it in the message header again for use by the receiver adapter.
    No changes will be required in the sender comm channel. There will not be any conversion to xml format and the data will pass through as is.
    Regards

  • How to handle the errors in BDC Session method

    Hi All,
    I am uploading Material Master (MM01) records using BDC Session Method.my problem is when i am running the program, all the error records are going to flat file.how can i correcting the error records and after correction how can i re-process the error records.tell me with example.
    i have around 70,000 records in my flat file.

    Hi,
    I am attaching few threads.Hope these will help you.
    If there are any error records in session, all those error records will get poulated in log .SM35 and after the session is completed , u can see error records which can be corrected and reprocessed again
    We have the structures BDCLD and BDCLM, which will capture the log details inthe session. Firstly, sesssion should be processed. After that log will be created. Then caputure the information into an internal table using BDCLM and BDCLD.
    and refer the link.
    error correction in bdc session
    regards
    Madhu

  • Question in BDC session method.

    Hi guys,
    I am trying to upload BOM using BDC session method.
    While doing this, i have learnt the steps by heart. But i do not understrand the logic behind the steps. For example, why do we include this statement
    Data: IT-BDC like BDCDATA occurs 0 with headerline.
    What if we don't include this statement?
    Moderator message: sorry, these forums are not targeted to provide step by step guides to beginners, please search for available information, take courses, etc.
    locked by: Thomas Zloch on Sep 10, 2010 1:06 PM

    Hello Dhirendra,
    Thanks for immediate reply. I want to understand BDC method conceptually. What exactly happens by performing each step.
    I am putting up the BDC i made. I copied some of the code from here and there. It works fine but i don't understand the purpose of BDCDATA,
    call transaction 'cs01'
    and form bdc_dynpro and form bdc_field.
    I am quite new to ABAP. Please don't mind if i ask dumb questions.
    I am unable to understand how control flows through the code logic.
    report ZBDCFORCS01
           no standard page heading line-size 255.
    *include bdcrecx1.
    DATA: IT_BDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
          IT_MSGCOLL LIKE BDCMSGCOLL OCCURS 0.
    TYPES TRUXS_T_TEXT_DATA(4096) TYPE C OCCURS 0.
    DATA: I_TAB_RAW_DATA TYPE TRUXS_T_TEXT_DATA.
    DATA: BEGIN OF ITAB OCCURS 0,
          MATNR(18),
          WERKS(4),
          STLAN(1),
          IDNRK(18),
          MENGE(20),
          END OF ITAB.
    SELECTION-SCREEN: BEGIN OF BLOCK b1.
      PARAMETERS: CS01FILE TYPE RLGRAP-FILENAME.
    SELECTION-SCREEN: END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR CS01FILE.
      CALL FUNCTION 'F4_FILENAME'
       EXPORTING
         PROGRAM_NAME        = SYST-CPROG
         DYNPRO_NUMBER       = SYST-DYNNR
         FIELD_NAME          = ' '
       IMPORTING
         FILE_NAME           = CS01FILE
    start-of-selection.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
      I_FIELD_SEPERATOR          =
      I_LINE_HEADER              =
        I_TAB_RAW_DATA             = I_TAB_RAW_DATA
        I_FILENAME                 = CS01FILE
      TABLES
        I_TAB_CONVERTED_DATA       = ITAB[]
    EXCEPTIONS
       CONVERSION_FAILED          = 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.
    *perform open_group.
    LOOP AT ITAB.
    perform bdc_dynpro      using 'SAPLCSDI' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29N-STLAN'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RC29N-MATNR'
                                 '1400-500'.
    itab-matnr.
    perform bdc_field       using 'RC29N-WERKS'
                                 '1000'.
    itab-werks.
    perform bdc_field       using 'RC29N-STLAN'
                                 '1'.
    itab-stlan.
    perform bdc_field       using 'RC29N-DATUV'
                                  '10.09.2010'.
    perform bdc_dynpro      using 'SAPLCSDI' '0110'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RC29K-BMENG'
                                  '1'.
    perform bdc_field       using 'RC29K-STLST'
                                  '1'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29K-EXSTL'.
    perform bdc_dynpro      using 'SAPLCSDI' '0111'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29K-LABOR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPLCSDI' '0140'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29P-MENGE(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RC29P-IDNRK(01)'
                                 '1300-320'.
    ITAB-IDNRK.
    perform bdc_field       using 'RC29P-IDNRK(02)'
                                 '1300-312'.
    ITAB-IDNRK.
    perform bdc_field       using 'RC29P-MENGE(01)'
                                 '2'.
    ITAB-MENGE.
    perform bdc_field       using 'RC29P-MENGE(02)'
                                 '2'.
    ITAB-MENGE.
    perform bdc_dynpro      using 'SAPLCSDI' '0130'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29P-POSNR'.
    perform bdc_field       using 'RC29P-POSNR'
                                  '0010'.
    perform bdc_field       using 'RC29P-IDNRK'
                                  '1300-320'.
    perform bdc_field       using 'RC29P-MENGE'
                                  '2'.
    perform bdc_field       using 'RC29P-MEINS'
                                  'PC'.
    perform bdc_dynpro      using 'SAPLCSDI' '0131'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29P-POTX1'.
    perform bdc_field       using 'RC29P-SANKA'
                                  'X'.
    perform bdc_dynpro      using 'SAPLCSDI' '0130'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29P-POSNR'.
    perform bdc_field       using 'RC29P-POSNR'
                                  '0020'.
    perform bdc_field       using 'RC29P-IDNRK'
                                  '1300-312'.
    perform bdc_field       using 'RC29P-MENGE'
                                  '2'.
    perform bdc_field       using 'RC29P-MEINS'
                                  'PC'.
    perform bdc_dynpro      using 'SAPLCSDI' '0131'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29P-POTX1'.
    perform bdc_field       using 'RC29P-SANKA'
                                  'X'.
    perform bdc_dynpro      using 'SAPLCSDI' '0140'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29P-POSNR(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPLCSDI' '0140'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29P-POSNR(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=FCBU'.
    perform bdc_transaction using 'CS01'.
    *perform close_group.
    CALL TRANSACTION 'CS01' USING IT_BDC
                MODE 'A'
                UPDATE 'S'
                MESSAGES INTO IT_MSGCOLL.
    REFRESH IT_BDC.           
    ENDLOOP.
    FORM BDC_DYNPRO USING PROGRAM_DYNPRO.
      CLEAR IT_BDC.
      BDCDATA-PROGRAM = PROGRAM.
      BDCDATA-DYNPRO = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND IT_BDC.
    ENDFORM.
    FORM BDC_FIELD USING FNAM FVAL.
      CLEAR BDCDATA.
      BDCDATA-FNAM = FNAM.
      BDCDATA-FVAL = FVAL.
      APPEND BDCDATA.
    ENDFORM.
    Edited by: Yayati6260 on Sep 10, 2010 12:29 PM

  • Please Help using BAPI_TRANSACTION_COMMIT in BDC session

    Hi,
      I am using custom transaction to create vendor invoices by using function module BAPI_INCOMINGINVOICE_CREATE and it creates the invoice and go to BAPI_TRANSACTION_COMMIT to commit the database updates. 
    The problem is when i am creating the invoice for multiple PO's using BDC session method this program executes only of one PO's and commits created invoice data and comes out of the program with out continuing to further steps after BAPI_TRANSACTION_COMMIT FM execution. Please advise me how to resolve this.
    Regards,
    Challa

    Hello Challa
    The command
    CALL TRANSACTION USING...
    has to optional addition
    OPTIONS FROM ls_options.
    where ls_options is of type CTU_PARAMS.
    In the documentation of CALL TRANSACTION is says that if RACOMMIT = 'X' then CALL TRANSACTION USING... is not completed by COMMIT.
    I guess the commit work does prematurely finish your BDC session if this option is initial.
    Regards
       Uwe

  • BDC session's program name

    Can anybody tell me the way so that i can find out which program has created the BDC session? I looked into APQI table but the PROGID field is blank. Is there any other way to find out the Program's name of BDC session?

    I am able to see here. I do not understand why you are not able to see that.
    Ok, try this, In the list of sessions displayed -> <b>double click the session</b> that an error (i.e. <b>Transaction Ended with errors).</b>
    Then it will take you to another screen, here you choose the <b>Screens tab</b>.
    You can find the program name here.
    Regards
    Kathirvel

  • Program To Update BDC Session Status in SM35

    Existing Process : Currently we create orders using a function module which internally uses BDC Session method for transaction VA01. If the session ran successfully then we check the status and use SAVE_TEXT to upload the long text for the order. But in some cases the order fails. Then the session will be errored out in SM35 and user runs the session manually and fixes the problem and post order. So the text cannot be uploaded now as the user ran the session manually. So I wrote a Z program to run the session using program RSBDCCTU which the runs the session in forground and get the text from memory which I exported to memory while initial transaction and upload it using SAVE_TEXT after the session ran successfully. This program works fine.
    Problem : After running my Z program the order is posted and text is uploaded but the session is still in error status in SM35. The standard program RSBDCCTU just runs the session in foreground but does not update the status.
    Is there any other way we can do this or any other standard programs available to update the status of the session.
    Any help will be appreciated.

    How are you importing text in the z program, which is exported in the function module? they are totally unrelated internal sessions.
    You can as well import text and use SAVE_TEXT using user exit USEREXIT_SAVE_DOCUMENT_PREPARE in include MV45AFZZ after executing the error session in SM35, you don't need a Z program.
    Use condition SY-BINPT = 'X' and  T180-TRTYP = 'H' in the user exit to process SAVE_TEXT.
    Regards
    Sridhar

  • BDC Session In Dynpro

    Hi,
               Is it possible to use BDC session to update data for TC : PA40 using webdynpro application . ...If so could you provide some example how to achive this ...
    Thanks,
    Kumar

    Hi,
    You can create a FM/BAPI for the BDC related stuff and then call these from your web dynpro application.
    Thanks,
    Abhishek

  • Mutiple transcation update using bdc

    Dear Gurus
    I have two questions .
    1. Can we update two transaction code using CALL TRANSACTION method in BDC?
    through searching in the forum i found that it not possible to update multiple transaction using CALL TRANSACTION method to update two t code simultaneously i have to use BDC session method , because CALL TRANSACTION method uses Asynchronous method for update data.
    2.Suppose I am updating  multiple transaction code using session method at first i create sales order using va01 when sales order is created  how i collect  this sales order no to use in the second t code in session method.
    Thanks in advance.
    Chitta Ranjan

    mahato123 wrote:
    through searching in the forum i found that it not possible to update multiple transaction using CALL TRANSACTION method to update two t code simultaneously i have to use BDC session method , because CALL TRANSACTION method uses Asynchronous method for update data.
    Don't know where you got this, but it's definitely possible to update using multiple transactions sequentially.
    Rob

Maybe you are looking for

  • WiFi not working with 2G iPod Touch (2.1.1)

    I just sold my 1st gen iPod touch on craigslist and got 2nd Gen. What a disappointment so far. It will not connect to my WiFi router using WPA/WPA2 encryption. I searched forums and found other people here having same issues. Someone suggested to do

  • Conditions are not getting calculated based on actual Base Quantity

    Hi Frineds, I have configure a new order type ZRE1 for credit return. While creating this credit return with the reference of actual Billing document, system is picking all conditions as mentained in actual Invoice. But while changing quantity in ZRE

  • Use of classes in com.sun.tools.doclets

    Hello -- What is the best practice recommendation wrt using the classes in com.sun.tools.doclets -- particularly with the planned refactoring? I'm writing a doclet that doesn't subclass, say, the standard doclet. There are obviously several very usef

  • Picture problem with developer 6i

    Hi all I am using BLOB data type for storing a picture in oralce 9i database server. I have image type item on my forms (Developer 6i). I am using following code to add picture to my image item. READ_IMAGE_FILE('mypicture.bmp','bmp','CAMPUS_PICTURE.P

  • Can anybody please tell me what this it means?

    i was using my computer mac mini late 2009 normally and suddenly an error crashed my computer. here is a report i have no idea what to do and if its dangerous or not. please help. Anonymous UUID:   345C6545-03B0-0B39-3470-16342F8E1AD5 Thu Apr 23 15:1