Test Run in BDC

Hi Experts,
Is it possible to run the BDC but in test run mode.
If possible please guide me how to do that.
Let say i'm doing BDC for VA01.
If i tick the test run, means no need to create the Sales Order Document just test run.
If i untick the test run, create the Sales Order document.
I'm using Call transcation method to doing the BDC
  CALL TRANSACTION fu_tcode USING ft_bdcdata
                            MODE  fu_mode
                            MESSAGES INTO ft_bdcmsg
                            UPDATE 'S'.
Best Regards,
Victor.

try this.
REPORT  zcrdtdaupld
                 NO STANDARD PAGE HEADING LINE-SIZE 255.
                    I N T E R N A L  T A B L E                       *
TYPES: BEGIN OF it_output,
       bldat(10)  TYPE  c,           "Document Date
       blart      TYPE  bkpf-blart,  "Document Type
       bukrs      TYPE  bkpf-bukrs,  "Company Code
       budat(10)  TYPE  c,           "Posting Date
       monat      TYPE  bkpf-monat,  "Period
       waers      TYPE  bkpf-waers,  "Currency
       xblnr      TYPE  bkpf-xblnr,  "Reference Field
       docid      TYPE  fs006-docid, "Document ID
       newbs      TYPE  rf05a-newbs, "Posting  Key
      newko      TYPE  rf05a-newko, "Account Code
       newko(10) TYPE c,        "Account,
       wrbtr(16)  TYPE  c,           "Amount in Document currency
       zfbdt(10)  TYPE  c,           "Baseline Date
       newbs2     TYPE  rf05a-newbs, "Account Key2
       newko2     TYPE  rf05a-newko, "Account code2
       wrbtr2(16) TYPE  c,                                  "Amount2
       END OF it_output.
DATA : BEGIN OF wa_error,
        index TYPE c LENGTH 1,
        text TYPE c LENGTH 100,
        END OF wa_error.
DATA lt_output  TYPE  it_output   OCCURS 0 WITH HEADER LINE.
DATA i_bdcdata  TYPE  bdcdata     OCCURS 0 WITH HEADER LINE.
DATA it_messtab LIKE  TABLE OF bdcmsgcoll.
DATA wa_messtab LIKE  LINE OF it_messtab.
DATA it_error   LIKE  TABLE OF wa_error.
                           D A T A                                   *
DATA: message     TYPE string.
DATA: v_index     TYPE i.
DATA: v_text(100) TYPE c.
DATA: c_x         TYPE char01 VALUE 'X',
      c_n(01)     TYPE c.
TYPES: BEGIN OF t_proc_tab,
         xblnr LIKE bkpf-xblnr,   "Reference number
         bldat(10) TYPE c,        "Document date
         blart LIKE bkpf-blart,   "Document type
         bukrs LIKE bkpf-bukrs,   "Company code
         budat(10) TYPE c,        "Posting date
         monat LIKE bkpf-monat,   "Period
         waers LIKE bkpf-waers,   "Currency
         docid  TYPE  fs006-docid, "Document ID
        bktxt LIKE bkpf-bktxt,   "Document header text
         newbs LIKE rf05a-newbs,  "Posting key
        newko LIKE rf05a-newko,   "Account
         newko(10) TYPE c,        "Account
         wrbtr(12) TYPE c,        "Amount
         zfbdt(10)  TYPE  c,       "Baseline Date
        zuonr LIKE bseg-zuonr,   "Assignment
        xmwst LIKE bkpf-xmwst,   "Calculate tax flag
        mwskz LIKE bseg-mwskz,   "Tax code
        sgtxt LIKE bseg-sgtxt,   "Text
        kostl LIKE cobl-kostl,   "Cost center
         nwbs2 LIKE rf05a-newbs,  "Posting key for next record
         nwko2 LIKE lfb1-lifnr,   "Account for next record
         wrbtr2(16) TYPE  c,
       END OF t_proc_tab.
DATA: wa_input_file TYPE it_output.
Internal table for the processed records
*DATA: i_proc_tab TYPE STANDARD TABLE OF t_proc_tab,
     wa_proc_tab TYPE t_proc_tab,
     wa_bdc_tab TYPE t_proc_tab.
Structure for table T003
TYPES: BEGIN OF t_t003,
         blart LIKE t003-blart,   "Document type
       END OF t_t003.
Structure for table T001
TYPES: BEGIN OF t_t001,
         bukrs LIKE t001-bukrs,   "Company code
       END OF t_t001.
Structure for table TCURC
TYPES: BEGIN OF t_tcurc,
         waers LIKE tcurc-waers,  "Currency code
       END OF t_tcurc.
Structure for table TBSL
TYPES: BEGIN OF t_tbsl,
         bschl LIKE tbsl-bschl,   "Posting key1
       END OF t_tbsl.
Structure for table LFB1
TYPES: BEGIN OF t_lfb1,
         lifnr LIKE lfb1-lifnr,   "Account number
         bukrs LIKE lfb1-bukrs,   "Company code
       END OF t_lfb1.
Structure for table KNB1
TYPES: BEGIN OF t_knb1,
         kunnr LIKE lfb1-lifnr,   "Cust Account number
         bukrs LIKE knb1-bukrs,   "Company code
       END OF t_knb1.
Structure for table SKA1
TYPES: BEGIN OF t_ska1,
         saknr LIKE ska1-saknr,   "G/L Account number
       END OF t_ska1.
Structure for table T007A
TYPES: BEGIN OF t_t007a,
         mwskz LIKE t007a-mwskz,  "Tax code
       END OF t_t007a.
Structure for table CSKS
TYPES: BEGIN OF t_csks,
         kostl LIKE csks-kostl,   "Cost center
       END OF t_csks.
Structure to hold the error records
TYPES: BEGIN OF t_error_file,
         row   LIKE alsmex_tabline-row,
         col   LIKE alsmex_tabline-col,
         value LIKE alsmex_tabline-value,
         mssg(100) TYPE c,
       END OF t_error_file.
Structure to hold the BDC error records
TYPES: BEGIN OF t_bdc_error,
        error_msg(100) TYPE c,
       END OF t_bdc_error.
       INTERNAL TABLE/STRUCTURE POOL DECLARATION                     *
In this section you can define internal table and sturcture.        *
Internal table for the input file
*DATA: i_input_file TYPE STANDARD TABLE OF t_input_file,
     wa_input_file TYPE t_input_file.
Internal table for T003
DATA: i_t003 TYPE STANDARD TABLE OF t_t003,
      wa_t003 TYPE t_t003.
Internal table for T001
DATA: i_t001 TYPE STANDARD TABLE OF t_t001,
      wa_t001 TYPE t_t001.
Internal table for TCURC
DATA: i_tcurc TYPE STANDARD TABLE OF t_tcurc,
      wa_tcurc TYPE t_tcurc.
Internal table for TBSL
DATA: i_tbsl TYPE STANDARD TABLE OF t_tbsl,
      i_tbsl_2 TYPE STANDARD TABLE OF t_tbsl,
      wa_tbsl TYPE t_tbsl.
