Unable to create batch input

could the error generated be because of the file?? the code is as follows:
a<u>sset upload</u>
report ZAST_UPL line-size 255.
data:   remaining_life_yrs type p,
        remaining_life_periods type p,
        days type p,
        remainder type p,
        useful_life type p,
        useful_period type p.
include bdcrecx1.
parameters: pfile type rlgrap-filename.
tables: ankb.
*data: pfile1 type string.
TYPES: begin of t_datatab ,
              assets_class(10),
              c_code(4),
              description(50),
              add_description(50),
              serial(18),
              capitalisation(8),
              c_centre(10),
              plant(4),
              asset_location(10),
              amount1(13),
              amount2(13),
       end of t_datatab.
data: begin of t_datatabfinal occurs 0,
              assets_class(10),
              c_code(4),
              description(50),
              add_description(50),
              serial(18),
              capitalisation(8),
              c_centre(10),
              plant(4),
              asset_location(10),
              amount1(13),
              amount2(13),
              end of t_datatabfinal.
data : assets_class1(4) value '0000',
       class_asset(8).
data : date_diff type p, earliest type C, timediff type p.
data : a_new type d, b_new type d.
data : capitalisation type string.
DATA: it_datatab TYPE STANDARD TABLE OF t_datatab,
      wa_datatab TYPE t_datatab.
DATA: wa_record TYPE t_datatab,
      it_record TYPE STANDARD TABLE OF t_datatab INITIAL SIZE 0.
DATA: itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
DATA: gd_currentrow TYPE i.
At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pfile.
  CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      field_name = 'PFILE'
    IMPORTING
      file_name  = pfile.
  data: itab like ALSMEX_TABLINE occurs 0 with header line.
*pfile1 = pfile.
START-OF-SELECTION.
  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      FILENAME                      = pfile
      I_BEGIN_COL                   = '1'
      I_BEGIN_ROW                   = '1'       "Column headers not required
      I_END_COL                     = '11'
      I_END_ROW                     = '4'
    TABLES
      INTERN                        = itab
            EXCEPTIONS
              INCONSISTENT_PARAMETERS       = 1
              UPLOAD_OLE                    = 2
              OTHERS                        = 3
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
Sort table by rows and colums
  SORT itab BY row col.
Get first row retrieved
  READ TABLE itab INDEX 1.
Set first row retrieved to current row
  gd_currentrow = itab-row.
  LOOP AT itab.
  Reset values for next row
    IF itab-row NE gd_currentrow.
      APPEND wa_datatab TO it_record.
      CLEAR wa_datatab.
      gd_currentrow = itab-row.
    ENDIF.
    CASE itab-col.
      WHEN '0001'.
        wa_datatab-assets_class       = itab-value.
      WHEN '0002'.
        wa_datatab-c_code             = itab-value.
      WHEN '0003'.
        wa_datatab-description        = itab-value.
      WHEN '0004'.
        wa_datatab-add_description    = itab-value.
      WHEN '0005'.
        wa_datatab-serial             = itab-value.
      WHEN '0006'.
        wa_datatab-capitalisation     = itab-value.
      WHEN '0007'.
        wa_datatab-c_centre           = itab-value.
      WHEN '0008'.
        wa_datatab-plant               = itab-value.
      WHEN '0009'.
        wa_datatab-asset_location     = itab-value.
      WHEN '0010'.
        wa_datatab-amount1            = itab-value.
      WHEN '0011'.
        wa_datatab-amount2            = itab-value.
      WHEN OTHERS.
    ENDCASE.
  ENDLOOP.
  APPEND wa_datatab TO it_record.
  LOOP AT it_record INTO t_datatabfinal.
    APPEND t_datatabfinal.
  ENDLOOP.
