Batch-Input Dynpro sequence changed

Hello,
a customer uses a report since today (1 1/2 years) that creates new materials by CALL TRANSACTION 'MMZ1'.
Hoever, the once recorded dynpro sequence changed and the report fails to create new materials. (already changed and material creation with BAPI_MATERIAL_SAVEDATA)
There were no changes to the customizing of that system and no patches etc. were installed. Even no user knew this transaction MMZ1, so that its sequence was not changed manually.
Now my question:
Which events do infuence transactions, transaction dynpro sequences?
Regards
Frank Zoor

Hi Frank,
If it is a BDC program, then the Sequence in which the dynpors were coded is almost harcoded and it needs to be changed according to the new sequence. There is no other alternative to this.
If it calls some BAPIs that creates the Material, then check the sequence in which the BAPI calls the screens and compare whether it is calling in the correct sequence. Else modify that.
Cheers,
Sam

Similar Messages

  • Problems Batch Input BDC-okCODE = LIST

    Hi experts!!
    I've a batch Input that must change the data from the infotype 2001. I do this steps...
    1. Go to PA30
    2. Insert the pernr and the code 2001
    3. Press the button LIST
    4. Choice the row I want to change, only the rows that are ocked
    5. Update and save...
    I'm trying to do this with a Batch Input, but I don't know how to indicate what row I want to change...I have a data that has all the positions that are locked in 2001 but I don't know how to know what row is from what row of my table... can anybody help me?
    Thanks a lot
    Regards,
    Rebeca

    Hi Rebeca,
    It is difficult to find the locked recods dynamically using your  BDC approach.
    The other way to delete the locked records is....
    Select the all the records from PA2001 infotype where SPRPS equal to 'X' ( Locked Entries ) into the itab internal table.
    later Loop the table and delete the record from 2001 using BDC on PA30.
    Do the recording for deleting individual  record.

  • 2 batch inputs always run in sequence in LSMW

    Hi all,
       Is it possible to run 2 batch inputs( one is for create material , other is change material tranactions) in sequence in LSMW, If possible please let me know?
    Thanks & Regards
    RK

    Hi
    No its not possible to run two in sequence in one shot
    u need to run one by one and one after the other
    bcoz mapping of structured fields will be clashed
    hope this is clear
    reward pts if helpful
    regards
    sreenivas

  • Calling Batch input from Web Dynpro - any alternatives for table updates?

    Hi!
    I am asked to create a screen in Web Dynpro for the GJ30 transaction (JV Cutback mapping of WBS' elements). I created a remote enabled function module which call batch input for GJ30 . Testing the Function modules direclty goes fine, but not calling the function module from WD. then I get the same error message as when I once tried to call SAP GUI from Web Dynpro ( Call transaction /submit program).
    My next step is to try to create a batch input session (instead of call transaction) and run it using rsbdcsub, and then check the result of the run. But maybe this will fail of the same reason as well, and I suppose this will make the user waiting longer for the response .
    I read somewhere that Web Dynpro does not support batch Input. But what can you do when there are no standard BAPI's for the update you want to do in SAP ?  We are not supposed to do direct table updates.  
    Anyone who have struggled with the same issues and found a solution??
    regards, Tine

    Hi,
    as BDC is calling screens and in Webdynpro ABAP you cannot use SAP GUI sceeen, you are getting short dump.
    Refer CNTL_SYSTEM_ERROR in webservices from r/3 system
    Thanks,
    Chandra

  • VL02N Batch INPUT, change field LFIMG

    HI gurus,
    On a selection screen i have those:
    parameters: p_vbeln
    select-options: s_posnr
    parameter: p_lfimg
    I did a BATCH input on VL02N on a delivery that has 2 items. When i'm trying to change the delivery quantity using the parameters and the select options on the selection screen i can't modify the field LFIMG with the value of parameter p_lfimg.
    PERFORM bdc_dynpro      USING 'SAPMV50A' '4004'.
      PERFORM bdc_field       USING 'BDC_CURSOR' 'LIKP-VBELN'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=ENT2_T'.
      PERFORM bdc_field       USING 'LIKP-VBELN'  <b>wa_lips-vbeln. </b>  "aici
      PERFORM bdc_dynpro      USING 'SAPMV50A' '1000'.
      PERFORM bdc_field       USING 'BDC_OKCODE'  '=SICH_T'.
    PERFORM bdc_field       USING 'LIPS-POSNR'  wa_lips-posnr.
    PERFORM bdc_field       USING 'BDC_CURSOR' <b>'LIPSD-G_LFIMG(01)'.</b>
      PERFORM bdc_field       USING 'LIPSD-G_LFIMG(01)' p_lfimg.  "aici
    THE PROBLEM is that vl02N modifies only the field 01 , although i want to modify the quantity for the position posnr that i've selected in select-options. How can i tell SAP to go and modify delivery quantity for the position that i;ve selected in select-options?
    Pls help.

    Previous answer was copy pasted from LSMW loading multiple structured records..

  • Change EKPO-KZWI6 in Batch input

    Hi experts.
    I'm creating a PO in ME21 via batch input and need to change the field EKPO-KZWI6, but I can't find this field in the transaction screens.
    How would you guy suggest me to do it?
    Thanks in advance,
    Alm.

    Hi
    That is a field for the subtotal of the pricing, so it's not available in the screens:
    here the system save a subtotal of a certain number of conditions: the rule is decided in the customizing of the price.
    So you need to change those conditions in order to modify your field
    Max

  • 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.

  • Batch input with customer fields

    I have to create a batch input process that post documents through FB01L.
    As the lines of each document have been added customer fields, when I tried to go from one line of the document to the following one, a screen appears when I have to introduce some data (two of the fields are mandatory). I had solved these issue by ending with a "Call Transaction" with option "No batch input" = 'X'. This way, these customer fields appear directly in the screen, and not in a popup screen, so the batch input process was very easy.
    But, I have been told that I don't have to use "Call transacion", I have to create a session, and the user will post the document by launching it in SM35. This way, even adding "No batch input" = 'X' in the options of "BDC_INSERT", the popup screen appears when running the session.
    So, is there any way of running the session in SM35 with the option "No batch input"? If it's not possible, which is the best option of dealing with these popup screens? I have been able to go from one dynpro to another, and to open that popup screen, but I can't fill the mandatory fields.
    I hope you understand my problem, please excuse my English.

    Hi ,
    Go to the T code Mass , put the object as KNA1 for customers .
    Execute the same and you will find all the option available for making mass changes .
    In case if your requirement does not meet here then you will have to go for a LSMW .
    Regards ,
    Dewang T

  • Batch input problem in SM35

    Dear all,
    I am uploading the bank statements using manual bank statements through Z transaction, Once uploaded system is generating the batch input session for the same.
    When i run the batch input session system not clearing outgoing payment automatically based on the assignment field, as i have alreday mentioned the same assignment while posting the document and in the excel file.
    I am getting the following message while running the batch input session.
    No batch input data for screen SAPDF05X 3100
    Message no. 00344
    Diagnosis
    The transaction sent a screen that was not expected in the batch input session and which therefore could not be supplied with data.
    Possible reasons:
    1. The batch input session was created incorrectly. The sequence of screens was recordly incorrectly.
    2. The transaction behaves differently in background processing in a batch work process than when running in dialog (SY-BATCH is queried and changes the screen sequence).
    3. The transaction has undergone user-specific Customizing and therefore certain screens may be skipped or processed differently, according to the current user. If the person who created a batch input session is not the same as the person now processing it, this problem may occur frequently.
    System Response
    None.
    Procedure
    For 1: Either re-create the session or process it in expert mode. Correct the batch input program.
    For 2. It is very difficult to analyze this problem, particularly in the case that the screen sequence or the display-only options of fields differ according to whether the transaction is being processed in the background or as an online dialog. It could also be that this kind of transaction cannot run with batch input.
    For 3: Have the creator of the session process it. If no error occurs now, then this is a program with user-specific Customizing.
    Please let me know solution for the same.
    Regards,
    Anand

    Hi,
    This may not be a solution but may help you to isolate the problem
    a) Are you able to load the bank statement for other banks without error ?
    b) Try for the same bank in a different system .
    c) If it is working for different bank then check the file format is the same for both the banks.
    d) If it is working in different system check the ABAP code for any changes between the system,
    e) Are you getting this message for all the line items or only for some line items ?
    Regards
    K.R

  • LSMW- Batch Input session getting error

    Hi All,
    I created LSMW object for Tcode KO01 and its creating the Internal order as expceted.But even after creating the document the Batch Input session status is showing incorrect.No messages are also displayed in the log.
    Please let me know why this is happening.
    Thanks in Advance,
    Savitha

    Hi,
    Detail Error Message is as follows:
    No batch input data for screen SAPLIMR0 1110
    Message no. 00344
    Diagnosis
    The transaction sent a screen that was not expected in the batch input session and which therefore could not be supplied with data.
    Possible reasons:
    1. The batch input session was created incorrectly. The sequence of screens was recordly incorrectly.
    2. The transaction behaves differently in background processing in a batch work process than when running in dialog (SY-BATCH is queried and changes the screen sequence).
    3. The transaction has undergone user-specific Customizing and therefore certain screens may be skipped or processed differently, according to the current user. If the person who created a batch input session is not the same as the person now processing it, this problem may occur frequently.
    System Response
    None.
    Procedure
    For 1: Either re-create the session or process it in expert mode. Correct the batch input program.
    For 2. It is very difficult to analyze this problem, particularly in the case that the screen sequence or the display-only options of fields differ according to whether the transaction is being processed in the background or as an online dialog. It could also be that this kind of transaction cannot run with batch input.
    For 3: Have the creator of the session process it. If no error occurs now, then this is a program with user-specific Customizing.
    Regards,
    ababfk

  • Batch Input - Fill hidden fields

    Hello to all,
    I've got a selection screen with 2 fields like:
    SELECT-OPTIONS s_docnum FOR edidc-docnum NO INTERVALS.
    PARAMETERS p_wfst TYPE c NO-DISPLAY.
    The parameter p_wfst isn't displayed on the selection screen.
    Now I want to call this screen via
    CALL TRANSACTION 'ZPROGRAM' USING lt_bdcdata .
    but I get an error:
    field P_WFST is not found on dynpro ZPROGRAM 0100
    How can I fill this hidden field?
    Regards Christian

    You cannot pass a parameter that is not input-enabled by batch-input, you must look for an other soluition.
    Some proposals :
    - Use a SUBMIT of your Z-program (if there are only data for first screen in the Batch Input data)
    - Change the called program to look for the hidden parameter in memory (Use a IMPORT from memory or a GET PARAMETER in the INITIALIZATION block, and an EXPORT or SET PARAMETER in the calling program.)
    Regards,
    Raymond

  • Error during batch input

    Hi everybody
    Ive run the tcode SHDB to get the recording of transaction XD02, in it, theres an input field called RMCLF-CLASS(01), but when Im running my program, its giving me an error message 'Field RMCLF-CLASS(1) is not an input field'.
    Does anybody know why?

    heres the code
    DATA : field1(20),
             field2(20),
             telf1 TYPE kna1-telf1,
             adrnr TYPE kna1-adrnr,
             ktokd TYPE kna1-ktokd,
             wa_extab TYPE ty_tab1,
             cname(20) VALUE 'KNVK-NAME1(00)',
             banks(20) VALUE 'KNBK-BANKS(00)',
             bankn(20) VALUE 'KNBK-BANKN(00)',
             bankl(20) VALUE 'KNBK-BANKL(00)'.
      DATA : field3(20) VALUE 'RCTMS-MNAME(00)',
             field4(20) VALUE 'RCTMS-MWERT(00)',
             pos(2) TYPE n VALUE 0.
      DATA : head2(10).
      DATA : t_smtp TYPE adsmtp OCCURS 0 WITH HEADER LINE.
      FIELD-SYMBOLS : <fs1>, <fs2>,
                      <fs_ablad> TYPE ty_ablad.
      CLEAR : bi_open, flags.
    Fill in work area fields with the appropriate data
      LOOP AT t_field ASSIGNING <fs_field>
                      WHERE value <> 00
                        AND flagname <> space.
        CONCATENATE 'FLAGS' <fs_field>-flagname INTO field1
                                                SEPARATED BY '-'.
        ASSIGN (field1) TO <fs1>.
        <fs1> = 'X'.
      ENDLOOP.
      IF flags-d0340 IS INITIAL AND p_unpnt = 'X'.
        flags-d0340 = 'X'.
      ENDIF.
      IF flags-d0310a = 'X' AND flags-d0310 IS INITIAL.
        flags-d0310 = 'X'.
      ENDIF.
      IF flags-d0320t = 'X' AND flags-d0320 IS INITIAL.
        flags-d0320 = 'X'.
      ENDIF.
      IF p_bppy = 'X'.
        flags-d0324 = 'X'.
      ENDIF.
      IF p_kzazu = 'X' AND flags-d0315 IS INITIAL.
        flags-d0315 = 'X'.
      ENDIF.
      LOOP AT intab.
        CLEAR: screen_cnt, t_ablad, t_knvp,
               t_kssk.
        REFRESH : t_ablad, t_knvp.
    Fill in work area fields with the appropriate data
        LOOP AT t_field ASSIGNING <fs_field>
                        WHERE value <> 00.
          CONCATENATE :
    Destination field
            'WA_EXTAB' <fs_field>-sapname INTO field1 SEPARATED BY '-',
    Source field
            'INTAB-FIELD' <fs_field>-value INTO field2.
          ASSIGN : (field1) TO <fs1>,
                   (field2) TO <fs2>.
          <fs1> = <fs2>.
        ENDLOOP.
    Pad customer number
        IF wa_extab-kunnr CO '0123456789 '.
          UNPACK wa_extab-kunnr TO wa_extab-kunnr.
        ENDIF.
        CLEAR : telf1, adrnr, ktokd.
        SELECT SINGLE telf1 adrnr ktokd FROM kna1
                                        INTO (telf1,adrnr,ktokd)
                                        WHERE kunnr = wa_extab-kunnr.
    Check customer exists
        IF sy-subrc <> 0.
          MOVE : wa_extab-kunnr TO wa_errtab-kunnr,
                 text-001       TO wa_errtab-message.
          INSERT wa_errtab INTO TABLE errtab. CLEAR wa_errtab.
          CONTINUE.
        ENDIF.
    DPZ01
    Check customer exists in sales area
        SELECT SINGLE kunnr FROM knvv
                            INTO knvv-kunnr
                            WHERE kunnr = wa_extab-kunnr
                              AND vkorg = wa_extab-vkorg
                              AND vtweg = wa_extab-vtweg
                              AND spart = wa_extab-spart.
        IF sy-subrc <> 0.
          MOVE : wa_extab-kunnr TO wa_errtab-kunnr,
                 text-010       TO wa_errtab-message.
          REPLACE : '&1' WITH wa_extab-vkorg INTO wa_errtab-message,
                    '&2' WITH wa_extab-vtweg INTO wa_errtab-message,
                    '&3' WITH wa_extab-spart INTO wa_errtab-message.
          CONDENSE wa_errtab-message.
          INSERT wa_errtab INTO TABLE errtab. CLEAR wa_errtab.
          CONTINUE.
        ENDIF.
    DPZ01
    Screens for the customer
        PERFORM select_screens USING ktokd
                               CHANGING i_flags screens.
        IF telf1 IS INITIAL.
          wa_extab-sw_tel = 'X'.
        ENDIF.
    Number of contacts
        SELECT COUNT( * ) FROM knvk INTO wa_extab-contact
                          WHERE kunnr = wa_extab-kunnr.
    Number of bank accounts
        SELECT COUNT( * ) FROM knbk INTO wa_extab-account
                          WHERE kunnr = wa_extab-kunnr.
        IF p_unpnt = 'X'.
    List of unloading points
          SELECT ablad FROM knva APPENDING TABLE t_ablad
                       WHERE kunnr = wa_extab-kunnr.
    UP exists in UP view ?
          READ TABLE t_ablad WITH TABLE KEY ablad = c_up
                             ASSIGNING <fs_ablad>.
          IF sy-subrc <> 0.
            MOVE : wa_extab-kunnr TO wa_errtab-kunnr,
                   text-002       TO wa_errtab-message.
            INSERT wa_errtab INTO TABLE errtab. CLEAR wa_errtab.
          ENDIF.
        ENDIF.
    Class assigned to customer
        IF NOT p_elevl1 IS INITIAL OR NOT p_elevl2 IS INITIAL OR
           NOT p_elevl3 IS INITIAL OR NOT p_esfid IS INITIAL OR
           NOT p_ehead  IS INITIAL OR NOT p_etelcm IS INITIAL OR
    *PCT
           NOT p_ctype IS INITIAL OR
           NOT p_eool IS INITIAL.
          MOVE wa_extab-kunnr TO objek.
          SELECT clint zaehl INTO CORRESPONDING FIELDS OF TABLE t_kssk
                             FROM kssk
                             WHERE objek = objek
                               AND klart = c_klart.
        ENDIF.
    BATCH INPUT
        IF bi_open IS INITIAL.
          PERFORM open_ses USING session_name.
          bi_open = 'X'.
        ENDIF.
    First screen
    DPZ01
       PERFORM first_screen USING wa_extab-kunnr i_flags.
        PERFORM first_screen USING wa_extab-kunnr wa_extab-vkorg
                                   wa_extab-vtweg wa_extab-spart i_flags.
    DPZ01
    Address
        IF i_flags-d0110 = 'X'.
          PERFORM choose_okcode USING screens
                                CHANGING screen_cnt okcode.
          PERFORM loadibatch USING : 'X' 'SAPMF02D' '111'.
          fill_field : wa_extab-name1 'ADDR1_DATA-NAME1',
                       wa_extab-stras 'ADDR1_DATA-STREET',
                       wa_extab-pstlz 'ADDR1_DATA-POST_CODE1',
                       wa_extab-ort01 'ADDR1_DATA-CITY1',
                       wa_extab-land1 'ADDR1_DATA-COUNTRY',
                       wa_extab-spras 'ADDR1_DATA-LANGU',
                       wa_extab-telfx 'SZA1_D0100-FAX_NUMBER'.
    Telephone number
          IF NOT wa_extab-telf1 IS INITIAL.
            IF wa_extab-sw_tel = 'X'.
    No tel.nbr -> can put it in current screen
              PERFORM loadibatch USING
                  ' ' 'SZA1_D0100-TEL_NUMBER' wa_extab-telf1.
            ELSE.
    A tel.nbr exists -> add the new one
              PERFORM loadibatch USING :
                  ' ' 'BDC_OKCODE' '=$MTE',
                  'X' 'SAPLSZA6'   '0200',
                  ' ' 'BDC_OKCODE' 'NEWL',
                  'X' 'SAPLSZA6'   '0200',
                  ' ' 'ADTEL-TEL_NUMBER(01)' wa_extab-telf1,
                  ' ' 'BDC_OKCODE' 'CONT',
                  'X' 'SAPMF02D'   '0111'.
            ENDIF.
          ENDIF.
    E-mail
          IF NOT wa_extab-email IS INITIAL.
            IF wa_extab-sw_mail = 'X'.
    No e-mail -> can put it in current screen
              PERFORM loadibatch USING
                  ' ' 'SZA1_D0100-SMTP_ADDR' wa_extab-email.
            ELSE.
    An e-mail exists -> add the new one
              PERFORM loadibatch USING :
                  ' ' 'BDC_OKCODE' '=$INT',
                  'X' 'SAPLSZA6'   '0600',
                  ' ' 'BDC_OKCODE' 'NEWL',
                  'X' 'SAPLSZA6'   '0600',
                  ' ' 'ADSMTP-SMTP_ADDR(01)' wa_extab-email,
                  ' ' 'BDC_OKCODE' 'CONT',
                  'X' 'SAPMF02D'   '0111'.
            ENDIF.
          ENDIF.
          IF NOT p_elevl1 IS INITIAL OR NOT p_elevl2 IS INITIAL OR
             NOT p_elevl3 IS INITIAL OR NOT p_esfid IS INITIAL OR
             NOT p_ehead IS INITIAL OR NOT p_etelcm IS INITIAL OR
    *PCT
             NOT p_ctype IS INITIAL OR
    *PCT
             NOT p_eool IS INITIAL.
            CLEAR pos.
            PERFORM loadibatch USING : ' ' 'BDC_OKCODE' 'KLAS',
                                       'X' 'SAPLCLCA' '0602',
                                       ' ' 'RMCLF-KLART' c_klart,
                                       ' ' 'BDC_OKCODE' 'ENTE',
                                       'X' 'SAPLCLFM' '0500'.
            IF t_kssk[] IS INITIAL.
              PERFORM create_new_class. "Create the first assignment
            ELSE.
              READ TABLE t_kssk WITH KEY clint = clint
                                ASSIGNING <kssk>.
              IF sy-subrc = 0.
                PERFORM change_class USING sy-tabix.  "Change existing class
              ELSE.
                PERFORM create_add_class.             "Add an assignment
              ENDIF.
            ENDIF.
            IF NOT wa_extab-levl1 IS INITIAL.
              ADD 1 TO pos.
              field312(2) = field412(2) = pos.
              PERFORM loadibatch USING : ' ' field3 c_level1,
                                         ' ' field4 wa_extab-levl1.
            ENDIF.
            IF NOT wa_extab-levl2 IS INITIAL.
              ADD 1 TO pos.
              field312(2) = field412(2) = pos.
              PERFORM loadibatch USING : ' ' field3 c_level2,
                                         ' ' field4 wa_extab-levl2.
            ENDIF.
            IF NOT wa_extab-levl3 IS INITIAL.
              ADD 1 TO pos.
              field312(2) = field412(2) = pos.
              PERFORM loadibatch USING : ' ' field3 c_level3,
                                         ' ' field4 wa_extab-levl3.
            ENDIF.
            IF NOT wa_extab-sfid IS INITIAL.
              ADD 1 TO pos.
              field312(2) = field412(2) = pos.
              PERFORM loadibatch USING : ' ' field3 c_sfid,
                                         ' ' field4 wa_extab-sfid.
            ENDIF.
            IF NOT wa_extab-head IS INITIAL.
              ADD 1 TO pos.
              field312(2) = field412(2) = pos.
              WRITE wa_extab-head TO head2 NO-ZERO.
              PERFORM loadibatch USING : ' ' field3 c_head,
                                         ' ' field4 head2.
            ENDIF.
            IF NOT wa_extab-telecm IS INITIAL.
              ADD 1 TO pos.
              field312(2) = field412(2) = pos.
              PERFORM loadibatch USING : ' ' field3 c_telecom,
                                         ' ' field4 wa_extab-telecm.
            ENDIF.
            IF NOT wa_extab-ool IS INITIAL.
              ADD 1 TO pos.
              field312(2) = field412(2) = pos.
              PERFORM loadibatch USING : ' ' field3 c_ool,
                                         ' ' field4 wa_extab-ool.
            ENDIF.
    *PCT
             IF NOT wa_extab-ctype IS INITIAL.
              ADD 1 TO pos.
              field312(2) = field412(2) = pos.
              PERFORM loadibatch USING : ' ' field3 c_contract,
                                         ' ' field4 wa_extab-ctype.
             ENDIF.
    *PCT
            PERFORM loadibatch USING : ' ' 'BDC_OKCODE' 'BACK',
                                      'X' 'SAPLCLFM' '0500',
                                       ' ' 'BDC_OKCODE' 'ENDE',
                                       'X' 'SAPMF02D' '0111'.
          ENDIF.
          PERFORM loadibatch USING ' ' 'BDC_OKCODE' okcode.
        ENDIF.
    PERFORM insert_ses USING 'XD02'.
    FORM loadibatch USING start fname fvalue.
      CLEAR ibatch.
    IF start = 'X'.
        ibatch-program = fname.
        ibatch-dynpro = fvalue.
      ELSE.
        ibatch-fnam = fname.
        ibatch-fval = fvalue.
      ENDIF.
      ibatch-dynbegin = start.
      APPEND ibatch.
    ENDFORM.
    FORM create_new_class.
    CONCATENATE 'RMCLF-CLASS(' '01)' INTO rmclf_class1.
    PERFORM loadibatch USING:
                       ' ' 'BDC_CURSOR' 'RMCLF-CLASS(01)',
                       ' ' 'BDC_OKCODE' '=AUSW',
                       ' ' 'RMCLF-CLASS(01)' c_class,
                       'X' 'SAPLCTMS' '0109'.
    PERFORM loadibatch USING :
                               ' ' 'RMCLF-CLASS(01)' c_class,
                                ' ' 'BDC_OKCODE' '/00',
                                'X' 'SAPLCTMS' '0109'.
    ENDFORM.                    " create_new_class
    *&      Form  create_add_class
          Create a new assignment
    FORM create_add_class.
      PERFORM loadibatch USING : ' ' 'BDC_OKCODE' 'NEUZ',
                                 'X' 'SAPLCLFM' '0500',
                                 ' ' 'RMCLF-CLASS(02)' c_class,
                                 ' ' 'BDC_OKCODE' '/00',
                                 'X' 'SAPLCTMS' '0109'.
    ENDFORM.                    " create_add_class
    *&      Form  change_class
          Change an existing assignment
         -->PAGPOS  Position of the class
    FORM change_class USING pagpos TYPE sy-tabix.
      DATA : pagpos2(2) TYPE n,
             field(20) VALUE 'RMCLF-KREUZ(00)'.
      MOVE pagpos TO pagpos2.
      REPLACE '00' WITH pagpos2 INTO field.
      CONDENSE field NO-GAPS.
      PERFORM loadibatch USING : ' ' field 'X',
                                 ' ' 'BDC_OKCODE' 'AUSW',
                                 'X' 'SAPLCTMS' '0109'.
    ENDFORM.                    " change_class

  • Batch Input Session for Errors

    Hello
    I'm running a Batch Input (in a FM) and I want to create a session for records with errors. In case of error (output parameter of the FM subrc NE 0) I send it to that session for later running.
    Can you explain how do I do this? Thanks!

    hi,
    Look at the sample program
    REPORT Z_BDC_CUSTOMER_R07
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    INCLUDE Z_CUSTOMER_BDC_R02.
    *-----AT SELECTION-SCREEN
    AT SELECTION-SCREEN.
      IF SY-UCOMM = 'ONLI'.
    *-----group and user must be filled to create a session
        IF SESSION = 'X' AND
           GROUP = SPACE OR USER = SPACE.
          MESSAGE E613(MS).
        ENDIF.
    *----Presentation File name should be entered
        IF SESSION = 'X' AND RB_PRE = 'X'
                         AND P_FILE = '' .
          MESSAGE E004(ZROJA).
        ELSEIF CTU = 'X' AND RB_PRE = 'X'
                         AND P_FILE = '' .
          MESSAGE E004(ZROJA).
        ENDIF.
    *----Application File name should be entered
        IF SESSION = 'X' AND RB_APP   = 'X'
                         AND P_FILE_A = '' .
          MESSAGE E004(ZROJA).
        ELSEIF CTU = 'X' AND RB_APP = 'X'
                   AND P_FILE_A = '' .
          MESSAGE E004(ZROJA).
        ENDIF.
      ENDIF.
    *-----AT SELECTION-SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
    *----When file from Presentation server is selected
      IF RB_PRE = 'X'.
    *----To make the application server inactive
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'AAA'.
            SCREEN-ACTIVE = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
    *----When file from Presentation server is selected
        RB_APP = 'X'.
    *----To make the application server inactive
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'BBB'.
            SCREEN-ACTIVE = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *-----AT SELECTION-SCREEN ON VALUE-REQUEST
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE_A.
      CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
        EXPORTING
          I_LOCATION_FLAG = 'A'
          I_SERVER        = ' '
          FILEOPERATION   = 'R'
        IMPORTING
          O_PATH          = P_FILE_A
        EXCEPTIONS
          RFC_ERROR       = 1
          ERROR_WITH_GUI  = 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.
    *-----AT SELECTION-SCREEN ON VALUE-REQUEST
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    *-----Function module for value-request
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = ' '
        IMPORTING
          FILE_NAME     = V_FILE_NAME.
    *----Assigning the flatfile to parameter
      P_FILE        = V_FILE_NAME.
    *-----START-OF-SELECTION
    START-OF-SELECTION.
      DATA: FILENAME TYPE STRING.
    *----When file from Presentation Server is selected
      IF RB_PRE = 'X'.
        FILENAME = P_FILE.
    *-----Function module to upload data from the presentation server
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            FILENAME                = FILENAME
            FILETYPE                = 'ASC'
            HAS_FIELD_SEPARATOR     = 'X'
          TABLES
            DATA_TAB                = IT_KNA1
          EXCEPTIONS
            FILE_OPEN_ERROR         = 1
            FILE_READ_ERROR         = 2
            NO_BATCH                = 3
            GUI_REFUSE_FILETRANSFER = 4
            INVALID_TYPE            = 5
            NO_AUTHORITY            = 6
            UNKNOWN_ERROR           = 7
            BAD_DATA_FORMAT         = 8
            HEADER_NOT_ALLOWED      = 9
            SEPARATOR_NOT_ALLOWED   = 10
            HEADER_TOO_LONG         = 11
            UNKNOWN_DP_ERROR        = 12
            ACCESS_DENIED           = 13
            DP_OUT_OF_MEMORY        = 14
            DISK_FULL               = 15
            DP_TIMEOUT              = 16
            OTHERS                  = 17.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ELSE.
    *----Upload the File from Application Server
        OPEN DATASET P_FILE_A FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    *-----to display an error if the file is not in application server
        IF SY-SUBRC NE 0.
          MESSAGE E006(ZROJA).
        ELSE.
          DO.
            READ DATASET P_FILE_A INTO X_KNA1.
            IF SY-SUBRC EQ 0.
              APPEND X_KNA1 TO IT_KNA1.
            ELSE.
              EXIT.
            ENDIF.
          ENDDO.
        ENDIF.
        CLOSE DATASET P_FILE_A.
      ENDIF.
    *-----To open a batchinput session
      IF SESSION = 'X'.
        CALL FUNCTION 'BDC_OPEN_GROUP'
          EXPORTING
            CLIENT              = SY-MANDT
            GROUP               = GROUP
            KEEP                = KEEP
            USER                = USER
            PROG                = SY-CPROG
          EXCEPTIONS
            CLIENT_INVALID      = 1
            DESTINATION_INVALID = 2
            GROUP_INVALID       = 3
            GROUP_IS_LOCKED     = 4
            INTERNAL_ERROR      = 6
            QUEUE_ERROR         = 7
            RUNNING             = 8
            SYSTEM_LOCK_ERROR   = 9
            USER_INVALID        = 10
            OTHERS              = 11.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    *-----Filling the BDCDATA using the Internal Table
      LOOP AT IT_KNA1 INTO X_KNA1.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0100'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RF02D-KTOKD'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'RF02D-KUNNR'
                                      X_KNA1-KUNNR.
        PERFORM BDC_FIELD       USING 'RF02D-KTOKD'
                                      X_KNA1-KTOKD.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0110'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNA1-SPRAS'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'KNA1-NAME1'
                                      X_KNA1-NAME1.
        PERFORM BDC_FIELD       USING 'KNA1-SORTL'
                                      X_KNA1-SORTL.
        PERFORM BDC_FIELD       USING 'KNA1-ORT01'
                                      X_KNA1-ORT01.
        PERFORM BDC_FIELD       USING 'KNA1-PSTLZ'
                                      X_KNA1-PSTLZ.
        PERFORM BDC_FIELD       USING 'KNA1-LAND1'
                                      X_KNA1-LAND1.
        PERFORM BDC_FIELD       USING 'KNA1-SPRAS'
                                      X_KNA1-SPRAS.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0120'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNA1-LZONE'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'KNA1-LZONE'
                                      X_KNA1-LZONE.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0125'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNA1-NIELS'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0130'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNBK-BANKS(01)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0340'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RF02D-KUNNR'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0370'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RF02D-KUNNR'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_FIELD       USING 'KNA1-CIVVE'
                                      'X'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0360'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNVK-NAMEV(01)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
    *----If Session is selected
        IF SESSION = 'X'.
    *----To insert data into batch input session
          CALL FUNCTION 'BDC_INSERT'
            EXPORTING
              TCODE     = 'XD01'
            TABLES
              DYNPROTAB = IT_BDCDATA.
          REFRESH IT_BDCDATA.
          AT LAST.
            SKIP.
            WRITE:/ TEXT-001.
          ENDAT.
        ELSE.
    *----Calling the transaction
          CALL TRANSACTION 'XD01' USING IT_BDCDATA
                                  MODE     CTUMODE
                                  UPDATE   CUPDATE
                                MESSAGES INTO IT_BDCMSGCOLL.
          CLEAR IT_BDCDATA.
          REFRESH IT_BDCDATA.
        ENDIF.
      ENDLOOP.
    *----If Session is Selected
      IF SESSION = 'X'.
    *----To close the session
        CALL FUNCTION 'BDC_CLOSE_GROUP'
          EXCEPTIONS
            NOT_OPEN    = 1
            QUEUE_ERROR = 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.
      ENDIF.
    *-----END-OF-SELECTION
    END-OF-SELECTION.
    *----To display the success messages
      LOOP AT IT_BDCMSGCOLL INTO X_BDCMSGCOLL WHERE MSGTYP = 'S' .
    *-----If Message Type Differs
        ON CHANGE OF X_BDCMSGCOLL-MSGTYP.
          WRITE:/ TEXT-002.
          SKIP.
          ULINE (58).
          WRITE:/01 SY-VLINE,02 TEXT-003,
                 14 SY-VLINE,15 TEXT-004,
                 21 SY-VLINE,22 TEXT-005,
                 35 SY-VLINE,36 TEXT-006,
                 58 SY-VLINE,/01 SY-ULINE(58).
        ENDON.
        WRITE:/01 SY-VLINE,02 X_BDCMSGCOLL-MSGTYP,
               14 SY-VLINE,15 X_BDCMSGCOLL-TCODE,
               21 SY-VLINE,22 X_BDCMSGCOLL-MSGV1,
               35 SY-VLINE,36 TEXT-007,
               58 SY-VLINE,/01 SY-ULINE(58).
      ENDLOOP.
      SKIP 2.
    *----To display the error messages
      LOOP AT IT_BDCMSGCOLL INTO X_BDCMSGCOLL WHERE MSGTYP = 'E'.
    *-----If Message Type Differs
        ON CHANGE OF X_BDCMSGCOLL-MSGTYP.
          WRITE:/ TEXT-008.
          SKIP.
          ULINE (58).
          WRITE:/01 SY-VLINE,02 TEXT-003,
                 14 SY-VLINE,15 TEXT-004,
                 21 SY-VLINE,22 TEXT-005,
                 35 SY-VLINE,36 TEXT-006,
                 58 SY-VLINE,/01 SY-ULINE(58).
        ENDON.
        WRITE:/01 SY-VLINE,02 X_BDCMSGCOLL-MSGTYP,
               14 SY-VLINE,15 X_BDCMSGCOLL-TCODE,
               21 SY-VLINE,22 X_BDCMSGCOLL-MSGV1,
               35 SY-VLINE,36 'Customer Already Exits',
               58 SY-VLINE,/01 SY-ULINE(58).
      ENDLOOP.
    *-----FORM fill_bdcdata
    FORM FILL_BDCDATA USING L_DYNPRO TYPE ANY
                            L_FNAME  TYPE ANY
                            L_FVALUE TYPE ANY.
      CLEAR X_BDCDATA.
      IF L_DYNPRO = 'X'.
        X_BDCDATA-DYNBEGIN = 'X'.
        X_BDCDATA-PROGRAM  = L_FNAME.
        X_BDCDATA-DYNPRO   = L_FVALUE.
      ELSE.
        X_BDCDATA-FNAM = L_FNAME.
        X_BDCDATA-FVAL = L_FVALUE.
      ENDIF.
      APPEND X_BDCDATA TO IT_BDCDATA.
    ENDFORM.                    "BDC_FIELD
    *-----Start new screen
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR IT_BDCDATA.
      IT_BDCDATA-PROGRAM  = PROGRAM.
      IT_BDCDATA-DYNPRO   = DYNPRO.
      IT_BDCDATA-DYNBEGIN = 'X'.
      APPEND IT_BDCDATA.
    ENDFORM.                    "BDC_DYNPRO
    *-----Insert field
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> SPACE.
        CLEAR IT_BDCDATA.
        IT_BDCDATA-FNAM = FNAM.
        IT_BDCDATA-FVAL = FVAL.
        APPEND IT_BDCDATA.
      ENDIF.
    ENDFORM.                    "BDC_FIELD

  • No batch input data for screen  occured in Call Transaction method for PA40

    Hi,
    I creatred an interface to update an employee action data ( Change of position )  PA40 by using  Call transaction method.
    while executing the  interface, I got the below error.
    No batch input data for screen MP049100 200 
    this interface updated the first employee from file,  then after it is giving the below error frequently.
    No batch input data for screen MP049100 200
    regards,
    Ashok Reddy Revoori

    The infogroup of action Change Position may be having infotype 0491. The infotypes screen sequence is decided based on employee's country grouping and user group. For the employee where you are receiving error, infotype 0491 screen is appearing for which you do not have BDC data.

  • Error "No batch input data for screen" in BDC for Tcode CN22

    Hi,
    The issue is When teh BDC code is run by Functional guys we are facing the error as "No batch input data for screen SAPLCONW 1100", when I am trying teh change the Network Activity Level User field in Tcode CN22. When I execute the same BDC code with Developer User id, it is executing perfectly.
    I have checked the User Profiles for both functional and Technical and both are same. What is my solution now?
    Regards,
    Deepthi.

    Hi
    Take Recording using the functional guy log in there might be user depended screen  sequence
    Regards
    Nilesh Gaikwad
    Edited by: Nilesh  Gaikwad on Jan 26, 2010 10:49 AM

Maybe you are looking for