Internal table for LFB1
DATA: i_lfb1 TYPE STANDARD TABLE OF t_lfb1,
      i_lfb1_2 TYPE STANDARD TABLE OF t_lfb1,
      wa_lfb1 TYPE t_lfb1.
Internal table for KNB1.
DATA: i_knb1 TYPE STANDARD TABLE OF t_knb1,
      i_knb1_2 TYPE STANDARD TABLE OF t_knb1,
      wa_knb1 TYPE t_knb1.
Internal table for SKA1
DATA: i_ska1 TYPE STANDARD TABLE OF t_ska1,
      i_ska1_2 TYPE STANDARD TABLE OF t_ska1,
      wa_ska1 TYPE t_ska1.
Internal table for T007A
DATA: i_t007a TYPE STANDARD TABLE OF t_t007a,
      wa_t007a TYPE t_t007a.
Internal table for CSKS
DATA: i_csks TYPE STANDARD TABLE OF t_csks,
      wa_csks TYPE t_csks.
Internal table for the processed records
DATA: i_proc_tab TYPE STANDARD TABLE OF t_proc_tab,
      wa_proc_tab TYPE t_proc_tab,
      wa_bdc_tab TYPE t_proc_tab.
Internal table for the processed records
DATA: BEGIN OF i_bdc_tab OCCURS 0.
        INCLUDE STRUCTURE wa_proc_tab.
DATA: END OF i_bdc_tab.
Internal table for the erroneous records
DATA: i_error_file TYPE STANDARD TABLE OF t_error_file,
      wa_error_file TYPE t_error_file.
Internal table for the BDC error records
DATA: i_bdc_error TYPE STANDARD TABLE OF t_bdc_error,
      wa_bdc_error TYPE t_bdc_error.
       DATA/VARIABLE DECLARATION                                     *
In this section you can define internal tables,variables and etc.   *
DATA : v_xblnr_cnt TYPE i.
        CONSTANTS DECLARATION                                        *
Constants are named data objects that you create statically using   *
a declarative statement. They allow you to store data under a       *
particular name within the memory area of a program.                *
The value of a constant cannot be changed during the execution of   *
the program.                                                        *
CONSTANTS: c_asc       TYPE char10 VALUE 'ASC',
          c_x         TYPE char01 VALUE 'X',
           c_01(02)    TYPE c VALUE '01',
           c_02(02)    TYPE c VALUE '02',
           c_03(02)    TYPE c VALUE '03',
           c_04(02)    TYPE c VALUE '04',
           c_05(02)    TYPE c VALUE '05',
           c_06(02)    TYPE c VALUE '06',
           c_07(02)    TYPE c VALUE '07',
           c_08(02)    TYPE c VALUE '08',
           c_09(02)    TYPE c VALUE '09',
           c_10(02)    TYPE c VALUE '10',
           c_11(02)    TYPE c VALUE '11',
           c_12(02)    TYPE c VALUE '12',
           c_dymd(04)  TYPE c VALUE 'DDMY',
           c_a(01)     TYPE c VALUE 'A',
          c_n(01)     TYPE c VALUE 'N',
           c_f63(04)   TYPE c VALUE 'F-63'.
         S E L E C T - O P T I O N S / P A R A M E T E R S           *
SELECTION-SCREEN BEGIN OF BLOCK block0 WITH FRAME.
PARAMETERS : p_file  LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN SKIP.
PARAMETERS:p_test RADIOBUTTON GROUP rec,
           p_back RADIOBUTTON GROUP rec DEFAULT 'X',
           p_onli RADIOBUTTON GROUP rec.
SELECTION-SCREEN END OF BLOCK block0.
         A T  S E L E C T I O N - S C R E E N                        *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      static    = 'X'
      mask      = space
    CHANGING
      file_name = p_file.
               S T A R T - O F - S E L E C T I O N
START-OF-SELECTION.
  PERFORM  upload USING p_file.
Validate the input file records
  PERFORM f_validate_records.
IF NOT p_test EQ c_x.
  PERFORM bdc.
ENDIF.
PERFORM f_audit_report. " for test mode option
*&      Form  bdc
      text
FORM bdc.
  IF p_onli =  c_x.
    c_n = 'A'.
  ELSE.
    c_n = 'N'.
  ENDIF.
  LOOP AT i_bdc_tab.
    v_index = sy-tabix.
    REFRESH i_bdcdata.
    CLEAR i_bdcdata.
    READ TABLE lt_output INDEX 1.
    PERFORM bdc_dynpro      USING 'SAPMF05A' '0100' c_x.
    PERFORM bdc_field       USING 'BDC_CURSOR' 'RF05A-NEWKO'.
    PERFORM bdc_field       USING 'BDC_OKCODE' '/00'.
    PERFORM bdc_field       USING 'BKPF-BLDAT'  i_bdc_tab-bldat.
    PERFORM bdc_field       USING 'BKPF-BLART'  i_bdc_tab-blart.
    PERFORM bdc_field       USING 'BKPF-BUKRS'  i_bdc_tab-bukrs.
    PERFORM bdc_field       USING 'BKPF-BUDAT'  i_bdc_tab-budat.
    PERFORM bdc_field       USING 'BKPF-MONAT'  i_bdc_tab-monat.
    PERFORM bdc_field       USING 'BKPF-WAERS'  i_bdc_tab-waers.
    PERFORM bdc_field       USING 'BKPF-XBLNR'  i_bdc_tab-xblnr.
    PERFORM bdc_field       USING 'FS006-DOCID' i_bdc_tab-docid.
    PERFORM bdc_field       USING 'RF05A-NEWBS' i_bdc_tab-newbs.
    PERFORM bdc_field       USING 'RF05A-NEWKO' i_bdc_tab-newko.
    PERFORM bdc_dynpro      USING 'SAPMF05A' '0302' c_x.
    PERFORM bdc_field       USING 'BDC_CURSOR' 'RF05A-NEWKO'.
    PERFORM bdc_field       USING 'BDC_OKCODE' '/00'.
    PERFORM bdc_field       USING 'BSEG-WRBTR'  i_bdc_tab-wrbtr.
    PERFORM bdc_field       USING 'BSEG-ZFBDT'  i_bdc_tab-zfbdt.
    PERFORM bdc_field       USING 'RF05A-NEWBS' i_bdc_tab-nwbs2.
    PERFORM bdc_field       USING 'RF05A-NEWKO' i_bdc_tab-nwko2.
    PERFORM bdc_dynpro      USING 'SAPMF05A' '0301' c_x.
    PERFORM bdc_field       USING 'BDC_CURSOR' 'BSEG-WRBTR'.
    PERFORM bdc_field       USING 'BDC_OKCODE'  '=BU'.
    PERFORM bdc_field       USING 'BSEG-WRBTR'  i_bdc_tab-wrbtr2.
    CALL TRANSACTION 'F-27' USING i_bdcdata
                               MODE c_n
                               UPDATE 'A'
                               MESSAGES INTO it_messtab.
    PERFORM f_error_handling.
  ENDLOOP.
ENDFORM.                    "bdc
      FORM BDC_DYNPRO                                               *
