HOW TO PROGRAM THE ERRORS IN POSTING A DOCU USING BAPI_ACC_DCOCUMENT_POST

MY INTERNAL TABLES ARE :
TABLE FOR INTERNAL CUSTOMER.
DATA:   BEGIN OF T_ICUSTOMER OCCURS 0,
           BUKRS   LIKE BKPF-BUKRS, "COMPANY
           BELNR   LIKE BKPF-BELNR, "ACC.DOCUMENT NUMBER
           GJAHR   LIKE BKPF-GJAHR, "FISCAL YEAR
           MONAT   LIKE BKPF-MONAT, "FISCAL PERIOD
           EBELN   LIKE EKKO-EBELN, "DOCUMENT NUMBER
         KUNNR   LIKE LIKP-KUNNR,"DEALER
           KUNNR   LIKE EKPO-KUNNR, "INTERNL DEALER NUMBER
           HKONT   LIKE BSEG-HKONT, "G/L ACCOUT NUMBER
           KOSTL   LIKE BSEG-KOSTL, "COST CENTRE NUMBER
       END OF T_ICUSTOMER.
table to pass data to bapi header
DATA:  BEGIN OF STR_BAPI_HDR,
          TCODE        LIKE  SY-TCODE,  " VALUE 'RFBU'
          USERNAME     LIKE  SY-UNAME,
          BUKRS        LIKE  BSEG-BUKRS,
          DOC_DATE     LIKE  SY-DATUM ,
          PSTNG_DATE   LIKE  SY-DATUM,
          YEAR         LIKE  BSEG-GJAHR,
          DOCTYPE      LIKE  BKPF-BLART, " VALUE 'ZZ',
          BELNR        LIKE  BKPF-BELNR,
       END OF STR_BAPI_HDR.
table for debit/credit data of a dealer
DATA:  BEGIN OF T_ITEM_DATA OCCURS 0,
          BELNR   LIKE BSEG-BELNR," DOCUMENT NUMBER
          BSCHL   LIKE BSEG-BSCHL," POSTING KEY
          SHKZG   LIKE BSEG-SHKZG," DEBIT/CREDIT INDICATOR
          WRBTR   LIKE BSEG-WRBTR," AMOUNT
          PSWSL   LIKE BSEG-PSWSL," CURRENCY
          HKONT   LIKE BSEG-HKONT," G/L ACCOUNT
          KUNNR   LIKE BSEG-KUNNR," DEALER
          PRCTR   LIKE BSEG-PRCTR," PROFIT CENTRE
       END OF T_ITEM_DATA.
table to pass data to bapiacgl09
DATA: T_ACCOUNTGL   TYPE STANDARD TABLE OF BAPIACGL09,
      WA_ACCOUNTGL  TYPE                   BAPIACGL09.
*table to pass data to bapiaccr09
DATA: T_CURRENCYAMOUNT    TYPE STANDARD TABLE OF BAPIACCR09,
      WA_CURRENCYAMOUNT   TYPE                   BAPIACCR09.
NOW I NEED TO PASS DATA TO BAPI 'BAPI_ACC_DOCUMENT_POST".
SO I CONSTRUCTED THE STRUCTURE AND TABLES TO PASS TO THE BAPI AS FOLLOWS:
LOOP AT T_ICUSTOMER.
SELECTING HEADER DATA VALUES TO PASS TO STRUCTURE BAPIACHE09
     CLEAR STR_BAPI_HDR.
     STR_BAPI_HDR-TCODE        = 'RFBU'.
     STR_BAPI_HDR-USERNAME     =  SY-UNAME.
     STR_BAPI_HDR-BUKRS        =  T_ICUSTOMER-BUKRS.
     STR_BAPI_HDR-DOC_DATE     =  SY-DATUM.
     STR_BAPI_HDR-PSTNG_DATE   =  SY-DATUM.
     STR_BAPI_HDR-YEAR         =  T_ICUSTOMER-GJAHR.
     STR_BAPI_HDR-DOCTYPE      =  'ZZ'.
     STR_BAPI_HDR-BELNR        =  T_ICUSTOMER-BELNR.
SELCETING DATA  FROM BSEG
        CLEAR T_ITEM_DATA.
        REFRESH T_ITEM_DATA.
     SELECT BELNR
            BSCHL
            SHKZG
            WRBTR
            PSWSL
            HKONT
            KUNNR
            PRCTR
            FROM BSEG
            INTO CORRESPONDING FIELDS OF TABLE T_ITEM_DATA
            WHERE BELNR = T_ICUSTOMER-BELNR.
      ITEMNO_ACC = 1.
      LOOP AT T_ITEM_DATA.
