How to set the BDC Call transaction Program in Background

Hi All,
        I have a requirement. If i execute a BDC Call Transaction Program in Background it is showing 0 seconds means it is not executing. Normally it is working properly. If execute in background it is not executing. But my client wnats to execute in background. How can i overcome this could you please suggest me?
Thanks in Advance

hi
To schedule the processing of session in backgroud you can use report RSBDCSUB.
You can do in two ways -
Ist Method
Define a batch job in SM36 with two steps -
First Step - Your Custom Program ( with a variant )
Second Step - RSBDCSUB ( With a variant having
the session name ).
2nd Method
In your program after BDC_CLOSE_GROUP add a line.
SUBMIT RSBDCSUB WITH MAPPE EQ <SESSION_NAME>.
Scedule you program as a batch job in SM36 ( Single Step ). ( You can also test the program by running in online mode . After your programs executes , go and see in SM35. You will see that your session created in being processed or has been processed in background).
In Both ways the session created by BDC_OPEN_GROUP will be processed in background
You would have to create a job on the fly to do this. This example shows how to kick off a background job via an ABAP program.
report zrich_0004 .
data:   sdate type sy-datum,
        stime type sy-uzeit,
        l_valid,
        ls_params like pri_params,
        l_jobcount like tbtcjob-jobcount,
        l_jobname  like tbtcjob-jobname.
start-of-selection.
Get Print Parameters
  call function 'GET_PRINT_PARAMETERS'
       exporting
            no_dialog      = 'X'
       importing
            valid          = l_valid
            out_parameters = ls_params.
Open Job
  l_jobname = 'ZRICH_0005'.
  call function 'JOB_OPEN'
       exporting
            jobname  = l_jobname
       importing
            jobcount = l_jobcount.
Submit report to job
  submit zrich_0005   
       via job     l_jobname
           number  l_jobcount
       to sap-spool without spool dynpro
           spool parameters ls_params
              and return.
Schedule and close job.
  call function 'JOB_CLOSE'
       exporting
            jobcount  = l_jobcount
            jobname   = l_jobname
            strtimmed = 'X.
regards
Satish