-->  PROGRAM                                                       *
-->  DYNPRO                                                        *
FORM bdc_dynpro USING program dynpro dynbegin.
  i_bdcdata-program  = program.
  i_bdcdata-dynpro   = dynpro.
  i_bdcdata-dynbegin = dynbegin.
  APPEND i_bdcdata.
  CLEAR i_bdcdata.
ENDFORM.                    "BDC_DYNPRO
      FORM                                                          *
FORM bdc_field USING fnam fval.
  i_bdcdata-fnam = fnam.
  i_bdcdata-fval = fval.
  APPEND i_bdcdata.
  CLEAR i_bdcdata.
ENDFORM.                    "BDC_FIELD
*&      Form  upload
      text
-->  p1        text
<--  p2        text
FORM upload USING p_filename.
  DATA: p_file1 TYPE string.
  p_file1 = p_file.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename = p_file1
      filetype = 'DAT'
    TABLES
      data_tab = lt_output.
ENDFORM.                    " upload
      FORM f_error_handling
      This subroutine populates the BDC table
FORM f_error_handling .
  LOOP AT it_messtab INTO wa_messtab.
    CLEAR v_text.
    CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        id   = wa_messtab-msgid
        lang = 'EN'
        no   = wa_messtab-msgnr
        v1   = wa_messtab-msgv1
        v2   = wa_messtab-msgv2
        v3   = wa_messtab-msgv3
        v4   = wa_messtab-msgv4
      IMPORTING
        msg  = v_text.
    IF sy-subrc = 0.
      CASE wa_messtab-msgtyp.
              WHEN 'S'.
              IF p_test NE c_x.
          WRITE:/ v_text.
          ENDIF.
          CLEAR v_text.
          SKIP 1.
        WHEN 'E'.
          wa_error-index = v_index. "record num
          wa_error-text =  v_text .  "message text
          APPEND wa_error TO it_error.
          CLEAR wa_error.
      ENDCASE.
    ENDIF.
  ENDLOOP.
  REFRESH it_messtab.
  CLEAR   wa_messtab.
display error messages
IF p_test NE c_x.
  IF NOT it_error[] IS INITIAL.
    WRITE: /30 'ERROR RECORDS DETAILS'.
    SKIP 1.
    WRITE: /5 'RECORD NO', 15 sy-vline,
            16 'ERROR MESSAGE'.
    ULINE.
    LOOP AT it_error INTO wa_error.
      WRITE : /5 wa_error-index LEFT-JUSTIFIED,
               15 sy-uline,
               16 wa_error-text.
      CLEAR wa_error.
    ENDLOOP.
  ENDIF.
  ENDIF.
ENDFORM.                    " f_error_handling
F O R M A L   E N D - O F - P R O G R A M                           *
*&      Form  f_validate_records
      text
-->  p1        text
<--  p2        text
FORM f_validate_records .
DATA: lw_tabix LIKE sy-tabix,
        lw_rowno LIKE sy-tabix,
        lw_xblnr LIKE bkpf-xblnr.
LOOP AT lt_output INTO wa_input_file.
  Convert the document date into system date format
PERFORM f_convert_date USING wa_input_file-bldat
                        CHANGING wa_input_file-bldat.
  Convert the posting date into system date format
    PERFORM f_convert_date USING wa_input_file-budat
                        CHANGING wa_input_file-budat.
  Popoulate the account code with leading zeroes
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = wa_input_file-newko
      IMPORTING
        output = wa_input_file-newko
      EXCEPTIONS
        OTHERS = 1.
    IF sy-subrc NE 0.
    ENDIF.
  Populate the i_proc_tab internal table.
    wa_proc_tab-xblnr = wa_input_file-xblnr.   "Reference number
    wa_proc_tab-bldat = wa_input_file-bldat.   "Document date
    wa_proc_tab-blart = wa_input_file-blart.   "Document type
    wa_proc_tab-bukrs = wa_input_file-bukrs.   "Company code
    wa_proc_tab-budat = wa_input_file-budat.   "Posting date
    wa_proc_tab-monat = wa_input_file-monat.   "Period
    wa_proc_tab-waers = wa_input_file-waers.   "Currency
   wa_proc_tab-bktxt = wa_input_file-bktxt.   "Document header text
    wa_proc_tab-docid  = wa_input_file-docid .   "Document ID
    wa_proc_tab-newbs = wa_input_file-newbs.   "Posting key
    wa_proc_tab-newko = wa_input_file-newko.   "Account
    wa_proc_tab-wrbtr = wa_input_file-wrbtr.   "Amount
    wa_proc_tab-zfbdt = wa_input_file-zfbdt.   "Baseline Date
   wa_proc_tab-zuonr = wa_input_file-zuonr.   "Assignment
   wa_proc_tab-xmwst = wa_input_file-xmwst.   "Calculate tax flag
   wa_proc_tab-mwskz = wa_input_file-mwskz.   "Tax code
   wa_proc_tab-sgtxt = wa_input_file-sgtxt.   "Text
   wa_proc_tab-kostl = wa_input_file-kostl.   "Cost center
    wa_proc_tab-nwbs2  = wa_input_file-newbs2 .   "Posting key for next record
    wa_proc_tab-nwko2  = wa_input_file-newko2.
    wa_proc_tab-wrbtr2 = wa_input_file-wrbtr2 .
    APPEND wa_proc_tab TO i_proc_tab.
    CLEAR: wa_input_file,
           wa_proc_tab.
  ENDLOOP.
Get the list of document types from table T003
  SELECT blart
  INTO TABLE i_t003
  FROM t003
  FOR ALL ENTRIES IN i_proc_tab
  WHERE blart EQ i_proc_tab-blart.
  IF sy-subrc NE 0.
    CLEAR i_t003.
  ENDIF.
Get the list of company code from table T001
  SELECT bukrs
  INTO TABLE i_t001
  FROM t001
  FOR ALL ENTRIES IN i_proc_tab
  WHERE bukrs EQ i_proc_tab-bukrs.
  IF sy-subrc NE 0.
    CLEAR i_t001.
  ENDIF.
Get the list of currency code from table TCURC
  SELECT waers
  INTO TABLE i_tcurc
  FROM tcurc
  FOR ALL ENTRIES IN i_proc_tab
  WHERE waers EQ i_proc_tab-waers.
  IF sy-subrc NE 0.
    CLEAR i_tcurc.
  ENDIF.
Get the list of posting key from table TBSL
  SELECT bschl
  INTO TABLE i_tbsl
  FROM tbsl
  FOR ALL ENTRIES IN i_proc_tab
  WHERE bschl EQ i_proc_tab-newbs.
  IF sy-subrc NE 0.
    CLEAR i_tbsl.
  ENDIF.
Get the list of account number from table LFB1
  SELECT lifnr
         bukrs
  INTO TABLE i_lfb1
  FROM lfb1
  FOR ALL ENTRIES IN i_proc_tab
  WHERE lifnr EQ i_proc_tab-newko
    AND bukrs EQ i_proc_tab-bukrs.
  IF sy-subrc NE 0.
    CLEAR i_lfb1.
  ENDIF.
Get the list of account number from table KNB1
SELECT kunnr
         bukrs
  INTO TABLE i_knb1
  FROM knb1
  FOR ALL ENTRIES IN i_proc_tab
  WHERE kunnr EQ i_proc_tab-newko
    AND bukrs EQ i_proc_tab-bukrs.
  IF sy-subrc NE 0.
    CLEAR i_knb1.
  ENDIF.
