BDC not working in MODE "N"

Hi All,
I have written a BDC for F-37, which is working fine in all screen mode
but not working in "N" mode..
P.S. I have BDC as the only option.
Thanks in advance,
Kalyan Venigalla.

If you look at the documentation of CALL TRANSACTION you can pass BDC options which is of type CTU_PARAMS. In this assign 'X' to field 'RACOMMIT' and try to run the BDC in 'N' mode.
DATA: OPT TYPE CTU_PARAMS.
OPT-DISMODE = 'N'.
OPT-UPMODE = 'L'.
OPT-RACOMMIT = 'X'.
CALL TRANSACTION 'F-37' USING BDC_TAB OPTIONS FROM OPT MESSAGES INTO MESSTAB.
Thanks and regards,
S. Chandramouli.

Similar Messages

  • BDC - not working in 'No Display' mode

    Hi Friends,
    I have written a BDC for TCode O3URV_SS0.I have used CALL TRANSACTION for that.For capturing messages I have used application log.
    In 'N' mode this BDC is not performing properly.For a new set of line item and  a header data it should save that  records and generate a document number.But in 'N' mode the BDC is working for 1st line item only.
    This BDC is working fine in 'A' mode.
    Please help me to solve this problem.

    Moderator message - Welcome to SCN
    But please search before asking - post locked
    Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
    Rob

  • BDC not working in display no screen mode

    Hi exparts,
    I am facing a strange problem. I am creating or changing PIR ( transaction ME11, ME12) through BDC.
    when i am running it in 'Display all screen mode' It is running fine and creating or changing the PIR.
    But, when i am running it in 'Display no screen mode' It is not working. I have used call transaction of BDC and its OPTIONS parameter to export mode and default sixe. In the both cases the return message carry only success message.
    Please advice where i am going wrong and how to run it in 'display no screen' mode.
    Thanks in advance.
    Regards,
    abhshek sarkar

    DId you try  OPT-RACOMMIT = 'X' ?
    DATA: P_OPT TYPE CTU_PARAMS.
                P_OPT-DISMODE = 'N'.
               P_OPT-UPMODE = 'L'.
               P_OPT-RACOMMIT = 'X'.
    CALL TRANSACTION tcode  USING BDC_TAB OPTIONS FROM P_OPT MESSAGES INTO MESSTAB.

  • BDC Not working in Background ?

    Hi ,
       we are having one RFC in which we have wriiten a BDC for Customer Mater creation. But this BDC is giving some problem with some screen when it has encountered Duplicate Address. We have taken a proper care in BDC with even this duplicate address recording. This even work fine when it is run in foreground.
    It is only giving problem when this RFC is been called from Other Application.
    Pl. help...
    Regards,
    Umesh

    hI,
           Many SAP transactions behave differently in online mode and in Batch mode and this mode is determined by the SY-BINPT variable that can be controlled using the OPTIONS command in addition to the CALL TRANSACTION.
    For example, the error message that usually comes in status bar while you are running the transaction online might appear in a popup window when you are running that in batch. This will make your fields disabled for input. This OPTIONS addition will remove this problem
    The way to use the OPTIONS addition.
    Declare a work area of type CTU_PARAMS.
    Fill the fields of CTU_PARAMS. The field NOBINPT should be set to ‘X’.
    This will set the SY-BINPT to space. So now the transaction which you will be calling will run in online mode.
    Example.
    clear X_OPTIONS.
    X_OPTIONS-DISMODE = 'E'.
    X_OPTIONS-UPDMODE = 'S'.
    X_OPTIONS-CATTMODE = ' '.
    X_OPTIONS-DEFSIZE = ' '.
    X_OPTIONS-RACOMMIT = ' '.
    X_OPTIONS-NOBINPT = 'X'.
    X_OPTIONS-NOBIEND = ' '.
    call transaction 'BP' using T_BDCDATA[] options from X_OPTIONS.
    Note:
    Do not use the MODE & UPDATE additions when you are using OPTIONS. The mode & update values are passed in the CTU_PARAMS structure.
    <b>Reward points</b>
    Regards

  • Bdc not working with workflow

    Hallo,
    I have an issue with a bdc FM i created not working with workflow.
    If I test the FM, it works ok.
    If i Test the method calling the FM it works ok.
    if i test the task calling the method it works ok.
    If I run the workflow it doesn't work, and i get the following messages:
    S     DC     1     Unable to initialise ABAP Control Framework ...             
    S     DC     1     Unable to initialise ABAP Control Framework ...          
    S     DC     6     Control Framework: Fatal error - GUI cannot be reached     
    A     SY     2     Exception condition "CNTL_ERROR" raised.
    What is the meaning of this??     
    Bdc is calling Me54n to set to click on reject button during Purchase Requisition Release,
    putting the PR processing state in status '08'
    I checked all the binding which are fine. No container parameter are passed a part from the business object.
    here is the FM coding:
    FUNCTION ZME_N_WF_REJ_PR.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(CTU) LIKE  APQI-PUTACTIVE DEFAULT 'X'
    *"     VALUE(MODE) LIKE  APQI-PUTACTIVE DEFAULT 'N'
    *"     VALUE(UPDATE) LIKE  APQI-PUTACTIVE DEFAULT 'L'
    *"     VALUE(GROUP) LIKE  APQI-GROUPID OPTIONAL
    *"     VALUE(USER) LIKE  APQI-USERID OPTIONAL
    *"     VALUE(KEEP) LIKE  APQI-QERASE OPTIONAL
    *"     VALUE(HOLDDATE) LIKE  APQI-STARTDATE OPTIONAL
    *"     VALUE(NODATA) LIKE  APQI-PUTACTIVE DEFAULT '/'
    *"     VALUE(BANFN_003) LIKE  BDCDATA-FVAL
    *"  EXPORTING
    *"     VALUE(SUBRC) LIKE  SYST-SUBRC
    *"  TABLES
    *"      MESSTAB STRUCTURE  BDCMSGCOLL OPTIONAL
    subrc = 0.
    perform bdc_nodata      using NODATA.
    perform open_group      using GROUP USER KEEP HOLDDATE CTU.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MECHOB'.
    *perform bdc_field       using 'DYN_6000-LIST'
                                 LIST_001.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MEREQ3328-AFNAM'.
    *perform bdc_field       using 'MEREQ3328-EKGRP'
                                 EKGRP_002.
    perform bdc_dynpro      using 'SAPLMEGUI' '0002'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MEOK'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MEPO_SELECT-BANFN'.
    perform bdc_field       using 'MEPO_SELECT-BANFN'
                                  BANFN_003.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MEREJECT'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'DYN_6000-LIST'.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MESAVE'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'DYN_6000-LIST'.
    perform bdc_transaction tables messtab
    using                         'ME54N'
                                  CTU
                                  MODE
                                  UPDATE.
    if sy-subrc <> 0.
      subrc = sy-subrc.
      exit.
    endif.
    perform close_group using     CTU.
    ENDFUNCTION.
    INCLUDE BDCRECXY .
    I tries the same approach on ML81N to block a service entry sheet.(pressing the lock icon),
    I get exactly the same issue.
    Anybody knows how to resolve?
    Or how to do the same without using a bdc call?
    regards,
    marco

    Hi
    this is the Method callind the FM
    object is BUS2105 w delegation ZBUS2105.
    BEGIN_METHOD ZRELEASEREJECTED CHANGING CONTAINER.
    Data: CTU TYPE APQI-PUTACTIVE,      
          MODE TYPE APQI-PUTACTIVE,     
          UPDATE TYPE APQI-PUTACTIVE,
         NODATA TYPE APQI-PUTACTIVE.  
    CTU = 'X'.               
    MODE = 'N'.                
    UPDATE = 'L'.              
    NODATA = '/'.              
    iobjectkey = object-key.
       CALL FUNCTION 'ZME_N_WF_REJ_PR'             
         EXPORTING                                 
           BANFN_003 = iobjectkey                  
           NODATA = NODATA                                            
           UPDATE = UPDATE                         
           MODE = MODE                             
           CTU = CTU                               
         IMPORTING                                 
           SUBRC = SUBRC                           
         TABLES                                    
           MESSTAB = MESSAGE                       
         EXCEPTIONS                                
           OTHERS = 01.                            
       CASE SY-SUBRC.                              
         WHEN 0.            " OK                   
         WHEN OTHERS.       " to be implemented    
       ENDCASE.                                    
    SWC_SET_ELEMENT CONTAINER 'Subrc' SUBRC.                   
    SWC_SET_TABLE CONTAINER 'MESSAGE' MESSAGE.                                                                               
    END_METHOD.

  • Bdc not working with workflow - background task

    Hallo,
    I have an issue with a bdc FM i created not working with workflow.
    If I test the FM, it works ok.
    If i Test the method calling the FM it works ok.
    if i test the task calling the method it works ok.
    If I run the workflow it doesn't work, and i get the following messages:
    S DC 1 Unable to initialise ABAP Control Framework ...
    S DC 1 Unable to initialise ABAP Control Framework ...
    S DC 6 Control Framework: Fatal error - GUI cannot be reached
    A SY 2 Exception condition "CNTL_ERROR" raised.
    What is the meaning of this??
    Bdc is calling Me54n to set to click on reject button during Purchase Requisition Release,
    putting the PR processing state in status '08'
    I checked all the binding which are fine. No container parameter are passed a part from the business object.
    here is the FM coding:
    FUNCTION ZME_N_WF_REJ_PR.
    ""Local interface:
    *" IMPORTING
    *" VALUE(CTU) LIKE APQI-PUTACTIVE DEFAULT 'X'
    *" VALUE(MODE) LIKE APQI-PUTACTIVE DEFAULT 'N'
    *" VALUE(UPDATE) LIKE APQI-PUTACTIVE DEFAULT 'L'
    *" VALUE(GROUP) LIKE APQI-GROUPID OPTIONAL
    *" VALUE(USER) LIKE APQI-USERID OPTIONAL
    *" VALUE(KEEP) LIKE APQI-QERASE OPTIONAL
    *" VALUE(HOLDDATE) LIKE APQI-STARTDATE OPTIONAL
    *" VALUE(NODATA) LIKE APQI-PUTACTIVE DEFAULT '/'
    *" VALUE(BANFN_003) LIKE BDCDATA-FVAL
    *" EXPORTING
    *" VALUE(SUBRC) LIKE SYST-SUBRC
    *" TABLES
    *" MESSTAB STRUCTURE BDCMSGCOLL OPTIONAL
    subrc = 0.
    perform bdc_nodata using NODATA.
    perform open_group using GROUP USER KEEP HOLDDATE CTU.
    perform bdc_dynpro using 'SAPLMEGUI' '0014'.
    perform bdc_field using 'BDC_OKCODE'
    '=MECHOB'.
    *perform bdc_field using 'DYN_6000-LIST'
    LIST_001.
    perform bdc_field using 'BDC_CURSOR'
    'MEREQ3328-AFNAM'.
    *perform bdc_field using 'MEREQ3328-EKGRP'
    EKGRP_002.
    perform bdc_dynpro using 'SAPLMEGUI' '0002'.
    perform bdc_field using 'BDC_OKCODE'
    '=MEOK'.
    perform bdc_field using 'BDC_CURSOR'
    'MEPO_SELECT-BANFN'.
    perform bdc_field using 'MEPO_SELECT-BANFN'
    BANFN_003.
    perform bdc_dynpro using 'SAPLMEGUI' '0014'.
    perform bdc_field using 'BDC_OKCODE'
    '=MEREJECT'.
    perform bdc_field using 'BDC_CURSOR'
    'DYN_6000-LIST'.
    perform bdc_dynpro using 'SAPLMEGUI' '0014'.
    perform bdc_field using 'BDC_OKCODE'
    '=MESAVE'.
    perform bdc_field using 'BDC_CURSOR'
    'DYN_6000-LIST'.
    perform bdc_transaction tables messtab
    using 'ME54N'
    CTU
    MODE
    UPDATE.
    if sy-subrc 0.
    subrc = sy-subrc.
    exit.
    endif.
    perform close_group using CTU.
    ENDFUNCTION.
    INCLUDE BDCRECXY .
    I tries the same approach on ML81N to block a service entry sheet.(pressing the lock icon),
    I get exactly the same issue.
    Anybody knows how to resolve?
    Or how to do the same without using a bdc call?
    regards,
    marco

    Hallo,
    I have an issue with a bdc FM i created not working with workflow.
    If I test the FM, it works ok.
    If i Test the method calling the FM it works ok.
    if i test the task calling the method it works ok.
    If I run the workflow it doesn't work, and i get the following messages:
    S DC 1 Unable to initialise ABAP Control Framework ...
    S DC 1 Unable to initialise ABAP Control Framework ...
    S DC 6 Control Framework: Fatal error - GUI cannot be reached
    A SY 2 Exception condition "CNTL_ERROR" raised.
    What is the meaning of this??
    Bdc is calling Me54n to set to click on reject button during Purchase Requisition Release,
    putting the PR processing state in status '08'
    I checked all the binding which are fine. No container parameter are passed a part from the business object.
    here is the FM coding:
    FUNCTION ZME_N_WF_REJ_PR.
    ""Local interface:
    *" IMPORTING
    *" VALUE(CTU) LIKE APQI-PUTACTIVE DEFAULT 'X'
    *" VALUE(MODE) LIKE APQI-PUTACTIVE DEFAULT 'N'
    *" VALUE(UPDATE) LIKE APQI-PUTACTIVE DEFAULT 'L'
    *" VALUE(GROUP) LIKE APQI-GROUPID OPTIONAL
    *" VALUE(USER) LIKE APQI-USERID OPTIONAL
    *" VALUE(KEEP) LIKE APQI-QERASE OPTIONAL
    *" VALUE(HOLDDATE) LIKE APQI-STARTDATE OPTIONAL
    *" VALUE(NODATA) LIKE APQI-PUTACTIVE DEFAULT '/'
    *" VALUE(BANFN_003) LIKE BDCDATA-FVAL
    *" EXPORTING
    *" VALUE(SUBRC) LIKE SYST-SUBRC
    *" TABLES
    *" MESSTAB STRUCTURE BDCMSGCOLL OPTIONAL
    subrc = 0.
    perform bdc_nodata using NODATA.
    perform open_group using GROUP USER KEEP HOLDDATE CTU.
    perform bdc_dynpro using 'SAPLMEGUI' '0014'.
    perform bdc_field using 'BDC_OKCODE'
    '=MECHOB'.
    *perform bdc_field using 'DYN_6000-LIST'
    LIST_001.
    perform bdc_field using 'BDC_CURSOR'
    'MEREQ3328-AFNAM'.
    *perform bdc_field using 'MEREQ3328-EKGRP'
    EKGRP_002.
    perform bdc_dynpro using 'SAPLMEGUI' '0002'.
    perform bdc_field using 'BDC_OKCODE'
    '=MEOK'.
    perform bdc_field using 'BDC_CURSOR'
    'MEPO_SELECT-BANFN'.
    perform bdc_field using 'MEPO_SELECT-BANFN'
    BANFN_003.
    perform bdc_dynpro using 'SAPLMEGUI' '0014'.
    perform bdc_field using 'BDC_OKCODE'
    '=MEREJECT'.
    perform bdc_field using 'BDC_CURSOR'
    'DYN_6000-LIST'.
    perform bdc_dynpro using 'SAPLMEGUI' '0014'.
    perform bdc_field using 'BDC_OKCODE'
    '=MESAVE'.
    perform bdc_field using 'BDC_CURSOR'
    'DYN_6000-LIST'.
    perform bdc_transaction tables messtab
    using 'ME54N'
    CTU
    MODE
    UPDATE.
    if sy-subrc 0.
    subrc = sy-subrc.
    exit.
    endif.
    perform close_group using CTU.
    ENDFUNCTION.
    INCLUDE BDCRECXY .
    I tries the same approach on ML81N to block a service entry sheet.(pressing the lock icon),
    I get exactly the same issue.
    Anybody knows how to resolve?
    Or how to do the same without using a bdc call?
    regards,
    marco

  • BDC not working for CATS_APPR_LITE

    Hi,
    Requirement: Auto-approval of time records for all employees (which are Released for Approval, status = 20)
    We tried to create a BDC program for transaction code CATS_APPR_LITE, it works for one time record. but when there are several time records (select all option is not there), the BDC is not working.
    Any idea / help.

    Simon,
    Requirement: Time record for reduced times should be approved by supervisor. we are using TS31000007 & BADI_CATS_APPROVAL to do this. this is working fine.
    But the requirement is to auto approve all time records (which are currently in approval with supervisor) on last day of the month. we want to use a batch job to do this.
    We tried using a BDC for CATS_APPR_LITE, but for several time records for several employees, the BDC is not working.
    Please advise.

  • MIR4- Invoice posting BDC not working in background

    Hi All,
    We have a requirement to create a BDC for posting an invoice and have created one. BDC is working in foreground and invoice is getting posted. But when we try to execute the BDC in background it is failing and invoice is not getting posted.
    Please help.
    Below is the dump in ST22.
    Category               ABAP Programming Error
    Runtime Errors         RAISE_EXCEPTION
    ABAP Program           SAPLMR1M
    Application Component  MM-IV
    A RAISE statement in the program "CL_GUI_DOCKING_CONTAINER======CP" raised the
      exception
    condition "CNTL_ERROR".
    Since the exception was not intercepted by a superior
    program, processing was terminated.
    Source code where the program terminated:
    CALL METHOD DOCK_AT_internal
         EXPORTING
             SIDE   = SIDE
             notify = space
         EXCEPTIONS
             CNTL_SYSTEM_ERROR = 1
             CNTL_ERROR = 2.
    CASE SY-SUBRC.
       WHEN 0.
       WHEN 1.
         RAISE CNTL_SYSTEM_ERROR.
       WHEN 2.
       >>>>  RAISE CNTL_ERROR.
       WHEN OTHERS.
         RAISE CNTL_ERROR.
    ENDCASE.

    When I tried checking, I understood that MIR4 transaction screen 6000 has docking container and when a screen has docking container the BDC fails in background. Any workaround other than BAPI for invoice posting as it is not of help in our requirement scenario as we have already checked.

  • BDC not working inside  the Workflow

    Hi,
    I created a BDC program and include it in the workflow as back ground task it not working .
    In the Business Object there it working fine. When I change it to foreground task in the workflow it working.
    If I declare as a  back ground it not working .
    Can you please tell me why this happening.
    Regards,
    Surjith

    Dear Sanjay,
    use BAPI "BAPI_MATERIAL_MAINTAINDATA_RT" or "MATERIAL_UPDATE_ALL_RETAIL" to manage Retail material.
    Gianluca

  • BDC not working in GB01

    Hi All,
    I have written a BDC program to upload data by GB01 tcode. In GB01 we have around 15 fields in my program after filling the first 8 fields i am using :  FLD 'BDC_OKCODE'    'DOWN' but, it is not working please see the below code. first 8 fields are overwritten by other one. How do i control this one.
      SCR 'SAPMGBUK' '0110'.
      FLD 'GLU1-TSL'      REC-AMOUNT.
      FLD 'RGBUK-O_V01'   REC-ACCOUNT.
      FLD 'RGBUK-O_V02'   REC-CONSACCT.
      FLD 'RGBUK-O_V03'   REC-DOCTYPE.
      FLD 'RGBUK-O_V04'   REC-LEDGERTYPE.
      FLD 'RGBUK-O_V05'   REC-RZZAFFILIATED.
      FLD 'RGBUK-O_V06'   REC-RZZAUTHORIZED.
      FLD 'RGBUK-O_V07'   REC-PROFITCENTER.
      FLD 'RGBUK-O_V08'   REC-RZZREINBASIS.
      FLD 'BDC_OKCODE'    'DOWN'.
      FLD 'RGBUK-O_V02'   REC-RZZRPTGREIND.
      FLD 'RGBUK-O_V03'   REC-LOB.
      FLD 'RGBUK-O_V04'   REC-RZZTRTYNO2.
      FLD 'RGBUK-O_V05'   REC-ZZCEDCO.
    FLD 'RGBUK-O_V06'   REC-LOB.
      FLD 'RGBUK-O_V07'   REC-ZZREFSYSID.
      FLD 'RGBUK-O_V08'   REC-ZZREIND.
      FLD 'GLU1-SGTXT'    HEADTEXT.
      FLD 'BDC_OKCODE'    'NEW'.

    I have just written a GB01 BDC as well and got the page down section to work with this code:
    It looks like you just need to change 'DOWN' to '=DOWN'.
    ---hope it works for you.
        PERFORM bdc_dynpro      USING 'SAPMGBUK' '0110'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=DOWN'.         "second
        PERFORM bdc_field       USING 'RGBUK-O_V01'
                                       it_input-prod_cat.    "Prod Catg
        PERFORM bdc_field       USING 'RGBUK-O_V02'
                                       it_input-cost_ctr.   "Cost Centre
        PERFORM bdc_field       USING 'RGBUK-O_V03'
                                       it_input-prod_des.   "Prod.Orig.Design.Ctr
        PERFORM bdc_field       USING 'RGBUK-O_V04'
        PERFORM bdc_field       USING 'RGBUK-O_V05'
                                       it_input-label.        . "Label
        PERFORM bdc_field       USING 'RGBUK-O_V06'
                                       it_input-exp.          "Expense
        PERFORM bdc_field       USING 'RGBUK-O_V08'
                                       it_input-material.     "Material
        PERFORM bdc_dynpro      USING 'SAPMGBUK' '0110'.
        IF wa_last IS INITIAL .
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=DOWN'.        "third
        ELSE.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BOOK'.
        ENDIF.
    ---then you can reuse the same RGBUK-O_V fields

  • MIGO BDC not working

    I have created one RFC Function in that i have called the MIGO BDC.
    When i execute the RFC in SAP with the parametres the MIGO BDC works perfectly.
    But when i call the RFC through Legacy System with the same data it is not working.
    Can you pls. let me know if something has to be done, so that the BDC will also works from Legacy?

    go for mb01 instead of migo.
    or else.
    check the last two posts in this source
    Re: Reg: Item ok check box in MIGO

  • New shuffle will not work usb mode in car

    new shuffle has USB plug as does my Sony car stereo but does not work. Stereo comes up with not supported. Works with auxillary cable.

    new shuffle has USB plug as does my Sony car stereo but does not work. Stereo comes up with not supported. Works with auxillary cable.

  • BDC not working in Background mode

    Hi All,
    I have created a BDC. It is working fine in forground mode but not woking in background mode. Please any one know what could be the problem.
    thanks,
    Shweta

    Hi,
    I think there is some field in your screen is disabled for input. As it will not through you error.
    Please run you BDC in foreground mode and check it and see if you get any message. it will be a sucess message.
    this thing happend to me also as my ship to party was disbled in one of screen of VA02.
    thanks,
    Sarbpreet

  • BDC not working in NO screen mode

    Hi All,
    We have a BDC in which we need to enter a multiple selection for a document field.
    For this we are using the table control concept.
    However, how do we fill in more than 8  single selections  (the number of input rows available on the screen)?
    We have tried to use the ok code "LINS" that inserts a line at a time. This is working perfectly in ALL screen mode.
    However, in NO screen mode what we observed is that the values get overwritten and only 1 document is eventually selected.
    Thanks & Regards,
    Sana.

    Hi,
    plz have a look at the below code...
    FORM bdc_data .
    Work area for data record.
      DATA : lwa_header1 TYPE t_header.
    Declaration of local variable.
      DATA : lv_index TYPE sytabix.
      IF NOT i_header[] IS INITIAL.
        v_item_cntr = 1.
        v_cond_cntr = 2.
        v_scale_cntr = 1.
        v_cong_flg = 2.
        LOOP AT i_header INTO wa_header.
          lv_index = sy-tabix + 1.
          CASE wa_header-rec_type.
            WHEN c_h.
    -- For header of contracts--
              PERFORM header_data_upload USING wa_header.
    --For items of contarcts--
            WHEN  c_i.
    If the number of lines in the line item screen exceeds
    14 then we need to use the newpage okcode for adding
    new line items
              IF v_item_cntr GE 15.
                PERFORM bdc_dynpro      USING 'SAPMM06E' '0220'.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                                      '=NP'.
                v_item_cntr = 2.
              ENDIF.
    For uploading the item data
              PERFORM item_data_upload USING wa_header.
    Read the internal table for next record
              READ TABLE i_header INTO lwa_header1 INDEX lv_index.
              IF lwa_header1-rec_type = c_h OR sy-subrc <> 0.
    if no more line items found then the data should be saved
                PERFORM bdc_dynpro      USING 'SAPMM06E' '0220'.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                                    'BU'.
    If there exists condition record for that line item
    then go to condition screen with OKCODE '=KO'
              ELSEIF lwa_header1-rec_type = c_c.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                         '=KO'.
              ENDIF.
    --for items conditions--
            WHEN c_c.
    Upload the condition data
              PERFORM conditions_data_upload USING wa_header.
    Read the internal table for next record
              READ TABLE i_header INTO lwa_header1 INDEX lv_index.
    If the next record is an item go back to item screen
              IF lwa_header1-rec_type = c_i.
                PERFORM bdc_dynpro      USING 'SAPMV13A' '0201'.
                PERFORM bdc_field  USING 'BDC_OKCODE'
                                         'BACK'.
    If the next record is header then save the data
              ELSEIF lwa_header1-rec_type = c_h OR sy-subrc <> 0.
                PERFORM bdc_dynpro      USING 'SAPMV13A' '0201'.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                        'BACK'.
                PERFORM bdc_dynpro      USING 'SAPMM06E' '0220'.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                                    'BU'.
    If there exists scale record for that condition
    then go to scale screen with OKCODE '=PSTF'
              ELSEIF lwa_header1-rec_type = c_s.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=PSTF'.
              ENDIF.
    --for items Scales--
            WHEN c_s.
    Upload the scales data
              PERFORM scales_data_upload USING wa_header.
    Read the internal table for next record
              READ TABLE i_header INTO lwa_header1 INDEX lv_index.
    If the next record is condition record then go to condition
    screen
              IF lwa_header1-rec_type = c_c .
                v_cong_flg = v_cong_flg + 1.
                v_scale_cntr = 1.
                PERFORM bdc_dynpro      USING 'SAPMV13A' '0303'.
                PERFORM bdc_field  USING 'BDC_OKCODE'
                                         'BACK'.
    If the next record is header the go back to item screen
    and save the data
              ELSEIF lwa_header1-rec_type = c_h OR sy-subrc <> 0.
                PERFORM bdc_dynpro      USING 'SAPMV13A' '0303'.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                        'BACK'.
                PERFORM bdc_dynpro      USING 'SAPMV13A' '0201'.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                        'BACK'.
                v_cond_cntr = 2.
                v_scale_cntr = 1.
                v_cong_flg = 2.
                PERFORM bdc_dynpro      USING 'SAPMM06E' '0220'.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                                    'BU'.
    If the next record is item the go back to item screen
              ELSEIF lwa_header1-rec_type = c_i.
                PERFORM bdc_dynpro      USING 'SAPMV13A' '0303'.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                        'BACK'.
                PERFORM bdc_dynpro      USING 'SAPMV13A' '0201'.
                PERFORM bdc_field       USING 'BDC_OKCODE'
                                        'BACK'.
                v_cond_cntr = 2.
                v_scale_cntr = 1.
                v_cong_flg = 2.
              ENDIF.
          ENDCASE.           "CASE wa_header-rec_type.
    If the next record is header or no next record found then
    call the transaction
          READ TABLE i_header INTO lwa_header1 INDEX lv_index.
          IF lwa_header1-rec_type = c_h OR sy-subrc NE 0.
            v_cong_flg = 2.
            v_scale_cntr = 1.
            v_item_cntr = 1.
            PERFORM call_transaction USING wa_header2 .
            CLEAR lv_index.
          ENDIF.
        ENDLOOP.               "LOOP AT i_header INTO wa_header.
      ENDIF.                   "IF NOT i_header[] IS INITIAL.
    ENDFORM.                   "bdc_data
           Start new screen                                              *
    FORM bdc_dynpro USING pv_program LIKE bdcdata-program
                          pv_dynpro LIKE bdcdata-dynpro.
      CLEAR wa_bdcdata.
      wa_bdcdata-program  = pv_program.
      wa_bdcdata-dynpro   = pv_dynpro.
      wa_bdcdata-dynbegin = c_x.
      APPEND wa_bdcdata TO i_bdcdata.
      CLEAR wa_bdcdata.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM bdc_field USING pv_fnam LIKE bdcdata-fnam
                         pv_fval TYPE any.
      CLEAR wa_bdcdata.
      wa_bdcdata-fnam = pv_fnam.
      wa_bdcdata-fval = pv_fval.
      APPEND wa_bdcdata TO i_bdcdata.
      CLEAR wa_bdcdata.
    ENDFORM.                    "BDC_FIELD
    Declaration of local constants
      CONSTANTS : lc_tcode  TYPE tstc-tcode VALUE 'ME31K',
                  lc_n      TYPE ctu_mode   VALUE 'N'.
    Declaration of local variables
      DATA: lv_msg   TYPE string,
            lv_opt   TYPE ctu_params.
      lv_opt-defsize = c_x.
      lv_opt-dismode = lc_n.
      lv_opt-updmode = c_l.
      REFRESH i_messtab.
    Call the transaction to create the Purchasing Contracts
      CALL TRANSACTION lc_tcode USING i_bdcdata
                       OPTIONS FROM lv_opt
                       MESSAGES INTO i_messtab.
      IF NOT i_messtab[] IS INITIAL.
        READ TABLE i_messtab WITH KEY msgtyp = 'E'.
        IF sy-subrc EQ 0.
          CALL FUNCTION 'FORMAT_MESSAGE'
            EXPORTING
              id   = i_messtab-msgid
              lang = sy-langu
              no   = i_messtab-msgnr
              v1   = i_messtab-msgv1
              v2   = i_messtab-msgv2
              v3   = i_messtab-msgv3
              v4   = i_messtab-msgv4
            IMPORTING
              msg  = lv_msg.
          MOVE: p_wa_header-lifnr TO wa_error-lifnr,
                p_wa_header-evart TO wa_error-evart,
                p_wa_header-vedat TO wa_error-vedat,
                p_wa_header-ekorg TO wa_error-ekorg,
                p_wa_header-ekgrp TO wa_error-ekgrp,
                p_wa_header-epstp TO wa_error-epstp,
                p_wa_header-knttp TO wa_error-knttp,
                p_wa_header-bukrs TO wa_error-bukrs,
                p_wa_header-kdatb TO wa_error-kdatb,
                p_wa_header-kdate TO wa_error-kdate,
                p_wa_header-ktwrt TO wa_error-ktwrt,
                p_wa_header-waers TO wa_error-waers,
                p_wa_header-wkurs TO wa_error-wkurs,
                p_wa_header-inco1 TO wa_error-inco1,
                p_wa_header-inco2 TO wa_error-inco2,
                p_wa_header-ihran TO wa_error-ihran,
                p_wa_header-angnr TO wa_error-angnr,
                lv_msg            TO wa_error-msg.
          APPEND wa_error TO i_error.
          CLEAR wa_error.
        ELSE.
          READ TABLE i_messtab WITH KEY msgtyp = 'S'.
          IF sy-subrc EQ 0.
            CALL FUNCTION 'FORMAT_MESSAGE'
              EXPORTING
                id   = i_messtab-msgid
                lang = sy-langu
                no   = i_messtab-msgnr
                v1   = i_messtab-msgv1
                v2   = i_messtab-msgv2
                v3   = i_messtab-msgv3
                v4   = i_messtab-msgv4
              IMPORTING
                msg  = lv_msg.
            MOVE: p_wa_header-lifnr TO wa_success-lifnr,
                  p_wa_header-evart TO wa_success-evart,
                  p_wa_header-vedat TO wa_success-vedat,
                  p_wa_header-ekorg TO wa_success-ekorg,
                  p_wa_header-ekgrp TO wa_success-ekgrp,
                  p_wa_header-epstp TO wa_success-epstp,
                  p_wa_header-knttp TO wa_success-knttp,
                  p_wa_header-bukrs TO wa_success-bukrs,
                  p_wa_header-kdatb TO wa_success-kdatb,
                  p_wa_header-kdate TO wa_success-kdate,
                  p_wa_header-ktwrt TO wa_success-ktwrt,
                  p_wa_header-waers TO wa_success-waers,
                  p_wa_header-wkurs TO wa_success-wkurs,
                  p_wa_header-inco1 TO wa_success-inco1,
                  p_wa_header-inco2 TO wa_success-inco2,
                  p_wa_header-ihran TO wa_success-ihran,
                  p_wa_header-angnr TO wa_success-angnr,
                  i_messtab-msgv2   TO wa_success-ebeln.
            APPEND wa_success TO i_success.
            CLEAR wa_success.
          ENDIF.
        ENDIF.
      ENDIF.
      REFRESH i_bdcdata.
    ENDFORM.                    " call_transaction
    Regards,
    Nagaraj

  • BDC not working in N mode due to 'S' Message but same working in 'E' & 'A'

    Hi ,
    I am using CALL Transaction method for doing a BDC of MBST Transaction ( sap-pp ) .
    When I perform the BDC for multiple items the same works in 'A' and 'E' mode but not in the 'N' mode .
    Please suggest how can I ignore system message in 'N' mode and make the bdc work in background irrespective whether the message comes or not .
    CODE USED :
        CALL TRANSACTION 'MBST' USING it_bdcdata  MODE p_mode " p_mode ( A,N,E)
             UPDATE p_mode MESSAGES INTO it_bdcmsg.

    Hi
    record your BDC for the message type S and try
    Thanks
    Shiva