Similar Messages

  • Improve performance of bdc call transaction

    Hi all,
    I am performing a batch update of tax codes in a BDC call transaction program. This particular code takes about 3 minutes to process 2,600 entries. I have tried almost everything but is there a way to improve / make it run faster?
    I have a feeling it has something to do with the form "do_transaction", but I really don't know anymore.
    Thank you in advance.
    Attached is the code:
    *& Report  ZFI_CHANGEWTAX
    *&  Description: Change Doctors Withholding Tax Code (EI)
    *&  Using BDC Call Transaction Method
    *&  Created by : mpena
    *&  Created on : 07/15/2009
    *&  Modification History
    *&  Seq  Changed on
    *&       Changed by
    *&  001   07/15/2009
    *&        mpena         Initial Development
    *&  002   07/20/2009
    *&        mpena         Logic modification
    *&                      Testing
    *&  003   07/20/2009
    *&        mpena         Call function parameter modification
    *&  004   07/22/2009
    *&        mpena         Report generation
    *&                      Performance improvements
    REPORT zfi_changewtax
           NO STANDARD PAGE HEADING
           MESSAGE-ID zfk02msg.
    TYPES: BEGIN OF t_tax,
           lifnr LIKE lfa1-lifnr,                "account number
           wt_withcd LIKE lfbw-wt_withcd,        "current tax code
           wt_withcd_new LIKE lfbw-wt_withcd,    "new tax code (left blank at default)
           END OF t_tax.
    DATA:  wa_tax TYPE t_tax,
           i_tax TYPE STANDARD TABLE OF t_tax,
           it_bdcdata TYPE bdcdata OCCURS 0 WITH HEADER LINE,
           lin TYPE i.
    -------Selection Screen Design -
    SELECTION-SCREEN:
    SKIP 1,
    BEGIN OF BLOCK blk1 WITH FRAME TITLE aaa.
    PARAMETERS: p_ktokk LIKE lfa1-ktokk DEFAULT 'DOCT' OBLIGATORY,
                p_bukrs LIKE lfbw-bukrs DEFAULT 'SL' OBLIGATORY,
                p_wtax LIKE lfbw-wt_withcd OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk1.
    INITIALIZATION.
      aaa = 'Change Tax Code to specified value'.
    TOP-OF-PAGE.
      WRITE:
      / 'Update of taxes successful on:', sy-datum, sy-uzeit,
      / 'Generated by:', sy-uname,
      / 'Company Code:', p_bukrs, 'Vendor Group:', p_ktokk.
      SKIP 1.
      ULINE.
      WRITE:
      / 'Account Number', 20 'Old Withholding Tax Code', 50 'New Withholding Tax Code'.
      ULINE.
    START-OF-SELECTION.
      SELECT lfa1~lifnr
             lfbw~wt_withcd
      INTO TABLE i_tax
      FROM lfa1 INNER JOIN lfbw
        ON lfa1lifnr = lfbwlifnr
        WHERE lfbw~bukrs EQ p_bukrs
        AND lfbw~witht EQ 'EI'.
      IF sy-subrc EQ 0.
        DESCRIBE TABLE i_tax LINES lin.
      ENDIF.
    Update i_tax with new value of wt_witchd, then display for comparison.
    After write: if old and new tax are the same, tax update was not successful for that specific account
    or inputted tax type is the same as the old one.
      LOOP AT i_tax INTO wa_tax.
        wa_tax-wt_withcd_new = p_wtax.
        MODIFY i_tax FROM wa_tax.
        WRITE:
        / wa_tax-lifnr,
        20 wa_tax-wt_withcd,
        50 wa_tax-wt_withcd_new.
        CLEAR wa_tax.
      ENDLOOP.
      PERFORM do_transaction USING p_bukrs p_wtax.
    *&      Form  do_transaction
         Extracted from ZFKO2 recording accessible in shdb.
    FORM do_transaction USING v_bukrs v_wtax.
      MESSAGE i000 WITH lin.
      LOOP AT i_tax INTO wa_tax.
        REFRESH it_bdcdata.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0106'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RF02K-D0610'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RF02K-LIFNR'
                                      wa_tax-lifnr.
        PERFORM bdc_field       USING 'RF02K-BUKRS'
                                      v_bukrs.
        PERFORM bdc_field       USING 'RF02K-D0610'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0610'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFBW-WT_WITHCD(01)'.
        PERFORM bdc_field       USING 'LFB1-QLAND'
                                      'PH'.
        PERFORM bdc_field       USING 'LFBW-WT_WITHCD(01)'
                                      v_wtax.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0610'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=UPDA'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFB1-QLAND'.
        PERFORM bdc_field       USING 'LFB1-QLAND'
                                      'PH'.
        CALL TRANSACTION 'FK02' USING it_bdcdata
                                MODE   'N'
                                UPDATE 'A'.
      ENDLOOP.
      MESSAGE i001.
    ENDFORM.                    "do_transaction
           form for bdc dynpro
    FORM bdc_dynpro USING program
                          dynpro.
      it_bdcdata-program = program.
      it_bdcdata-dynpro = dynpro.
      it_bdcdata-dynbegin = 'X'.
      APPEND it_bdcdata.
      CLEAR it_bdcdata.
    ENDFORM.                    "bdc_dynpro
           form for bdc field
    FORM bdc_field  USING fnam
                          fval.
      it_bdcdata-fnam = fnam.
      it_bdcdata-fval = fval.
      APPEND it_bdcdata.
      CLEAR it_bdcdata.
    ENDFORM.                    "bdc_field

    You might want to try using a BAPI instead of a call transaction.   I believe "BAPI_VENDOR_SAVECHARVALREPLICA" will work for you.  Calling a BAPI is just like calling a function module.   After you call the bapi remember to commit it with the function module "BAPI_TRANSACTION_COMMIT".

  • How to resolve the error in bdc call transaction in ALV report

    Dear Experts, i am executing the alv report program and in alv report program one bdc is there..
    after executing output is showing in alv format but one button is there (update master)..when i am clicking update button the bdc is run but is not updated in the material master..after executing my bdc is not updated in mm02.
    how to resove it?
    CALL TRANSACTION 'MM02' USING BDCDATA MODE MODE
                                                              UPDATE 'S'
                                                      MESSAGES INTO MESSTAB.

    Hi Kaustav,
    Looking at the code you attached, it appears to me that your BDC (Form  USER_COMMAND) is not executed at all as you haven't passed the 'USER_COMMAND' in FM REUSE_ALV_GRID_DISPLAY for ALV display.
    You must pass the importing parameter  I_CALLBACK_USER_COMMAND of this FM as 'USER_COMMAND', only then this form will be executed and your BDC will run.
    Thereafter, in case your BDC update fails, you can put a break-point in the form (at CALL TRANSACTION statement) and analyze the message table MESSTAB.
    Hope it helps.
    Regards,
    Sapeksh

  • How to do the job scheduling in BDC Call transaction

    Hi Experts,
    I've a Query like how to do the job scheduling in BDC Call transaction
      If anybody knows the answer please send me the reply.
      Thanks.
       Regards,
        Rekha

    Hi ,
    any progarm can be scheduled, wether it may be BDC or report thru SM36 Tcode.
    But do rememeber that if ur BDC is using GUI_UPLOAD function module, then it wont work , coz the function Gui_upload or GUI_DOWNLOAd wont work in back ground.
    If u r going to use OPEN_DATASET , READ dataset ....then it can be scheduled. i.e BDC can work if ur program retrievesz the data from Application server.
    Rvert back if any issues,
    Reward with poinst if helpful.
    Regards,
    Naveen

  • How to set the IP and MAC address in C program?

    My working environment is Sun250 Server, Solaris 7 operating system. I encountered a problem ---- How to set the IP and MAC address in C program to make the system change it IP & MAC at runtime?
    Any idea is welcome! Thanks!

    Hi
    As a simplest possible solution, you can use the system command
    to run ifconfig that can set both the mac address and the IP address of the system. You will have to use setuid though.
    Or you can use the DLPI calls ( do a man DLPI or search for a
    Sun documentation on the same at http://soldc.sun.com) to write
    a pure C program.
    HTH
    Shridhar

  • How to set the root path of XML document when calling Inserting procedure

    Hi,
    I was create a procedure to insert XML Document in to DBMS Tables, but i am not able to set the Start root element in calling procedure.
    My calling procedure is
    exec insXmldoc('pmc_sample.xml', 'pmc')
    When i am calling this procedure i got this error
    11:23:54 Error: ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 8
    ORA-06512: at line 2
    I am checking my XML file using XML Validator. My XML file was parsed with out errors.
    Please give the solution,and tell me where i did wrong in my calling procedure.
    suppose i have this XML file in local E drive ,how to set the path for that XML file in my calling procedure.

    Hi, I am doing the code likthis,please give the solution.
    SQL> create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
    2 insCtx DBMS_XMLSave.ctxType;
    3 l_ctx dbms_xmlsave.ctxtype;
    4 rows number;
    5 begin
    6 insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
    7 rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    8 DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    9 end;
    10 /
    Procedure created.
    SQL> begin
    2 insProc('/usr/tmp/ROWSET.xml', 'emp');
    3 end;
    4 /
    begin
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:
    Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 7
    ORA-06512: at line 2
    Kishore B

  • How to set the caller tune on PRI-Line/CUCM 8.X

    Hi Team,
    If passible to set the caller tune songs or advertising in CUCM 8.x -( in place of ringing).
    How to set the caller tune for incoming calls( advertising), including 4 digit extension. This feature is available or not (cucm 8.0.3) Kindly verify and confirm
    regards,
    Johnson

    Dear Team,
    Now i have configured the Call Queuing, Its working fine, But how to verify to incoming calls or Missed call  are in queuing, how to showing. 
    Connected call are showing, but unable show missed call like who ever in queue.
    Regards,
    Johnson.

  • Plz tell me BDC  CALL TRANSACTION steps with simple example

    hi,
    plz tell me the steps
    BDC  CALL TRANSACTION steps with simple example

    Hi,
    BATCH DATA COMMUNICATION
    About Data Transfer In R/3 System
    When a company decides to implement the SAP R/3 to manage business-critical data, it usually does not start from a no-data situation. Normally, a SAP R/3 project comes into replace or complement existing application.
    In the process of replacing current applications and transferring application data, two situations might occur:
    ? The first is when application data to be replaced is transferred at once, and only once.
    ? The second situation is to transfer data periodically from external systems to SAP and vice versa.
    ? There is a period of time when information has to be transferred from existing application, to SAP R/3, and often this process will be repetitive.
    The SAP system offers two primary methods for transferring data into SAP systems. From non-SAP systems or legacy system. These two methods are collectively called ?batch input? or ?batch data communication?.
    1. SESSION METHOD
    2. CALL TRANSACTION
    3. DIRECT INPUT
    Advantages offered by BATCH INPUT method:
    1. Can process large data volumes in batch.
    2. Can be planned and submitted in the background.
    3. No manual interaction is required when data is transferred.
    4. Data integrity is maintained as whatever data is transferred to the table is through transaction. Hence batch input data is submitted to all the checks and validations.
    To implement one of the supported data transfers, you must often write the program that exports the data from your non-SAP system. This program, known as a ?data transfer? program must map the data from the external system into the data structure required by the SAP batch input program.
    The batch input program must build all of the input to execute the SAP transaction.
    Two main steps are required:
    ? To build an internal table containing every screen and every field to be filled in during the execution of an SAP transaction.
    ? To pass the table to SAP for processing.
    Prerequisite for Data Transfer Program
    Writing a Data Transfer Program involves following prerequisites:
    Analyzing data from local file
    Analyzing transaction
    Analyzing transaction involves following steps:
    ? The transaction code, if you do not already know it.
    ? Which fields require input i.e., mandatory.
    ? Which fields can you allow to default to standard values.
    ? The names, types, and lengths of the fields that are used by a transaction.
    ? Screen number and Name of module pool program behind a particular transaction.
    To analyze a transaction::
    ? Start the transaction by menu or by entering the transaction code in the command box.
    (You can determine the transaction name by choosing System ? Status.)
    ? Step through the transaction, entering the data will be required for processing your batch input data.
    ? On each screen, note the program name and screen (dynpro) number.
    (dynpro = dyn + pro. Dyn = screen, pro = number)
    ? Display these by choosing System ? Status. The relevant fields are Program (dynpro) and Dynpro number. If pop-up windows occur during execution, you can get the program name and screen number by pressing F1 on any field or button on the screen.
    The technical info pop-up shows not only the field information but also the program and screen.
    ? For each field, check box, and radio button on each screen, press F1 (help) and then choose Technical Info.
    Note the following information:
    - The field name for batch input, which you?ll find in its own box.
    - The length and data type of the field. You can display this information by double clicking on the Data Element field.
    ? Find out the identification code for each function (button or menu) that you must execute to process the batch-input data (or to go to new screen).
    Place the cursor on the button or menu entry while holding down the left mouse button. Then press F1.
    In the pop-up window that follows, choose Technical info and note the code that is shown in the Function field.
    You can also run any function that is assigned to a function key by way of the function key number. To display the list of available function keys, click on the right mouse button. Note the key number that is assigned to the functions you want to run.
    Once you have program name, screen number, field name (screen field name), you can start writing.
    DATA TRANSFER program.
    Declaring internal table
    First Integral Table similar to structure like local file.
    Declaring internal table like BDCDATA
    The data from internal table is not transferred directly to database table, it has to go through transaction. You need to pass data to particular screen and to particular screen-field. Data is passed to transaction in particular format, hence there is a need for batch input structure.
    The batch input structure stores the data that is to be entered into SAP system and the actions that are necessary to process the data. The batch input structure is used by all of the batch input methods. You can use the same structure for all types of batch input, regardless of whether you are creating a session in the batch input queue or using CALL TRANSACTION.
    This structure is BDCDATA, which can contain the batch input data for only a single run of a transaction. The typical processing loop in a program is as follows:
    ? Create a BDCDATA structure
    ? Write the structure out to a session or process it with CALL TRANSACTION USING; and then
    ? Create a BDCDATA structure for the next transaction that is to be processed.
    Within a BDCDATA structure, organize the data of screens in a transaction. Each screen that is processed in the course of a transaction must be identified with a BDCDATA record. This record uses the Program, Dynpro, and Dynbegin fields of the structure.
    The screen identifier record is followed by a separate BDCDATA record for each value, to be entered into a field. These records use the FNAM and FVAL fields of the BDCDATA structure. Values to be entered in a field can be any of the following:
    ? Data that is entered into screen fields.
    ? Function codes that are entered into the command field. Such function codes execute functions in a transaction, such as Save or Enter.
    The BDCDATA structure contains the following fields:
    ? PROGRAM: Name of module pool program associated with the screen. Set this field only for the first record for the screen.
    ? DYNPRO: Screen Number. Set this field only in the first record for the screen.
    ? DYNBEGIN: Indicates the first record for the screen. Set this field to X, only for the first record for the screen. (Reset to ? ? (blank) for all other records.)
    ? FNAM: Field Name. The FNAM field is not case-sensitive.
    ? FVAL: Value for the field named in FNAM. The FVAL field is case-sensitive. Values assigned to this field are always padded on the right, if they are less than 132 characters. Values must be in character format.
    Transferring data from local file to internal table
    Data is uploaded to internal table by UPLOAD of WS_UPLOAD function.
    Population of BDCDATA
    For each record of internal table, you need to populate Internal table, which is similar to BDCDATA structure.
    All these five initial steps are necessary for any type of BDC interface.
    DATA TRANSFER program can call SESSION METHOD or CALL TRANSACTION. The initial steps for both the methods are same.
    First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.
    SESSION METHOD
    About Session method
    In this method you transfer data from internal table to database table through sessions.
    In this method, an ABAP/4 program reads the external data that is to be entered in the SAP System and stores the data in session. A session stores the actions that are required to enter your data using normal SAP transaction i.e., Data is transferred to session which in turn transfers data to database table.
    Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.
    When the program has finished generating the session, you can run the session to execute the SAP transactions in it. You can either explicitly start and monitor a session or have the session run in the background processing system.
    Unless session is processed, the data is not transferred to database table.
    BDC_OPEN_GROUP
    You create the session through program by BDC_OPEN_GROUP function.
    Parameters to this function are:
    ? User Name: User name
    ? Group: Name of the session
    ? Lock Date: The date on which you want to process the session.
    ? Keep: This parameter is passed as ?X? when you want to retain session after
    processing it or ? ? to delete it after processing.
    BDC_INSERT
    This function creates the session & data is transferred to Session.
    Parameters to this function are:
    ? Tcode: Transaction Name
    ? Dynprotab: BDC Data
    BDC_CLOSE_GROUP
    This function closes the BDC Group. No Parameters.
    Some additional information for session processing
    When the session is generated using the KEEP option within the BDC_OPEN_GROUP, the system always keeps the sessions in the queue, whether it has been processed successfully or not.
    However, if the session is processed, you have to delete it manually. When session processing is completed successfully while KEEP option was not set, it will be removed automatically from the session queue. Log is not removed for that session.
    If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.
    CALL TRANSACTION
    About CALL TRANSACTION
    A technique similar to SESSION method, while batch input is a two-step procedure, Call Transaction does both steps online, one after the other. In this method, you call a transaction from your program by
    Call transaction <tcode> using <BDCTAB>
    Mode <A/N/E>
    Update <S/A>
    Messages into <MSGTAB>.
    Parameter ? 1 is transaction code.
    Parameter ? 2 is name of BDCTAB table.
    Parameter ? 3 here you are specifying mode in which you execute transaction
    A is all screen mode. All the screen of transaction are displayed.
    N is no screen mode. No screen is displayed when you execute the transaction.
    E is error screen. Only those screens are displayed wherein you have error record.
    Parameter ? 4 here you are specifying update type by which database table is updated.
    S is for Synchronous update in which if you change data of one table then all the related Tables gets updated. And sy-subrc is returned i.e., sy-subrc is returned for once and all.
    A is for Asynchronous update. When you change data of one table, the sy-subrc is returned. And then updating of other affected tables takes place. So if system fails to update other tables, still sy-subrc returned is 0 (i.e., when first table gets updated).
    Parameter ? 5 when you update database table, operation is either successful or unsuccessful or operation is successful with some warning. These messages are stored in internal table, which you specify along with MESSAGE statement. This internal table should be declared like BDCMSGCOLL, a structure available in ABAP/4. It contains the following fields:
    1. Tcode: Transaction code
    2. Dyname: Batch point module name
    3. Dynumb: Batch input Dyn number
    4. Msgtyp: Batch input message type (A/E/W/I/S)
    5. Msgspra: Batch input Lang, id of message
    6. Msgid: Message id
    7. MsgvN: Message variables (N = 1 - 4)
    For each entry, which is updated in database, table message is available in BDCMSGCOLL. As BDCMSGCOLL is structure, you need to declare a internal table which can contain multiple records (unlike structure).
    Steps for CALL TRANSACTION method
    1. Internal table for the data (structure similar to your local file)
    2. BDCTAB like BDCDATA
    3. UPLOAD or WS_UPLOAD function to upload the data from local file to itab. (Considering file is local file)
    4. Loop at itab.
    Populate BDCTAB table.
    Call transaction <tcode> using <BDCTAB>
    Mode <A/N/E>
    Update <S/A>.
    Refresh BDCTAB.
    Endloop.
    (To populate BDCTAB, You need to transfer each and every field)
    The major differences between Session method and Call transaction are as follows:
    SESSION METHOD CALL TRANSACTION
    1. Data is not updated in database table unless Session is processed. Immediate updation in database table.
    2. No sy-subrc is returned. Sy-subrc is returned.
    3. Error log is created for error records. Errors need to be handled explicitly
    4. Updation in database table is always synchronous Updation in database table can be synchronous Or Asynchronous.
    Error Handling in CALL TRANSACTION
    When Session Method updates the records in database table, error records are stored in the log file. In Call transaction there is no such log file available and error record is lost unless handled. Usually you need to give report of all the error records i.e., records which are not inserted or updated in the database table. This can be done by the following method:
    Steps for the error handling in CALL TRANSACTION
    1. Internal table for the data (structure similar to your local file)
    2. BDCTAB like BDCDATA
    3. Internal table BDCMSG like BDCMSGCOLL
    4. Internal table similar to Ist internal table
    (Third and fourth steps are for error handling)
    5. UPLOAD or WS_UPLOAD function to upload the data from the local file to itab. (Considering file is local file)
    6. Loop at itab.
    Populate BDCTAB table.
    Call transaction <tr.code> using <Bdctab>
    Mode <A/N/E>
    Update <S/A>
    Messages <BDCMSG>.
    Perform check.
    Refresh BDCTAB.
    Endloop.
    7 Form check.
    IF sy-subrc <> 0. (Call transaction returns the sy-subrc if updating is not successful).
    Call function Format_message.
    (This function is called to store the message given by system and to display it along with record)
    Append itab2.
    Display the record and message.
    DIRECT INPUT
    Thanks &regards,
    Sravani

  • Hi Problem in call transaction program of FB60

    Hi Techies,
    in my call transaction program for FB60 compnay code is defaulted in the initial screen.Every time i need to post different records with the different company codes.
    when i record the company code change in FB60 through SHDB once i chnage the company code it is coming out of the recording.
    pls let me know how can i continue FB60 transaction once i change the company code for further processing.
    and let me know and logic to handle the compnay code when it is defaulted in FB60.
    Thanks in advance
    Krishna D

    Hi,
    Try this code and cross check with urs.
      CASE SY-UCOMM.
        WHEN '&BATCH'.             "Batch Field
          PERFORM F1000_BDC_MM03 USING LV_MATNR LV_WERKS.
    endcase.
    FORM F1000_BDC_MM03 USING    P_LV_MATNR
                                 P_LV_WERKS.
      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '4110'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '=GESV'.
      CALL TRANSACTION C_TRANSACTION_CALL_MM03 USING I_BDCDATA MODE 'E'
      MESSAGES INTO I_MESSTAB.
    ENDFORM.                    " f1000_bdc_mm03
    &----&      Form  bdc_dynpro
    &----  Appending the BDC dynpros to internal table BDCDATA
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR W_BDCDATA.
      W_BDCDATA-PROGRAM  = PROGRAM.
      W_BDCDATA-DYNPRO   = DYNPRO.
      W_BDCDATA-DYNBEGIN = 'X'.
      APPEND W_BDCDATA TO I_BDCDATA.
    ENDFORM.
    DATA:  I_BDCDATA TYPE STANDARD TABLE OF BDCDATA,
    Internal table to hold BDC messages
           I_MESSTAB TYPE STANDARD TABLE OF BDCMSGCOLL.
    &----&      Form  bdc_field
        Appending the BDC FIELDS to internal table BDCDATA
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> NODATA.
        CLEAR W_BDCDATA.
        W_BDCDATA-FNAM = FNAM.
        W_BDCDATA-FVAL = FVAL.
        APPEND W_BDCDATA TO I_BDCDATA.
      ENDIF.
    ENDFORM.
    Tahnks & Regards,
    Judith

  • Authorization check in BDC call transaction

    Hello gurus,
    My requirement is MB1B t-code is not authorized for basis users but only for end user, but when I create a Z-program with a BDC call transaction MB1B it is allowing access.
    How is this possible? My boss will ask me this question and I don't know the answer.
    Regards,
    Krishna
    Edited by: Julius Bussche on Dec 2, 2008 10:54 AM
    Several errors corrected...
    Edited by: Julius Bussche on Dec 2, 2008 2:44 PM

    Hi Krishna Moorthy
    To the best of my knowledge you need check the authorization in your program
    use AUTHORITY CHECK
    for further info take the help of KEY word documentaion
    Regards
    Ramchander Rao.K
    Edited by: ramchander krishnamraju on Dec 2, 2008 10:20 AM

  • Holder(A008) is not maintaing in HRP1001 (BDC - Call Transaction Method)

    Dear Friends,
    Holder (A008) in HRP1001 is not maintained for some hiried persons through BDC - Call Transaction Method.
    Except Holder update eveything is updated in the hrp1001.
    When we hire a perosn through PA40, then its automatically maintaining Holder ( A008 ) in HRP1001. But for the same case through BDC program with Call Transaction method, its not maintaining Holder.
    What can be reason behind not updating holder in HRP1001. How we can maintain Holder in this case.
    Thanks
    Rav
    Edited by: Rav Jordan on Jan 10, 2012 8:03 AM

    Hi Keshav,
    Thanks for your response.
    After running
       CALL TRANSACTION 'PA40' USING BDCDATA
                               MODE CTUMODE " 'A'
                             UPDATE 'A'
                           MESSAGES INTO MESSTAB.
    if sy-subrc eq '0'.
    i am selecting perner created from pa0002.
    now to update holder i am using fucntion module.
         WA_HOLD-AEDTM = SY-DATUM.
          WA_HOLD-UNAME = SY-UNAME.
          WA_HOLD-OBJID = P_PLANS.
          WA_HOLD-BEGDA = DT.
          WA_HOLD-ENDDA = '99991231'.
          WA_HOLD-OTYPE = 'S'.
          WA_HOLD-PLVAR = '01'.
          WA_HOLD-RSIGN = 'A'.
          WA_HOLD-RELAT = '008'.
          WA_HOLD-SCLAS = 'P'.
          WA_HOLD-SOBID = GD_PERNR.
          CALL FUNCTION 'RH_INSERT_INFTY'
            EXPORTING
             FCODE                     = 'INSE'
             VTASK                     =  'A'
      ORDER_FLG                 = 'X'
      COMMIT_FLG                = 'X'
      AUTHY                     = 'X'
      PPPAR_IMP                 =
      OLD_TABNR                 = ' '
      REPID                     = ' '
      FORM                      = ' '
      KEEP_LUPD                 =
      WORKF_ACTV                = 'X'
            TABLES
              INNNN                     = WA_HOLD
      ILFCODE                   =
    EXCEPTIONS
      NO_AUTHORIZATION          = 1
      ERROR_DURING_INSERT       = 2
      REPID_FORM_INITIAL        = 3
      CORR_EXIT                 = 4
      BEGDA_GREATER_ENDDA       = 5
      OTHERS                    = 6
          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.
    This also not updating holder in the hrp1001 postion in the table.
    May i know where to do change in the code so that holder can be maintained.
    Thanks
    Rav

  • Writing a Batch Input or Call Transaction program for transaction code MMAM

    Hi All,
    I'm writing a Batch Input or Call Transaction program for transaction code MMAM (Changing Material Type). The program was able to run but somehow I was not able to capture the log of the output after running MMAM. The log was not part of the SY-MESSAGE so adding in MESSTAB into call transaction doesn't help while BDC session logs shows only the transaction was processed.
    Anyone has encounter such problems before?
    Regards,
    Ramu.

    Hi
    Overview of Batch Input Session
    The first batch input method is to create a batch input session. It is the processing of this batch input session that updates the database, not the execution of the batch input program. i am giving you example for Change Vendor you practice for ur tcode
    For our example, we will use the “Change Vendor” transaction (“FK02”) to add a street address to an already existing vendor.
    Step #1
    Use “System&#61664;Status” menu path to determine online program name (SAPMF02K), screen number (0110)
    Step #2
    Use “F1” key and “Technical Info” pushbutton in each screen field to be filled to determine the field name.
    Step #3
    Determine how to proceed in the transaction
    (save the record by clicking on the ‘Save’ pushbutton or pressing the ‘F11’ key).
    The process flow of CALL TRANSACTION
    A program that uses CALL TRANSACTION USING to process legacy data should execute thefollowing steps:
    Prepare a BDCDATA structure for the transaction that you wish to run.
    Prepare a internal table to store error messages Tab_Mess like structure of BDCMSGCOLL.
    With a CALL TRANSACTION USING statement, call the transaction and prepare the BDCDATA structure. For example:
    CALL TRANSACTION ‘MM01' USING BDCDATA MODE 'A' UPDATE 'S'. MESSAGES INTO TAB_MESS.
    IF SY-SUBRC <> 0.
    <Error_handling>.
    ENDIF.
    Overview of Batch Input Session
    The first batch input method is to create a batch input session. It is the processing of this batch input session that updates the database, not the execution of the batch input program

  • Error While Uploading Material Master Through Bdc Call Transaction

    Hi Sap Gurus,
    I am doing Bdc call Transaction for Material Master Uploading.
    But After Entering data for 4-5 screen i got a error_
    Field Mara-iprkz doesn,t exit in the screen saplmgmm 4000
    Field Mara-prctr doesn,t exit in the screen saplmgmm 4000
    Field Mbew-stprs doesn,t exit in the screen saplmgmm 4000
    Field Marc-mtvfe doesn,t exit in the screen saplmgmm 4000
    Enter Valuation class.
    This is my Programme....................................
    <removed by moderator>
    Thanks in advance.
    Arindam
    Moderator message: please post only relevant code parts, your post must be less than 5000 characters to preserve formatting.
    Edited by: Thomas Zloch on Apr 16, 2011 9:29 PM

    Sorry for my obvious answer, but you should ask a more precise question.
    Your errors are that you try to enter fields but they don't exist, so it sounds logic.
    And the error "Enter Valuation class." means that the field is mandatory. So you must enter it.
    Re-record the transaction using SHDB (eventually play with the http://wiki.sdn.sap.com/wiki/display/ABAP/Recordduringplay), run it in A display mode, and correct your program.
    Sandra
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'MVKE-SKTOF'
                                  'X'.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'MARC-PRCTR'
                                  wa_mara-prctr."'MUMBAI'.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'MARA-IPRKZ'
                                  'D'.

  • BDC call transaction

    Hi All,
      Help needed. Im facing a problem in BDC call transaction. Im calling a z screen ie i have developed a modulepool prog. In this I have given a zscreen.
    Now by using a call transasction method im calling this screen ie the zscreen and i  want to update a z table through a flat file.
    the system is able to read the flat file and then im able to read it in my internal table. after this im transfering this internal table content in the BDCtable it is even taking it up but then when im calling the command:
    CALL TRANSACTION 'YVTRANS' USING jtab MODE 'A' UPDATE 'S' MESSAGES INTO ktab.
    It takes me to the screen connected by the ztcode yvtrans. but no data is coming in the screen . and then vn im inserting the content but nothing happens wat could be the probable error.
    This is my code:
    *& Report  ZBDCCALLTXN1
    REPORT  zbdccalltxn1.
    *& Report  ZBDCCALLTXN
    *REPORT  zbdccalltxn.
    PREDEFINED TABLES ***
    TABLES:zemp.
    INTERNAL TABLE TO UPLOAD FLAT FILE ***
    DATA:BEGIN OF itab OCCURS 0,
         empno LIKE zemp-empno,
         name LIKE zemp-empname,
         deptno LIKE zemp-deptid,
         deptname LIKE zemp-deptname,
         END OF itab.
    INTERNAL TABLE FOR MAPPING USING BDCDATA ***
    DATA:BEGIN OF jtab OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA:END OF jtab.
    INTERNAL TABLE FOR ERROR CAPTURING USING BDCMSGCOLL ***
    DATA:BEGIN OF ktab OCCURS 0.
            INCLUDE STRUCTURE bdcmsgcoll.
    DATA:END OF ktab.
    FUNCTION MODULE TO UPLAOD FLAT FILE ***
    CALL FUNCTION 'UPLOAD'
      EXPORTING
        filename                      = 'C:\Documents and Settings\mad13363\Desktop\file.txt'
       filetype                      = 'ASC'
                       HAS_FIELD_SEPARATOR           = ' '
                       HEADER_LENGTH                 = 0
                       READ_BY_LINE                  = 'X'
                       DAT_MODE                      = ' '
                       CODEPAGE                      = ' '
                       IGNORE_CERR                   = ABAP_TRUE
                       REPLACEMENT                   = '#'
                       CHECK_BOM                     = ' '
                       VIRUS_SCAN_PROFILE            =
                     IMPORTING
                       FILELENGTH                    =
                       HEADER                        =
      TABLES
        data_tab                      = itab
    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.
    READ DATA FROM ITAB ***
    LOOP AT itab.
      REFRESH jtab.
      PERFORM sub USING 'YVTRANS' '0100'.
    TRANSFER THE DATA FROM INTERNAL TABLE TO APLLICATION ***
      PERFORM sub1.
    TO SAVE THE RECORDS IN DB SERVER ***
    PERFORM sub1 USING 'BDC_OKCODE' 'INSERT'.
    LOGIC TO PROVIDE VALIDATIONS USING BDCDATA, DISPLAY MODE, BDCMSGCOLL ***
      CALL TRANSACTION 'YVTRANS' USING jtab MODE 'A' UPDATE 'S' MESSAGES INTO ktab.
    LOGIC REQUIRED FOR LOG FILE ***
      LOOP AT ktab.
        IF ktab-msgtyp = 'I' OR
            ktab-msgnr = 000.
          WRITE:/1 'VENDOR', 15 itab-empno, 30 'INSERTED'.
        ELSEIF ktab-msgtyp = 'E' OR
                  ktab-msgnr = '001'.
          WRITE:/1 'VENDOR', 15 itab-empno, 30 'NOT INSERTED'.
        ENDIF.
      ENDLOOP.
      REFRESH ktab.
    ENDLOOP.
    FROM TO PASS  PRG NAME, SCREEN NUMBER AND FIRST SCREEN ***
    FORM sub USING a b.
      CLEAR jtab.          " CLEAR REFRESHES WORK AREA
      jtab-program = a.
      jtab-dynpro = b.
      jtab-dynbegin = 'X'.
      APPEND jtab.
    ENDFORM.                    "SUB
    FROM TO PASS FEILD NAME AND FIELD VALUE ***
    FORM sub1.
      CLEAR jtab.
      jtab-fnam = 'zemp-EMPNO'.
      jtab-fval = itab-empno.
      jtab-program = 'YVTRANS'.
      jtab-dynpro = '0100'.
      APPEND jtab.CLEAR jtab.
    *Passing screen information to BDCDATA
      jtab-fnam = 'ZEMP-EMPNAME'.
      jtab-fval = itab-name.
      jtab-program = 'YVTRANS'.
      jtab-dynpro = '0100'.
      APPEND jtab.CLEAR jtab.
      jtab-fnam = 'ZEMP-DEPTID'.
      jtab-fval = itab-deptno.
      jtab-program = 'YVTRANS'.
      jtab-dynpro = '0100'.
      APPEND jtab.CLEAR jtab.
      jtab-fnam = 'ZEMP-DEPTNAME'.
      jtab-fval = itab-deptname.
      jtab-program = 'YVTRANS'.
      jtab-dynpro = '0100'.
      APPEND jtab.CLEAR jtab.
    *Passing BDC_OKCODE to BDCDATA
      jtab-fnam = 'BDC_OKCODE'.
      jtab-fval = 'INSERT'.
      APPEND jtab.CLEAR jtab.
    ENDFORM.                                                    "sub1
    reward for all useful ans

    Hi madhvi,
                       You are using jtab within the form.. i dont think you can use it directly inside ur FORM sub1 without declaring it or without passing it. and it will give you the syntax error.
    and please send me the step by step code you have written in editor so that i can check it and can reply you with proper solution'
    Thanks ,
    Prasanna

  • How to set the File Path to run a javascript using Plugin Code?

    Hi All,
    Im new to Indesign Plugin Development.Can any one help me out with my problem.
    What i want to do is to run a javascript using Plugin Code.When i went through this forum i was able to find out that i should use the IscriptRunner Class to automate this.I could also figure out that the Member Function to use is "CanHandleFile" &"RunFile".
    The first parameter in CanHandleFile & RunFile Member Function is to specify the path of the JavaScript File i suppose!I could also find out that IDFile has to used to set the file path Information.
    But im clueless how to set the Javascript FilePath using IDFile.Can any one help me how to do this?Any Code Snippets Please?
    Waiting for reply.
    Thanks
    myRiaz

    Hi,  Andreas<br /><br />  Can you explain this in detail? I found it in your post before.<br /><br />  The content of elements are returned through the Characters callback function:<br /><br />From ISaxContentHandler.h:<br /><br />/**<br />        Receives character data<br /><br />The parser will call this method to report each chunk of<br />        character data. SAX parsers may return all contiguous<br />        character data in a single chunk, or they may split it into<br />        several chunks. But all characters in any single<br />        event must come from the same external entity so the<br />        Locator provides useful information.<br /><br />Note some parsers will report whitespace using the<br />        IgnorableWhitespace() method rather than this one (validating<br />        parsers must do so).<br /><br />@param Chars The characters from the XML document.<br />        */<br />virtual void Characters(const PMString& chars) = 0; <br /><br />  What i have done is implement my own SAXContentHandlerServiceBoss, and in my file XXXSAXContentHandler.cpp, I override the fonctions StartElement, EndElement, and Characters() like below: I add the PMString xmlData to collect the file content:<br /><br />class XXXSAXContentHandler : public CSAXContentHandler<br />{<br />void XXXSAXContentHandler::Characters(const WideString& chars)<br />{<br />xmlData.Append(chars);<br />}<br /><br />void XXXSAXContentHandler::StartElement(const WideString& uri, const WideString& localname, const WideString& qname, ISAXAttributes* attrs)<br />{<br />xmlData.Append("<"); xmlData.Append(localname); xmlData.Append(">");<br />}<br />void XXXSAXContentHandler::EndElement(const WideString& uri, const WideString& localname, const WideString& qname)<br />{<br />xmlData.Append("</"); xmlData.Append(localname); xmlData.Append(">");<br />}<br /><br />}<br /><br />and in my program, I use the code below to call the fonction I overrided, but I dont know how I can get the String xmlData I defined in the XXXSAXContentHandler.cpp<br /><br />InterfacePtr<IK2ServiceRegistry> serviceRegistry(gSession, UseDefaultIID());<br /><br />InterfacePtr<IK2ServiceProvider> xmlProvider(serviceRegistry->QueryServiceProviderByClassID(kXMLParserService, kXMLParserServiceBoss));<br /><br />InterfacePtr<ISAXServices> saxServices(xmlProvider, UseDefaultIID());<br />InterfacePtr<ISAXContentHandler> saxHandler(::CreateObject2<ISAXContentHandler>(kXXXSAXContentHandlerServiceBoss));<br />saxHandler->Register(saxServices);<br />bool16 parseFailed = saxServices->ParseStream(readStream, saxHandler);<br /><br />Can you give me any help?<br /><br />Thanks and regards!

Maybe you are looking for

  • Is There a Way to Run a Redo log for a Single Tablespace?

    I'm still fairly new to Oracle. I've been reading up on the architecture and I am getting the hang of it. Actually, I have 2 questions. 1) My first question is..."Is there a way to run the redo log file...but to specify something so that it only appl

  • HP Laserjet 6L not recognised under Mavericks when connected via USB

    Hi there, am desperately trying to connect my good old Laserjet 6L via USB port to my iMac that's running on Mavericks. The issue I have is that the printer does not even get recognised when unplugging / plugging the USB cable. Have tried different U

  • Cannot Logout or Reboot:  Logout Times Out

    Over the past few days I have been unable to reboot or log out in a "normal" fashion. Every time I try it quits all the apps, then sits for a minute, then informs me that logout timed out, because the application (fill in the blank) could not be quit

  • 10.7.4 has killed my SMB Shares

    I updated a server to 10.7.4 this weekend based on the release notes: - Address an issue that may prevent files from being saved to an SMB server. Instead, now my Windows users can't connect at all. I've manually restarted the SMB service - sudo laun

  • Can't Connect EAS

    Before I log a support case, has anyone else come across this ??????I can retrieve data fine from my cubes, but when I try to log onto EAS (version 7.1 btw), I get the message "could not connect to Administration Server telesto".Keep in mind we have