Get the list of account number from table SKA1
  SELECT saknr
  INTO TABLE i_ska1
  FROM ska1
  FOR ALL ENTRIES IN i_proc_tab
  WHERE saknr EQ i_proc_tab-newko.
  IF sy-subrc NE 0.
  ENDIF.
Get the list of posting key from table TBSL
  SELECT bschl
  INTO TABLE i_tbsl_2
  FROM tbsl
  FOR ALL ENTRIES IN i_proc_tab
  WHERE bschl EQ i_proc_tab-nwbs2.
  IF sy-subrc NE 0.
    CLEAR i_tbsl_2.
  ENDIF.
Get the list of account number from table LFB1
  SELECT lifnr
         bukrs
  INTO TABLE i_lfb1_2
  FROM lfb1
  FOR ALL ENTRIES IN i_proc_tab
  WHERE lifnr EQ i_proc_tab-nwko2
    AND bukrs EQ i_proc_tab-bukrs.
  IF sy-subrc NE 0.
    CLEAR i_lfb1_2.
  ENDIF.
Get the list of account number from table KNB1
SELECT kunnr
         bukrs
  INTO TABLE i_knb1_2
  FROM knb1
  FOR ALL ENTRIES IN i_proc_tab
  WHERE kunnr EQ i_proc_tab-nwko2
    AND bukrs EQ i_proc_tab-bukrs.
  IF sy-subrc NE 0.
    CLEAR i_knb1_2.
  ENDIF.
Get the list of account number from table SKA1
  SELECT saknr
  INTO TABLE i_ska1_2
  FROM ska1
  FOR ALL ENTRIES IN i_proc_tab
  WHERE saknr EQ i_proc_tab-nwko2.
  IF sy-subrc NE 0.
  ENDIF.
CLEAR lw_rowno.
  LOOP AT i_proc_tab INTO wa_proc_tab.
    lw_tabix = sy-tabix + 1.
    lw_rowno = lw_rowno + 1.
    IF lw_xblnr NE wa_proc_tab-xblnr.
      ADD 1 TO v_xblnr_cnt.
      lw_xblnr = wa_proc_tab-xblnr.
    ENDIF.
  Validate the document type
    READ TABLE i_t003 INTO wa_t003
         WITH KEY blart = wa_proc_tab-blart.
    IF sy-subrc NE 0.
      wa_error_file-row   = lw_rowno.
      wa_error_file-col   = 2.
      wa_error_file-value = wa_proc_tab-blart.
      wa_error_file-mssg  = text-002.
      APPEND wa_error_file TO i_error_file.
      DELETE i_proc_tab.
      CONTINUE.
    ENDIF.
  Validate the company code
    READ TABLE i_t001 INTO wa_t001
         WITH KEY bukrs = wa_proc_tab-bukrs.
    IF sy-subrc NE 0.
      wa_error_file-row   = lw_rowno.
      wa_error_file-col   = 3.
      wa_error_file-value = wa_proc_tab-bukrs.
      wa_error_file-mssg  = text-003.
      APPEND wa_error_file TO i_error_file.
      DELETE i_proc_tab.
      CONTINUE.
    ENDIF.
  Validate the period
    IF NOT wa_proc_tab-monat EQ c_01 AND
       NOT wa_proc_tab-monat EQ c_02 AND
       NOT wa_proc_tab-monat EQ c_03 AND
       NOT wa_proc_tab-monat EQ c_04 AND
       NOT wa_proc_tab-monat EQ c_05 AND
       NOT wa_proc_tab-monat EQ c_06 AND
       NOT wa_proc_tab-monat EQ c_07 AND
       NOT wa_proc_tab-monat EQ c_08 AND
       NOT wa_proc_tab-monat EQ c_09 AND
       NOT wa_proc_tab-monat EQ c_10 AND
       NOT wa_proc_tab-monat EQ c_11 AND
       NOT wa_proc_tab-monat EQ c_12.
      wa_error_file-row   = lw_rowno.
      wa_error_file-col   = 5.
      wa_error_file-value = wa_proc_tab-monat.
      wa_error_file-mssg  = text-004.
      APPEND wa_error_file TO i_error_file.
      DELETE i_proc_tab.
      CONTINUE.
    ENDIF.
  Validate the currency
    READ TABLE i_tcurc INTO wa_tcurc
         WITH KEY waers = wa_proc_tab-waers.
    IF sy-subrc NE 0.
      wa_error_file-row   = lw_rowno.
      wa_error_file-col   = 6.
      wa_error_file-value = wa_proc_tab-waers.
      wa_error_file-mssg  = text-005.
      APPEND wa_error_file TO i_error_file.
      DELETE i_proc_tab.
      CONTINUE.
    ENDIF.
  Validate the posting key
    READ TABLE i_tbsl INTO wa_tbsl
         WITH KEY bschl = wa_proc_tab-newbs.
    IF sy-subrc NE 0.
      wa_error_file-row   = lw_rowno.
      wa_error_file-col   = 9.
      wa_error_file-value = wa_proc_tab-newbs.
      wa_error_file-mssg  = text-006.
      APPEND wa_error_file TO i_error_file.
      DELETE i_proc_tab.
      CONTINUE.
    ENDIF.
   IF wa_tbsl = '31' . " then its a vendor account no
  Validate the account number
    READ TABLE i_lfb1 INTO wa_lfb1
         WITH KEY lifnr = wa_proc_tab-newko
                  bukrs = wa_proc_tab-bukrs.
    IF sy-subrc NE 0.
      READ TABLE i_ska1 INTO wa_ska1
           WITH KEY saknr = wa_proc_tab-newko.
      IF sy-subrc NE 0.
        wa_error_file-row   = lw_rowno.
        wa_error_file-col   = 10.
        wa_error_file-value = wa_proc_tab-newko.
        wa_error_file-mssg  = text-007.          "Invalid Vendor account
        APPEND wa_error_file TO i_error_file.
        DELETE i_proc_tab.
        CONTINUE.
      ENDIF.
    ENDIF.
  ENDIF.
  IF wa_tbsl = '11' OR  wa_tbsl = '01'.  "Then its customer no.
  Validate the account number
    READ TABLE i_knb1 INTO wa_knb1
         WITH KEY kunnr = wa_proc_tab-newko
                  bukrs = wa_proc_tab-bukrs.
    IF sy-subrc NE 0.
      READ TABLE i_ska1 INTO wa_ska1
           WITH KEY saknr = wa_proc_tab-newko.
      IF sy-subrc NE 0.
        wa_error_file-row   = lw_rowno.
        wa_error_file-col   = 10.
        wa_error_file-value = wa_proc_tab-newko.
        wa_error_file-mssg  = text-026.          " Invalid Customer account
        APPEND wa_error_file TO i_error_file.
        DELETE i_proc_tab.
        CONTINUE.
      ENDIF.
    ENDIF.
  ENDIF.
  Validate the posting key2
