SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Создание основного средства с BAPI_FIXEDASSET_OVRTAKE_CREATE



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> CO
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Tue Oct 23, 2007 10:37 am    Post subject: Создание основного средства с BAPI_FIXEDASSET_OVRTAKE_CREATE Reply with quote

Code:

FORM map_fixassets  CHANGING p_input_table TYPE t_input_table
                             p_asset_table TYPE t_asset_table
                             p_cost_table TYPE t_cost_table
                             p_depr_table TYPE t_depr_table
                             p_error_table TYPE t_error_table
                             p_t093c       TYPE  t_t093c_table
                             p_csks        TYPE  t_csks_table.
 
  DATA:
        l_testrun TYPE bapi1022_misc-testrun,
        la_generaldata TYPE bapi1022_feglg001,
        la_generaldatax TYPE bapi1022_feglg001x,
        la_inventory TYPE bapi1022_feglg011,
        la_inventoryx TYPE bapi1022_feglg011x,
        la_postinginformation TYPE bapi1022_feglg002,
        la_postinginformationx TYPE bapi1022_feglg002x,
        la_key TYPE bapi1022_key,
        la_timedependentdata TYPE bapi1022_feglg003,
        la_timedependentdatax TYPE bapi1022_feglg003x,
        la_allocations TYPE bapi1022_feglg004,
        la_allocationsx TYPE bapi1022_feglg004x,
        la_origin TYPE bapi1022_feglg009,
        la_originx TYPE bapi1022_feglg009x,
        la_assetcreated TYPE bapi1022_reference,
        li_depreciationareas TYPE TABLE OF bapi1022_dep_areas,
        la_depreciationareas LIKE LINE OF li_depreciationareas,
        li_depreciationareasx TYPE TABLE OF bapi1022_dep_areasx,
        la_depreciationareasx LIKE LINE OF li_depreciationareasx,
        li_cumulatedvalues TYPE TABLE OF bapi1022_cumval,
        la_cumulatedvalues LIKE LINE OF li_cumulatedvalues,
        li_postedvalues TYPE TABLE OF bapi1022_postval,
        la_postedvalues LIKE LINE OF li_postedvalues,
        li_transactions TYPE TABLE OF bapi1022_trtype,
        la_transactions LIKE LINE OF li_transactions.
 
 
  DATA: l_anlkl TYPE anla-anlkl,
        l_flag TYPE c.
 
  DATA: l_message TYPE string.
 
  CLEAR: g_no_read, g_no_valid, g_no_invalid, g_no_load, g_no_failed,
         wa_input, l_testrun, la_generaldata, la_generaldatax, la_inventory,
         la_inventoryx, la_postinginformation, la_postinginformationx, la_key,
         la_timedependentdata, la_timedependentdatax, la_allocations, la_allocationsx,
         la_origin, la_originx, li_depreciationareas, la_depreciationareas,
         li_depreciationareasx, la_depreciationareasx, li_cumulatedvalues,
         la_cumulatedvalues, li_postedvalues, la_postedvalues, li_transactions,
         la_transactions, wa_error_file.
 
  IF p_create = 'X'.       "Determine whether testrun or actual run.
    l_testrun = space.
  ELSE.
    l_testrun = 'X'.
  ENDIF.
 
 
  SORT p_asset_table BY lclass.
  SORT p_cost_table BY ldept.
  SORT p_depr_table BY ldepr.
  SORT p_t093c BY bukrs.
  SORT p_csks BY kostl.
 
 
  LOOP AT p_input_table INTO wa_input.
 
    CLEAR: l_anlkl,
           l_flag.
 
    g_no_read = g_no_read + 1.
 
* To pick up the asset class from the asset class file corresponding to the legacy class
    READ TABLE p_asset_table INTO wa_asset
           BINARY SEARCH WITH KEY lclass = wa_input-lclass.
 
    IF sy-subrc = 0.
 
      l_anlkl = wa_asset-anlkl.
 
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = l_anlkl
        IMPORTING
          output = l_anlkl.
 