*declare a variable here to pass to item tab..
          IF  T_ITEM_DATA-BSCHL  = '31' AND
              T_ITEM_DATA-SHKZG  = 'H'.     " IF CREDITING THE INVENTORY
                CONCATENATE TEXT T_ICUSTOMER-EBELN  INTO ITEM_TEXT.
                    WA_ACCOUNTGL-ITEMNO_ACC         = ITEMNO_ACC.
                    WA_ACCOUNTGL-GL_ACCOUNT         = T_ICUSTOMER-HKONT.
                    WA_ACCOUNTGL-ITEM_TEXT          = ITEM_TEXT.
                    WA_ACCOUNTGL-COSTCENTER         = T_ICUSTOMER-KOSTL.
                    WA_ACCOUNTGL-DE_CRE_IND         = 's'.
                    WA_CURRENCYAMOUNT-ITEMNO_ACC  = ITEMNO_ACC.
                    WA_CURRENCYAMOUNT-CURRENCY    = T_ITEM_DATA-PSWSL.
                   WA_CURRENCYAMOUNT-CURRENCY_ISO = T_ITEM_DATA-PSWSL.
                    WA_CURRENCYAMOUNT-AMT_DOCCUR   = T_ITEM_DATA-WRBTR.
                    APPEND WA_ACCOUNTGL TO T_ACCOUNTGL.
                    APPEND WA_CURRENCYAMOUNT TO T_CURRENCYAMOUNT.
                    CLEAR: WA_ACCOUNTGL,WA_CURRENCYAMOUNT.
         ELSEIF T_ITEM_DATA-BSCHL   = '99' AND
                T_ITEM_DATA-SHKZG  = 'S'.
                    WA_ACCOUNTGL-ITEMNO_ACC       =  ITEMNO_ACC.
                    WA_ACCOUNTGL-GL_ACCOUNT       =  T_ITEM_DATA-HKONT.
                    WA_ACCOUNTGL-PROFIT_CTR       =  T_ITEM_DATA-PRCTR.
                    WA_ACCOUNTGL-DE_CRE_IND       =  'H'.
                    WA_CURRENCYAMOUNT-ITEMNO_ACC  = ITEMNO_ACC.
                    WA_CURRENCYAMOUNT-CURRENCY    = T_ITEM_DATA-PSWSL.
                   WA_CURRENCYAMOUNT-CURRENCY_ISO = T_ITEM_DATA-PSWSL.
                   WA_CURRENCYAMOUNT-AMT_DOCCUR   = T_ITEM_DATA-WRBTR.
                   APPEND WA_ACCOUNTGL TO T_ACCOUNTGL.
                   APPEND WA_CURRENCYAMOUNT TO T_CURRENCYAMOUNT.
                   CLEAR: WA_ACCOUNTGL,WA_CURRENCYAMOUNT.
         ENDIF.
           ITEMNO_ACC = ITEMNO_ACC + 1.
ENDLOOP.
NOW I CALL THE BAPI AND PASS THESE STRUCTURE AND TABLE:
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
  EXPORTING
    documentheader          = STR_BAPI_HDR
  CUSTOMERCPD             =
  CONTRACTHEADER          =
IMPORTING
  OBJ_TYPE                =
  OBJ_KEY                 =
  OBJ_SYS                 =
  tables
    ACCOUNTGL               =  T_ACCOUNTGL
  ACCOUNTRECEIVABLE       =
  ACCOUNTPAYABLE          =
  ACCOUNTTAX              =
    currencyamount          = T_CURRENCYAMOUNT
  CRITERIA                =
  VALUEFIELD              =
  EXTENSION1              =
   return                 =
  PAYMENTCARD             =
  CONTRACTITEM            =
NOW I WANT TO CHECK IF THE DOCUMENT IS POSTED OR NOT.SO I NEED TO CONSTRUCT THE TABLE RETURN....
CAN ANY ONE HELP ME IN CONSTRUCTING THE TABLE AND HOW TO CHECK IF IT IS SUCCESSFULL OR NOTAND DO THE NECESSARY POST PROCESSING..I.E. CALL THE REURN VALUE INTO
THE PROGRAM AND DO THE POST PROCESSING..
ENDLOOP.

I guess this is what you want:
DATA: BEGIN OF return OCCURS 0.
        INCLUDE STRUCTURE bapiret2.
DATA: END   OF return.
DATA: do_commit.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
  EXPORTING
    documentheader = str_bapi_hdr
  TABLES
    accountgl      = t_accountgl
    currencyamount = t_currencyamount
    return         = return.
CLEAR do_commit.
LOOP AT return..
  WRITE: /001 return-message.
  IF  return-type = 'S'.
    do_commit = 'X'.
  ENDIF.
ENDLOOP.
IF NOT do_commit IS INITIAL.
  CLEAR   return.
  REFRESH return.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait   = 'X'
    IMPORTING
      return = return.
ENDIF.
Rob

