Mass updates in CUA via a Batch Input Session

We are trying to do a mass upload of users in CUA, via SU01. When we come to create the batch input session, by creating a record, we find that the only thing that is not saved is the role data entered on the role tab, everything else gets saved.
Can anybody help with a solution ?

Hi Geoff
Initial load of user through Batch-Input or CATT is kind of difficult when you are using CUA.
I use a couple of ABAP Reports for this, one that creates the users, and one to assign the roles, but it's not SAP standard reports
There are some good BAPI'S for both to create your own load program.
Regards
Morten Nielsen

Similar Messages

  • Creation of batch input session for mass reversal of payment documents

    Hello FI experts,
    There is a business requirement in which the users want to reverse the payments en-masse. This can be achieved by creating a batch input session via a custom program to upload the documents from excel . Then calling FBRA and FB08 to do the resetting and reversal.
    My issue is how to create the batch input session ? Please help.
    Regards,
    Van

    Hi,
    I have got developed such program earlierr.
    You can define your custom program specification as below:-
    (A) Based on the selection screen, the program will read all the records (field document number VBLNR, company code ZBUKR and year from field ZALDT) from table REGUH. (Proposal Run Indicator XVORL should be blank.)
    (B) If Paying company code (REGUH-ZBUKR) is equal to Sending company code (REGUH-ABSBU):-
           Step 1:- For each record of (Payment Document Number (REGUH-VBLNR), Company code (REGUH-ZBUKR), and Fiscal Year (REGUH-ZALDT)) it will call transaction FBRA and will reset the clearing of the document.
           Step 2:- Then call transaction FB08 and pass the data as below:-
                  Document Number     =     Payment Document Number (REGUH-VBLNR)
                  Company Code     =     Company code (REGUH-ZBUKR)
                  Fiscal Year               =     Fiscal Year (REGUH-ZALDT)
                  Reversal Reason, Posting Date and Posting period will be defaulted from the selection screen of out program.
    (C) If Paying company code (REGUH-ZBUKR) is not equal to Sending company code (REGUH-ABSBU):-
           Step 1:- For each record of (Payment Document Number (REGUH-VBLNR), Company code (REGUH-ZBUKR), and Fiscal Year (REGUH-ZALDT)) it will call transaction FBRA and will reset the clearing of the document.
            Step 2:- for each record of (Payment Document Number (REGUH-VBLNR), Company code (REGUH-ZBUKR), and Fiscal Year (REGUH-ZALDT)) get the cross company code document number (BKPF-BVORG) and
                   (ii) Then find out the Document number (BKPF-BELNR) from BKPF matching BUKRS = Sending company code (REGUH-ABSBU) and GJAHR = Fiscal Year (REGUH-ZALDT) and BVORG = cross company code document number (BKPF-BVORG) as obtained above in
                  (iii) Then call transaction FBRA and will reset the clearing of the document passing BKPF-BELNR, BKPF-BUKRS and BKPF-GKAHR as obtained in (ii) above.
           Step 3:- Then call transaction FBU8 and pass the data as below:-
                  Cross CC Doc. Number=     Blank
                  Document Number     =     Payment Document Number (REGUH-VBLNR)
                  Company Code     =     Company code (REGUH-ZBUKR)
                  Fiscal Year               =     Fiscal Year (REGUH-ZALDT)
                  Reversal Reason, Posting Date and Posting period will be defaulted from the selection screen of out program.
    Regards,
    Gaurav

  • Update error after all screens in Batch Input session is processed.

    Hi,
    I have a problem in processing the batch input session.  The batch input session is calling F-02 to post less than 999 line items (around 700) to a single financial document. The batch session is expected to have an error because tax code is missing for some line items but even after the tax code is added manually onto the batch screen, the update error message still happened at the end of the process. In the log, it said "System error: Error when inserting table BSET". Same account has been used to post 10+ line items manually with F-02, no error occurred.
    Does anyone have any idea what possible reason could cause the update error in updating the tax table?

    Hi Rob,
    That is exactly what happened to us. We already had note 521481 in our system but we also have OSS 558288 in which causes our scenario not generating an error message but an update termination instead.
    The other thing I found out is once tax code is entering in one of the line items, it will be copied to all the succeeding line items even for the accounts that does not require a tax code (i.e. posting without tax code allowed checked) which will significantly increase the amounts of data posted into BSET.
    We fixed the issue by changing the BDC program so it will take out the auto-copied tax code from other line items. Issue is solved. Thank you. I also rewarded the points.
    Minami

  • How to run the Batch input session(SM35) in background thru Report program

    Hi Experts,
    I am working in one modification report requirement ,the report is Mass upload will update and run the file via batch input session. The client requirement is to implement the report execution in background mode , the batch input session will process automatically (ie. the job runs the batch input session in background and process the session ends).
    Currently, the report calls SM35 to write a batch input session and the user manually selects the session and record the transactions.
    Once the Transaction enters and the selection-screen inputs are given, then the transaction executed in background mode and all the above batch input process to be implemented.
    Please advise and guide me, how to proceed.
    I need your guidance to proceed via Call transaction using bdcdata statement, if it can be achieved the requirement.
    Thanks & Regards
    San.

    Hi Arabind Prasad,
    Thanks for your inputs.
    I know the process of the report Execution in background and job steps.
    I want the inputs for how to upload thru Batch input session in background job and the session should also processed automatically
    Currently the report logic declared like call transaction 'SM35' and skip first screen.Once the report (tcode) executed (not in background) It writes one session in SM35. The user should select the session and process the transaction manually.
    The new requirement is, if the report (tcode) executes in background mode...what and how the batch input session should be declared and how it process automatically (like you said mode 'N').
    Hope I am clear in my query.
    Please advise.
    Regards
    San.
    Edited by: San Learner on Mar 1, 2011 7:16 PM

  • Zfield is not apearing in the batch input session ( Customer Master Record)

    Hello,
    We have added one Z field in the customer master record (sales are tab). But this Z table not appear in the Batch Input session(SM35). My user want to update this field for all the customers at once, but this Z field not appearing even in MASS transaction.
    For your information, we have appended the KNVV table. Can any one of you give some suggestions on this.
    Regards,
    Srinivas.

    It's rather easy via a custom ABAP program to wait for the end of a batch input session. Some codes were already pubilshed (look whole SCN for APQI-QSTATE).
    What you can do is to select the sessions to be started via this custom program, and it will submit a job which will run in an endless loop until the last session is released. It might use a WAIT UP TO X SECONDS to sleep for a few seconds between each scan of session status.

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

  • At the time of Batch input session system asking business place and profit

    Hi,
    After doing the transaction f.26 interest calculation on customers (security depost) then we are running the batch input session there system asking business place and profit center there we are giving manually, my client having thousands of customers so they wants update these automatically.
    is there any option for automatically updation for business place and profit center.
    Kindly give me the solution.
    Thanks &Reg
    obi

    There will be two options.
    1. Customize default profit centre for GL
    2. Write substitution for profit centre

  • 'S' message in BDC and message of type 'A' in batch input session

    We have to upload data for ABZON transaction of assets. When we use LSMW with recording method and try to upload say 3 records. All teh records are updated successfully but the batch input session log says last two records with a message of type 'A' "leave transaction is not possible in batch input"
    But when we upload the same data with BDC program with call transaction then teh log shows same message with type 'S'.
    what could be the reason for this?
    Though data gets uploaded successfully the 'A' message is being displayed in LSMW batch input log.
    if anyone has encountered a similar problem pls let us know how to resolve this asap.
    Thanks,
    Simmi

    Did your batch input end with save ( /11 ) or what ok_code are you using ?

  • SM35 - manual processing of the batch input session

    Hello,
    In SM35 I see that some batch input sessions were processed by user XXX-XXXX (user type:System) (in our case INT-3528) in N mode. The question is: how to determine the exact user who has really processed that session? We need to stop that - I guess - automatic processing of the sessions and process them manually.
    Thanks for help,
    Slawek

    Hi,
    also, you can check the logs directly in SM35. So if any documents were posted (or anyting updated in the system) information about what happened should be shown there.
    If there were acounting documents (table BKPF), I think the user name will be the same system user "who" has processed the sessions.
    I think that your basis team has set up the system in a way that batch input sessions are processed automatically. This is simialr when scheduled jobs are running under a pseudo user name (system user, IT user, not a real person behind). You can ask the basis team to switch off this automatic processing competely or only for selected sessions.
    Hope that helps, points welcome
    Csaba

  • Stopping a batch Input  session

    Hi,
    I need to stop a job which is being processed. Please tel me how do i acheive this.
    I've tried SM37 & went for release but it says 'cannot be done because of the stattus it has'
    I've also tried to stop the batch using the push button in Appl tool bar in SM37 but still i have the same message.

    Hi..,
    In the BDC_OKCODE,
    give <b>/n</b> to stop that particular transaction...
    give <b>/bend</b> to quit the entire Session....
    You can interrupt the interactive execution of a session by entering the<b> /bend</b> OK code on any screen. <b>/bend </b>terminates the transaction currently being executed in the session and marks the transaction with the status Incorrect. The session is kept in the queue and is displayed in the Errors section of the list. Changes made by the interrupted transaction are rolled back as long as the transaction uses only the R/3 update facility. Direct database changes made by the transaction are not rolled back.
    You can use <b>/bend</b> when testing sessions. For example, you may wish to run the first transactions of a large session in display-all mode to make sure that the session has been generated correctly.
    You can restart processing of a transaction by entering the <b>/bbeg</b> OK code on any screen. <b>/bbeg </b>terminates the transaction that is currently being processed and then restarts the transaction fresh, as it is recorded in the batch input session. Any changes made by the transaction are rolled back, as long as they were made only by way of the R/3 update facility. Changes made directly to the database are not rolled back.
    You can delete a transaction from a session during interactive execution by entering the <b>/bdel</b> OK code. The transaction is removed from the session. The deleted transaction cannot be run even if you restart the session, and you cannot take back the deletion.
    regards,
    sai ramesh
    Message was edited by:
            Sai ramesh

  • 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

  • Batch Input Session for RFUMSV50 is not getting processed.

    Dear All,
    When i am trying to transfer the Service Tax Inetrim account to Service tax final account with the help of the program RFUMSV50 the batch input session is getting generated without any error. But when i process the same in SM35 it is not getitng processed.
    Please advice on this.
    Regards,
    Rajeswari Shankar.

    Hello Rajeswari,
    Yes, this is normal.
    When batch input sessions is generated with any error, this does not mean that you can execute it after via SM35 without any error
    Moreover, you have the option in SM35 to execute it and with option "display error only", so this means that it can happen that there is no error
    For example, the profit center is mandatory, and it is missing in the document. In that case the system will display error and ask you to fulfill the profit center
    Please tell me, which error you have (message number)
    Thanks
    Tarek

  • Batch input session in n-joy sap transaction

    Hello experts,
    I am trying to update data through a batch input session using transaction KE21N.
    there are 258 records.
    The problem is when I run the session in background, all of the records are errored and not updated.
    But when I process them using 'display errors only/foreground'.
    some of the are updated ( the rest are becuse the material is not in the tables).
    I want to know if we can run the background process, so that the correct fields can be updated.

    Generally, you should not use EnjoySAP transactions in batch input - particularly in the background. SAP keeps the old transactions around for just this purpose. So try transaction KE21.
    Rob

  • Batch input session in background

    hai guys,
    Can we execute Batch input session in background scheduling thru jobs.
    i tried with sm37. but there is not option i guess.
    could you pls guide us.
    ambichan.

    Hi Ambi,
    As Anand and Wolfgang suggested, what you need to do in your ZFB05 program is as follows. Insert this after you create the sessions.
    Add parameters to your ZFB05 program for the session background processing like date, session name etc.
    Then after you create your sessions, insert the following code
    *-- run in the background
          CALL FUNCTION 'JOB_OPEN'
               EXPORTING
                    jobname          = 'YOURJOBNAME'
               IMPORTING
                    jobcount         = v_jobcount
               EXCEPTIONS
                    cant_create_job  = 1
                    invalid_job_data = 2
                    jobname_missing  = 3
                    OTHERS           = 4.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            EXIT.
          ENDIF.
          submit rsbdcsub  with mappe    = 'YOURSESSIONNAME'
                           with z_verarb = 'X'
                           with fehler   = 'X'
                           USER sy-uname
                           VIA JOB 'YOURJOBNAME'
                           NUMBER v_jobcount AND RETURN.
    *-- close the job
               CALL FUNCTION 'JOB_CLOSE'
               EXPORTING
                    jobcount             = v_jobcount
                    jobname              = 'YOURJOBNAME'
                    strtimmed            = 'X'
               EXCEPTIONS
                    cant_start_immediate = 1
                    invalid_startdate    = 2
                    jobname_missing      = 3
                    job_close_failed     = 4
                    job_nosteps          = 5
                    job_notex            = 6
                    lock_failed          = 7
                    OTHERS               = 8.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE 'W' NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    Hope this helps,
    Srinivas

  • BDC Batch input session method

    Hi ,
               I am new to SAP progamming. Pls let me know the basics of BDC Batch Input session method and Call transaction method. I want to know the pros and cons of both methods with justification. Please help me in this regarding.

    Hi,
    Session method.
    1) synchronous processing.
    2) can tranfer large amount of data.
    3) processing is slower.
    4) error log is created
    5) data is not updated until session is processed.
    Call transaction.
    1) asynchronous processing
    2) can transfer small amount of data
    3) processing is faster.
    4) errors need to be handled explicitly
    5) data is updated automatically
    Check these link:
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm
    http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
    http://www.planetsap.com/bdc_main_page.htm
    Session method:
    1. Data migration is done in two steps .. Generate session and Process session.
    So resouces can be used efficiently. good for bulkdata migration.
    2. Session method generates error log when u process a session.
    3. No SY-SUBRC can be returned after each transaction is called.
    4. Provides synchronous Updation only...
    Call transaction method:
    1. Data migration is done in single steps ..bcoz Transactions are called immediately after filling BDCDATA table. So good for small amount of data.
    2. We have to collect error messages using BDCMSGCOLL Table
    3. Returns SY-SUBRC and Messages ..after each Call Transaction..very useful feature for further processing based on the Status and Messages..
    4. Supports Asynch or Synch Updation.
    Example code for session method
    Here is the porgram for Purchase order
    REPORT zmm0069 NO STANDARD PAGE HEADING
                                      MESSAGE-ID z0
                                      LINE-SIZE  132
                                      LINE-COUNT 65(2).
                         Internal Tables                                 *
    *Internal table for the purchasing info records fields.
      DATA: BEGIN OF i_inforecord OCCURS 0,
            matnr(18),
            lifnr(10),
            uom(3),
            ekgrp(3),
            planned_time(3),
            under_tol(3),
            over_tol(3),
            qty(10),
            price_cat(5),
            inco(3),
            designation(28),
            netpr(13),
            scale_qty1(10),
            scale_pr1(13),
            scale_qty2(10),
            scale_pr2(13),
            scale_qty3(13),
            scale_pr3(10),
            scale_qty4(13),
            scale_pr4(10),
            scale_qty5(13),
            scale_pr5(10),
            scale_qty6(13),
            scale_pr6(10),
            scale_qty7(13),
            scale_pr7(10),
            scale_qty8(13),
            scale_pr8(10),
            scale_qty9(13),
            scale_pr9(10),
            scale_qty10(13),
            scale_pr10(10),
            END OF i_inforecord.
    Internal table for Old and New Vendor number
      DATA : BEGIN OF i_lfb1 OCCURS 1,
             lifnr(10),
             altkn(10),
             END   OF i_lfb1.
    Declare internal table for Call Transaction and BDC Session
      DATA: i_bdc_table LIKE bdcdata OCCURS 0 WITH HEADER LINE.
                         Global Variables                                *
      DATA: g_counter(2) TYPE n,
            g_field_name(18) TYPE c,
            zc_yes  TYPE syftype VALUE 'X'.
                         Selection Screen                                *
      SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
      PARAMETERS: p_fname1 TYPE localfile .
      SELECTION-SCREEN SKIP 1.
      SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.
      PARAMETERS: p_rloc1 AS CHECKBOX  DEFAULT 'X'.
      SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-003.
      PARAMETERS p_group(12) OBLIGATORY DEFAULT 'ZPURCHINFO'.
      SELECTION-SCREEN END OF BLOCK c.
      SELECTION-SCREEN END OF BLOCK b.
      SELECTION-SCREEN END OF BLOCK a.
    **WRITE the report header
      TOP-OF-PAGE.
        INCLUDE zheading.
                         Start of selection                              *
      START-OF-SELECTION.
    Load Input file
        PERFORM f_load_input_file.
    Create BDC records.
        PERFORM create_bdc_records .
    *&      Form  Create_BDC_records
          Perform the BDC for the records in the internal table
      FORM create_bdc_records .
        IF NOT i_inforecord[] IS INITIAL.
    Open BDC session
          PERFORM open_bdc_session.
          SELECT lifnr altkn FROM lfb1 INTO TABLE i_lfb1
                              FOR ALL ENTRIES IN i_inforecord
                              WHERE altkn = i_inforecord-lifnr.
    Sorting the Internal table for better performance
          SORT i_lfb1 BY altkn.
          LOOP AT i_inforecord.
    ***Mapping Old Vendor number to the new Vendor number
            READ TABLE i_lfb1 WITH KEY altkn = i_inforecord-lifnr BINARY
                                                                  SEARCH.
            IF sy-subrc EQ 0.
              i_inforecord-lifnr = i_lfb1-lifnr.
            ENDIF.
            CLEAR i_bdc_table[].
            PERFORM insert_screen_header.
         call transaction 'ME11' using i_bdc_table
                       mode 'A'.
         CLEAR i_bdc_table.
          ENDLOOP.
          CLEAR i_inforecord[].
          PERFORM close_bdc_session.
    Release the BDC sessions created
          PERFORM release_bdc.
        ENDIF.
      ENDFORM.                    " open_group
    *&      Form  bdc_dynpro_start
          Start the screen for the transfer of fields
      FORM bdc_dynpro_start  USING    p_g_program_1
                                      p_g_screen.
        CLEAR i_bdc_table.
        i_bdc_table-program  = p_g_program_1.
        i_bdc_table-dynpro   = p_g_screen.
        i_bdc_table-dynbegin = 'X'.
        APPEND i_bdc_table.
      ENDFORM.                    " bdc_dynpro_start_start
    *&      Form  bdc_insert_field
           Insert field                                                  *
      FORM bdc_insert_field USING f_name f_value.
        IF f_value <> space.
          CLEAR i_bdc_table.
          i_bdc_table-fnam = f_name.
          i_bdc_table-fval = f_value.
          APPEND i_bdc_table.
        ENDIF.
      ENDFORM.                    "bdc_insert_field
    *&      Form  open_bdc_session
          Open a BDC session
      FORM open_bdc_session .
    Open BDC session and create and update records
        CALL FUNCTION 'BDC_OPEN_GROUP'
          EXPORTING
            client                    = sy-mandt
          DEST                      = FILLER8
            group                     = p_group
          HOLDDATE                  = FILLER8
            keep                      = 'X'
            user                      = sy-uname
          RECORD                    = FILLER1
          PROG                      = SY-CPROG
        IMPORTING
          QID                       =
       EXCEPTIONS
         client_invalid            = 1
         destination_invalid       = 2
         group_invalid             = 3
         group_is_locked           = 4
         holddate_invalid          = 5
         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.
      ENDFORM.                    " create_bdc_session
    *&      Form  insert_screen_header
          Screen flow for the transfer of fields
      FORM insert_screen_header .
    First Screen 100
        PERFORM bdc_dynpro_start USING 'SAPMM06I' '0100'.
        PERFORM bdc_insert_field USING:'BDC_CURSOR' 'EINA-LIFNR',
                                       'BDC_OKCODE' '/00',
                                       'EINA-LIFNR' i_inforecord-lifnr,
                                       'EINA-MATNR' i_inforecord-matnr,
                                       'EINE-EKORG' '1000',
                                       'RM06I-NORMB' zc_yes.
    Next Screen 101
        PERFORM bdc_dynpro_start USING 'SAPMM06I' '0101'.
        PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'EINA-MAHN1',
                                         'BDC_OKCODE' '/00',
                                         'EINA-MEINS' i_inforecord-uom.
    *Next Screen 102
        PERFORM bdc_dynpro_start USING 'SAPMM06I' '0102'.
        PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'EINE-INCO2',
                                     'EINE-APLFZ' i_inforecord-planned_time,
                                     'EINE-EKGRP' i_inforecord-ekgrp,
                                     'EINE-NORBM' i_inforecord-qty.
        PERFORM bdc_insert USING  'EINE-UEBTK' ' '.
        PERFORM bdc_insert_field USING:'EINE-PEINH' i_inforecord-scale_qty1,
                                       'EINE-BPRME' i_inforecord-uom,
                                       'EINE-UNTTO' '5',
                                       'EINE-UEBTO' '25',
                                       'EINE-MEPRF' i_inforecord-price_cat,
                                       'EINE-NETPR' i_inforecord-netpr,
                                       'EINE-INCO1' i_inforecord-inco,
                                      'EINE-INCO2' i_inforecord-designation.
    Checking for Scale quantities
        IF i_inforecord-scale_qty2 = space.
          PERFORM bdc_insert_field  USING 'BDC_OKCODE' '=BU'.
          PERFORM insert_bdc_new.
        ELSE.
          PERFORM bdc_insert_field  USING 'BDC_OKCODE' '=KO'.
    Next Screen 201
          PERFORM bdc_dynpro_start USING 'SAPMV13A' '0201'.
          PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'RV13A-DATAB',
                                            'BDC_OKCODE' '=PSTF'.
    Next Screen 201
          PERFORM bdc_dynpro_start USING 'SAPMV13A' '0201'.
          PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'KONP-KSCHL(01)',
                                           'BDC_OKCODE' '=PSTF',
                                           'RV130-SELKZ(01)' zc_yes.
    LAST SCREEN 303
          PERFORM bdc_dynpro_start USING 'SAPMV13A' '0303'.
          PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'KONM-KBETR(03)',
                                           'BDC_OKCODE' '=SICH'.
    Counter to Loop the Item level entry
          g_counter = 0.
          PERFORM scale_entry USING i_inforecord-scale_qty2
                                    i_inforecord-scale_pr2.
          PERFORM scale_entry USING i_inforecord-scale_qty3
                                    i_inforecord-scale_pr3.
          PERFORM scale_entry USING i_inforecord-scale_qty4
                                    i_inforecord-scale_pr4.
          PERFORM scale_entry USING i_inforecord-scale_qty5
                                    i_inforecord-scale_pr5.
          PERFORM scale_entry USING i_inforecord-scale_qty6
                                    i_inforecord-scale_pr6.
          PERFORM scale_entry USING i_inforecord-scale_qty7
                                    i_inforecord-scale_pr7.
          PERFORM scale_entry USING i_inforecord-scale_qty8
                                    i_inforecord-scale_pr8.
          PERFORM scale_entry USING i_inforecord-scale_qty9
                                    i_inforecord-scale_pr9.
          PERFORM scale_entry USING  i_inforecord-scale_qty10
                                     i_inforecord-scale_pr10.
          PERFORM insert_bdc_new.
        ENDIF.
      ENDFORM.                    " insert_screen_header
    *&      Form  insert_bdc
          Insert BDC
      FORM insert_bdc_new .
        CALL FUNCTION 'BDC_INSERT'
           EXPORTING
             tcode                  = 'ME11'
          POST_LOCAL             = NOVBLOCAL
          PRINTING               = NOPRINT
          SIMUBATCH              = ' '
          CTUPARAMS              = ' '
           TABLES
             dynprotab              = i_bdc_table
        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 ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        CLEAR i_bdc_table[].
      ENDFORM.                    " insert_bdc
    *&      Form  close_bdc_session
         Close the BDC session
      FORM close_bdc_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.
      ENDFORM.                    " close_bdc_session
    *&      Form  f_load_input_file
          Upload the file
      FORM f_load_input_file.
    Check always Local file for upload
        IF p_rloc1 = zc_yes.
          CALL FUNCTION 'WS_UPLOAD'
               EXPORTING
                    filename                = p_fname1
                    filetype                = 'DAT'
               TABLES
                    data_tab                = i_inforecord
               EXCEPTIONS
                    conversion_error        = 1
                    file_open_error         = 2
                    file_read_error         = 3
                    invalid_type            = 4
                    no_batch                = 5
                    unknown_error           = 6
                    invalid_table_width     = 7
                    gui_refuse_filetransfer = 8
                    customer_error          = 9
                    OTHERS                  = 10.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            STOP.
          ENDIF.
        ENDIF.
      ENDFORM.                    " f_load_input_file
    *&      Form  release_bdc
         Release the session
      FORM release_bdc.
        SUBMIT rsbdcsub WITH mappe EQ p_group
                        WITH von EQ sy-datum
                        WITH bis EQ sy-datum
                        WITH fehler EQ '.'
                        EXPORTING LIST TO MEMORY
                        AND RETURN.
      ENDFORM.                    " release_bdc
    *&      Form  scale_entry
          Populate the Scale quantities
         -->P_SCALE_QTY
         -->P_SCALE_PRICE
      FORM scale_entry USING    p_scale_qty
                                p_scale_price.
    Increment the Counter
        g_counter = g_counter + 1.
        IF p_scale_qty <> space.
          CONCATENATE 'KONM-KSTBM('  g_counter  ')' INTO g_field_name.
          PERFORM bdc_insert_field USING g_field_name p_scale_qty.
          CONCATENATE 'KONM-KBETR('  g_counter  ')' INTO g_field_name.
          PERFORM bdc_insert_field USING g_field_name p_scale_price.
        ENDIF.
      ENDFORM.
    *&      Form  bdc_insert
          To uncheck the Unlimited (UEBTK)
      FORM bdc_insert USING  f_name f_value.
        CLEAR i_bdc_table.
        i_bdc_table-fnam = f_name.
        i_bdc_table-fval = f_value.
        APPEND i_bdc_table.
      ENDFORM.                    " bdc_insert
    Reward points if it is usefull ....
    Cheers,
    Chandra Sekhar.

Maybe you are looking for