* To validate asset class
      CALL FUNCTION 'AM_ASSET_CLASS_READ'
        EXPORTING
          i_anlkl                = l_anlkl
        TABLES
          t_ankb                 = i_ankb
          t_ankv                 = i_ankv
        EXCEPTIONS
          klasse_nicht_vorhanden = 1
          i_anlkl_fehlt          = 2
          OTHERS                 = 3.
 
      IF sy-subrc <> 0.      " asset class not valid
        MOVE-CORRESPONDING wa_input TO wa_error_file.
        wa_error_file-mssg1 = text-028.
        l_flag = 'X'.
      ELSE.
 
        la_generaldata-assetclass = l_anlkl.
      ENDIF.
 
    ELSE.
 
      MOVE-CORRESPONDING wa_input TO wa_error_file.
      wa_error_file-mssg1 = text-071.
      l_flag = 'X'.
    ENDIF.
 
 
    CALL FUNCTION 'ZFAA_FORMAT_FIELDS'
      EXPORTING
        zinput  = wa_input-txt50
      IMPORTING
        zoutput = wa_input-txt50.
 
    CALL FUNCTION 'ZFAA_FORMAT_FIELDS'
      EXPORTING
        zinput  = wa_input-txa50
      IMPORTING
        zoutput = wa_input-txa50.
 
 
 
    la_generaldata-descript   = wa_input-txt50.
    la_generaldata-descript2  = wa_input-txa50.
    la_generaldata-serial_no  = wa_input-sernr.
    la_generaldata-invent_no  = wa_input-invnr.
 
    la_generaldatax-assetclass = 'X'.
    la_generaldatax-descript   = 'X'.
    la_generaldatax-descript2  = 'X'.
    la_generaldatax-serial_no  = 'X'.
    la_generaldatax-invent_no  = 'X'.
 
 
    la_inventory-note             = wa_input-note.
    la_inventoryx-note            = 'X'.
 
 
    la_postinginformation-cap_date  = wa_input-aktiv.
    la_postinginformationx-cap_date = 'X'.
 
 
* To pick up the cost center from cost center file corresponding to legacy dept
    READ TABLE p_cost_table INTO wa_cost
           BINARY SEARCH WITH KEY ldept = wa_input-kostl.
 
 
    IF sy-subrc = 0.
 
* To validate company code
      READ TABLE p_t093c INTO wa_t093c BINARY SEARCH WITH KEY bukrs = wa_cost-bukrs.
 
      IF sy-subrc <> 0.      "company code not valid
 
        IF l_flag <> 'X'.
          MOVE-CORRESPONDING wa_input TO wa_error_file.
          l_flag = 'X'.
          wa_error_file-mssg1 = text-029.
        ELSE.
          CONCATENATE wa_error_file-mssg1 text-029
         INTO wa_error_file-mssg1 SEPARATED BY ','.
*        wa_error_file-mssg2 = text-029.
        ENDIF.
      ELSE.
 
        la_key-companycode  = wa_cost-bukrs.
      ENDIF.
 
* to validate cost centre
      READ TABLE p_csks INTO wa_csks BINARY SEARCH WITH KEY kostl = wa_cost-kostl.
 
      IF sy-subrc <> 0.     "cost center not valid
 
        IF l_flag <> 'X'.
          MOVE-CORRESPONDING wa_input TO wa_error_file.
          l_flag = 'X'.
          wa_error_file-mssg1 = text-030.
        ELSE.
          CONCATENATE wa_error_file-mssg1 text-030
          INTO wa_error_file-mssg1 SEPARATED BY ','.
        ENDIF.
 
*        wa_error_file-mssg3 = text-030.
      ELSE.
 
        la_timedependentdata-costcenter  = wa_cost-kostl.
        la_timedependentdata-plant       = wa_cost-werks.
        la_timedependentdata-location    = wa_cost-loc.
        la_timedependentdata-room        = wa_input-room.
        la_timedependentdatax-costcenter = 'X'.
        la_timedependentdatax-plant      = 'X'.
        la_timedependentdatax-location   = 'X'.
        la_timedependentdatax-room       = 'X'.
      ENDIF.
    ELSE.
 
      IF l_flag <> 'X'.
        MOVE-CORRESPONDING wa_input TO wa_error_file.
        l_flag = 'X'.
        wa_error_file-mssg1 = text-072.
 
      ELSE.
        CONCATENATE wa_error_file-mssg1 text-072
        INTO wa_error_file-mssg1 SEPARATED BY ','.
      ENDIF.
 
