LT04 BATCH INPUT TROUBLE

Hy guys i have a little trouble with my batch input. in my table t_fabb i have many rows but just after the first batch, i have an error message:MESSAGE e000(zlo) WITH 'Errore conferma OT LT04.
If i exit from the report ang get in again , the same row that failed , succed but the next row fail etc...
i can't understand why....
LOOP AT t_fabb.   
SELECT *
      FROM ltbk
     WHERE tbnum >= t_fabb-tbnum
       AND lznum  = t_fabb-aufnr
       AND lgnum  = '050'
       AND statu <> 'E'.
      SELECT SINGLE *
        FROM ltbp
       WHERE lgnum  = '050'
         AND elikz <> 'X'
         AND matnr = t_fabb-matnr
         AND tbnum = ltbk-tbnum
         AND charg <> ''.
      IF sy-subrc = 0.
        EXIT.
      ENDIF.
    ENDSELECT.
    IF sy-subrc <> 0.
      MESSAGE e000(zlo) WITH 'Numero OT già confermata'.
      LEAVE SCREEN.SET SCREEN 0.
    ENDIF.
    CLEAR bdcdata.
    REFRESH bdcdata.
    PERFORM bdc_dynpro      USING 'SAPML03T' '0131'.
*  PERFORM bdc_field       USING 'BDC_CURSOR'
*                               'LTBK-TBNUM'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM bdc_field       USING 'LTAK-LGNUM'
                                  '050'.
    PERFORM bdc_field       USING 'LTBK-TBNUM'
                                  ltbp-tbnum.
    PERFORM bdc_field       USING '*LTBP-TBPOS'
                                ltbp-tbpos.
    PERFORM bdc_field       USING 'RL03T-ALAKT'
                                  'X'.
    PERFORM bdc_field       USING 'RL03T-DUNKL'
                                   'D'.
    CALL TRANSACTION 'LT04' USING bdcdata
*{   REPLACE        LGPK901791                                        1
*                     MODE 'N'  UPDATE 'S' MESSAGES INTO messtab.
                     MODE 'E'  UPDATE 'S' MESSAGES INTO messtab.
*}   REPLACE
    IF sy-subrc = 0.
      SELECT SINGLE *
        FROM ltbp
       WHERE lgnum = '050'
         AND tbnum = ltbp-tbnum
         AND tanum <> ' '.
      IF sy-subrc = 0.
        z311a-ztanum = ltbp-tanum.
      ENDIF.
      PERFORM modify_z331a.
    ELSE.
      MESSAGE e000(zlo) WITH 'Errore conferma OT LT04'.
      LEAVE SCREEN.SET SCREEN 0.
    ENDIF.
    READ TABLE messtab WITH KEY msgtyp = 'S'
                                msgid = 'LT'
                                msgnr = '100'.
  ENDLOOP.

Hi,
Just check in 'messtab' if there is some error messages.
Please note that when transfer orders are created in sequence a commit work must be placed between the calls so as to clear the global internal tables associated.
Instead of call transaction i suggest that you use the FM L_TO_CREATE_TR. Please go through teh documenttation of the FM.
Also i find that you are doing SELECT within LOOPs. Please try to avoid it. Although it is not related to your issue; but as best practices one should avoid it.
Regards,
Ankur Parab

