URGENT - HOW TO PROCESS A BDC SESSION (IN BACKGROUND) FROM INSIDE A REPORT

Hi All,
I have a requirement wherein I need to create a BDC session for mass update(from file) of one transaction and check if at all that update has taken place and proceed with the same session for another transaction.
For this I need to know how to process the session in background in a report, so that if the processing is done, the next set of data to update a different transaction can happen.
All inputs are welcome and highly valuable to me.
If someone is unable to intrepret this, I'll detail it again.
Thanks in advance,
Vaishnavi Varadarajan

Hi,
1.Use RSBDCDRU is an exe pg.With this u can download the logs into local file.
2.It will create the spool request .from there u can download or print.
OtherWise:
Use the code from the link below. U need to provide the session queue id as input and it will download the log to an excel file. U can change it to  ur reqmt.
Re: BDC
regards
kiran

Similar Messages

  • LSMW-Error during processing of BDC session change to material master MM02

    I have created an LSMW for changing material master data.  I recorded MM02 and using the "select views" screen selected the accounting 2 view and entered the information in the fields on that screen requiring changes.  I've set up all of the technical screens for the LSMW.  However, when I process the BDC session with "display errors only", the program stops at the select view screen with an error message "Select at least one view".  Any ideas how I can process through this screen so that the Accounting 2 screen opens in the BDC session?  One further note, I set that selection as a constant in the field mapping and conversion rules screen.  The field name recorded as KZSEL_05.

    hi
    one question how did you choose the view? i mean to ask by scrolling down using mouse or page down.
    the scrolling by mouse is not recognized by recording and that may be the error. so whenever you have to go down in screen please use page down not scrolling at least in LSMW.

  • How to process data in the past based from data in the present

    hello guys,
    i have a problem in my labview programs. how to process data in the past based from data in the present ?
    i have a formula self-organizing maps
    this formula is looking for D1, D1 is neuron index that will be searched for the smallest value.and the result are D1=2 ,D2=5, D3=17 from calculating with formula  .it means the smallest value is 2, "2" from weight [2 2] in file attached.
    and then it will be in other formula
    it mean [2 2] + 0.5 ( [1 1]-[2 2] ) = [1.5 1.5]
    and the weight will be  [1.5 2 2 ] in matrix
                                              1.5 3 5
    I would appreciate any input/help on solving this
    thanks
    Attachments:
    dika.vi ‏16 KB
    weight.txt ‏1 KB
    data .txt ‏1 KB

    Hi Ronny Hanks,
    Moving your records from internal table into the database table depends upon various scenarios :-
    1. If you use INSERT statement.
    INSERT <database_table> FROM TABLE <internal_table>.
    But in this case, you need to make sure that you don't have any duplicate entries in your internal table that violates data entry into database table, else you will get a dump.
    INSERT <database_table> FROM TABLE <internal_table> ACCEPTING DUPLICATE KEYS.
    In this case, you are forcefully inserting duplicate records into your database table which may lead to data redundancy in your database table.
    2. If you use UPDATE statement.
    UPDATE <database_table> FROM TABLE <internal_table>.
    This will update the existing records in your database table from the internal table.
    3. If you use MODIFY statement.
    MODIFY <database_table> FROM TABLE <internal_table>.
    This statement works both in combination of INSERT & UPDATE statements.
    Existing records (in database table) will be eventually updated/modified and new records (not in database table currently) will be successfully inserted into the database table.
    Hope this solves your problem.
    Thanks & Regards.
    Tarun Gambhir.

  • How to extract a folder (and its contents) from inside a zip file?

    There is a zip file which contains a folder inside it. The folder itself contains a few files. I would need to know how to extract the folder (with its contents) from inside a zip file.
    I have found a few unzipping code samples which show how to handle a folder inside a zip file. An example is shown below:
    public static void extract(String workingDirectory, byte[] zipFile)
    throws Exception {
    ByteArrayInputStream byteStream = new ByteArrayInputStream(zipFile);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    ZipInputStream zipStream = new ZipInputStream(byteStream);
    ZipEntry zipEntry = null;
    String nameZipEntry = null;
    byte[] contentZiphttp://forum.java.sun.com/post!default.jspa?forumID=31#
    Click for code tagsEntry = null;
    boolean isDirectory = false;
    int indexFileSeparator = -1;
    String directory = null;
    String fileName =  null;
    while ( (zipEntry = zipStream.getNextEntry()) != null )
                nameZipEntry = workingDirectory + File.separator + zipEntry.getName();
                isDirectory = zipEntry.isDirectory();
                if (isDirectory) {
    File file = new File(nameZipEntry);
    file.mkdirs();
                else
                    // read zipEntry
                    byte[] buf = new byte[1024];
                    int c = 0;
                    while ( (c = zipStream.read(buf)) != -1)
                        out.write(buf, 0, c);
                    indexFileSeparator = nameZipEntry.lastIndexOf(File.separator);
                    directory = nameZipEntry.substring(0, indexFileSeparator);
                    fileName =  nameZipEntry.substring(indexFileSeparator+1,nameZipEntry.length());
                    FileSystemTools.createFile(directory, fileName, out);
                    out.reset();
                    zipStream.closeEntry();
            zipStream.close();
            byteStream.close();
    }The code sample which deals with the part where the zipEntry is a directory creates a directory with the same path and name. (highlighted in bold)
    Another similar variation is:
    File file = new File(dirDestiny.getAbsolutePath() + File.separator + zipEntry.getName() );
    if(zipEntry.isDirectory())
          file.mkdirs();When the code creates a directory for the folder, does it unzip the contents inside the folder as well?
    If not, how do I extract the files inside the folder?

    Have you already tried to see if the sample code you downloaded works or not? Maybe if you try out the code yourself you can see if it extracts files from a directory within a zip file?
    I like to use pkzip. It is a command line compression/uncompression tool that can be used from a batch file. If you assignment involves unzipping large amount of zip files on a regular basis, I recommend taking a look at pkzip.

  • How to process batch input session through program

    Hi Friends,
    I am getting 5 batch input sessions in SM35,but  I want to process these all sessions through program without going to SM35.
    How it is possible through Program?
    Please Guide me!
    Thanks,
    Yogesh

    Hi,
    It's the report to run the batchinput sessions.
    When you create to B.I. session, you can execute it by transaction SM35 (but it uses rsbdcsub) or rsbdcsub.
    For example you can use it in the same program where you create B.I.:
    Here the code to fill the structures of FI batch input
    standard....
    ...here it creates session...
    SUBMIT RFBIBL00 WITH DS_NAME = VA_FILE
    WITH CALLMODE = CALLMODE AND RETURN.
    ....here it runs session....
    SUBMIT RSBDCSUB WITH MAPPE = P_NAME
    WITH VON = SY-DATUM
    WITH BIS = SY-DATUM
    WITH FEHLER = ' '
    TO SAP-SPOOL
    LIST NAME P_NAME
    LIST DATASET P_NAME
    COVER TEXT P_NAME
    NEW LIST IDENTIFICATION ' '
    EXPORTING LIST TO MEMORY
    AND RETURN.
    regards,
    Shiva.

  • How to Process "Being Created" Sessions

    Dear Experts,
    Program created sessions are tagged to be "Being Created". Can any one of you explain me how to process these sessions through a program again.?
    It would be of great help and useful answers are rewarded.
    Best Regards,
    Arunkumar S

    After BDC_CLOSE_GROUP use rsbdcsub to run the session.
    ex:
    DATA: l_abap_list       TYPE abaplist OCCURS 0 WITH HEADER LINE,
    l_ascii_list(200) TYPE c        OCCURS 0 WITH HEADER LINE.
    SUBMIT rsbdcsub AND RETURN EXPORTING LIST TO MEMORY
                         WITH mappe = c_bdcname  "Session name
                         WITH z_verarb = 'X'
                         WITH fehler = ' '.
      COMMIT WORK AND WAIT.
    Retrieve the output from memory and place into l_abap_list
      CLEAR l_abap_list.
      FREE  l_abap_list.
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          listobject = l_abap_list
        EXCEPTIONS
          not_found  = 1
          OTHERS     = 2.
      IF sy-subrc EQ 0.
        CLEAR l_ascii_list.
        FREE  l_ascii_list.
        CALL FUNCTION 'LIST_TO_ASCI'
          EXPORTING
            list_index         = -1
          TABLES
            listasci           = l_ascii_list
            listobject         = l_abap_list
          EXCEPTIONS
            empty_list         = 1
            list_index_invalid = 2
            OTHERS             = 3.
        IF sy-subrc NE 0.
    'Unable to convert list from rsbdcsub to ascii'
          MESSAGE w368 WITH text-010.
        ENDIF.
      ENDIF.

  • Process bdc session in Background

    Hi all,
    I have created a BDC Session, Now i want to process it in Foreground not in Background.
    I know taht we use report RSBDCSUB for background processing but don't know the procedure for Forground.
    Sugess.
    Points will be sured for valuable answers.
    Thanks
    Sanket sethi

    hi,
    if you want it to be done by program then try this which is done through program
    TABLES: LFA1,
            RF02K.
    TYPES: BEGIN OF TY_ITAB,
            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 TY_ITAB.
    DATA: T_ITAB TYPE TABLE OF TY_ITAB,
           W_ITAB TYPE TY_ITAB.
    DATA: I_BDCDATA TYPE TABLE OF BDCDATA,
           WA_BDCDATA TYPE BDCDATA.
    DATA : ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    DATA : JOBNAME(32) TYPE C,
            JOBCOUNT(8) TYPE C.
    DATA: R1 TYPE I VALUE 1,
           C1 TYPE I VALUE 1,
           R2 TYPE I VALUE 4,
           C2 TYPE I VALUE 8,
           FILEPATH LIKE RLGRAP-FILENAME.
    SELECTION-SCREEN: BEGIN OF BLOCK B1.
    PARAMETERS:P_SRCFIL LIKE RLGRAP-FILENAME.
    SELECTION-SCREEN: END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SRCFIL.
    PERFORM SELECT_FILE USING P_SRCFIL.
    START-OF-SELECTION.
    FILEPATH = P_SRCFIL.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
       EXPORTING
         FILENAME                      = FILEPATH
         I_BEGIN_COL                   = 1
         I_BEGIN_ROW                   = 1
         I_END_COL                     = 8
         I_END_ROW                     = 4
       TABLES
         INTERN                        = ITAB1.
    PERFORM ORGANIZE_UPLOADED_DATA.
    CALL FUNCTION 'BDC_OPEN_GROUP'
      EXPORTING
        CLIENT                    = SY-MANDT
       DEST                      = FILLER8
        GROUP                      = 'XK01'
       HOLDDATE                  = FILLER8
        KEEP                       = 'X'
        USER                       = SY-UNAME.
    LOOP AT T_ITAB INTO W_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'
    W_ITAB-LIFNR.
    PERFORM BDC_FIELD USING 'RF02K-KTOKK'
    W_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'
    W_ITAB-NAME1.
    PERFORM BDC_FIELD USING 'LFA1-SORTL'
    W_ITAB-SORTL.
    PERFORM BDC_FIELD USING 'LFA1-LAND1'
    W_ITAB-LAND1.
    PERFORM BDC_FIELD USING 'LFA1-SPRAS'
    W_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 'SAPMF02K' '0380'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR' 'KNVK-NAMEV(01)'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE' '=ENTR'.
    CLEAR W_ITAB.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
       TCODE                   = 'XK01'
      TABLES
        DYNPROTAB              = I_BDCDATA.
      REFRESH I_BDCDATA.
    ENDLOOP.
    CALL FUNCTION 'BDC_CLOSE_GROUP' .
    JOBNAME = 'JOB'.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
      DELANFREP              = ' '
      JOBGROUP               = ' '
          JOBNAME                = JOBNAME
    IMPORTING
       JOBCOUNT               = JOBCOUNT
    CHANGING
      RET                    =
    EXCEPTIONS
      CANT_CREATE_JOB        = 1
      INVALID_JOB_DATA       = 2
      JOBNAME_MISSING        = 3
      OTHERS                 = 4
      IF SY-SUBRC = 0.
       MESSAGE I000(0)      WITH 'SUCCESSFUL JOB OPENING'.
    SUBMIT RSBDCSUB
    WITH MAPPE = 'XK01'
    WITH VON = SY-DATUM
    *WITH Z_VERARB = 'X'
    WITH ERR = 'X'
    WITH LOGALL = 'X'
    AND RETURN EXPORTING LIST TO MEMORY.
    ENDIF.
    CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          JOBCOUNT                          = JOBCOUNT
          JOBNAME                           = JOBNAME
    EXCEPTIONS
       CANT_START_IMMEDIATE              = 1
       INVALID_STARTDATE                 = 2
       JOBNAME_MISSING                   = 3
       JOB_CLOSE_FAILED                  = 4
       JOB_NOSTEPS                       = 5
       JOB_NOTEX                         = 6
       LOCK_FAILED                       = 7
       INVALID_TARGET                    = 8
       OTHERS                            = 9
      IF SY-SUBRC <> 0.
       MESSAGE I000(0)   WITH 'JOBCLOSE'.
    ENDIF.
    *&      Form  ORGANIZE_UPLOADED_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM ORGANIZE_UPLOADED_DATA .
    SORT ITAB1 BY ROW COL.
    LOOP AT ITAB1.
    CASE ITAB1-COL.
    WHEN 1.
    W_ITAB-LIFNR = ITAB1-VALUE.
    WHEN 2.
    W_ITAB-KTOKK = ITAB1-VALUE.
    WHEN 3.
    W_ITAB-NAME1 = ITAB1-VALUE.
    WHEN 4.
    W_ITAB-SORTL = ITAB1-VALUE.
    WHEN 5.
    W_ITAB-LAND1 = ITAB1-VALUE.
    WHEN 6.
    W_ITAB-SPRAS = ITAB1-VALUE.
    ENDCASE.
    AT END OF ROW.
    APPEND W_ITAB TO T_ITAB.
    CLEAR W_ITAB.
    ENDAT.
    ENDLOOP.
    ENDFORM.                    " ORGANIZE_UPLOADED_DATA
    *&      Form  select_file
          text
         -->P_P_SRCFIL  text
    FORM SELECT_FILE  USING    P_SRCFIL.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = SYST-CPROG
       DYNPRO_NUMBER       = SYST-DYNNR
       FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = P_SRCFIL
    ENDFORM.                    " select_file
    *&      Form  bdc_dynpro
          text
         -->P_0131   text
         -->P_0132   text
    FORM BDC_DYNPRO  USING   PROGRAM LIKE BDCDATA-PROGRAM DYNPRO LIKE BDCDATA-DYNPRO.
      CLEAR WA_BDCDATA.
      WA_BDCDATA-PROGRAM  = PROGRAM.
      WA_BDCDATA-DYNPRO   = DYNPRO.
      WA_BDCDATA-DYNBEGIN = 'X'.
      APPEND WA_BDCDATA TO I_BDCDATA.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
          text
         -->P_0136   text
         -->P_0137   text
    FORM BDC_FIELD  USING    FNAM LIKE BDCDATA-FNAM  FVAL TYPE ANY  .
        CLEAR WA_BDCDATA.
        WA_BDCDATA-FNAM = FNAM.
        WA_BDCDATA-FVAL = FVAL.
        APPEND WA_BDCDATA TO I_BDCDATA.
    ENDFORM.                    " bdc_field
    reward if useful,
    thanks and regards

  • Urgent: how to use cookies or session in javafx

    Hi....
    i am new to javafx and need help to learn how to use cookies and session in javafx.i want to create a simple website using javafx.....
    Urgent reply is requested
    mufaddal

    Please correct me if I'm wrong: I think LiveConnect is not supported on IE, and Mozilla has plans to discontinue it.
    Didn't an earlier version of JavaFX allow access to the Applet instance, including the AppletContext? Seems to me, just generally, that JavaFX applets are hobbled unless they have that functionality available. Cookies are one example. Also applet parameters, hyperlinks, and the browser status display.
    Especially hyperlinks.

  • Updating a DB table by a BDC session in background

    Hi,
    I need to  update a DB table with records using a BDC session. I need to run this session in background. But the Error Log I'm getting suggests that Table Maintenance is required for the same.
    Note that I can very well insert records in this table thru se11 and also by running the session in foreground.
    Is there any work-around for this issue?
    Thanks.

    Hi
    If at all you are using any DOWNLOAD and UPLOAD related function modules you can't run the BDC program in the background.
    If it is a Z table update you can create the table maintenance generator.
    other wise you can do it.
    You can run session in background.
    Reward points if useful
    Regards
    Anji

  • How to processing of bdc in the middle

    i have 30,000 records i have updated some 10,000 records now i want to stop complete bdc process how can i do that? please provide me the answer.

    Hi Kudala,
    If you are executing in Forground then
    ->right click on the SAP session ->STOP TRANSACTION
    If Executing in background ->
    Cancel/ Delete the Session in SM35.
    Hope this helps.
    Manish

  • Immediate Processing of BDC Session

    Hi ,
    In my Invoice Ouput Program ( RLB_INVOICE ), i m trying to call a transaction via BDC. The program is triggered at the point of saving VF01. But i think it does not allow us to Call a Transaction from within that program,so it throws up an 'Express Message'( ie, the program is terminated). i think Session method will work here but the problem is , i want that session to get processed immediately(in background).  How can i achieve this??
    ur valuable inputs awaited.
    Thanks & Regards,
    Bikash

    Thanks Srinivas, u ve made me feel a little comfortable now... u ve got my problem. i removed the SUBMIT in my program and found out that:
    1. when i execute the report independently, a NEW session gets generated in SM35...no problem..
    2. when i execute using VF01, i see that a session <b>IS</b> Generated, BUT NOT IN NEW CATEGORY, its in BEING CREATED column, and thats the reason the session doesnt process even when i run RSBDCSUB after that. dats the problem i suppose...
    This is the code in the output program :
         Print of a invoice by SAPscript SMART FORMS               *
    REPORT rlb_invoice.
    declaration of data
    INCLUDE rlb_invoice_data_declare.
    definition of forms
    INCLUDE rlb_invoice_form01.
    INCLUDE rlb_print_forms.
    *C-----BDC for reversal
    INCLUDE <b>zbdcrecx2</b>.  " only session method
          FORM ENTRY
    FORM entry USING return_code us_screen.
      TABLES: bkpf,vbrk.
      DATA: lf_retcode TYPE sy-subrc.
      CLEAR retcode.
      xscreen = us_screen.
      PERFORM processing USING us_screen
                         CHANGING lf_retcode.
    IF lf_retcode NE 0.
       return_code = 1.
    ELSE.
      return_code = 0.
    ENDIF.
    ENDFORM.                    "ENTRY
          FORM PROCESSING                                               *
    FORM processing USING proc_screen
                    CHANGING cf_retcode.
      DATA: ls_print_data_to_read TYPE lbbil_print_data_to_read.
      DATA: ls_bil_invoice TYPE lbbil_invoice.
      DATA: lf_fm_name            TYPE rs38l_fnam.
      DATA: ls_control_param      TYPE ssfctrlop.
      DATA: ls_composer_param     TYPE ssfcompop.
      DATA: ls_recipient          TYPE swotobjid.
      DATA: ls_sender             TYPE swotobjid.
      DATA: lf_formname           TYPE tdsfname.
      DATA: ls_addr_key           LIKE addr_key.
      DATA: ls_dlv-land           LIKE vbrk-land1.
      DATA: ls_job_info           TYPE ssfcrescl.
    C**BDC for F-02 ( Reversal of line items of accounting document)
      DATA : t_bseg TYPE TABLE OF bseg WITH HEADER LINE.
      TYPES: BEGIN OF tp_reverse,
             wrbtr_01 LIKE bseg-wrbtr,
             wrbtr_40 LIKE bseg-wrbtr,
             wrbtr_50 LIKE bseg-wrbtr,
             bschl_01(2),
             bschl_40(2),
             bschl_50(2),
             hkont_01(10),
             hkont_40(10),
             hkont_50(10),
             prctr_40(10),
             prctr_50(10),
             END OF tp_reverse.
      DATA : t_reverse TYPE tp_reverse.
      DATA : g_wrbtr_01(15),
             g_wrbtr_40(15),
             g_wrbtr_50(15),
             g_date(8),
             g_vbeln(10),
             g_belnr(10).
    SmartForm from customizing table TNAPR
      lf_formname = tnapr-sform.
    determine print data
      PERFORM set_print_data_to_read USING    lf_formname
                                     CHANGING ls_print_data_to_read
                                     cf_retcode.
      IF cf_retcode = 0.
    select print data
        PERFORM get_data USING    ls_print_data_to_read
                         CHANGING ls_addr_key
                                  ls_dlv-land
                                  ls_bil_invoice
                                  cf_retcode.
      ENDIF.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = ls_bil_invoice-hd_gen-bil_number
        IMPORTING
          output = g_vbeln.    "billing document number
    C*billing document no. used to pick up the accounting doc no.
      SELECT SINGLE belnr INTO g_belnr FROM bseg WHERE vbeln = g_vbeln.
      SELECT * FROM bseg INTO TABLE t_bseg
      WHERE belnr = '0000800643'.
      CLEAR t_reverse.
        LOOP AT t_bseg WHERE ( ( bschl = '01' ) OR
      ( bschl = '40' AND hkont = '0000542001' ) OR
      ( bschl = '50' AND hkont = '0000700000' ) ).
    LOOP AT t_bseg WHERE ( ( bschl = '01' ) OR
    ( bschl = '40' AND hkont = '0000542040' ) OR
    ( bschl = '50' AND hkont = '0000720080' ) ).
        CASE t_bseg-bschl.
          WHEN '01'.
            t_reverse-wrbtr_01 = t_reverse-wrbtr_01 + t_bseg-wrbtr.
            t_reverse-bschl_01 = '11'.
            t_reverse-hkont_01 = t_bseg-kunnr.
          WHEN '40'.
            t_reverse-wrbtr_40 = t_reverse-wrbtr_40 + t_bseg-wrbtr.
            t_reverse-bschl_40 = '50'.
            t_reverse-hkont_40 = t_bseg-hkont.
            t_reverse-prctr_50 = t_bseg-prctr.
          WHEN '50'.
            t_reverse-wrbtr_50 = t_reverse-wrbtr_50 + t_bseg-wrbtr.
            t_reverse-bschl_50 = '40'.
            t_reverse-hkont_50 = t_bseg-hkont.
            t_reverse-prctr_40 = t_bseg-prctr.
        ENDCASE.
      ENDLOOP.
      g_wrbtr_01 = t_reverse-wrbtr_01.
      g_wrbtr_40 = t_reverse-wrbtr_40.
      g_wrbtr_50 = t_reverse-wrbtr_50.
      g_date(2) = sy-datum+6(2).
      g_date2(2) = sy-datum4(2).
      g_date+4(4) = sy-datum(4).
      CONDENSE: g_wrbtr_01,g_wrbtr_40,g_wrbtr_50.
      PERFORM open_group.
      PERFORM bdc_dynpro      USING 'SAPMF05A' '0100'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'RF05A-NEWKO'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM bdc_field       USING 'BKPF-BLDAT'
                                    g_date.
      PERFORM bdc_field       USING 'BKPF-BUKRS'
                                    '1000'.
      PERFORM bdc_field       USING 'BKPF-BUDAT'
                                    g_date.
      PERFORM bdc_field       USING 'BKPF-WAERS'
                                    'INR'.
      PERFORM bdc_field       USING 'BKPF-BKTXT'
                                    'AMC REVERSAL'.
      PERFORM bdc_field       USING 'RF05A-NEWBS'
                                    t_reverse-bschl_01.
      PERFORM bdc_field       USING 'RF05A-NEWKO'
                                    t_reverse-hkont_01.
      PERFORM bdc_dynpro      USING 'SAPMF05A' '0301'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'BSEG-SGTXT'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM bdc_field       USING 'BSEG-WRBTR'
                                    g_wrbtr_01.
      PERFORM bdc_field       USING 'RF05A-NEWBS'
                                    t_reverse-bschl_40.
      PERFORM bdc_field       USING 'RF05A-NEWKO'
                                    t_reverse-hkont_40.
      PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'BSEG-SGTXT'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM bdc_field       USING 'BSEG-WRBTR'
                                    g_wrbtr_40.
      PERFORM bdc_field       USING 'RF05A-NEWBS'
                                   t_reverse-bschl_50.
      PERFORM bdc_field       USING 'RF05A-NEWKO'
                                   t_reverse-hkont_50.
      PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'COBL-PRCTR'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=ENTE'.
      PERFORM bdc_field       USING 'COBL-PRCTR'
                                     t_reverse-prctr_40.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=ENTE'.
      PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'RF05A-NEWKO'.
      PERFORM bdc_field       USING 'BSEG-WRBTR'
                                    g_wrbtr_50.
      PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'COBL-PRCTR'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=ENTE'.
      PERFORM bdc_field       USING 'COBL-PRCTR'
                                     t_reverse-prctr_50.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=ENTE'.
      PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'RF05A-NEWKO'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=BU'.
      PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'COBL-PRCTR'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=ENTE'.
      PERFORM bdc_field       USING 'COBL-PRCTR'
                                     t_reverse-prctr_50.
      PERFORM bdc_transaction USING 'F-02'.
    C*running the Session Immediately using variant AMC
    SUBMIT rsbdcsub USING SELECTION-SET 'AMC'.
    ENDFORM.                    "PROCESSING
    MY INCLUDE :
    ***INCLUDE ZBDCRECX2.
    for programs doing a data transfer by creating a batch-input session
    and
    for programs doing a data transfer by CALL TRANSACTION USING
      data definition
          Batchinputdata of single transaction
    DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.
          messages of call transaction
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
          error session opened (' ' or 'X')
    DATA:   E_GROUP_OPENED.
          message texts
    TABLES: T100.
      open dataset                                                       *
    FORM OPEN_DATASET USING P_DATASET.
      OPEN DATASET P_DATASET
                   FOR INPUT IN TEXT MODE
                   ENCODING DEFAULT.
      IF SY-SUBRC <> 0.
        WRITE: / TEXT-E00, SY-SUBRC.
        STOP.
      ENDIF.
    ENDFORM.
      close dataset                                                      *
    FORM CLOSE_DATASET USING P_DATASET.
      CLOSE DATASET P_DATASET.
    ENDFORM.
      create batchinput session                                          *
      (not for call transaction using...)                                *
    FORM OPEN_GROUP.
        CALL FUNCTION 'BDC_OPEN_GROUP'
             EXPORTING  CLIENT   = SY-MANDT
                        GROUP    = 'AMC_REVERSAL'
                        USER     = sy-uname.
    ENDFORM.
      end batchinput session                                             *
      (call transaction using...: error session)                         *
    FORM CLOSE_GROUP.
        CALL FUNCTION 'BDC_CLOSE_GROUP'.
    ENDFORM.
           Start new transaction according to parameters                 *
    FORM BDC_TRANSACTION USING TCODE.
      DATA: L_MSTRING(480).
      DATA: L_SUBRC LIKE SY-SUBRC.
        CALL FUNCTION 'BDC_INSERT'
             EXPORTING TCODE     = TCODE
             TABLES    DYNPROTAB = BDCDATA.
      REFRESH BDCDATA.
    ENDFORM.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> '/'.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.

  • Warning while processing the BDC session for ME11 - create info records

    Hi,
    I have succesfully created a BDC recording(SHDB) for ME11 transaction. but when I am trying to process the session(SM35) with file having correct data, I an getting a warning message" Please check Unit of measure and conversion factor" eventhogh correct values are being populated in the respective fields. Status of the run is shown as INCORRECT.
        Any pointers on avoiding this warning message would be appreciated.
    PS: I have tried putting an extra OK CODE with enter button, dint work.

    ...try to use transaction SXDA_TOOLS and Object type: BUS3003
    Here you will find the standard batch-input program RM06IBI0

  • BDC Session in background

    Hi...
    I write a BDC Program using Session method.
    Now the requirement is , it should be run every 1 hour in background..
    Can U Please tell me the procedure to do this background process.
    Thanks in advance
    Ganesh Reddy

    Hello,
    Search in sap formus you will find the options
    https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=bdcSessioninbackground+&adv=false&sortby=cm_rnd_rankvalue

  • Urgent: How to change GL acc thats in production from P&L to BS

    Hi Gurus
    We have a G/L accounts xxxxxxxx in Production, which has to be changed from P&L to a Bal Sheet as soon as possible.
    Initially there were some postings on the accounts.  So we reversed the docs and the account balances are now zero. The system still not allowing us to change the account from a P&L to BS.
    Its very urgent. Plz help

    Hi Suresh,
    The error I am getting is
    Change to balance sheet control in spite of postings
    The data contains error, you cannot save.
    Please suggest. Can I email you?
    Thanks
    Edited by: prince light on Apr 2, 2008 7:55 PM

  • Urgent:How can to control passing inputs to BAPI from different sources

    Hi all,
    I'm stuck up with an issue.
    I'm passing a user entered input to a webservice checking for status of that particular record.
    If status is "yes", I just call a form.
    I have used the visibility control for displaying the form
    If Status is "no" I call a BAPI passing the output of webservice(this is same as the user entered input).
    I'm using guard condition in this case.
    If there is no such record present, I'll have to call the same BAPI passing the user input.
    In this case the webservice does not return any output...And the BAPI has to look the input form for the input.
    I dont know how I can make the BAPI look the input form for input in case no record is present.
    Can some one help me in this case?
    Thanks,
    Ajitha

    store the value from input into a datastore while you are getting the status, then pass value from this datastore into the actual BAPI that u need to call.
    For the input parameter of bapi you can specify default values were u can specify these values from data store.
    let me know if it worked

Maybe you are looking for