Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

BAPI fixedasset_change

$
0
0

Hi, below is my source code, syntax ok, my upload file has one record asset: 1000, company code:1000, description1: test1, description 2: test2.

after running this program, it says asset 1000 is not in company code 1000, however, in AS03, asset 1000 is there. let me know which error I made.

 

Type-pools: truxs.

Data: it_raw type truxs_t_text_data.

Parameters: p_file like ibipparms-path.

 

Data: companycode like bapi1022_1-comp_code,

asset like bapi1022_1-assetmaino,

subnumber like bapi1022_1-assetsubno,

Generaldata like bapi1022_feglg001,

Generaldatax like bapi1022_feglg001x,

Return like bapiret2.

 

Data: begin of record occurs 0,

Anln1_001(012),

Bukrs_002(004),

Txt50_003(050),

Anlhtxt_004(050),

End of record.

 

At selection-screen on value-request for p_file.

   CALL FUNCTION 'F4_FILENAME'

     EXPORTING

       FIELD_NAME = 'P_file '

     IMPORTING

       FILE_NAME  = p_file.

 

 

Start-of-selection.

   CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

     EXPORTING

*   I_FIELD_SEPERATOR          =

     I_LINE_HEADER              ='X'

       I_TAB_RAW_DATA             = it_raw

       I_FILENAME                 = p_file

     TABLES

       I_TAB_CONVERTED_DATA       = record[]

* EXCEPTIONS

*     CONVERSION_FAILED          = 1

*     OTHERS                     = 2.

   .

   IF SY-SUBRC <> 0.

* Implement suitable error handling here

   ENDIF.

 

   Check not record[] is initial.

   Loop at record.

     companycode = record-bukrs_002.

     asset = record-anln1_001.

*    SELECT SINGLE anln2 INTO subnumber FROM anla WHERE bukrs = companycode AND anln1 = asset.

     subnumber = '0000'.

     Generaldata-descript = record-txt50_003.

     Generaldata-descript2 = record-anlhtxt_004.

     Generaldatax-descript = 'X'.

     Generaldatax-descript2 = 'X'.

     CALL FUNCTION 'BAPI_FIXEDASSET_CHANGE'

       EXPORTING

         COMPANYCODE = companycode

         ASSET = asset

         SUBNUMBER = subnumber

*       GROUPASSET           =

         GENERALDATA = generaldata

         GENERALDATAX = generaldatax

*       INVENTORY            =

*       INVENTORYX           =

*       POSTINGINFORMATION   =

*       POSTINGINFORMATIONX  =

*       TIMEDEPENDENTDATA    =

*       TIMEDEPENDENTDATAX   =

*       ALLOCATIONS          =

*       ALLOCATIONSX         =

*       ORIGIN               =

*       ORIGINX              =

*       INVESTACCTASSIGNMNT  =

*       INVESTACCTASSIGNMNTX =

*       NETWORTHVALUATION    =

*       NETWORTHVALUATIONX   =

*       REALESTATE           =

*       REALESTATEX          =

*       INSURANCE            =

*       INSURANCEX           =

*       LEASING              =

*       LEASINGX             =

       IMPORTING

         RETURN = return.

* TABLES

*   DEPRECIATIONAREAS          =

*   DEPRECIATIONAREASX         =

*   INVESTMENT_SUPPORT         =

*   EXTENSIONIN                =

     .

 

     Write:/ record-anln1_001, return-type, return-message.

   Endloop.


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>