CLEAR wa_tbsl.
    READ TABLE i_tbsl_2 INTO wa_tbsl
         WITH KEY bschl = wa_proc_tab-nwbs2.
    IF sy-subrc NE 0.
      wa_error_file-row   = lw_rowno.
      wa_error_file-col   = 13.
      wa_error_file-value = wa_proc_tab-nwbs2.
      wa_error_file-mssg  = text-006.
      APPEND wa_error_file TO i_error_file.
      DELETE i_proc_tab.
      CONTINUE.
    ENDIF.
   IF wa_tbsl = '31' . " then its a vendor account no
  Validate the account number2
CLEAR wa_lfb1.
    READ TABLE i_lfb1_2 INTO wa_lfb1
         WITH KEY lifnr = wa_proc_tab-nwko2
                  bukrs = wa_proc_tab-bukrs.
    IF sy-subrc NE 0.
    CLEAR wa_ska1.
      READ TABLE i_ska1_2 INTO wa_ska1
           WITH KEY saknr = wa_proc_tab-nwko2.
      IF sy-subrc NE 0.
        wa_error_file-row   = lw_rowno.
        wa_error_file-col   = 14.
        wa_error_file-value = wa_proc_tab-nwko2.
        wa_error_file-mssg  = text-007.          "Invalid Vendor account
        APPEND wa_error_file TO i_error_file.
        DELETE i_proc_tab.
        CONTINUE.
      ENDIF.
    ENDIF.
  ENDIF.
  IF wa_tbsl = '11' OR  wa_tbsl = '01'.  "Then its customer no.
  Validate the account number2
CLEAR wa_knb1.
    READ TABLE i_knb1_2 INTO wa_knb1
         WITH KEY kunnr = wa_proc_tab-nwko2
                  bukrs = wa_proc_tab-bukrs.
    IF sy-subrc NE 0.
CLEAR  wa_ska1.
      READ TABLE i_ska1_2 INTO wa_ska1
           WITH KEY saknr = wa_proc_tab-nwko2.
      IF sy-subrc NE 0.
        wa_error_file-row   = lw_rowno.
        wa_error_file-col   = 14.
        wa_error_file-value = wa_proc_tab-nwko2.
        wa_error_file-mssg  = text-026.          " Invalid Customer account
        APPEND wa_error_file TO i_error_file.
        DELETE i_proc_tab.
        CONTINUE.
      ENDIF.
    ENDIF.
  ENDIF.
  Populate the i_bdc_tab internal table.
    MOVE-CORRESPONDING wa_proc_tab TO i_bdc_tab.
  Get the posting key and account for the next records
    READ TABLE i_proc_tab INTO wa_proc_tab INDEX lw_tabix.
    IF i_bdc_tab-xblnr EQ wa_proc_tab-xblnr.
      IF sy-subrc EQ 0.
        i_bdc_tab-nwbs2 = wa_proc_tab-newbs.
        i_bdc_tab-nwko2 = wa_proc_tab-newko.
      ENDIF.
    ENDIF.
    APPEND i_bdc_tab.
  ENDLOOP.
ENDFORM.                    " f_validate_records
*&      Form  f_convert_date
      text
     -->P_WA_INPUT_FILE_BLDAT  text
     <--P_WA_INPUT_FILE_BLDAT  text
FORM f_convert_date  USING    fp_in_date
                     CHANGING fp_out_date.
DATA: lw_in_date(10)  TYPE c,
        lw_out_date(10) TYPE c.
  lw_in_date = fp_in_date.
  CALL FUNCTION '/SAPDMC/LSM_DATE_CONVERT'
    EXPORTING
      date_in             = lw_in_date
      date_format_in      = c_dymd
      to_output_format    = c_x
    IMPORTING
      date_out            = lw_out_date
    EXCEPTIONS
      illegal_date        = 1
      illegal_date_format = 2
      no_user_date_format = 3
      OTHERS              = 4.
  IF sy-subrc EQ 0.
    fp_out_date = lw_out_date.
  ENDIF.
ENDFORM.                    " f_convert_date
*&      Form  f_audit_report
      text
-->  p1        text
<--  p2        text
FORM f_audit_report .
DATA: lv_input     TYPE i,
        lv_process   TYPE i,
        lv_error     TYPE i,
        lv_bdc_error TYPE i.
  DESCRIBE TABLE lt_output LINES lv_input.
  DESCRIBE TABLE i_bdc_tab LINES lv_process.
  DESCRIBE TABLE i_error_file LINES lv_error.
  DESCRIBE TABLE it_error LINES lv_bdc_error.
  IF p_test = c_x.
  Audit report when the program is executed in test mode
    ULINE.
    WRITE:/ text-011.
    ULINE.
    WRITE: /5 text-012,
           50 lv_input,
           /5 text-013,
           50 lv_process,
           /5 text-014,
           50 lv_error,
           /5 text-025,
           50 v_xblnr_cnt.
    SKIP 2.
    WRITE: 1 text-015.
    ULINE.
    WRITE: /5 text-016,
           20 text-017,
           40 text-018,
           55 text-019.
    ULINE.
    LOOP AT i_error_file INTO wa_error_file.
      WRITE: /5 wa_error_file-row,
             20 wa_error_file-col,
             40 wa_error_file-value,
             55 wa_error_file-mssg.
    ENDLOOP.
    ENDIF.
ENDFORM.                    " f_audit_report
check it is according to ur requirement.
thanks jayant