*      wa_error_file-mssg2 = text-072.
 
    ENDIF.
 
    g_no_valid = g_no_valid + 1.
 
    la_allocations-evalgroup5  = wa_input-gdlgrp.
    la_allocationsx-evalgroup5 = 'X'.
 
    CALL FUNCTION 'ZFAA_FORMAT_FIELDS'
      EXPORTING
        zinput  = wa_input-liefe
      IMPORTING
        zoutput = wa_input-liefe.
 
    CALL FUNCTION 'ZFAA_FORMAT_FIELDS'
      EXPORTING
        zinput  = wa_input-typbz
      IMPORTING
        zoutput = wa_input-typbz.
 
    la_origin-vendor        = wa_input-liefe.
    la_origin-type_name     = wa_input-typbz.
    la_origin-orig_asset    = wa_input-aibn1.
    la_originx-vendor       = 'X'.
    la_originx-type_name    = 'X'.
    la_originx-orig_asset   = 'X'.
 
*      IF  wa_input-valuedate(4) <> sy-datum(4).
 
* for depr 01
* To pick up the depr key from dept input file corresponding to legacy depr key
    READ TABLE p_depr_table INTO wa_depr
               BINARY SEARCH WITH KEY ldepr = wa_input-afasl_01.
 
    IF sy-subrc = 0.
 
      la_depreciationareas-area             = wa_input-afabe_01.
      la_depreciationareas-dep_key          = wa_depr-afasl.
      la_depreciationareas-ulife_yrs        = wa_input-ndjar_01.
      la_depreciationareas-ulife_prds       = wa_input-ndper_01.
      la_depreciationareas-exp_ulife_yrs    = wa_input-exp_year_01.
      la_depreciationareas-exp_ulife_prds   = wa_input-exp_period_01.
 
      APPEND la_depreciationareas TO li_depreciationareas.
      CLEAR: la_depreciationareas.
 
      la_depreciationareasx-area            = wa_input-afabe_01.
      la_depreciationareasx-dep_key         = 'X'.
      la_depreciationareasx-ulife_yrs       = 'X'.
      la_depreciationareasx-ulife_prds      = 'X'.
      la_depreciationareasx-exp_ulife_yrs   = 'X'.
      la_depreciationareasx-exp_ulife_prds  = 'X'.
      APPEND la_depreciationareasx TO li_depreciationareasx.
      CLEAR: la_depreciationareasx.
 
      la_cumulatedvalues-area = wa_input-afabe_01.
      la_cumulatedvalues-acq_value = wa_input-comm_acq_01.
      la_cumulatedvalues-ord_dep   = wa_input-acc_ord_depr_01.
      APPEND la_cumulatedvalues TO li_cumulatedvalues.
      CLEAR: la_cumulatedvalues.
 
      la_postedvalues-area    = wa_input-afabe_01.
      la_postedvalues-ord_dep = wa_input-ord_depr_post_01.
      APPEND la_postedvalues TO li_postedvalues.
      CLEAR: la_postedvalues.
 
    ELSE.
 
      IF l_flag <> 'X'.
        MOVE-CORRESPONDING wa_input TO wa_error_file.
        l_flag = 'X'.
        CONCATENATE wa_input-afasl_01 text-110 '01'
          INTO wa_error_file-mssg1 SEPARATED BY ','.
      ELSE.
        CONCATENATE wa_error_file-mssg1 wa_input-afasl_01 text-110 '01'
          INTO wa_error_file-mssg1 SEPARATED BY ','.
      ENDIF.
 
    ENDIF.
 
* for depr 10
* To pick up the depr key from dept input file corresponding to legacy depr key
    READ TABLE p_depr_table INTO wa_depr
              BINARY SEARCH WITH KEY ldepr  = wa_input-afasl_10.
 
    IF sy-subrc = 0.
 
      la_depreciationareas-area             = wa_input-afabe_10.
      la_depreciationareas-dep_key          = wa_depr-afasl.
      la_depreciationareas-ulife_yrs        = wa_input-ndjar_10.
      la_depreciationareas-ulife_prds       = wa_input-ndper_10.
      la_depreciationareas-exp_ulife_yrs    = wa_input-exp_year_10.
      la_depreciationareas-exp_ulife_prds   = wa_input-exp_period_10.
      APPEND la_depreciationareas TO li_depreciationareas.
      CLEAR: la_depreciationareas.
 
      la_depreciationareasx-area            = wa_input-afabe_10.
      la_depreciationareasx-dep_key         = 'X'.
      la_depreciationareasx-ulife_yrs       = 'X'.
      la_depreciationareasx-ulife_prds      = 'X'.
      la_depreciationareasx-exp_ulife_yrs   = 'X'.
      la_depreciationareasx-exp_ulife_prds  = 'X'.
      APPEND la_depreciationareasx TO li_depreciationareasx.
      CLEAR: la_depreciationareasx.
 
      la_cumulatedvalues-area = wa_input-afabe_10.
      la_cumulatedvalues-acq_value = wa_input-comm_acq_10.
      la_cumulatedvalues-ord_dep   = wa_input-acc_ord_depr_10.
      la_cumulatedvalues-spe_dep   = wa_input-spe_depr_10.
      APPEND la_cumulatedvalues TO li_cumulatedvalues.
      CLEAR: la_cumulatedvalues.
 
    ELSE.
 
      IF l_flag <> 'X'.
        MOVE-CORRESPONDING wa_input TO wa_error_file.
        l_flag = 'X'.
        CONCATENATE wa_input-afasl_10 text-110 '10'
          INTO wa_error_file-mssg1 SEPARATED BY ','.
      ELSE.
        CONCATENATE wa_error_file-mssg1 wa_input-afasl_10 text-110 '10'
          INTO wa_error_file-mssg1 SEPARATED BY ','.
      ENDIF.
 
    ENDIF.
 
 