start-of-selection.
  refresh bdcdata.
  clear bdcdata.
  perform open_group.
  Loop at t_datatabfinal.
    data: stop(1),
          date1(8).
    stop = `.`.
    concatenate assets_class1 t_datatabfinal-assets_class into class_asset.
    concatenate t_datatabfinal-capitalisation(2) stop t_datatabfinal-capitalisation2(2) stop t_datatabfinal-capitalisation6(2) into date1.
    select * from ankb where ANLKL = class_asset
                                    and AFABE = '01'
                                    and afasl = 'LINS'.
      if sy-subrc = 0 .
        useful_life = ankb-NDJAR.
        useful_period = ankb-NDPER.
      endif.
      useful_life = useful_life * 365.
      useful_period = useful_period * 30.
    endselect.
    perform bdc_dynpro      using 'SAPLAIST' '0105'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ANLA-BUKRS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'ANLA-ANLKL'                              "TOPICK Asset class
                                  t_datatabfinal-assets_class.
                               '4000'.
    perform bdc_field       using 'ANLA-BUKRS'                              "TOPICK Company code
                                  t_datatabfinal-c_code.
                               '2000'.
    perform bdc_dynpro      using 'SAPLAIST' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TAB02'.
    perform bdc_field       using 'ANLA-TXT50'                              "TOPICK Asset description
                                  t_datatabfinal-description.
                               'Compaq Evo D3102'.
    perform bdc_field       using 'ANLA-TXA50'                              "TOPICK Additional asset description
                                  t_datatabfinal-add_description.
                               'Desktop Computer'.
    perform bdc_field       using 'ANLA-SERNR'                              "TOPICK Serial number
                                  t_datatabfinal-serial.
                               'V309LB42A259'.
    perform bdc_field       using 'RA02S-XHIST'
                                  'X'.
perform bdc_field       using 'BDC_CURSOR'
                               'ANLA-AKTIV'.
    perform bdc_field       using 'ANLA-AKTIV'                              "TOPICK Asset capitalization
                                  date1.
                               '13.10.03'.
    perform bdc_dynpro      using 'SAPLAIST' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
perform bdc_field       using 'BDC_CURSOR'
                               'ANLZ-KOSTL'.
    perform bdc_field       using 'ANLZ-KOSTL'
                                  t_datatabfinal-c_centre.
                               '203000'.
    perform bdc_dynpro      using 'SAPLAIST' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ALTD'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ANLZ-STORT'.
perform bdc_field       using 'ANLZ-GSBER'                              "TOPICK Business area
                               t_datatabfinal-bus_area.
                               'B008'.
    perform bdc_field       using 'ANLZ-KOSTL'                              "TOPICK Cost center
                                  t_datatabfinal-c_centre.
                               '203000'.
    perform bdc_field       using 'ANLZ-WERKS'                               "TOPICK Plant
                                  t_datatabfinal-plant.
                               '2001'.
    perform bdc_field       using 'ANLZ-STORT'                              "TOPICK Asset location
                                  t_datatabfinal-asset_location.
                               '001'.
    perform bdc_field       using 'ANLZ-FISTL'                              "TOPICK Funds center
                                  t_datatabfinal-c_centre.
                               '203000'.
    perform bdc_dynpro      using 'SAPLALTD' '1100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
   perform bdc_field       using 'BDC_CURSOR'
                                 'RALT_DYNP_STRUC-ANBTR01(06)'.
    perform bdc_field       using 'RALT_DYNP_STRUC-ANBTR01(01)'
                                  t_datatabfinal-amount1.
                             '          450000'.
    perform bdc_field       using 'RALT_DYNP_STRUC-ANBTR01(06)'
                                  t_datatabfinal-amount2.
                             '           25000'.
    perform bdc_dynpro      using 'SAPLALTD' '1100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ANLA-ANLN1'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BUCH'.
    perform bdc_transaction using 'AS91'.
    concatenate t_datatabfinal-capitalisation4(4) t_datatabfinal-capitalisation2(2) t_datatabfinal-capitalisation(2) into capitalisation.
    a_new = '20070701'. "Date format is YYYYMMDD
    b_new = capitalisation. "Date format is YYYYMMDD
    CALL FUNCTION '/SDF/CMO_DATETIME_DIFFERENCE'
      EXPORTING
        date1            = a_NEW
        time1            = '000000'
        date2            = b_NEW
        time2            = '000000'
      IMPORTING
        DATEDIFF         = date_diff
      EXCEPTIONS
        INVALID_DATETIME = 1
        OTHERS           = 2.
    IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