Maybe you are looking for

  • Internal Webcam and Microphone not working after Screen Fix

    I own a HP Envy Spectre XT Ultrabook, and last week I tried to use the webcam and the microphone for the first time in a few months. However I was shocked to find that Skype kept saying that the webcam was not detected. The microphone also could not

  • Is there a way to open a smart object, but get the original instead of a temp file?

    Working with large amounts of images and PSD files. 1.  We create a smart object from say, a .jpg file on a layer, then filter, etc. 2.  Double clicking the smart object creates a new window with that object as a .psB file. 3.  When the file is saved

  • Convert/Import TDMS to Excel

    So I have some LabVIEW code which logs to TDMS just fine.  I installed the TDMS Excel Add on to Excell 2007 and it imports the TDMS just fine and it looks good. What I would like do do now is instead of just having that TDMS file, I would also like t

  • Problem with adapter network category reverting to public after change to private

    I noticed that after setting up HyperV Server 2012 R2, that after applying needed firewall rules to allow remote management, that these were added into the "Public" profile. So, I disabled them and enabled for Private and proceeded to change the NIC

  • Payment Grantee Procedure

    Hello In Sales Order Header.... Billing Tab there is a Payment Grantee Procedure and Financial Document Number. What is the use of these fields in Foreign Trade Data. How are these fields determined in Sales order and what is the impact of these fiel