Sap
Sap
Sap
put_to_use_date(10) TYPE c,
bl_key_add_depr(5) TYPE c,
* type(2) TYPE c,
* base_value(23) TYPE c,
* purchprice(23) TYPE c,
* no_paymnts(5) TYPE c,
* payment(23) TYPE c,
END OF ty_data.
DATA:
wa_key LIKE bapi1022_key,
wa_reference LIKE bapi1022_reference,
wa_createsubnumber LIKE bapi1022_misc-xsubno,
wa_creategroupasset LIKE bapi1022_misc-xanlgr,
wa_testrun LIKE bapi1022_misc-testrun,
wa_generaldata LIKE bapi1022_feglg001,
wa_generaldatax LIKE bapi1022_feglg001x,
wa_inventory LIKE bapi1022_feglg011,
wa_inventoryx LIKE bapi1022_feglg011x,
wa_postinginformation LIKE bapi1022_feglg002,
wa_postinginformationx LIKE bapi1022_feglg002x,
wa_timedependentdata LIKE bapi1022_feglg003,
wa_timedependentdatax LIKE bapi1022_feglg003x,
wa_allocations LIKE bapi1022_feglg004,
wa_allocationsx LIKE bapi1022_feglg004x,
wa_origin LIKE bapi1022_feglg009,
wa_originx LIKE bapi1022_feglg009x,
wa_glo_in_gen LIKE bapi1022_glo_in_gen,
wa_glo_in_genx LIKE bapi1022_glo_in_genx,
wa_lease LIKE bapi1022_feglg005,
wa_leasex LIKE bapi1022_feglg005x.
START-OF-SELECTION.
IF p_file IS INITIAL.
MESSAGE 'Please select upload file' TYPE 'E'.
LEAVE LIST-PROCESSING.
ENDIF.
PERFORM pass_data .
PERFORM display_log.
*&---------------------------------------------------------------------*
*& Form PASS_DATA
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM pass_data .
wa_generaldata-assetclass = wa_data-anlkl .
wa_generaldata-descript = wa_data-txt50_1 .
wa_generaldata-descript2 = wa_data-txt50_2 .
wa_generaldata-serial_no = wa_data-sernr .
wa_generaldata-invent_no = wa_data-invnr .
wa_generaldata-quantity = wa_data-menge .
wa_generaldata-main_descript = wa_data-main_descript .
wa_generaldata-history = wa_data-history .
wa_generaldata-base_uom = wa_data-meins .
wa_generaldatax-assetclass = 'X'.
wa_generaldatax-descript = 'X'.
wa_generaldatax-descript2 = 'X'.
wa_generaldatax-serial_no = 'X'.
wa_generaldatax-invent_no = 'X'.
wa_generaldatax-quantity = 'X'.
wa_generaldatax-base_uom = 'X'.
wa_generaldatax-main_descript = 'X'.
wa_generaldatax-history = 'X'.
wa_inventory-include_in_list = wa_data-include_in_list.
wa_inventoryx-include_in_list = 'X'. "wa_data-INCLUDE_IN_LIST'.
wa_postinginformation-cap_date = wa_data-aktiv.
wa_postinginformationx-cap_date = 'X'.
wa_timedependentdata-costcenter = wa_data-kostl.
wa_timedependentdatax-costcenter = 'X'.
wa_timedependentdata-plant = wa_data-werks.
wa_timedependentdatax-plant = 'X'.
wa_timedependentdata-location = wa_data-location.
wa_timedependentdatax-location = 'X'.
* wa_timedependentdata-room = wa_data-room.
* wa_timedependentdatax-room = 'X'.
wa_allocations-evalgroup1 = wa_data-evalgroup1.
wa_allocationsx-evalgroup1 = 'X'.
wa_allocations-evalgroup2 = wa_data-evalgroup2.
wa_allocationsx-evalgroup2 = 'X'.
wa_origin-vendor_no = wa_data-lifnr.
wa_origin-manufacturer = wa_data-manufacturer.
* wa_origin-trade_id = wa_data-trade_id.
* wa_origin-country = wa_data-country.
* wa_origin-type_name = wa_data-type_name.
wa_origin-orig_acq_yr = wa_data-orig_acq_yr.
wa_origin-orig_value = wa_data-orig_value.
* wa_origin-inhouse_prod_percentage = wa_data-inhouse_prod_percentage.
wa_originx-vendor_no = 'X'.
wa_originx-manufacturer = 'X'.
* wa_originx-trade_id = 'X'.
* wa_originx-country = 'X'.
* wa_originx-type_name = 'X'.
wa_originx-orig_acq_year = 'X'.
wa_originx-orig_value = 'X'.
* wa_originx-inhouse_prod_percentage = 'X'.
wa_glo_in_gen-block_key = wa_data-block_key.
wa_glo_in_gen-bl_key_add_depr = wa_data-bl_key_add_depr.
wa_glo_in_gen-put_to_use_date = wa_data-put_to_use_date.
wa_glo_in_genx-block_key = 'X'.
wa_glo_in_genx-bl_key_add_depr = 'X'.
wa_glo_in_genx-put_to_use_date = 'X'.
* wa_lease-type = wa_data-type.
* wa_lease-base_value = wa_data-base_value.
* wa_lease-purchprice = wa_data-purchprice.
* wa_lease-no_paymnts = wa_data-no_paymnts.
* wa_lease-payment = wa_data-payment.
* wa_leasex-type = 'X'.
* wa_leasex-base_value = 'X'.
* wa_leasex-purchprice = 'X'.
* wa_leasex-no_paymnts = 'X'.
* wa_leasex-payment = 'X'.
*
* UNPACK wa_data-afabe TO wa_data-afabe.
* ENDIF.
*** IF wa_data-knafa GE 0.
*** wa_data-knafa = wa_data-knafa * -1.
** IF wa_data-knafa_02 GE 0.
** wa_data-knafa_02 = wa_data-knafa_02 * -1.
** wa_postedvalues-ord_dep = wa_data-knafa_02.
** ELSE.
** wa_postedvalues-ord_dep = wa_data-knafa_02.
** ENDIF.
** APPEND wa_postedvalues TO it_postedvalues.
**
*** APPEND wa_cumulatedvalues TO it_cumulatedvalues.
*** ENDIF.
PERFORM post_bapi.
CLEAR : wa_data
, it_depreciationareas
, it_depreciationareasx
, wa_generaldata
, wa_generaldatax
, wa_inventory
, wa_inventoryx
, wa_postinginformation
, wa_postinginformationx
, wa_timedependentdata
, wa_timedependentdatax
, wa_allocations
, wa_allocationsx
,wa_origin
,wa_originx
,it_cumulatedvalues
,it_postedvalues
,it_return.
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form POST_BAPI
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM post_bapi .
CLEAR:wa_return_dis.
ELSEIF wa_return-type EQ 'S'.
CLEAR:wa_return_dis.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form DISPLAY_LOG
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM display_log .
ENDFORM.