***calculation of remaining life in years and periods for the asset***
    remaining_life_yrs = ( useful_life - date_diff ) div 365.
    remainder = ( useful_life - date_diff ) mod 365.
    remaining_life_periods = remainder div 30.
    perform bdc_dynpro      using 'SAPLAIST' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ANLA-ANLN1'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=D190'.
   perform bdc_field       using 'ANLA-ANLN1'
                                 '40006'.
    perform bdc_field       using 'ANLA-ANLN2'
                                  '0'.
    perform bdc_field       using 'ANLA-BUKRS'
                                  t_datatabfinal-c_code.
                                 '2000'.
    perform bdc_dynpro      using 'SAPLAIST' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BUCH'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ANLB-AFABG(01)'.
    perform bdc_field       using 'ANLB-NDJAR(01)'
                                  remaining_life_yrs.
                                 '  1'.
    perform bdc_field       using 'ANLB-NDPER(01)'
                                  remaining_life_periods.
                                 '  8'.
    perform bdc_field       using 'ANLB-AFABG(01)'
                                  '01.07.2007'.
    perform bdc_transaction using 'AS92'.
  endloop.
  perform close_group.

Formatting error in file. resolved.

Similar Messages

  • Create batch input, does not include all records

    Have anyone experienced, when doing Create Batch Input from the LSMW menu it does not include all rows.
    For example I have a .txt file with 3000 records that I specify in "Specify Files"
    "Read Data"  reads 3000 records.
    "Convert Data" Converts 3000 records
    "Create Batch input Sessions" creates 2461 records? ?
    I have noticed that this happen when the system is busy running many batches and Idocs.

    I'm talking about LSMW programs with regular Batch input Recording.
    I haven't noticed which transactions it skips since I do not run the Batch, when I notice that it does not include all rows as I have read and converted.
    However usually if I "Create the batch input session" once again it includes all the records from the conversion before.
    But since Create a batch input can take a long time depending on the amount of transactions it creates this is not a desired option.
    So it is not possible that the transactions it does not create are errors since its possible to run them successfully. And I haven't used any SKIP TRANSACTION in the mapping step.
    But like I said this only happens when the system is running many batches / idocs at the moment, for example if we are loading the material master at the same time as I run my batch input programs.

  • LSMW Create Batch Input Session question

    Hi all
    when I use LSMW to upload data. every step is OK, but at the NO. 13 step ' 13 Create Batch Input Session', it always set the 'Display Trnacts per BI Folder' field a default value '1' .I must clear the defautl value and let the field to black so I can create ONE session.
    why it always set a default value '1' in the 'Display Trnacts per BI Folder' field ??
    anybody can help me?
    thanks a lot!!

    Hi,
    => Looks like you havent mentioned the TCODE that you are using whilst recording. There is a field specific to TCODE in the step 'Maintain Field Mapping and Conversion Rules'. Double Click on the field, a dialog opens, give your TCODE in capitals.
    => Check if you have mapped all the fields that you want to upload using LSMW. You could have missed mapping few target fields with their source fields.
    => Remove any unnecessary structure relations in step 4 - 'Maintain Structure Relations'.

  • LSMW  Create Batch Input Session

    Hi all
    when I use LSMW to upload data. every step is OK, but at the NO. 13 step ' 13 Create Batch Input Session', it always set the 'Display Trnacts per BI Folder' field a  default value '1' .I must clear the defautl value and let the field to black so I can create ONE session.
    why it always set a default value '1' in the 'Display Trnacts per BI Folder' field ??
    anybody can help me?

    It shows the no. of transactions covered in a particular session. Like if you have 1000 records in your load file and if u put 500 transactions as value then it will create 2 sessions of 500 each. And if you leave it blank then by default also it will create 1 session......
    Best Luck,
    Ravin

  • PIR - LSWM Error in create batch input session

    Hi
    i made a conversion program Purchasing info record through Standard object / Direct Input in that Step 13 : Create Batch input session when i execute the Batch Input session i am getting the following error message
    Transaction 00000001 : no transaction code transfered.
    Please help me to solve this issue
    Thanks & Regards,
    mani.

    Hi
    Everything is working perfectly till STEP 10 : " Display Read Data"
    once if i convert it it was not populating the correct one. i cant find the T.Code ,Material Number & Indictor for Purchasing Info record.
    Please help me to solve thi s issue
    Thanks & Regards,
    Mani.

  • LSMW Routing Standard Batch Input Create Batch Input Session

    Hello All,
    I am using LSMW for routing upload, using standard batch input method. Program RCPTRA01.
    I am facing this quite peculiar problem.
    I have tried first with separate text file for every source structure. Everything works fine till convert data step.
    But when I go for 'Create Batch Input Session' it creates session for tables MAPL, PLKO, PLPO, PLMZ, PLMK. Other tables remain balnk (EAPL, PLFL, PLAB, PLFH, PLPH, PLFT, PLFV, PLWP). Because of this while running the session only the header and material assignment to task list get uploaded. Rest data, operation, MIC, component allocation do not get uploaded.
    I have also tried for one text file for multiple structure. In that I face porblem for BDC creation. While debugging I faced th same thing in this also.
    Could anyone please explain me the soution for this? Do I need to amend any progrm fior this?
    Expecting lightning fast replies from Gurus....
    Mimiri

    Hello All,
    I am awaiting your reply on this.......
    Mimiri

  • LSMW - Error in Inventory - Create batch input session

    Hello good day.
    I'm trying to create a batch input session for inventory upload (Standard Batch Input program - RM07MMBL) and when I select the Name of logical file = "MM_INVENTORY_MANAGEMENT_GOODS_MOVEMENT" and press F8, the following error occurs:
    <b>Sequential file mmgoods cannot be opened
    Message no. M7 850</b>
    Now as the legend says.... I've contacted my system administrator and he keeps telling me everything is ok, but the error keeps appearing, where can I see if I have authorization for this "file" ???
    Where is it created ??
    I need more info on this.
    Your help is very much appreciated.
    Thank you.
    Juan

    go to file transaction n check for the logical file path and logical file weather it is defined correctly r not?
    if it is correctly defined check for the file, weather the flat file is defined at the correct location which is defined in the logical file path
    u can refer the below link also
    Re: Logical file
    Regards,
    Naveen

  • Create Batch Input

    Hi,
    I have to create a batch input to modify storage location with CO02.
    Is there a procedure that show how to create it with SM35 ?
    Have never use that transaction.
    Bob.

    Hi Robert,
    use transaction code SHDB to know the screen and field sequence and either u can create a program to upload ur data through BDC where u have to call these Function module like:
    1.CALL FUNCTION 'BDC_OPEN_GROUP'
            EXPORTING
              client              = sy-mandt
              group               = p_group
              holddate            = p_hdate
              keep                = p_keep
              user                = p_user
    2. This FM is used to insert the records into session.
          CALL FUNCTION 'BDC_INSERT'
            EXPORTING
              tcode            = l_k_mek1
            TABLES
              dynprotab        = i_bdcdata(<b>intenal table which contains data). this function module has to call that many times as many record u want to post)</b>
    3. To close the session
          CALL FUNCTION 'BDC_CLOSE_GROUP'
            EXCEPTIONS
              not_open    = 1
              queue_error = 2
              OTHERS      = 3.
    <b>or</b>
    after recording through transaction 'SHDB', save that data and create a program by clicking program from application tool bar that will give u ready made code for BDC.

  • Error while creating a product group--Batch input error 9

    Hi,
       While creating a product group in T-code MC84, getting the error message" Product group can not be created (Batch input error 9)". Would appreciate providing yr help to resolve above issue.
    Thks,
    Nilesh

    Hi Neel,
       As ponited by you, the material type "PROD" is realted with creation of product group.I am able to resolve the error, "actually the work schedulling & MRP views were not activated for "PROD" resulting in the above error.
      Thks for yr help.
    Regards,
    Nilesh

  • Batch input session for Recurring Entry

    Hello All,
    i have created Batch input session for Posting document's for recurring entries creted and job executed in background through SM35 and done successfully, but i am unable to find the Batch input session in SM35 which i have created to run the job.
    i want to see the log file for this Batch Input session.
    Please help me how to get the batch Input Session.
    Thanks
    Shankar

    Hi Murali...
    Thank you a lot for your answer, i have created the Batch input session without selecting the "HOLD Session" Check box..
    Issue Resolved
    Thanks Again
    Shankar

  • FCHR - Online Cashed Check - Creates Batch session ending with ERR session

    My user is using the transaction FCHR - Online cashed checks to clear the payment document which we have made check payment and creates clearing document automatically in the bank GL account. In my case, the batch input session is creating with name ending with "ERR" and needs to process foreground in SM35 to create the clearing document. Most of time FCHR creates clearing document automatically and some times it is creating batch input session with user name ending with ERR. Can anyone provide me the reason for creating batch input session sometimes.
    Thanks in advance.

    Do you mean FCKR?  FCKR will generate a bach session with ERR when FCKR is unable to post the clearing at the time it is ran.  There is a check box at the bottom of the transaction called "Print posting log".  The posting log should give the errors that occur during posting.  Make sure this check box is checked when FCKR is run and review the log generated for errors.
    Regards,
    Shannon

  • Unable to create restore disk image with Disk Utility

    I've tried three times in order to create a restore image of the users' volume of my Powerbook. I followed exactly the procedure explained typing "man asr" in a terminal window. I booted the Powerbook in target disk mode while connected to my iMac G5 from which Disk utility was run. Every time the disk image creation failed with a log report like this:
    Creating Image “HOME_HD.dmg”
    Initializing...
    Copying...
    /Volumes/HOME_HD: Authentication error
    Initializing...
    Finishing...
    Initializing...
    Creating...
    Copying...
    could not access /Volumes/HOME_HD/./Users/delos/Music/iTunes/iTunes Music/David Bowie/The Best Of David Bowie 1974-1979/01 Sound And Vision.m4a - Input/output error
    Finishing...
    Unable to create “HOME_HD” - Input/output error.
    I don't know how my imported music could create such a problem to Disk utility, nevertheless I removed the incriminated song from the Music library but another one raised to be not accessible. Then I booted the powerbook from the supplied Tiger DVD too, and I got an error over the music file, something about an allocation that was 190 instead of 1, I got the volume repaired from Disk utility but the Disk image creation failed again without any hint because booting from DVD does not allow to save log file anywhere. Why on Earth I can't manage such a critical task as back up under Tiger while using Panther everything worked like a charm following the same procedure? Is anyone experiencing something similar?
    Greetings
    Gianmarco

    Hi Lee, thank you for your answer, indeed I've just read carefully your article few hours ago, while I googled the net to find some hints on my issue. I think that I've followed exactly the right procedure to make the back up image, and can't find what is wrong. Actually Disk utility Repair disk successfully repaired the allocation bit (whatever that means) of the music files but that wasn't enough to let the creation of the disk image. Quite odd that the music files where recognized as messed up by Disk utility only booting from Tiger DVD and not while the Powerbook was connected to an iMac running Tiger too.
    I'll do further investigation during weekend.
    Greetings
    Gianmarco

  • Issue with RFBIBL00 batch input processing

    Hello ABAP Experts,
    I am having issue with a speed of batch input session processing.  If you can please help me resolve the issue.
    I have a requirement to post liquidation document to clear open vendor down payment items and then to clear vendor invoice with liquidation.  I have created a custom program to address this requirement where it uses the SAP program and Call Transaction.
    For liquidation document posting, I am using the program RFBIBL00.  The custom program has steps:
    1.  Submit RFBIBL00 via job to create batch input session
    2.  Close job
    3.  Submit RSBDCSUB via job to process batch input session
    4.  Close job
    5.  Wait for 15 seconds
    6.  Read job log to get liquidation document number
    7.  If no document posted then display error
    The issue is when the job log is read it says u2018Session 10zrsbdcsubxxxxxxx is being processed by user   in mode   on serveru2019 and there is no error message or no document number with message number 312.  So the program displays error message, stops and cannot perform the second step. If I check in the system after a couple of minutes I find the document posted. I also increased the wait time.  But the first record processing always takes longer and the program finds as a failure.  The program can process next several records with success.
    I am looking for expert help if you please suggest how to resolve this.
    Thanks & Regards.
    Yashasvi

    Hi,
    Have you tried calling FM DEQUEUE_ALL before/after schedulling job?
    Gouri.

  • Batch input - FB05 - How to fill LIFNR if I post on GL account.

    Hi, our company normaly use IDOCs (FIDCCP02) for posting FI documents (accrual intercompany FI documents) and there we can fill LIFNR and it is saved in BSEG-LIFNR. But now I  created batch input for transactin FB05 and I cannot fill LIFNR anywhere on screen by FI document posting on GL account. Is there any option how to fill LIFNR in batch input when i post on GL account?
    Thanks

    I would check field status group assigned to your account and check which fields are enabled in this group (in SPRO under Financial Accounting -> Financial Accounting Global Settings -> Document -> Line Item -> Controls -> Maintain Field Status Variants)

  • Field Exit for Batch Input creation from LSMW

    Hi all,
    I am having problems getting a field exit to work for validation of user id in the "Create Batch Input Session" step of LSMW.
    Program: /SAPDMC/SAP_LSMW_BI_RECORDING
    Screen:  1000
    Data Element: SYUNAME
    Any help would be appreciated.
    Regards,
    Jason
    Message was edited by: Jason Lante

    Field exits are not supported after 4.6 yes, but they still work. I found the reason why my field exit wasn't working; it related to the fact that the field I am applying it to is not directly related to a dictionary object. Meaning I cannot apply a field exit.
    So my question now is what other ways are there to enhance LSMW?
    Regards,
    Jason

Maybe you are looking for

  • How to call a proxy written in ECC from Neteweaver Gateway

    Hi Experts, We have a scenario in our project where there is a proxy written in ECC which brings inventory data from POSDM system. We need to call this proxy and then send the data to SMP 3.0. Can the experts guide me here on how to go about doing th

  • Keychain error -25299 when trying to access Time Machine

    I am in the process of migrating to a new iMac and am having trouble getting Time Machine to work on my Time Capsule. It was working fine with my old iMac and it still works fine with my Macbook but when I try to access it on the new machine I am ask

  • Operating command before message processing

    Hi experts, i have a file to jdbc scenario. My problem is that i want to send files that are generated on a ftp seperately. To do so, i wrote a .bat script to rename the files the way I want, and then the CC takes the file under the specific name I s

  • Loader component

    i have an aplication that upon on(release) uploads simultaniously few jpg from server to loaders. working locally - no problem. workingf from server i face problem. some loaders are ok but some of them (every time another loader) does not scale the c

  • Oraoledb.dll not found

    Hi, I am currently encountering the issue with the application for which 'Oraoledb.dll' is required in Oracle home path. However, when I looked into my Oracle home path I couldn't find this file anywhere. I researched and found that in order to get t