Similar Messages

  • How to run my program in "test run" mode, programmatically ??

    Hi,
    Assume I have written a Zprogram and called a BDC to input a batch of data from an CSV file. I could see that in a normal input mode, some of the SAP transactions allow me to select "Test Run" so that SAP first checks if the data I enter is correct and can be saved. It then reports a succes and then I re execute !! U can see that option in transaction KP90, Delete Planned cost.
    Can I do the same programmatically so that I ensure that my batch data upload will be successful for this set of data ??
    Also, another question related to BDC... what happens when a record fails to confirm the SAP input rules ?? will only that be skipped from the batch input and rest be stored in the DB or will the entire batch of data will be reverted , something like ROLLBACK ??
    thanks

    hi,
       set one flag in the program for test run.
       if flag = 'X'.
          write success message here.
          dont save ur data
       else.
         save ur data
       endif.
       regarding ur 2nd question if one record is error also the data will not be updated for all the records.
       as u had mentioned it will ROLLBACK

  • Test run for IW31

    Hi Experts,
    We are using BDC file for creating work orders in IW31.While creating orders,if we face any error in between the process, system will not allow further processing.but order will be generated for the remaining equipments.Can we provide any test run option in IW31 so that we can find out the error before generating work order.
    If no errors are there in process,then we need to upload the data.
    Can any one provide me some valuable inputs?
    Regards,
    Sibinraj

    Hi Sibinraj,
    As mentioned and suggested your technical team can achieve this, You can ask your technical team to work in below steps as
    1. All the pre-checks need to performed . 
    2. After the pre-checks a log is produced with complete results.
    3. If at any stage an Abort type error is encountered the log is updated as such but the checks are continued.
    4. After output of the log the load is aborted (prevented) by the system.
    5. If no Abort level error is encountered the user is still given the opportunity to manually abort after evaluation of the load-log.
    NOTE: In each case write the result as welwell as the state to the log.
    Once The successful Logs identified, User can go for actual run.
    Hope this will guide your technical team to meet your requirement.
    Riyaj

  • Test run in Batch input session

    Hi All,
    I am Working on BDC Batch input session i am able to create the Session 'SM35'  through my program.I have two radio two buttons in my program one is test and real.Is it possible to test run for the BDC(Batch input session).
    Thanks,

    Hi All,
    After Running the Batch Input Session in SM35.Is it possible  to get the order number which is created in the Batch Session.
    Can any body please help me out.
    Thanks,
    Swapna.

  • Error while running a BDC for the Transaction F-02

    Hi,
           I'm getting an error <b><i>"Parking not possible during Batch Input"</i></b> while running a BDC for the transaction F-02.
           When i click on the error message it displays the message [b<i>]"In Customizing, you can control whether an error message is issued."</b></i>
            How to solve this issue?.
            Waiting for ur replies.........
    Regards
    N.Senthil

    Hi,
    When you are doing the recording in SHDB, and in the same screen where the TCODE to be recorded is given, there are options that you can choose called "Recording Parameters"...Select the checkbox which says "Not a Batch Input Session", this will set the sy-binpt variable to " "(in a recording by default it is "X")...and you will not get this error...
    Also make sure while writing the BDC program to make use of the "bdc options" parameter which has this property to switch of sy-binpt...
        Refer below theard for sample bdc code for f-02.
    https://forums.sdn.sap.com/click.jspa?searchID=5126766&messageID=1538409
    Regards

  • The build directory of the test run either does not exist or access permission is required.

    i am trying to run automated tests
    i follow the steps in the web but when i have 2 issues that does not solve
    1. i created console project and add build definition without drop folder and queue builds that success.
    2. i created C# unit test and add build definition and run it from VS and it worked and done what i want to do.
    3. i built lab with 1 machine and define the controller on this pc ( the machine in the lab is another pc)
    4. i created test suite with test cases and from vs 2013 i associated automation nethod that i created in 2.
    5. when i try to associate the builds for the test plan i have a PROBLEM(1):
    this happened every new build that i try to assign - all the builds appears after refresh and when i press assign to plan button
    a pop up shown with error : " The build that you selected for this plan no longer exist " but he chose it in build in use but there no work item under it - the list is empty even that there are 2 tests under this test suite.
    and than when i try to run the automated tests i have this PROBLEM(2):
    The build directory of the test run either does not exist or access permission is required. and the test failed.
    Please Help
    Roey

    Hi Rory,
    Thank you for posting in MSDN forum.
    According to the error message:
    (1) a pop up shown with error : " The build that you selected for this plan no longer exist "
    I tried to create a build definition without the drop folder location for unit test solution from the VS IDE, and then I try to select the Build in use option to add the Available builds, then click this Assign to plan. I found that I get same error message
    with yours like the following screen shot.
    However, when we try to create a build definition with drop folder location for this same unit test solution and then build successfully in the VS IDE.
    After you add the Available builds and then click this Assign to plan in the MTM, it work fine.
    Therefore, I assume that the issue is related to that you did not specify a build directory for automated test case. MTM need to know where is the drop location of the build building your tests.
    http://stackoverflow.com/questions/20033217/couldnt-run-my-test-using-microsoft-test-manager
    In addition, I did some research about the problem 2:"The build directory of the test run either does not exist or access permission is required. and the test failed."
    I know that the error message occur in either of the following conditions:
    1. The account under which test controller is running does not have read permission on the build directory. (The build directory is same as the drop location of build associated with this test run.) 
    2. The build directory itself does not exist.
    So please refer the following blog to check this issue:
    http://blogs.msdn.com/b/aseemb/archive/2009/11/25/error-starting-the-test-run-build-directory-of-the-test-run-is-not-specified-or-does-not-exist.aspx
    Therefore, I suggest you can try to specify a drop location for build when you run the automated test from the MTM and then check this issue.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • My system is asking to run the hard disk test run...What i have to do? can any one guide me????

    model is Hp Pavilion  g6.. windows 7 home basic,
    My system is asking to run the hard disk test run.. i have run , there was no error, but the message is still comming, i do not kow whether i amdoing it in a right way or not.. Please any giude do that test and find the issue.....

    Hi,
    If you receive this message when starting the notebook, try the following.
    Shut down the notebook.  Tap away at f10 as you start the notebook to enter the bios menu.  Under the Advanced or Diagnostic tab you should find the facility to run a test on the Hard Drive.  Post back with the details of any error messages.
    If you receive this message while Windows is running , click the Start Menu, click Computer, left click Local Disc C once to highlight it, right click Local Disc C and select Properties.  Click the Tools tab and then click the button to 'Check the Drive for Errors'.  In the following window make sure both boxes are ticked and then click Start.  Agree to schedule the check at the next system restart and then restart the notebook - this process can take a couple of hours to complete before loading back into Windows.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Want to run a BDC even if there is an error in the TCode

    Hi,
      In one of the screens in my BDC an error comes (this happens when that transaction is run from command prompt in foreground also). But in the actual transaction after the user sees the error, he is able to continue changing the fields on the screen and post it. However in BDC, as soon as the error comes, the BDC exits and comes back. I would like it to continue, just the way it does during the manual entry, is there a way I can do this?
    The Tcode is LT06 and when user enters the Material doc and click on enter the error occurs, but in the manual mode he is able to enter the Destn Bin, storage type etc and continue. However that is not the case with BDC. I also tried using function module L_TO_CREATE_POSTING_CHANGE, but it gives the same error as the screen
    FORM create_to USING r_mblnr TYPE mblnr
                         r_to_lgort TYPE lgort_d
                         r_sto_bin TYPE lgpla
                   CHANGING rt_bapi_message TYPE type_t_bapi_message
                            r_success TYPE c.
      DATA: v_mode TYPE c,
            wa_bapi_message TYPE bdcmsgcoll.
      CLEAR s_bdcdata.
      REFRESH t_bdcdata.
      PERFORM bdc_dynpro      USING 'SAPML02B' '0203'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'RL02B-MBLNR'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM bdc_field       USING 'RL02B-MBLNR'
                                    r_mblnr.
    PERFORM bdc_field       USING 'RL02B-MJAHR'
                                   '2009'.
      PERFORM bdc_field       USING 'RL02B-DUNKL'
                                    'H'.
      PERFORM bdc_dynpro      USING 'SAPML03T' '0102'.
      PERFORM bdc_field       USING 'LTAP-NLTYP'
                                    r_to_lgort.
      PERFORM bdc_field       USING 'LTAP-NLBER'
                                    '001'.        "destn storage section
      PERFORM bdc_field       USING 'LTAP-NLPLA'
                                    r_sto_bin.        "destn storage section
      v_mode = 'N'.
      CALL TRANSACTION 'LT06'
                       USING t_bdcdata
                       MODE   v_mode
                       UPDATE 'S'
                       MESSAGES INTO t_messtab.
    IF sy-subrc <> 0.
      IF sy-subrc = 0.
        LOOP AT t_messtab INTO wa_bapi_message.
          APPEND wa_bapi_message TO rt_bapi_message.
          EXIT.
       MESSAGE ID wa_bapi_message-msgid TYPE wa_bapi_message-msgtyp NUMBER wa_bapi_message-msgnr
         WITH wa_bapi_message-msgv1 wa_bapi_message-msgv2 wa_bapi_message-msgv3 wa_bapi_message-msgv4.
        ENDLOOP.
      ELSE.
        LOOP AT t_messtab INTO wa_bapi_message.
       MESSAGE ID wa_bapi_message-msgid TYPE wa_bapi_message-msgtyp NUMBER wa_bapi_message-msgnr
         WITH wa_bapi_message-msgv1 wa_bapi_message-msgv2 wa_bapi_message-msgv3 wa_bapi_message-msgv4.
          APPEND wa_bapi_message TO rt_bapi_message.
        ENDLOOP.
       APPEND t_messtab to rt_bapi_message.
      ENDIF.
      COMMIT WORK AND WAIT.
    ENDFORM.                    "create_to
    Thanks for reading

    Hi ,
    Now as per the transaction an error is prompted only when the compiler interprets it as false on a data field or a combination of them . Now its in the programmers hand to validate the data before submitting it to the screen .. now this validation should cover all scenario's . One point i want to make here is that bdc is nothing but replaying how the user enter's manually for no of records..
    i dont know about this tcode LT06 .
    //The Tcode is LT06 and when user enters the Material doc and click on enter the error occurs, but in the manual mode he is able to enter the Destn Bin, storage type etc and continue. However that is not the case with BDC.//
    you are entering the material doc no in screen 0203 ..use all screen mode and check what is the error prompting if any and in the normal debugging track that error if some user exit is written using sy-binpt with some error message..
    did you tried some relavant tcode other than LT06 which can be used for this purpose cause sometimes we have alternate tcodes to run the bdc .. please check on this .
    Br,
    Vijay.

  • How to Use synchronous RFC calls during test run for remote accesses

    there is a Setting for the usage of RFC accesses from a tested system
    using eCATT.
    'X' - Use asynchronous RFC calls during test run for remote accesses
    ' ' - Use synchronous RFC calls during test run for remote accesses
    I developed an eCATT as following :
      SAPGUI ( SAPGUI_1 , Target_system_1 ).
      SAPGUI ( SAPGUI_2 , Target_system_2 ).
    My question is how to run the eCATT in a synchronous RFC calls
    PS: I do not want to change the Target_system to the same one in the
    above script of ecatt.Because I need to run it in 2 different Target
    systems sometime.
    for example, I give a Target_system_3 when run this eCATT
    I want the SAPGUI_1 and SAPGUI_2 run the Target_system_3 but not the
    Target_system_1 or Target_system_2 .
    Could you please tell me how to make it without the changes in script?
    Edited by: Weitong Liu on Mar 24, 2011 9:44 AM

    Hi Liu,
    Weitong Liu wrote:
    > ' ' - Use synchronous RFC calls during test run for remote accesses
    This is the standard option value. Asynchronous are not the standard way and used only for very special purposes.
    Weitong Liu wrote:
    > I developed an eCATT as following :
    >   SAPGUI ( SAPGUI_1 , Target_system_1 ).
    >   SAPGUI ( SAPGUI_2 , Target_system_2 ).
    > My question is how to run the eCATT in a synchronous RFC calls
    The commands will be executed in sequence. So each call will be synchronously replayed against TS1 and TS2.
    What is you issue with this standard procedure?
    Kind regards,
    Christoph

  • Unit test runs perfectly fine with NUnit but fails when run from TestExplorer

    Hello all,
    I have a TestProject, Harmony.Tests. In there, I have a method AddApplicationEvent()
    which calls another method Send(InvokeRequestMessage requestMessage) which calls a webservice (OperationHandlerBrokerWebService). 
    The code snippet looks like this. This is not the complete code but a part where we are calling the web service. It fails on the underlined Italic line of code.
    OperationHandlerBrokerWebService brokerService = new OperationHandlerBrokerWebService();
    brokerService.UseDefaultCredentials = true;
    brokerService.Url = address;
    brokerService.Timeout = timeoutInMilliseconds;
    byte[] serializedResponseMessage = brokerService.InvokeOperationHandler(serializedRequestMessage);
    The same test works and passed fine when I ran it with NUnit, but failed with following exception when I tried to run it from TestExplorer. 
    Test Name: AddApplicationEvent
    Test FullName: N4S.Harmony.Tests.CaseManagement.HarmonyFacadeTests.AddApplicationEvent
    Test Source: d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\CaseManagement\HarmonyFacadeTests.cs : line 665
    Test Outcome: Failed
    Test Duration: 0:00:00.296
    Result Message:
    SetUp : Message returned System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Invalid token for impersonation - it cannot be duplicated.
    at System.Security.Principal.WindowsIdentity.CreateFromToken(IntPtr userToken)
    at System.Security.Principal.WindowsIdentity..ctor(SerializationInfo info)
    at System.Security.Principal.WindowsIdentity..ctor(SerializationInfo info, StreamingContext context)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
    at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
    at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
    at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
    at System.Runtime.Serialization.ObjectManager.DoFixups()
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
    at N4S.Forms.OperationHandlerBroker.AMessage.DeserializeMessage(Byte[] serializedMessage)
    at N4S.Forms.OperationHandlerBroker.WebServiceServer.BrokerService.InvokeOperationHandler(Byte[] serializedInvokeRequestMessage)
    --- End of inner exception stack trace ---
    expected: <0>
    but was: <1>
    Result StackTrace:
    at N4S.Harmony.Tests.TestHelper.InvokeOperation(OperationHandler handler, OperationHandlerInput input, Boolean expectedToWork) in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 136
    at N4S.Harmony.Tests.TestHelper.LoginAsUser(String username, String password) in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 394
    at N4S.Harmony.Tests.TestHelper.Login(TestUserName requestedUser) in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 377
    at N4S.Harmony.Tests.TestHelper.LoginAsAdvisor() in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 230
    at N4S.Harmony.Tests.CaseManagement.HarmonyFacadeTests.Login() in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\CaseManagement\HarmonyFacadeTests.cs:line 76
    at N4S.Harmony.Tests.CaseManagement.HarmonyFacadeTests.SetupTest() in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\CaseManagement\HarmonyFacadeTests.cs:line 67
    I am not sure what causing the issue. I checked the Credentials, Windows Identity during both the test run and there is no difference. Please advise !!
    Thanks,
    Deepak

    Hi Tina,
    Thanks for your reply. 
    I do have NUnit adapter installed. I even noticed that the test runs fine with NUnit GUI and also if I run it through Resharper Test Explorer window. 
    As you can see in the image above the same test is passed when I ran it from Resharper Unit Test Explorer window but fails when I ran it from Test Explorer window. I also captured the information on fiddler. 
    There was a significant difference in the Header Content length. Also under the User-Agent property the protocol versions are different. 
    Not sure why VSTest ExecutionEngine is picking a different version.
    The UnitTest in question is calling a webservice method which in turn calls a method from another referenced project. 
    Web Service class
    using System;
    using System.Web.Services;
    using N4S.Forms.OperationHandlerBroker.Server;
    using NLog;
    namespace N4S.Forms.OperationHandlerBroker.WebServiceServer
    /// <summary>
    /// The operaton-handler broker service.
    /// </summary>
    [WebService(Description = "The N4S Forms Operation-Handler Broker Web-Service.", Name = "OperationHandlerBrokerWebService",
    Namespace = "N4S.Forms.OperationHandlerBroker.WebServiceServer")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class BrokerService : WebService
    { /// <summary>
    /// Calls <see cref="HandleRequest"/>. Updates performance-counters.
    /// </summary>
    /// <param name="serializedInvokeRequestMessage">the binary-serialized <see cref="InvokeRequestMessage"/></param>
    /// <returns>the binary-serialized response message</returns>
    [WebMethod(BufferResponse = true, CacheDuration = 0, Description = "Invokes the requested operation-handler and returns a binary-serialized response-message.", EnableSession = false)]
    public byte[] InvokeOperationHandler(byte[] serializedInvokeRequestMessage)
    logger.Trace(Strings.TraceMethodEntered);
    PerformanceMonitor.RecordRequestStarted();
    InvokeRequestMessage requestMessage = (InvokeRequestMessage) AMessage.DeserializeMessage(serializedInvokeRequestMessage);
    InvokeResponseMessage responseMessage;
    try
    responseMessage = HandleRequest(requestMessage);
    PerformanceMonitor.RecordSuccessfulRequest();
    catch (Exception)
    PerformanceMonitor.RecordFailedRequest();
    throw;
    finally
    PerformanceMonitor.RecordRequestEnded();
    logger.Trace(Strings.TraceMethodExiting);
    return AMessage.SerializeMessage(responseMessage);
    UnitTest snippet
    OperationHandlerBrokerWebService brokerService = new OperationHandlerBrokerWebService();
    brokerService.UseDefaultCredentials = true;
    byte[] serializedResponseMessage = brokerService.InvokeOperationHandler(serializedRequestMessage);
    Please advise.
    Thanks,
    Deepak

  • AFAR test run showing the values but not posting in Real run.

    Hi Friends,
    i have an issue with AFAR recalculating the depreclation. The details are as below;
    1. Asset value date is 15.07.2010. but ordinary dep. start date was set as 01.01.2010 manually by the user.
    2. The Period control method 11, the dep. is calculated for entire year for acquisition.
    3. we have already calculated depreciation from period 12 2010 to period 04, 2011.
    4. Now, we have changed ordinary depreciation start date for 5 asset records from 01.01.2010 to 15.07.2010.
    5. Therefore, we recalculated AFAR for these assets for 2010 and test run is showing the values for these 5 asset. The same was expected by the business.
    6. When we execute the real run, it is not posting and no change in asset explorer for period 12, 2010 or in current period. No error message is available in spool / job log.
    We have opened FI periods as well.
    My question is  that why the system calculating the values in test run and if it is calculated in test run, why it is not posting in update run?
    As per the period control method, the depreciation should not recalculated for half year even we change the ordinary dep,start date from 1st Jan to 15th July.
    I  request you to clarify my doubt and help me to understand the error which is stoping the values in update run of AFAR.
    Best Regards,
    Padmaja

    Hi,
    Sorry...it is not worked out. Alternatively, i tried the shift factor with variable depreciation and i achieved the values which appeared in AFAR test run.
    Thanks for the help.
    Regards,
    Padmaja
    Edited by: PadmajaCH on May 19, 2011 3:26 PM

  • Remove test run from Load Test Manager in Visual Studio Online Load Testing

    I have been using the Visual Studio Online Azure load testing for a while now, and I have a number of test runs that I would like to remove.  I am not referring to my local Load Test Results Store (on-premise SQL DB), as I can remove test runs no problem.
     I mean, how to remove them from "the cloud" so we can no longer re-download the test results.  

    Hi David,
    As far as I know, it's not supported for Visual Studio Online to run load tests for solutions hosted on GitHub. You can submit a user voice
    here.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Document is not cretaed but test  run is successful.

    Hello this is the my problem.
    While runninf AFAB test run is successful but no document is getting posted.
    Data :
    Dep key assigned ZEIN
    Cal Methods Assigned :
    Base Method 014 Period Control 01 Multilevel ZEI(4.75% of Dep)
    Asset Values is there even tthough why I couldnt get the document after AFAB in test mode.
    Plz advice ASAP.

    Did you look at the spool in SM37 after you ran the transaction to see if it indicated any problems?
    Had you run ASKB (or ASKBN) first before running AFAB?

  • Schedule multiple jobs/test runs

    Hi,
    Is there a way to schedule multiple jobs/test runs with oats 9.10?
    It seems it is only possible to schedule a single job, by setting the start time in OLT...
    Any suggestions?

    Hi
    I'm talking about functional tests.
    In OLT when you set the auto-pilot you can schedule the test to start after a delay of xxx minutes or at some exact time, however I have never used that fixture.
    Regards
    Alex

  • Need to add TEST RUN in the Z  Program (URGENT)

    Dear All,
    I have to add a TEST RUN check Box in the Selection screen,same as Tcode:MRRL.
    Current Functionality: When we run this Z program,this will update the Local file data into DATABASE,will create a list stating the number of records updated and so.
    Required Functionality is: Before updating the data into DATABASE,want a preview of list with the details of number of records will update and so.
    Once user confirms the message,will back to the Selection-Screen and Uncheck the Check box and execute.Now data will update in the DATABASE.
    I hope You understand what i mean to say.
    Thanks & Regards,
    Seshadri G

    Hello Seshadri
    If the DB table is updated from an itab having the same structure then you could simply display the data in an ALV list, e.g.:
      IF ( p_test = 'X' ).
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
          EXPORTING
            I_STRUCTURE_NAME = <name of DB tabe>
         TABLES
            t_outtab = <your itab with updated data>.
      ELSE.
    * ... update DB table
      ENDIF.
    Regards
      Uwe

Maybe you are looking for

  • How much use can a MacBook pro take?

    Hi I just received my new MacBook pro 2.4ghz, and it's extremely fast. I have noticed that it gets hot when playing games, or when doing a lot at once. I was just worried, since I don't want to abuse my machine, whether I could keep the computer on f

  • How can I get audiobook chapters back after upgrading i Tunes and i Pad? I onlynave maprmparts of the book now.

    How can I retrieve individual chapters from an audio book after upgrading my i Pad 2. I now only jave the majormpart pf the bookmthat I had purchased via i Tunes.

  • HP Photosmart 5520 only printing black

    I have a new Photosmart 5520, loaded with new HP cartridges.  The ink colour levels are showing as fine, but it will not print in colour, only black.  Have tried with various PCs.  Test sheet and copying also comes out mono.

  • Open File dialog shortcuts

    Is there anyway to customize the shortcut? * I have a desktop shortcut which is pointless. - (I don't know, who throws working files on desktop, or have desktop as their working directory.) - Can I remove this? * I have a home shortcut which point to

  • What happened to the Safari status bar?

    Before Lion Safari used to have a nice little piece of functionality in the Status Bar. Before I ask, let me explain what *didn't* change. Still functioning in the status bar is notification that the link you're hovering over wil open up in a new tab