* for depr 11
* To pick up the depr key from dept input file corresponding to legacy depr key
    READ TABLE p_depr_table INTO wa_depr
             BINARY SEARCH WITH KEY ldepr   = wa_input-afasl_11.
 
    IF sy-subrc = 0.
 
      la_depreciationareas-area             = wa_input-afabe_11.
      la_depreciationareas-dep_key          = wa_depr-afasl.
      la_depreciationareas-ulife_yrs        = wa_input-ndjar_11.
      la_depreciationareas-ulife_prds       = wa_input-ndper_11.
      la_depreciationareas-exp_ulife_yrs    = wa_input-exp_year_11.
      la_depreciationareas-exp_ulife_prds   = wa_input-exp_period_11.
      APPEND la_depreciationareas TO li_depreciationareas.
      CLEAR: la_depreciationareas.
 
      la_depreciationareasx-area            = wa_input-afabe_11.
      la_depreciationareasx-dep_key         = 'X'.
      la_depreciationareasx-ulife_yrs       = 'X'.
      la_depreciationareasx-ulife_prds      = 'X'.
      la_depreciationareasx-exp_ulife_yrs   = 'X'.
      la_depreciationareasx-exp_ulife_prds  = 'X'.
      APPEND la_depreciationareasx TO li_depreciationareasx.
      CLEAR: la_depreciationareasx.
 
      la_cumulatedvalues-area = wa_input-afabe_11.
      la_cumulatedvalues-ord_dep   = wa_input-acc_ord_depr_11.
      la_cumulatedvalues-spe_dep   = wa_input-spe_depr_11.
      APPEND la_cumulatedvalues TO li_cumulatedvalues.
      CLEAR: la_cumulatedvalues.
 
    ELSE.
 
      IF l_flag <> 'X'.
        MOVE-CORRESPONDING wa_input TO wa_error_file.
        l_flag = 'X'.
        CONCATENATE wa_input-afasl_11 text-110 '11'
          INTO wa_error_file-mssg1 SEPARATED BY ','.
      ELSE.
        CONCATENATE wa_error_file-mssg1 wa_input-afasl_11 text-110 '11'
          INTO wa_error_file-mssg1 SEPARATED BY ','.
      ENDIF.
 
    ENDIF.
 
 
* for depr 30
* To pick up the depr key from dept input file corresponding to legacy depr key
    READ TABLE p_depr_table INTO wa_depr
               BINARY SEARCH WITH KEY ldepr  = wa_input-afasl_30.
 
    IF sy-subrc = 0.
 
      la_depreciationareas-area             = wa_input-afabe_30.
      la_depreciationareas-dep_key          = wa_depr-afasl.
      la_depreciationareas-ulife_yrs        = wa_input-ndjar_30.
      la_depreciationareas-ulife_prds       = wa_input-ndper_30.
      la_depreciationareas-exp_ulife_yrs    = wa_input-exp_year_30.
      la_depreciationareas-exp_ulife_prds   = wa_input-exp_period_30.
      APPEND la_depreciationareas TO li_depreciationareas.
      CLEAR: la_depreciationareas.
 
      la_depreciationareasx-area            = wa_input-afabe_30.
      la_depreciationareasx-dep_key         = 'X'.
      la_depreciationareasx-ulife_yrs       = 'X'.
      la_depreciationareasx-ulife_prds      = 'X'.
      la_depreciationareasx-exp_ulife_yrs   = 'X'.
      la_depreciationareasx-exp_ulife_prds  = 'X'.
      APPEND la_depreciationareasx TO li_depreciationareasx.
      CLEAR: la_depreciationareasx.
 
      la_cumulatedvalues-area = wa_input-afabe_30.
 
      la_cumulatedvalues-acq_value = wa_input-comm_acq_30.  "MOD001+
 
      la_cumulatedvalues-ord_dep   = wa_input-acc_ord_depr_30.
      APPEND la_cumulatedvalues TO li_cumulatedvalues.
      CLEAR: la_cumulatedvalues.
 