Similar Messages

  • Batch Input with transaction ME58

    Hello SAP:
    We are trying to do a Batch Input Session with transaction ME58
    (Creating Service Entry Sheets) by using a FrameWork Order.
    After the batch input selects the purchase order and mark all
    the requisitions related with that order and confirms the selection,
    the system calls program SAPLMLSR dynpro 400, where the tab "Basic
    Data" appears and the error "Make an entry in all required fields"
    (00 055) is displayed. Althought we had put all the obligatory
    fields required by the Batch Input in that particular
    screen SAPLMLSR - 400 (we also tried with subscreen 410), the fields
    indicated in the Batch Input were lost.
    It seems the flow control of the Batch Input is lost because of the
    error message 00 055.
    Thank You - And we will be waiting for Your answer.
    Frinee Paredes

    Hi Christian!!
    The error that is displayed is because of a mandatory field, the problem is that it appears before the screen is displayed, I mean the validation occurs before I can input data.
    It's very interesting what you said about enjoy transactions and there might be the problem, a few minutes ago, while debugging transaction ME58, I found that it calls function module MS_SERVICE_ENTRY2, which calls transaction ML81N, which I think is an enjoy sap transaction, I guess I'm in a big trouble because I've already looked for a BAPI and it seems there aren't any.
    If you like to reproduce the error you could record transaction ME58 with transaction SHDB,you would need a framework order (FO) for the selection screen and purchase requisitions (PO) created asociated to that FO.
    What I want to do with ME58 is to run a job periodically which creates service entry sheets with the FO and PR as input.
    Thank you very much!!
    Frinee

  • LSMW Batch Input Recording for Create BOM

    Dear All,
    I want to do LSMW for Creating BOM using Batch Input Recording,
    I know that i have to make 2 time Recording, first for the BOM Header and second for the BOM item
    For the BOM header i have done it, but for the BOM item i got some trouble with the item number (POSNR),
    when i run the LSMW, for the first item (item 0010) was success, but for the item 0020, it can't work and i got error
    message " NO BATCH INPUT FOR SAPLCSDI 0150"
    How is the recording step by step for BOM Item so the Item number can increase well?
    Very need your help,
    Regards,
    Marufat

    Hello Santosh,
    Thanks for the reply,
    I already check in SM35 where i also thought that the main problem is about adding the new item number,
    but when i tried to do repeat recording, i can not find any entry for adding the line item, so the line item after 0010 cannot be input
    Is there any solution?
    Regards,
    Marufat

  • Leave to transaction "SAPMF05L" not allowed in batch input

    Hello,
    When we run FF.5 with the file sent from Itaú, it is generated a batch input for transaction FB02 which updates the reference key 1, 2 and 3 (XREF1, XREF2 and XREF3) in the documents.
    There are some cases where the batch input does not update all the document items. For example, I got a document that has 32 items to be updated with the reference keys, but the update is only done in the first 14 document items. I observed that the batch input only updates up to number 14 because the standard program does not u201Cscroll the baru201D to check if there are more items in the document to be updated. The batch input is having trouble and generating some incorrect transactions and showing the error message: LEAVE TO TRANSACTION u201CSAPMF05Lu201D not allowed in batch input.
    I tried to find a SAP note, but couldnu2019t find anything that was related to this. Does anyone got this problem and maybe can help me?
    Thanks,
    Leandro

    if you want to leave a batch session try "/bend" or "/n" to move to the next record.

  • Funds Commitment Batch-Input running in Job

    Hi Folks,
    I'm having some trouble with a batch-input running in job for transaction FMZ1.
    When I run the batch-input in a dialog process (no job) it works perfectly, however when I execute this same program in a Job the job doesn't finishes, and when I debug the job, it freezes when calling transaction FMZ1.
    Does anyone know if I'm missing something? Or is there any restriction for this transaction to be executed in a job?
    Thanks in advance.
    Regards,
    Gilberto Li

    Hi Vijay,
    Using the following function modules you can create a batch input session.
    BDC_OPEN_GROUP
    BDC_INSERT
    BDC_CLOSE_GROUP
    Example - http://www.sap-img.com/abap/auto-disallowed-back-posting-to-previous-period.htm
    You can use the program RSBDCSUB to schedule batch input sessions in background.
    http://www.sap-img.com/abap/learning-bdc-programming.htm - How to write BDC program
    Executing batch-input sessions in background jobs - Example for how to call the bdc session.
    Hope these are helpful.
    Thanks
    Vinod

  • Batch input of a list of values

    Hello,
    I have to make a batch input of a list.
    The screen of the transaction contains a list with 9 lines, if i enter a value in one, another line is added to the list.
    I did record this transaction and have an incremented list in the generated program that looks like this :
    it begins whith ADRPCIT-POST_CODE(01) and increments till 09
    perform bdc_dynpro      using 'SAPLSZRL' '0400'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ADRPCDCITY-POST_CODE(08)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'ADRPCDCITY-POST_CODE(08)'
                                  record-POST_CODE_08_017.
    perform bdc_dynpro      using 'SAPLSZRL' '0400'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ADRPCDCITY-POST_CODE(09)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'ADRPCDCITY-POST_CODE(09)'
                                  record-POST_CODE_09_018.
    perform bdc_dynpro      using 'SAPLSZRL' '0400'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ADRPCDCITY-POST_CODE(09)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPLSZRL' '0400'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ADRPCDCITY-POST_CODE(07)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'ADRPCDCITY-POST_CODE(07)'
                                  record-POST_CODE_07_019.
    perform bdc_dynpro      using 'SAPLSZRL' '0400'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ADRPCDCITY-POST_CODE(08)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'ADRPCDCITY-POST_CODE(08)'
                                  record-POST_CODE_08_020.
    perform bdc_dynpro      using 'SAPLSZRL' '0400'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ADRPCDCITY-POST_CODE(09)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'ADRPCDCITY-POST_CODE(09)'
                                  record-POST_CODE_09_021.
    perform bdc_dynpro      using 'SAPLSZRL' '0400'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ADRPCDCITY-POST_CODE(09)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SAVE'.
    What i did is setting the value of the incremented number to 09 if it's greater than 09 but i'm not sure it's the right way to do it cause i get only 9 records
    My code :
    LOOP AT gt_record ASSIGNING <fs_record>.
        IF sy-tabix > 9.
          ligne = 9.
        ELSE.
          ligne = sy-tabix.
        ENDIF.
        IF ligne > 1.
          IF city_mem EQ <fs_record>-city_code_001.
            flag_end = 'X'.
          ELSE.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=SAVE'.
            PERFORM bdc_transaction USING 'SR10'.
            CLEAR flag_end.
          ENDIF.
        ENDIF.
        city_mem = <fs_record>-city_code_001.
        IF flag_end NE 'X'. "premier passage
          PERFORM bdc_dynpro      USING 'SAPLSZRC' '0100'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'ADRCITYD-CITY_CODE'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING 'ADRCITYD-CITY_CODE'
                                        <fs_record>-city_code_001.
          PERFORM bdc_field       USING 'ADRCITYD-COUNTRY'
                                        'FR'.
          PERFORM bdc_field       USING 'ADRCITYD-LANGU'
                                        'F'.
          PERFORM bdc_dynpro      USING 'SAPLSZRC' '0200'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'ADRCITYD-COMMU_CODE'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING 'ADRCITYD-FLAG_STRTS'
                                        'X'.
          PERFORM bdc_field       USING 'ADRCITYD-CITY_NAME'
                                        <fs_record>-city_name_005.
          PERFORM bdc_field       USING 'ADRCITYD-REGION'
                                        <fs_record>-region_006.
          PERFORM bdc_field       USING 'ADRCITYD-TIME_ZONE'
                                        'CET'.
          PERFORM bdc_field       USING 'ADRCITYD-COMMU_CODE'
                                        <fs_record>-commu_code_008.
          PERFORM bdc_field       USING 'ADRCITYD-DEF_LANGU'
                                         'F'.
          PERFORM bdc_dynpro      USING 'SAPLSZRC' '0200'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'ADRCITYD-CITY_NAME'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=PSTC'.
          PERFORM bdc_field       USING 'ADRCITYD-FLAG_STRTS'
                                        'X'.
          PERFORM bdc_field       USING 'ADRCITYD-CITY_NAME'
                                        <fs_record>-city_name_005.
          PERFORM bdc_field       USING 'ADRCITYD-REGION'
                                        <fs_record>-region_006.
          PERFORM bdc_field       USING 'ADRCITYD-TIME_ZONE'
                                        'CET'.
          PERFORM bdc_field       USING 'ADRCITYD-COMMU_CODE'
                                        <fs_record>-commu_code_008.
          PERFORM bdc_field       USING 'ADRCITYD-DEF_LANGU'
                                        'F'.
    *      PERFORM bdc_dynpro      USING 'SAPLSZRL' '0400'.
        ENDIF.
        PERFORM bdc_dynpro      USING 'SAPLSZRL' '0400'.        "ajout2
        lignec = ligne.
        CONCATENATE 'ADRPCDCITY-POST_CODE(' lignec ')' INTO cp.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      cp.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING cp
                                      <fs_record>-post_code_01_016.
      ENDLOOP.
    *  deniere sauvegarde
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=SAVE'.
      PERFORM bdc_transaction USING 'SR10'.
      CLEAR flag_end.
      PERFORM close_group.
      PERFORM close_dataset USING dataset.
    Can somebody help me on this one ?
    Thank you,
    Tom.

    If it is table control you may have to pass PageDown after 9 rec & again start with (01)
    record number remains 1 to 9 but Top_line parameter will change to 9or10 after 1 pagedown.
    Cxould be P++
    you can record Pagedown & check recording.

  • Manual bank statement: no batch input was generated

    Hi,
    maybe somebody has a clue with this problem regarding FF67: after the data processing, no batch input is generated in order to post the bank statement.
    Please, I need your help with an OSS note or with a posting solution without batch input ( I tried to process the bank statement with "processing type = 4", but it didn't work).

    Hi Andrea,
    Try to add value in <i>Session name for bank postings</i>
    Do not hesitate to ask for further clarifications. Award points if useful.
    Regards,
    Siva

  • Batch input session is not generating In BRS

    Hello,
    I am uploading bank statement through ZFF67 program manual bank statement, after entering all the line items in the file, batch input session is not generating in SM35.
    Please give advice.
    Thanks,
    Ratnam

    Hi,
    Go to environment - specification-  here you need to maintain settings for batch input processing in T.code FF67.
    I am not exactly remembering the menu option name. The sub option name is Specification, these settings you need to change with your user id.
    Check and revert back still the same problem exists.
    Regards,
    Sankar

  • Is it possible to maintain a view vai Batch Input

    Hi guys,
    The user required to develop a BDC program to upload the data source from outside of SAP, and maintain these data into a view via Tcode: SM34. But it seems the view doesn't support Batch input.....
    Can anybody tell me, is it possible to maintain a view via Batch input? Many thanks!
    Brian Liu

    Additional information:
    This requirement is to upload the Overhead Rate data from outside of SAP, and maintained via KZM2 or SM34. But when I tried to record a BDC for KZM2, it seems that the SAP can not support batch input.
    I find a SAP note 208474, it says:
    Symptom
    Overhead rates of the costing sheet of the overhead rates, which have been created, changed or deleted via batch input or Call Transaction, are not saved.
    The same rates are saved if processing is carried out via Transaction KZZ2 or the Implementation Guide IMG.
    Cause and prerequisites
    Processing the Customizing transactions for maintaining the overhead rates of the costing sheet (Transaction KZZ2, KZM2) is
    not supported in the batch input. This corresponds to the SAP standards according to which Customizing transactions in general need not necessarily be capable of batch input.
    The batch input data of the overhead rates are not saved in the standard because processing is terminated by a COMMIT WORK. This statement ensures that the internal tables for the transport of the overhead rates are only deleted if their transfer to the database tables to be transported has been processed successfully.
    Solution
    The subsequent modification allows batch input processing of the overhead rates, by suppressing the COMMIT WORK statement. As a result of the modification, the tables in the transport request of the overhead rates may be incomplete in single cases.
    In cases where the overhead rates have not been transferred completely to the target system after implementation of the modification, include the overhead rates again in a transport request, repeat the transport and, if necessary, subsequent processing.
    Note that the attached modifications are not and will not be included in the R/3 standard system.
    I modified the sap standard program L0COEF04 according to another SAP note 150041, but after the modification, I still couldn't record the BDC.
    Anybody who have ever met the same situation, or can give me some suggestion? With many thanks!
    Brian Liu

  • How to check whether a batch input session is completed in ABAP program

    I have created a ABAP program to create a batch input session (reference to RSBDCSUB). After the creation of the batch input session, I kick it to start and read the execution log. However, sometimes I cannot read anything from the execution log as the execution of the batch input is a synchronized process to the execution of my program, i.e. at the time being that I try to read the log of a particular transaction, that transaction is being processing / haven't start processing.
    How can I check whether a batch input session is completed in the program?
    The code that corresponding to the triggering of batch input session:
    SUBMIT (SUBREPORT)
       USER MTAB-USERID
       VIA JOB MTAB-GROUPID
       NUMBER JNUMB
       WITH QUEUE_ID  EQ MTAB-QID
       WITH MAPPE     EQ MTAB-GROUPID
       WITH MODUS     EQ 'N'
       WITH LOGALL    EQ LMODUS
    Or is there any method to wait here until the process is completed before further processing?

    Hi gundam,
    1. Or is there any method to wait here until the process is completed before further processing?
    There is no such direct method to wait.
    2. Immediately after submitting in background,
       we cannot wait
      neither can we LOOP and go on detecting
      whether the b/g process has completed or not !
    3. To over come such problems,
      we have to use another technique.
    4. we have to submit another
       job which will get triggered
       on event SAP_END_OF_JOB
       ie. when the original job will finish,
      our new job will AUTOMATICALLY get triggered,
    5. This new job / program
       will do the FURTHER actions !
    regards,
    amit m.

  • Batch input for IQ02 not accepting "yes" for 'POPUP_TO_CONFIRM'

    Hello,
    I wrote a batch input for a transaction (IQ02) and all works fine except one thing:
    -when all data  is entered and SAVE button is pressed, there is an additional pop-up, from an user exit which needs an YES/NO answer.
    The function module used to display the popup is: 'POPUP_TO_CONFIRM'
    I do not manage to press the YES button. This is the data I receive when pressing F1 on YES button:
    Program         SAPLSPO1
    Function          OPT1
    Normally, in batch input, this is the way I pass user-commands:
    PERFORM bdc_dynpro USING 'SAPMIEQ0' '0101'.
    PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
    But it's not working for this particular situation.
    Any ideas?
    Thank you.
    Edited by: Julius Bussche on Jan 5, 2009 2:07 PM
    Quality of subject title improved.

    Hi
    Find out under which condition popups appears.
    for that condition you have to put the following code
    PERFORM bdc_dynpro USING 'SAPLSPO1' ''<SCREEN_NUMBER>'.
    PERFORM bdc_field USING 'BDC_OKCODE' '=OPT1' .
    Hope this helps,
    Rajat

  • 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

  • BDC programming using Batch input Session.

    Hello Experts.
    I'm an ABAP beginner. I've benn practicing BDC programming using Batch input Session
    at the moment.
    This is the program that upload Local file which has plural records, and put the records into a Session.
    These are the records.
    413459,KIM EI HWAN121                ,19810607,MIADONG1234
    423459,KIM EI HWAN122                ,19810607,MIADONG1235
    433459,KIM EI HWAN123                ,19810607,MIADONG1236
    443459,KIM EI HWAN124                ,19810607,MIADONG1237
    453459,KIM EI HWAN125                ,19810607,MIADONG1238
    463459,KIM EI HWAN126                ,19810607,MIADONG1239
    I succeeded making Session.
    However, for some reaseon, every record in the Session has got the same, value which is the first record.
    Why is this happening? And How can I correct the code below?
    REPORT ZBCUSER002_BATCH NO STANDARD PAGE HEADING
                            LINE-SIZE 255
                            MESSAGE-ID ZBATCH.
    = Types definition ===================================================
    TYPES: BEGIN OF TYP_LOCAL,               "For Local file upload
             RECORD(200) TYPE C,
           END   OF TYP_LOCAL.
    = Internal table definition ==============================================
    DATA: BEGIN OF BDC_TAB OCCURS 0.        "BDCDATA itab
            INCLUDE STRUCTURE BDCDATA.
    DATA: END   OF BDC_TAB.
    DATA: BEGIN OF MESSAGE_BDC OCCURS 0.    "Message itab
            INCLUDE STRUCTURE BDCMSGCOLL.
    DATA: END   OF MESSAGE_BDC.
    DATA: TBL_LOCAL TYPE STANDARD TABLE OF TYP_LOCAL,  "Local file itab
          F_TBL     TYPE FILETABLE.                    "FILETABLE fot local
    = Structure table definition =========================================
    DATA: STR_F_TBL LIKE LINE OF F_TBL,                "FILETABLE structure
          STR_LOCAL TYPE TYP_LOCAL.                    "Local file structure
    = Variable definition ================================================
    DATA: LV_RC     TYPE I,                            "Method parameter
          ENUMBER   TYPE ZT601-ENUMBER,                "Employee number
          NAME      TYPE ZT601-NAME,                   "Employee name
          BIRTH     TYPE ZT601-BIRTH,                           "Birthday
          HOMETOWN  TYPE ZT601-HOMETOWN,                        "Hometown
          SYSVAL    TYPE SY-SUBRC.                     "System valuible
    = Constants definition ===============================================
    CONSTANTS: TBL_NAME(10) TYPE C VALUE 'ZT601'.      "Table name ZT601
    = Parameters definition ==============================================
    PARAMETERS: F_NAME      TYPE RLGRAP-FILENAME OBLIGATORY,    "File path
                EXECMODE(1) TYPE C.                    "Execute mode
    INITIALIZATION
    *----- Initialize all valuables, structures and internal tables
    CLEAR: LV_RC,
           STR_F_TBL,
           STR_LOCAL,
           ENUMBER,
           NAME,
           BIRTH,
           HOMETOWN.
    REFRESH: F_TBL,
             TBL_LOCAL.
    AT SELECTION-SCREEN
    *----- When the button next to Parameter 'F_NAME',
    *----- File dialog open.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR F_NAME.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
        EXPORTING
          WINDOW_TITLE            = 'SELECT FILE'
          DEFAULT_FILENAME        = '*.TXT'
       CHANGING
         FILE_TABLE               = F_TBL
         RC                       = LV_RC
        EXCEPTIONS
          FILE_OPEN_DIALOG_FAILED = 1
          CNTL_ERROR              = 2
          OTHERS                  = 3
    *----- system valiable check.
    *----- If done properly,
    *----- Put the path into the File path parameter
      IF SY-SUBRC = 0.
        READ TABLE F_TBL INTO STR_F_TBL INDEX 1.
        F_NAME = STR_F_TBL.
    *----- If not done properly, show message
    *----- An error occured while getting file path then end program
      ELSE.
        MESSAGE E000.
      ENDIF.
    *----- Execute code can only be A or N.
    AT SELECTION-SCREEN ON EXECMODE.
      IF EXECMODE <> 'A' AND EXECMODE <> 'N'.
        MESSAGE E001.
      ENDIF.
    START-OF-SELECTION
    START-OF-SELECTION.
    *----- Upload Local file of file path parameter.
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                FILENAME                = F_NAME
                FILETYPE                = 'ASC'
           TABLES
                DATA_TAB                = TBL_LOCAL
           EXCEPTIONS
                FILE_OPEN_ERROR         = 1
                FILE_READ_ERROR         = 2
                NO_BATCH                = 3
                GUI_REFUSE_FILETRANSFER = 4
                INVALID_TYPE            = 5
                OTHERS                  = 6.
    *----- System valiable check.
    *----- If not done properly, show an error message
    *----- An error occured while uploading local file then end program
      IF SY-SUBRC <> 0.
        MESSAGE E002.
      ENDIF.
      PERFORM BDC_OPEN.
    *----- Loop Internal table
      LOOP AT TBL_LOCAL INTO STR_LOCAL.
    *----- Spilt the file record and put them into each valiable.
        SPLIT STR_LOCAL AT ',' INTO  ENUMBER
                                     NAME
                                     BIRTH
                                     HOMETOWN.
    *----- Data check Function module
        CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
             EXPORTING
                  DATE                      = BIRTH
             EXCEPTIONS
                  PLAUSIBILITY_CHECK_FAILED = 1
                  OTHERS                    = 2.
    *----- When error occurs while checking date, show an error message.
    *----- (&1) is not date
        IF SY-SUBRC <> 0.
          MESSAGE E003 WITH BIRTH.
        ENDIF.
    *-- The first screen of SE11
    *----- Screen number 0102 of program id SAPMSRD0
        PERFORM BDC_DYNPRO      USING 'SAPMSRD0' '0102'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RSRD1-TBMA_VAL'. "Field on Cursor
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=SHOW'.          "Display button
        PERFORM BDC_FIELD       USING 'RSRD1-TBMA'
                                      'X'.
        PERFORM BDC_FIELD       USING 'RSRD1-TBMA_VAL'
                                       TBL_NAME.                "ZT601
    *-- Table definition screen
    *----- Screen number 2000 of program id SAPLSD02
        PERFORM BDC_DYNPRO      USING 'SAPLSD02' '2000'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'DD02D-TABCLTEXT'.  "Field on Cursor
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=TDED'.            "Create entry
        PERFORM BDC_FIELD       USING 'BDC_SUBSCR'
                                      'SAPLSD02'.
        PERFORM BDC_FIELD       USING 'BDC_SUBSCR'
                                      'SAPLSED5'.
    *-- Data input screen
    *----- Screen number 0101 of program /1BCDWB/DBZT601
        PERFORM BDC_DYNPRO      USING '/1BCDWB/DBZT601' '0101'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'ZT601-CRUSER'.    "Field on Cursor
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=SAVE'.                  "Save
        PERFORM BDC_FIELD       USING 'ZT601-MANDT'
                                      SY-MANDT.                 "Client
        PERFORM BDC_FIELD       USING 'ZT601-ENUMBER'
                                      ENUMBER.           "Employee number
        PERFORM BDC_FIELD       USING 'ZT601-NAME'
                                      NAME.              "Employee name
        PERFORM BDC_FIELD       USING 'ZT601-BIRTH'
                                      BIRTH.                    "Birthday
        PERFORM BDC_FIELD       USING 'ZT601-HOMETOWN'
                                      HOMETOWN.                 "Hometown
        PERFORM BDC_FIELD       USING 'ZT601-CRDATE'
                                      SY-DATUM.          "System date
        PERFORM BDC_FIELD       USING 'ZT601-CRTIME'
                                      SY-UZEIT.          "System time
        PERFORM BDC_FIELD       USING 'ZT601-CRUSER'
                                      SY-UNAME.          "System user
    *-- Data input screen (After input)
    *----- Screen number 0101 of program /1BCDWB/DBZT601
        PERFORM BDC_DYNPRO      USING '/1BCDWB/DBZT601' '0101'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/EBACK'.                 "Back
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'ZT601-CRUSER'.    "Field on Cursor
    *-- Table definition screen]
    *----- Screen number 2000 of program SAPLSD02
        PERFORM BDC_DYNPRO      USING 'SAPLSD02' '2000'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'DD02D-TABCLTEXT'.  "Field on Cursor
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=WB_BACK'.               "Back
    *-- The first screen of SE11
    *----- Screen number 0102 of program SAPMSRD0
        PERFORM BDC_DYNPRO      USING 'SAPMSRD0' '0102'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RSRD1-TBMA_VAL'.   "Field on Cursor
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=BACK'.
        PERFORM BDC_FIELD       USING 'RSRD1-TBMA'
                                      'X'.
        PERFORM BDC_FIELD       USING 'RSRD1-TBMA_VAL'
                                      TBL_NAME.
        PERFORM BDC_INSERT.
      ENDLOOP.
      PERFORM BDC_CLOSE.
          FORM BDC_DYNPRO                                               *
          Put Program-Id, Dynpro screen number, Start point
          into DBCDATA
    -->  PROGRAM                                                       *
    -->  DYNPRO                                                        *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDC_TAB.
      BDC_TAB-PROGRAM  = PROGRAM.
      BDC_TAB-DYNPRO   = DYNPRO.
      BDC_TAB-DYNBEGIN = 'X'.
      APPEND BDC_TAB.
    ENDFORM.
          FORM BDC_FIELD                                                *
          Put Field Name and Value into BDCDATA
    -->  FNAM                                                          *
    -->  FVAL                                                          *
    FORM BDC_FIELD USING FNAM FVAL.
      CLEAR BDC_TAB.
      BDC_TAB-FNAM = FNAM.
      BDC_TAB-FVAL = FVAL.
      APPEND BDC_TAB.
    ENDFORM.
          FORM bdc_process                                              *
    FORM BDC_OPEN.
      CALL FUNCTION 'BDC_OPEN_GROUP'
           EXPORTING
                CLIENT = SY-MANDT
                GROUP  = 'Testsession'
                KEEP   = 'X'
                USER   = SY-UNAME.
      IF SY-SUBRC <> 0.
        MESSAGE E006 WITH SY-SUBRC.
      ENDIF.
    ENDFORM.
          FORM bdc_insert                                               *
    FORM BDC_INSERT.
      CALL FUNCTION 'BDC_INSERT'
           EXPORTING
                TCODE            = 'SE11'
           TABLES
                DYNPROTAB        = BDC_TAB
           EXCEPTIONS
                INTERNAL_ERROR   = 1
                NOT_OPEN         = 2
                QUEUE_ERROR      = 3
                TCODE_INVALID    = 4
                PRINTING_INVALID = 5
                POSTING_INVALID  = 6
                OTHERS           = 7.
      IF SY-SUBRC <> 0.
        MESSAGE E007 WITH SY-SUBRC.
      ENDIF.
      CLEAR: BDC_TAB.
    ENDFORM.
          FORM bdc_close                                                *
    FORM BDC_CLOSE.
      CALL FUNCTION 'BDC_CLOSE_GROUP'
           EXCEPTIONS
                NOT_OPEN    = 1
                QUEUE_ERROR = 2
                OTHERS      = 3.
      IF SY-SUBRC <> 0.
        MESSAGE E008 WITH SY-SUBRC.
      ENDIF.
    ENDFORM.

    God I forgot to refresh Internal table after putting record into Session.
    Now I'm done.
    You guys be careful too.

  • Error in batch input through a job (mm01)

    Hi,
    I have a problem with a batch input on MM01.
    I want to extend material for a new center and I do it through a batch input. If I execute this batch input with F8 and in mode = 'N', it ends ok.
    The problem is when I run this program with a job, the material is not added to the new center.
    Can anyone help me?
    Thanks,
    Liliana.

    Hi,
    Try using BAPI BAPI_MATERIAL_SAVEDATA...
    Check this link for a sample code..
    http://www.sap-img.com/abap/bapi-to-copy-materials-from-one-plant-to-another.htm
    Thanks,
    Naren

  • Error exec. Background Mode a Batch-Input using KP26 Transaction Code

    I have a program that build a Batch-Input based on transaction code KP26.
    I encounter the following error :
    Field Z-BDC02(1) is not an input field (Program : SAPLKPP2 Screen : 0112)
    When executing in background I got the error and when executing in Foreground, it is OK.
    I use SHDB to look at the field needed and  it gave me the same field to use.
    Here is an extract of my program for the field I have the issue on :
        PERFORM F100_BDC_FIELD USING 'Z-BDC02(01)' I_T01-LST.
        PERFORM F100_BDC_FIELD USING 'Z-BDC05(01)' I_T01-SPRED.
        PERFORM F100_BDC_FIELD USING 'Z-BDC07(01)' I_T01-TOV.
        PERFORM F100_BDC_FIELD USING 'Z-BDC08(01)' I_T01-TOF.
    Any one have an hint to solve this ?

    Hi,
    Just one remark: batch input is always executed in synchronous mode (hopefully, otherwise we would get many lock issues during mass updates!) Or is there something I missed?
    Same thing when you use BDC_INSERT, CTU_PARAMS is ignored ([SAP note 1437811 (Batch input: BDC_INSERT parameter CTUPARAMS)|https://service.sap.com/sap/support/notes/1437811 ])
    About the issue, I don't know, so maybe explain more about the context: for instance, do you run the session under a different user? (for instance, the user could be assigned a transaction/screen variant with table control variant, that protects some fields) Do you have one transaction in the batch input session or are there several ones. Try with one only to see if it works. If yes, then maybe it's something in memory that changes the "input-capability" of the field after the first transaction.
    Sandra

Maybe you are looking for

  • [Solved] Reflect all changes to a filesystem in another filesystem

    I'm looking for a solution to the following problem: I want to setup an external harddisk so that two different partitions on it behave in the following way: Given an ext4 partition mounted rw at /mnt/ext and a NTFS partition mounted also rw at /mnt/

  • Which LCD screen do I need for replacement?

    Hi, I'm looking to switch out my damaged LCD screen for my BB Curve 8530. I've had a look at purchasing a replacement online, but have noticed there are 3 different kinds. How can I tell which one I need without opening the phone up first. 004/005 or

  • Upgrade to SQL Server 2005 media

    I am trying to find out if SAP provides a DVD with the SQL Server 2005 software for upgrade/installation as it did for 2000.  I have found references in notes to using the DVD provided by SAP and a SQL4SAP vb script to run to do the install.  And in

  • ODCI : oracle data catridge interface service : what shared libs are needed

    Hi, I am writing aggregate functions. For using ODCI along with OCI in C/C++.. what are the shared libraries which are required : i have oci.h & odci.h files but do not know what shared libraries are needed to use the ODCI interface. I am getting the

  • Vendor Evaluation QM

    Hi!! I woul'd like to use SAP standard Vendor Evaluation, but I'm not understanding how the subcriteria 'GR Inspection', of criterion 'Quality' is evaluated... Could you help me about what SAP uses for evalueted this subcriteria? Thankyou! Regards,