Similar Messages

  • Error while posting a document using  the  BAPI_GOODSMVT_CREATE

    Hi,
    i was trying to post the Goods Receipt document ( Tcode MB1C) using the bapi  BAPI_GOODSMVT_CREATE
    i am passing the item details and Serial number details.
    the error triggered was Maintain Serial Numbers for Total Quantity
    but i am passing the quantity as 1 ( in item data) and passing one serial number.
    is this error because of data problem or am i missing to pass the value to  some dependent parameter..?
    Please help me out.
    Thanks in advance.
    Sriram

    Hi David,
    i was tring to pass the same.
    in item table we have we have four item details ( below)
    RES_ITEM - Item Number of Reservation/Dependent Requirement
    ORDER_ITNO - Order Item Number
    S_ORD_ITEM - Item Number in Sales Order ( length mismatch with serial  item number)
    PO_ITEM  - Item Number of Purchasing Document ( length mismatch with serial  item number)
    out 4 , 2 are ruled out because of length mismatch. and in the reaming two are
    RES_ITEM - Item Number of Reservation/Dependent Requirement
    ORDER_ITNO - Order Item Number
    this is a Goods receipt document, please let me know which field is required to map with item number in the above two.
    Regards,
    Sriram.

  • How to program the FPGA with compact flash without using IMPACT

    hi;
    I want to load my download.bit generated by the EDK tool in the compact flash to program the FPGA (spartan 3a for dsp),
    please anyone help me to program my FPGA (spartan 3a for dsp) using the compact flash without using IMPACT

    check if the following link helps
    http://www.xilinx.com/products/intellectual-property/xps_sysace.html

  • Error whil posting FI Document using 'F-28' 'Entry not Possible'

    Hi ,
            When i  trying post FI Dcoument using 'F-28'. As sudden given Posting key and account number i m getting the error "Entry not possible'. Can someone tell what is the reason for this.
    Regards
    Balamurugan N

    Check table TBSL : posting key TBSL-BSCHL give allowed account type TBSL-KOART
    A-nlagen(Asset),
    D-ebitoren(customer),
    K-reditoren(vendor),
    M-aterial,
    S-achkonten (general ledger))
    So, you cannot use a [posting key|http://help.sap.com/saphelp_46c/helpdata/en/96/8b3ee943ce11d189ee0000e81ddfac/frameset.htm] like 40 or 50 for a customer account or a 01 or 11 for a bank or expense/fee account.
    Regards,
    Raymond

  • How to read the error message like clipping positive or -ve in Tektronix oscillioscope 3012B

    During acquiring the Sine wave or triangular wave from TDS3012B, if the amplitude or Max or min is clipping, how do you read the error?  I used *ESR?, first time when I ran the error query program, it gave me Error message saying it is clipping, after that If I run again,the error query , It would not give me the error message, I couldn't reproduce it, eventhough but On the screen if I measure, Amp, min and Max it says that it is clipping positive or -ve. I was wondering how to read the error message while aquiring the data?  If any one could help me that would be of great help.. Thanks

    Usually, reading the error status register clears it. I'm not familiar with this particular model of scope but you may have to initiate a new acquisition in order for the scope to generate a new error. Another possiblity is that a new error will be generated when the vertical scale changes. Unless someone posts with an answer, I'd say that your best bet to get an answer is to contact Tektronix technical support.

  • How to rectify the errors through call transaction metod in bdc

    how to rectify the errors through call transaction metod in bdc

    Hi ,
    View the highlited part of the below code.
    REPORT ygfrivat1 NO STANDARD PAGE HEADING
                     LINE-SIZE 165
                     MESSAGE-ID yif_groc.
    Program     YGFRIVAT1
    Function    Report to Upload the VAT Adjustment File.
    Author      ARENAPU
    Date        11.05.2007
    PMTS        AM12810157
    Transport   G6DK937834
    Description:
    Modification log:
    1. Changed by  :
       Changed on  :
       PMTS        :
       Transport   :
       Tag         :
       Description :
           T A B L E S   D E C L A R A T I O N S
    TABLES: edidc,  "Control record (IDoc)
            edids,  "Status Record (IDoc)
            t001w.
    Internal Tables Declaration.
    Internal table to hold data from table EDIDS
    DATA: BEGIN OF t_edids OCCURS 0,
           docnum LIKE edids-docnum,
           logdat LIKE edids-logdat,
           logtim LIKE edids-logtim,
           countr LIKE edids-countr,
           credat LIKE edids-credat,
           uname  LIKE edids-uname,
          END OF t_edids,
    Internal table to hold data from table EDIDC
          BEGIN OF t_edidc OCCURS 0,
           docnum LIKE edidc-docnum,
           rcvprt LIKE edidc-rcvprt,
           rcvprn LIKE edidc-rcvprn,
           credat LIKE edidc-credat,
          END OF t_edidc,
    Internal table to hold data from upload file
          BEGIN OF t_tab OCCURS 0,
           cust(10),        "site/customer number
           date(10),        "transaction date
           currency(04),    "currency
           extnbr(15),      "external reference number
           pos-cont(05),    "POS controler
           pos-id(25),      "POS id
           cashier(10),     "cashier name
           qualif(04),      "qualifier of the article
           matnr(25),       "article number
           qty(10),         "quantity
           sale(16),        "sale value
           pos-tr(04),      "POS transfert type
           paymeth(04),     "payment method
           final(35),       "final price
           tarcur(04),      "target currency
           assign(35),      "assignment day
           error,
          END OF t_tab,
    Internal table for Report display.
          BEGIN OF t_tab1 OCCURS 0,
           cust(10),                    "site/customer number
           date(10),                    "transaction date
           currency(04),                "currency
           extnbr(15),                  "external reference number
           pos-cont(05),                "POS controler
           pos-id(25),                  "POS id
           cashier(10),                 "cashier name
           qualif(04),                  "qualifier of the article
           matnr(25),                   "article number
           qty(16)   TYPE p DECIMALS 2, "quantity
           sale(16)  TYPE p DECIMALS 2, "sale value
           pos-tr(04),                  "POS transfert type
           paymeth(04),                 "payment method
           final(16) TYPE p DECIMALS 2, "final price
           tarcur(04),                  "target currency
           assign(35),                  "assignment day
          END OF t_tab1,
          t_tab_temp LIKE t_tab OCCURS 0 WITH HEADER LINE,
    Internal table to Validate Customer no.
          BEGIN OF t_check OCCURS 0,
           werks LIKE t001w-werks,
           vkorg LIKE t001w-vkorg,
           value(40),
          END OF t_check,
          t_check_temp LIKE t_check OCCURS 0 WITH HEADER LINE.
    Internal table to hold data from table ZCS_PARAM.
    DATA: BEGIN OF t_zcs_param OCCURS 0.
            INCLUDE STRUCTURE zcs_param.
    DATA: vkorg LIKE t001w-vkorg,
          END OF t_zcs_param.
    *Internal table to hold Messages.
    DATA: BEGIN OF t_message OCCURS 0,
             msgnum TYPE msgnum,
             msgtyp TYPE msgtyp,
             msgtxt TYPE msgtext,
           END OF t_message.
    *Work area for table t_message
    DATA : w_message LIKE LINE OF t_message.
    Internal table to hold BDC data
    DATA: t_bdcdata LIKE bdcdata    OCCURS 0 WITH HEADER LINE,
    Internal table to collect error messages
          messtab   LIKE bdcmsgcoll OCCURS 0  WITH HEADER LINE.
    *Internal table to hold messages from call transaction
    DATA: BEGIN OF t_text OCCURS 0,
           desc(150),
           msgtxt(100),
          END OF t_text.
           D A T A   D E C L A R A T I O N S
    DATA: n TYPE i,
          gv_status(11) TYPE c, "Shows status, Production or Test
          gv_exit TYPE c,  "Exit Flag
          gv_qty(16)   TYPE p DECIMALS 2, "Variable to sum Quantity
          gv_sale(16)  TYPE p DECIMALS 2, "Variable to sum Amount
          gv_final(16) TYPE p DECIMALS 2. "Variable to sum Final Amount
    DATA: w_text(100),
          gv_mode TYPE c,
          error TYPE c.  "Flag to Indicate error.
    CONSTANSTS DECLARATION
    CONSTANTS : gc_fieldname LIKE dynpread-fieldname VALUE 'P_FNAME',
                gc_seq_no LIKE zcs_param-seq_no VALUE '00110',
                gc_object LIKE zcs_param-object VALUE 'YGFVAT',
                gc_paraname LIKE zcs_param-paraname VALUE 'VKORG',
                gc_back TYPE c VALUE 'N',
                gc_error TYPE c VALUE 'E',
                gc_all TYPE c VALUE 'A'.
               S E L E C T I O N   S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
    PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-002 FOR FIELD p_test.
    PARAMETERS : p_test AS CHECKBOX.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK a1.
    SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-006.
    PARAMETERS : rb_back RADIOBUTTON GROUP rb1 DEFAULT 'X',
                 rb_error RADIOBUTTON GROUP rb1,
                 rb_all RADIOBUTTON GROUP rb1.
    SELECTION-SCREEN END OF BLOCK a2.
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    *Subroutine to provide F4 help for file name
      PERFORM fr_get_filename.
           I N I T I A L I Z A T I  O N
    INITIALIZATION.
    *Subroutine to check authorization.
    PERFORM fr_authority_check.
            T O P - O F - P A G E
    TOP-OF-PAGE.
    *Subroutine to diplay header
      PERFORM fr_display_header.
             S T A R T - O F - S E L E C T I O N
    START-OF-SELECTION.
    *Subroutine to upload data from presentation server.
      PERFORM fr_upload_data.
    *Subroutine to validate records from uploaded file.
      PERFORM fr_validate_data.
    *Subroutine to build report internal table.
      PERFORM fr_build_rep.
             E N D - O F - S E L E C T I O N
    END-OF-SELECTION.
    *Subroutine to display report.
      PERFORM fr_write_report.
            F O R M   S U B R O U T I N E S
    *&      Form  fr_get_filename
          text
    FORM fr_get_filename.
      DATA : lv_repid LIKE sy-repid,         " Report id
             lv_file  LIKE ibipparms-path.   " File Path
      lv_repid = sy-repid.
    F4 help for file path.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                program_name  = lv_repid
                dynpro_number = syst-dynnr
                field_name    = gc_fieldname                    " p_fname1
           IMPORTING
                file_name     = lv_file.
      IF NOT lv_file EQ space.
        p_fname = lv_file.
      ELSE.
        MESSAGE e999 WITH 'Invalid Path'(005).
      ENDIF.
    ENDFORM.                    " fr_get_filename
    *&      Form  fr_upload_data
          text
    FORM fr_upload_data.
      DATA: lv_fname TYPE string.
      CLEAR lv_fname.
      lv_fname = p_fname.
    Uploading file from PC or presentation server to internal table.
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                filename            = lv_fname
                filetype            = 'ASC'
                has_field_separator = 'X'
           TABLES
                data_tab            = t_tab
           EXCEPTIONS
                file_open_error     = 1.
      IF sy-subrc <> 0.
        DESCRIBE TABLE t_message LINES n.
        w_message-msgnum = n + 1.
        w_message-msgtyp = 'E'.
        MOVE text-m01  TO w_message-msgtxt.
        APPEND w_message TO t_message.
    Subroutine for writing log.
        PERFORM fr_write_log.
      ENDIF.
    ENDFORM.                    " fr_upload_data
    *&      Form  fr_validate_data
          text
    FORM fr_validate_data.
      DATA : lv_lines1 TYPE i,
             lv_lines2 TYPE i.
    *Obtain Status depending on Check box selected.
      IF p_test IS INITIAL.
        gv_status = 'PRODUCTION'.
      ELSE.
        gv_status = 'TEST RUN'.
      ENDIF.
    *Batch Mode
      CLEAR gv_mode.
      IF rb_back EQ 'X'.          "No Display
        MOVE gc_back TO gv_mode.
      ELSEIF rb_error EQ 'X'.     "Error Only
        MOVE gc_error TO gv_mode.
      ELSEIF rb_all EQ 'X'.       "All Screens
        MOVE gc_all TO gv_mode.
      ENDIF.
      IF NOT t_tab[] IS INITIAL.
        SORT t_tab BY cust.
        REFRESH t_tab_temp.
        t_tab_temp[] = t_tab[].
        SORT t_tab_temp BY cust.
        DELETE ADJACENT DUPLICATES FROM t_tab_temp COMPARING cust.
        IF NOT t_tab_temp[] IS INITIAL.
          SELECT werks vkorg FROM t001w
                             INTO TABLE t_check
                             FOR ALL ENTRIES IN t_tab_temp
                             WHERE werks = t_tab_temp-cust+0(4).
          IF sy-subrc = 0.
            SORT t_check BY werks.
          ENDIF.
          LOOP AT t_check.
            IF t_check-vkorg <> ' '.
              MOVE t_check-vkorg TO t_check-value.
              MODIFY t_check TRANSPORTING value.
            ENDIF.
          ENDLOOP.
        ENDIF.
        FREE t_tab_temp.
      ENDIF.
      IF NOT t_check[] IS INITIAL.
        REFRESH t_check_temp.
        t_check_temp[] = t_check[].
        SORT t_check_temp BY value.
        DELETE ADJACENT DUPLICATES FROM t_check_temp COMPARING value.
        IF NOT t_check_temp[] IS INITIAL.
          SELECT * FROM zcs_param INTO TABLE t_zcs_param
                   FOR ALL ENTRIES IN t_check_temp
                   WHERE seq_no   EQ gc_seq_no
                     AND object   EQ gc_object
                     AND paraname EQ gc_paraname
                     AND value    EQ t_check_temp-value.
          IF sy-subrc = 0.
            SORT t_zcs_param BY value.
          ENDIF.
        ENDIF.
        FREE t_check_temp.
      ENDIF.
      IF NOT t_tab[] IS INITIAL.
        LOOP AT t_tab.
          READ TABLE t_check WITH KEY werks = t_tab-cust BINARY SEARCH.
          IF sy-subrc <> 0.
            MOVE 'X' TO t_tab-error.
            MODIFY t_tab TRANSPORTING error.
            DESCRIBE TABLE t_message LINES n.
            w_message-msgnum = n + 1.
            w_message-msgtyp = 'E'.
            CONCATENATE t_tab-cust text-030
            INTO w_message-msgtxt SEPARATED BY space.
            APPEND w_message TO t_message.
    Subroutine for writing log.
            PERFORM fr_write_log.
            EXIT.
          ELSE.
            READ TABLE t_zcs_param WITH KEY value = t_check-vkorg
                                                         BINARY SEARCH.
            IF sy-subrc <> 0.
              MOVE 'X' TO t_tab-error.
              MODIFY t_tab TRANSPORTING error.
              DESCRIBE TABLE t_message LINES n.
              w_message-msgnum = n + 1.
              w_message-msgtyp = 'E'.
              CONCATENATE text-003 t_tab-cust text-004 t_check-vkorg
              INTO w_message-msgtxt SEPARATED BY space.
              APPEND w_message TO t_message.
    Subroutine for writing log.
              PERFORM fr_write_log.
              EXIT.
            ELSE.
              PERFORM fr_format_tab.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE t_tab LINES lv_lines1.
      IF lv_lines1 <> 0.
        DELETE t_tab WHERE error EQ 'X'.
      ENDIF.
      DESCRIBE TABLE t_tab LINES lv_lines2.
      IF lv_lines2 <> 0.
        IF lv_lines2 <> lv_lines1.
          EXIT.
        ELSE.
          IF p_test IS INITIAL.
            LOOP AT t_tab.
    *Subroutine to build BDC table
              PERFORM fr_fill_bdctab.
    *Subroutine to Post Data into SAP.
              PERFORM fr_data_posting.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " fr_validate_data
    *&      Form  fr_write_log
          text
    FORM fr_write_log.
      CLEAR error.
      error = 'X'.
      WRITE:/1 'Msg No'(027), 10 'Type'(028), 20 'Text'(029).
      ULINE:/1(120).
      FORMAT RESET.
      LOOP AT t_message.
        IF t_message-msgtyp = 'E'.
          FORMAT COLOR 6 INTENSIFIED .
        ELSEIF t_message-msgtyp = 'W'.
          FORMAT COLOR 3 INTENSIFIED .
        ELSEIF t_message-msgtyp = 'I'.
          FORMAT COLOR 5 INTENSIFIED .
        ENDIF.
        WRITE:/1 t_message-msgnum,
              10 t_message-msgtyp,
              20 t_message-msgtxt.
        FORMAT RESET.
      ENDLOOP.
      ULINE:/1(120).
    ENDFORM.                    " fr_write_log
    *&      Form  fr_write_report
          text
    FORM fr_write_report.
      CLEAR gv_exit.
      LOOP AT t_message.
        IF t_message-msgtyp = 'E'.
          gv_exit = 'X'.
          EXIT.
        ENDIF.
      ENDLOOP.
      IF NOT gv_exit IS INITIAL.
        EXIT.
      ELSE.
        PERFORM fr_display_report.
        IF NOT t_text[] IS INITIAL.
    Subroutine for Display Call Transaction messages.
          PERFORM fr_write_msg.
        ENDIF.
      ENDIF.
    ENDFORM.                    " fr_write_report
    *&      Form  fr_display_report
          text
    FORM fr_display_report.
      IF NOT t_tab1[] IS INITIAL.
        CLEAR: gv_qty, gv_sale, gv_final.
        LOOP AT t_tab1.
          WRITE:/1(10) t_tab1-cust,
                13(10) t_tab1-date,
                25(05) t_tab1-currency,
                32(14) t_tab1-extnbr,
                48(09) t_tab1-pos-cont,
                60(18) t_tab1-matnr,
                80(16) t_tab1-qty RIGHT-JUSTIFIED ,
                98(16) t_tab1-sale RIGHT-JUSTIFIED ,
               116(07) t_tab1-paymeth,
               125(16) t_tab1-final RIGHT-JUSTIFIED,
               143(06) t_tab1-tarcur,
               152(12) t_tab1-assign.
          gv_qty   = t_tab1-qty   + gv_qty.
          gv_sale  = t_tab1-sale  + gv_sale.
          gv_final = t_tab1-final + gv_final.
        ENDLOOP.
        FORMAT COLOR 3.
        ULINE: /(164).
        WRITE:/ 'TOTALS',
          80(16) gv_qty RIGHT-JUSTIFIED,
          98(16) gv_sale RIGHT-JUSTIFIED,
         125(16) gv_final RIGHT-JUSTIFIED,
         182 ''.
        ULINE: /(164).
        FORMAT RESET.
      ENDIF.
    ENDFORM.                    " fr_display_report
    *&      Form  FR_DISPLAY_HEADER
          text
    FORM fr_display_header.
      IF error IS INITIAL.
        FORMAT COLOR 1.
        WRITE:/ 'Date upload           :'(007),   25 sy-datum,  38 ''.
        WRITE:/ 'Production or Test Run:'(008),   25 gv_status, 38 ''.
        WRITE:/ 'Upload User Logon     :'(009),   25 sy-uname,  38 ''.
        ULINE: /(164).
        WRITE:/1(04) 'Site'(010),
              13(10) 'Date'(011),
              25(05) 'Curr.'(012),
              32(14) 'Receipt'(013),
              48(09) 'Cashier'(014),
              60(18) 'Article'(015),
              92     'Qty'(016),
              102    'Item Amount'(017),
              116(7) 'M.o.P.'(018),
              128    'Tender Amount'(019),
              143(6) 'T.Curr'(020),
             152(12) 'Assignment'(021).
        ULINE:/(164).
        FORMAT RESET.
      ENDIF.
    ENDFORM.                    " FR_DISPLAY_HEADER
    *&      Form  fr_newdynpro
          text
    FORM fr_newdynpro USING program LIKE bdcdata-program
                            dynpro  LIKE bdcdata-dynpro.
      t_bdcdata-program = program .
      t_bdcdata-dynpro  = dynpro.
      t_bdcdata-dynbegin = 'X'.
      APPEND t_bdcdata.
      CLEAR t_bdcdata.
    ENDFORM.                    " fr_newdynpro
    *&      Form  fr_loadfield
          text
    FORM fr_loadfield USING field LIKE bdcdata-fnam
                            value.
      t_bdcdata-fnam = field.
      t_bdcdata-fval = value.
      APPEND t_bdcdata.
      CLEAR t_bdcdata.
    ENDFORM.                    " fr_loadfield
    *&      Form  fr_fill_bdctab
          text
    FORM fr_fill_bdctab.
      REFRESH t_bdcdata.
      PERFORM fr_newdynpro USING 'SAPMWPUK' '100'.
      PERFORM fr_loadfield USING 'G_FILIALE' t_tab-cust.
      PERFORM fr_loadfield USING 'G_DATUM'   t_tab-date.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'BON'.
      PERFORM fr_newdynpro USING 'SAPMWPUK' '500'.
      PERFORM fr_loadfield USING 'WPSCB01-POSKREIS'   t_tab-pos-cont.
      PERFORM fr_loadfield USING 'WPSCB01-KASSID'     t_tab-pos-id.
      PERFORM fr_loadfield USING 'WPSCB01-BELEGWAERS' t_tab-currency.
      PERFORM fr_loadfield USING 'WPSCB01-CSHNAME'    t_tab-cashier.
      PERFORM fr_loadfield USING 'WPSCB01-BONNUMMER'  t_tab-extnbr.
      PERFORM fr_loadfield USING 'E1WPB02-QUALARTNR(01)'  t_tab-qualif.
      PERFORM fr_loadfield USING 'E1WPB02-ARTNR(01)'      t_tab-matnr.
      PERFORM fr_loadfield USING 'E1WPB02-MENGE(01)'      t_tab-qty.
      PERFORM fr_loadfield USING 'WPSCB03-KONDVALUE(01)'  t_tab-sale.
      PERFORM fr_loadfield USING 'E1WPB02-VORGANGART(01)' t_tab-pos-tr.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'ZAHL'.
      PERFORM fr_newdynpro USING 'SAPMWPUK' '530'.
      PERFORM fr_loadfield USING 'WPSCB06-ZAHLART'  t_tab-paymeth.
      PERFORM fr_loadfield USING 'WPSCB06-SUMME'    t_tab-final.
      PERFORM fr_loadfield USING 'WPSCB06-WAEHRUNG' t_tab-tarcur.
      PERFORM fr_loadfield USING 'WPSCB06-ZUONR'    t_tab-assign.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'SAVE'.
      PERFORM fr_newdynpro USING 'SAPMWPUK' '530'.
      PERFORM fr_loadfield USING 'WPSCB06-ZAHLART'  t_tab-paymeth.
      PERFORM fr_loadfield USING 'WPSCB06-SUMME'    t_tab-final.
      PERFORM fr_loadfield USING 'WPSCB06-WAEHRUNG' t_tab-tarcur.
      PERFORM fr_loadfield USING 'WPSCB06-ZUONR'    t_tab-assign.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'BACK'.
      PERFORM fr_newdynpro USING 'SAPLSPO1' '0200'.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'YES'.
      PERFORM fr_newdynpro USING 'SAPMWPUK' '100'.
      PERFORM fr_loadfield USING 'G_FILIALE' t_tab-cust.
      PERFORM fr_loadfield USING 'G_DATUM'   t_tab-date.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'BACK'.
    ENDFORM.                    " fr_fill_bdctab
    *&      Form  fr_data_posting
          text
    FORM fr_data_posting.
      IF NOT t_bdcdata[] IS INITIAL.
        REFRESH messtab.
        CALL TRANSACTION 'WPUK' USING t_bdcdata
                                MODE gv_mode
                                UPDATE 'S'
                                MESSAGES INTO messtab.
        IF sy-subrc = 0 .
          CLEAR w_text.
          LOOP AT messtab.
            CALL FUNCTION 'FORMAT_MESSAGE'
                 EXPORTING
                      id        = messtab-msgid
                      lang      = sy-langu
                      no        = messtab-msgnr
                      v1        = messtab-msgv1
                      v2        = messtab-msgv2
                      v3        = messtab-msgv3
                      v4        = messtab-msgv4
                 IMPORTING
                      msg       = w_text
                 EXCEPTIONS
                      not_found = 1
                      OTHERS    = 2.
            MOVE w_text TO t_text-msgtxt.
            CONCATENATE 'Site:'(031)    t_tab-cust
                        'Article:'(024) t_tab-matnr
                        'Posted Sucessfully'(032)
              INTO t_text-desc SEPARATED BY space.
            APPEND t_text.
            CLEAR t_text.
          ENDLOOP.
        ELSE.
          CLEAR w_text.
          LOOP AT messtab.
            CALL FUNCTION 'FORMAT_MESSAGE'
                 EXPORTING
                      id        = messtab-msgid
                      lang      = sy-langu
                      no        = messtab-msgnr
                      v1        = messtab-msgv1
                      v2        = messtab-msgv2
                      v3        = messtab-msgv3
                      v4        = messtab-msgv4
                 IMPORTING
                      msg       = w_text
                 EXCEPTIONS
                      not_found = 1
                      OTHERS    = 2.
            MOVE w_text TO t_text-msgtxt.
            IF messtab-msgnr EQ '213'.
              CONCATENATE 'Site:'(031)    t_tab-cust
                          'Article:'(024) t_tab-matnr
                          'Posted Sucessfully'(032)
               INTO t_text-desc SEPARATED BY space.
              APPEND t_text.
              CLEAR t_text.
              EXIT.        ELSE.
              CONCATENATE 'Site:'(031)    t_tab-cust
                          'Article:'(024) t_tab-matnr
                          'Not Posted'(033)
               INTO t_text-desc SEPARATED BY space.
              APPEND t_text.
              CLEAR t_text.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.                    " fr_data_posting
    *&      Form  fr_authority_check
          text
    FORM fr_authority_check.
      AUTHORITY-CHECK OBJECT 'Y_VATADJ'
               ID 'VKORG' FIELD t001w-vkorg
               ID 'TCD'   FIELD 'YGFVAT'.
      IF sy-subrc NE 0.
        MESSAGE e999 WITH text-m02.
      ENDIF.
    ENDFORM.                    " fr_authority_check
    *&      Form  fr_write_msg
          text
    FORM fr_write_msg.
      SKIP.
      ULINE:/(164).
      WRITE:/
      'Messages encountered while Calling Transaction WPUK'(025),
          90 'Message Text'(026).
      ULINE:/1(164).
      LOOP AT t_text.
        WRITE:/1 t_text-desc,
              90 t_text-msgtxt,
              164 ''.
      ENDLOOP.
      ULINE:/1(164).
    ENDFORM.                    " fr_write_msg
    *&      Form  FR_BUILD_REP
          text
    FORM fr_build_rep.
      IF error IS INITIAL.
        IF NOT t_tab[] IS INITIAL.
          LOOP AT t_tab.
            MOVE:
              t_tab-cust     TO t_tab1-cust,        "site/customer number
              t_tab-date     TO t_tab1-date,        "transaction date
              t_tab-currency TO t_tab1-currency,    "currency
            t_tab-extnbr   TO t_tab1-extnbr,      "external reference number
              t_tab-pos-cont TO t_tab1-pos-cont,    "POS controler
              t_tab-pos-id   TO t_tab1-pos-id,      "POS id
              t_tab-cashier  TO t_tab1-cashier,     "cashier name
             t_tab-qualif   TO t_tab1-qualif,      "qualifier of the article
              t_tab-matnr    TO t_tab1-matnr,       "article number
              t_tab-pos-tr   TO t_tab1-pos-tr,      "POS transfert type
              t_tab-paymeth  TO t_tab1-paymeth,     "payment method
              t_tab-tarcur   TO t_tab1-tarcur,      "target currency
              t_tab-assign   TO t_tab1-assign.
            REPLACE ',' WITH '.' INTO t_tab-qty.
            CONDENSE t_tab-qty NO-GAPS.
            MOVE t_tab-qty TO t_tab1-qty.
            REPLACE ',' WITH '.' INTO t_tab-sale.
            CONDENSE t_tab-sale NO-GAPS.
            MOVE t_tab-sale TO t_tab1-sale.
            REPLACE ',' WITH '.' INTO t_tab-final.
            CONDENSE t_tab-final NO-GAPS.
            MOVE t_tab-final TO t_tab1-final.
            APPEND t_tab1.
            CLEAR t_tab1.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.                    " FR_BUILD_REP
    *&      Form  fr_format_tab
          text
    FORM fr_format_tab.
      DATA : lv_qty TYPE string.
      IF NOT t_tab-qty IS INITIAL.
        IF t_tab-qty+0(1) EQ '-'.
          CLEAR lv_qty.
          MOVE t_tab-qty TO lv_qty.
          CLEAR t_tab-qty.
          SHIFT lv_qty LEFT CIRCULAR.
          CONDENSE lv_qty NO-GAPS.
          MOVE lv_qty TO t_tab-qty.
          MODIFY t_tab TRANSPORTING qty.
        ENDIF.
      ENDIF.
    ENDFORM.                    " fr_format_tab

  • How to rectify the errors in master data loads & transactional data loads?

    hy,
    please any one tell me
    How to rectify the errors in master data loads & transactional data loads?
    thnQ
    Ravi

    Hi,
    Please post specific questions in the forum.
    Please explain the error you are getting.
    -Vikram

  • The server deploy EJB but I run EJB Client program,The error msg is can't find JNDI

    Hi all:
    I am using Weblogic 6.1/SP2. I use the console to start
    server and deploy EJB jar,from the msg I see my EJB jar
    been deployed. When I run EJB Client program, the error
    msg is can't find JNDI name t3://URL:11003.....
    I check my ejb-jar.xml amd weblogic-ejb-jar.xml are fine.
    Last week I did deploy EJB and ran the client both
    suceessful. Any ideas, Thank you.

    Sabha:
    Thank you for your help info, I soloved the problem.
    The problem is the ejb jar was deleted(I don't why)
    then System Admin to deploy EJB jar from Admin console.
    After that everything is fine.
    "Sabha" <[email protected]> wrote:
    Run weblogic.Admin -url ... LIST to see whether the JNDI name is there
    . or
    you can view the jndi tree of the server from the console (right click
    on
    server name) and check whether the ejb home is bound to the correct jndi
    name.
    -Sabha
    "Matthew Shinn" <[email protected]> wrote in message
    news:[email protected]..
    Hi Albert,
    I would double check to make sure the EJB was indeed deployed (check
    server log). What message did you see that leads you to believe itwas
    successfully deployed? Also, verify the JNDI name you are lookingup in
    your client matches the JNDI name for the EJB. If this doesn't solve
    the problem, please post the error message and stack trace you are
    seeing on the client.
    - Matt
    Albert Pi wrote:
    Hi all:
    I am using Weblogic 6.1/SP2. I use the console to start
    server and deploy EJB jar,from the msg I see my EJB jar
    been deployed. When I run EJB Client program, the error
    msg is can't find JNDI name t3://URL:11003.....
    I check my ejb-jar.xml amd weblogic-ejb-jar.xml are fine.
    Last week I did deploy EJB and ran the client both
    suceessful. Any ideas, Thank you.

  • How to customize the error messages in web analysis reports

    Does anyone know how to customize the error messages that web analysis shows ,
    I want to customize the below error message with a custom error message
    "Document does not exist or no authorization to open document.Error occurred while loading document"
    Does anyone know how to do this ?

    Rajesh,
    you may want to check these links
    How to the Change the Application Stopped Message
    How to Change the Dispatcher Running, No Server Connected Message
    http://help.sap.com/saphelp_nw70/helpdata/en/65/18fc3f9ec4e669e10000000a155106/frameset.htm
    Thanks
    Bala Duvvuri

  • How to program a midi foot controller on Mainstage? Does anyone knows how to program the foot controller with exclusive solo channel in order not to dance "tip tap" while from clean guitar I go to crunch or solo? How to do this programming on Mainstage?

    How to program a midi foot controller on Mainstage? Does anyone knows how to program the foot controller with exclusive solo channel in order not to dance "tip tap" while from clean guitar I go to crunch or solo? How to do this programming on Mainstage?
    I basically managed to learn how to invert parameters which allows me to be as default in the clean guitar channel and if I switch the first button on the midi foot controller I switch to crunch, but at this point I tryied so hard to programm the second and third button to switch, only through a button in one step, to a third channel for distorsion or a 4th channel for solo guitar but I couldn't figured out how this work can be done!
    I would appreciate if anyone could help or share this experience with others who are experiencing the same problem.
    Cheers.
    F.

    I cannot seem to get mainstage to recognize my FCB either. I am using IFCB. Anyone figure this out?
    Thanks,
    Eric

  • How i fix the error 1015 for my iphone3g coz my phone i opining

    how i fix the error 1015 for my iphone3g coz my phone i opining and also i can use since i face that problem

    Yes, if it has been jailbroken, then there is probably nothing that you can do and you will never be able to use it, so ditch it and buy a new phone.
    If it's an iPhone 3g, then it is a very old phone anyway and you shoud consider buying a new one.

  • How to handle the #error in ssrs expression

    hi 
    Please any one help me to resolve this #error ,
    I have a calculated filed in that expression i given a if condition like below 
    data of column is coming like this 0 , 0.0 
    =IIF(Fields!Column1.Value=0,0,((Fields!Column2.Value - Fields!Column1.Value)/( Fields!Column1.Value)))
    how to handle the #error 
    Please let me know any one 

    Hi deepuk23,
    According to your description, when you use the IIF() function in the report you got some error,right?
    The issue can be caused by the column1 and column2 have different datatype, I assumed that one is integer and another is float, when the Column1 is 0 or null,  because IIF() function always evaluates both the true part and the false part, even
    though it returns only one of them, it will throw out the error. 
    To resolve the issue, you should use a nested IIF() function to avoid the zero-divisor in any rate like below:
    =IIF(Fields!Column1.Value=0,0,((Fields!Column2.Value - Fields!Column1.Value)/(IIF(Fields!Column1.Value=0,1,Fields!Column1.Value))))
    For more information, please refer to this article:
    FAQ: Why does the “Attempted to divide by zero” error still happen?
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • TS2529 how to fix the error message itunes can't sync apps because it can't determine what apps are installed

    how to fix the error message itunes can't sync apps because it can't determine what apps are installed

    Hi,
    This may be Helpful 
    AMDS for Windows
    http://support.apple.com/kb/TS1567

  • How to catch the error occurred in Integration Process, and then save it?

    1. how to catch the error occurred in Integration Process, and then save the detailed error message to the file?
    2. there are fault message type for inbound message interface, how to use the fault message type in IR?
    Thanks,
    Michael
    Message was edited by: Spring Tang
    inital
    Message was edited by: Spring Tang
    detailed message output
    Message was edited by: Spring Tang
    fault message type

    Hi Spring,
    If u give an exception step along with your Transformation Step, whenever some error occurs in your message mapping, this exception block wil be triggered.
    You can configure your exception block to do all exception processing that you want. This exception handling is like any other java Exceptio n Handler. You can do anything that you want in your exception handler block on the basis of your requirements.
    <i>If an exception is triggered at runtime, the system first searches for the relevant exception handler in surrounding blocks. If it does not find the correct exception handler, it continues the search in the next block in the block hierarchy.
    When the system finds the correct system handler, it stops all active steps in the block in which the exception handler is defined and then continues processing in the exception handler branch. Once the exception handler has finished processing, the process is continued after the block.
    If the system fails to find an exception handler, it terminates the integration process with an error.</i>
    Regards,
    Bhavesh

  • How to rectify the error message " duplicate data records found"

    Hi,
    How to  rectify the error "duplicate data records found" , PSA is not there.
    and give me brief description about RSRV
    Thanks in advance,
    Ravi Alakunlta

    Hi Ravi,
    In the Info Package screen...Processing tab...check the option Do not allow Duplicate records.
    RSRV is used for Repair and Analysis purpose.
    If you found Duplicate records in the F fact table...Compress it then Duplicate records will be summarized in the Cube.
    Hope this helps.

Maybe you are looking for

  • Mail greyed out, won't close

    I am running 10.6.8, and this so often happens to me. I don't know why. Mail has also "lost" mail periodically recently. Most "sent" and "received" mail appears in Mail AND on my server, but there is a significnt number of "sent" mails that don't app

  • FrameMaker hangs and can't print to Adobe PDF

    FrameMaker has been hanging and blowing up on me. Specifically, it hangs when I try to save all the chapters in a book. Some of these books are very small, maybe 20 or 30 pages. After I stop Frame thru Task Manager and reboot, I can reopen the book a

  • MPB Wakes from sleep but then goes right back...

    Hey all, having a weird problem since my Lion install. It's happening randomly, with no peripherals attached. I will open my MPB as it has been sleeping closed; the passcode screen will pop up but before I can type, the screen goes black and it goes

  • How do I stop Firefox from going to Google everytime I open the browser?

    In my organization, we have well over 2,000 PCs. Every time Firefox is open, it connects to Google IPs (74.125.x.x) even when we are not on Google's site and do not have Google as the search provider. From what I understand (and correct me if I am wr

  • Change contents of T077X (Customer Account Group Names)

    Hi, I have copied an existing account group to create a new account group. When i go to the table T077X, it is showing valid description in EN language. In other languages, the table shows the old account group description. May i know how to change t