*Begin of  MOD001-
*          la_postedvalues-area    = wa_input-afabe_30.
*          la_postedvalues-ord_dep = wa_input-ord_depr_post_30.
*          APPEND la_postedvalues TO li_postedvalues.
*          CLEAR: la_postedvalues.
*End of MOD001-
 
    ELSE.
 
      IF l_flag <> 'X'.
        MOVE-CORRESPONDING wa_input TO wa_error_file.
        l_flag = 'X'.
        CONCATENATE wa_input-afasl_30 text-110 '30'
          INTO wa_error_file-mssg1 SEPARATED BY ','.
      ELSE.
        CONCATENATE wa_error_file-mssg1 wa_input-afasl_30 text-110 '30'
          INTO wa_error_file-mssg1 SEPARATED BY ','.
      ENDIF.
 
    ENDIF.
 
 
* for depr 40
* To pick up the depr key from dept input file corresponding to legacy depr key
    READ TABLE p_depr_table INTO wa_depr
               BINARY SEARCH WITH KEY ldepr = wa_input-afasl_40.
 
    IF sy-subrc = 0.
 
      la_depreciationareas-area             = wa_input-afabe_40.
      la_depreciationareas-dep_key          = wa_depr-afasl.
      la_depreciationareas-ulife_yrs        = wa_input-ndjar_40.
      la_depreciationareas-ulife_prds       = wa_input-ndper_40.
      la_depreciationareas-exp_ulife_yrs    = wa_input-exp_year_40.
      la_depreciationareas-exp_ulife_prds   = wa_input-exp_period_40.
      APPEND la_depreciationareas TO li_depreciationareas.
      CLEAR: la_depreciationareas.
 
      la_depreciationareasx-area            = wa_input-afabe_40.
      la_depreciationareasx-dep_key         = 'X'.
      la_depreciationareasx-ulife_yrs       = 'X'.
      la_depreciationareasx-ulife_prds      = 'X'.
      la_depreciationareasx-exp_ulife_yrs   = 'X'.
      la_depreciationareasx-exp_ulife_prds  = 'X'.
      APPEND la_depreciationareasx TO li_depreciationareasx.
      CLEAR: la_depreciationareasx.
 
      la_cumulatedvalues-area = wa_input-afabe_40.
      la_cumulatedvalues-ord_dep   = wa_input-acc_ord_depr_40.
      APPEND la_cumulatedvalues TO li_cumulatedvalues.
      CLEAR: la_cumulatedvalues.
 
    ELSE.
 
      IF l_flag <> 'X'.
        MOVE-CORRESPONDING wa_input TO wa_error_file.
        l_flag = 'X'.
        CONCATENATE wa_input-afasl_40 text-110 '40'
          INTO wa_error_file-mssg1 SEPARATED BY ','.
      ELSE.
        CONCATENATE wa_error_file-mssg1 wa_input-afasl_40 text-110 '40'
          INTO wa_error_file-mssg1 SEPARATED BY ','.
      ENDIF.
 
    ENDIF.
 
    IF wa_error_file IS NOT INITIAL.
      wa_error_file-type   = 'E'.
      APPEND wa_error_file TO p_error_table.
      CLEAR: wa_error_file.
    ENDIF.
 
    IF l_flag <> 'X'.
 
      IF  wa_input-valuedate(4) <> sy-datum(4).
 
        CALL FUNCTION 'BAPI_FIXEDASSET_OVRTAKE_CREATE'
          EXPORTING
            key                 = la_key
            testrun             = l_testrun
            generaldata         = la_generaldata
            generaldatax        = la_generaldatax
            inventory           = la_inventory
            inventoryx          = la_inventoryx
            postinginformation  = la_postinginformation
            postinginformationx = la_postinginformationx
            timedependentdata   = la_timedependentdata
            timedependentdatax  = la_timedependentdatax
            allocations         = la_allocations
            allocationsx        = la_allocationsx
            origin              = la_origin
            originx             = la_originx
          IMPORTING
            assetcreated        = la_assetcreated
          TABLES
            depreciationareas   = li_depreciationareas
            depreciationareasx  = li_depreciationareasx
            cumulatedvalues     = li_cumulatedvalues
            postedvalues        = li_postedvalues
            return              = i_return.
 
 
      ELSE.
 
        la_transactions-current_no = '00001'.
        la_transactions-area     = wa_input-area_p1.
        la_transactions-valuedate = wa_input-valuedate.
        la_transactions-assettrtyp = wa_input-tran_type.
        la_transactions-amount     = wa_input-amount_p1.
        APPEND la_transactions TO li_transactions.
        CLEAR:la_transactions.
 
        la_transactions-current_no = '00001'.
        la_transactions-area     = wa_input-area_p2.
        la_transactions-valuedate = wa_input-valuedate.
        la_transactions-assettrtyp = wa_input-tran_type.
        la_transactions-amount     = wa_input-amount_p2.
        APPEND la_transactions TO li_transactions.
        CLEAR:la_transactions.
 
        la_transactions-current_no = '00001'.
        la_transactions-area     = wa_input-area_p3.
        la_transactions-valuedate = wa_input-valuedate.
        la_transactions-assettrtyp = wa_input-tran_type.
        la_transactions-amount     = wa_input-amount_p3.
        APPEND la_transactions TO li_transactions.
        CLEAR:la_transactions.
 
 
        CALL FUNCTION 'BAPI_FIXEDASSET_OVRTAKE_CREATE'
          EXPORTING
            key                 = la_key
            testrun             = l_testrun
            generaldata         = la_generaldata
            generaldatax        = la_generaldatax
            inventory           = la_inventory
            inventoryx          = la_inventoryx
            postinginformation  = la_postinginformation
            postinginformationx = la_postinginformationx
            timedependentdata   = la_timedependentdata
            timedependentdatax  = la_timedependentdatax
            allocations         = la_allocations
            allocationsx        = la_allocationsx
            origin              = la_origin
            originx             = la_originx
          IMPORTING
            assetcreated        = la_assetcreated
          TABLES
            depreciationareas   = li_depreciationareas
            depreciationareasx  = li_depreciationareasx
            cumulatedvalues     = li_cumulatedvalues
            postedvalues        = li_postedvalues
            transactions        = li_transactions
            return              = i_return.
 
 
      ENDIF.
 
 
      IF NOT i_return[] IS INITIAL.
 
        CLEAR: wa_return,
               wa_error_file,
               l_message.
 
 
        LOOP AT i_return INTO wa_return.
 
          IF wa_return-type   = 'S'.
 
            wa_error_file-type = wa_return-type.
            g_no_load = g_no_load + 1.
 
            IF l_testrun <> 'X'.
 
              CONCATENATE text-009 la_assetcreated-asset
                  INTO l_message.
 
              CLEAR: la_assetcreated.
 
              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
            ELSE.
 
              l_message = text-064.
            ENDIF.
 
            EXIT.
          ELSE.
 
            IF l_message IS INITIAL.
              CONCATENATE l_message wa_return-message INTO l_message.
            ELSE.
              CONCATENATE l_message wa_return-message INTO l_message SEPARATED BY ','.
            ENDIF.
 
          ENDIF.
 
          CLEAR: wa_return.
        ENDLOOP.
 
 
        MOVE-CORRESPONDING wa_input TO wa_error_file.
 
        IF wa_error_file-type <> 'S'.
          wa_error_file-type = 'E'.
          g_no_failed = g_no_failed + 1.
        ENDIF.
 
        wa_error_file-mssg1     = l_message.
 
        APPEND wa_error_file TO p_error_table.
        CLEAR: wa_error_file, l_message.
 
      ENDIF.
 
 
    ELSE.
      g_no_invalid = g_no_invalid + 1.
 
    ENDIF.
 
    CLEAR: i_return, wa_input, la_generaldata, la_generaldatax, la_inventory,
        la_inventoryx, la_postinginformation, la_postinginformationx, la_key,
        la_timedependentdata, la_timedependentdatax, la_allocations, la_allocationsx,
        la_origin, la_originx, li_depreciationareas, la_depreciationareas,
        li_depreciationareasx, la_depreciationareasx, li_cumulatedvalues,
        la_cumulatedvalues, li_postedvalues, la_postedvalues, li_transactions,
        la_transactions.
  ENDLOOP.
ENDFORM.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> CO All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.