Skip OK Code in BDC

Hi experts,
I did a BDC recording for MM03 & created a program. When i execute the program it gives me the OK Code screen & asks to press ENTER. Same happens for further screens to reach MRP1 screen.But use dont want to do that.
They want to see the MRP1 screen directly.
I am calling this BDC in my ALV report to Display the MRP1 data for a material.
Please give me some Ideas to solve this problem
Regards,
Nik

check below sample code
REPORT zsritest.
TABLES mara.
DATA: lv_bilds LIKE t133a-bilds,
ls_t130m LIKE t130m,
ls_rmmg1 LIKE rmmg1,
lwa_view TYPE mbildtab,
lwa_auswg TYPE mgauswg,
lt_views TYPE STANDARD TABLE OF mbildtab INITIAL SIZE 0,
lt_auswg TYPE STANDARD TABLE OF mgauswg INITIAL SIZE 0.
PARAMETERS: p_matnr LIKE mara-matnr,
p_werks LIKE marc-werks,
p_dytxt LIKE mbildtab-dytxt.
SELECT SINGLE * FROM mara WHERE matnr EQ p_matnr.
CHECK sy-subrc EQ 0.
CALL FUNCTION 'T130M_SINGLE_READ'
EXPORTING
tcode = 'MM03'
kzrfb = 'X'
IMPORTING
wt130m = ls_t130m
EXCEPTIONS
not_found = 1
wrong_call = 2
OTHERS = 3.
CALL FUNCTION 'BILDSEQUENZ_IDENTIFY'
EXPORTING
branche = mara-mbrsh
materialart = mara-mtart
tcode_ref = ls_t130m-trref
KZRFB = ' '
IMPORTING
bildsequenz = lv_bilds
KZ_BILDS_CHANGED =
EXCEPTIONS
wrong_call = 1
not_found = 2
OTHERS = 3.
CALL FUNCTION 'SELECTION_VIEWS_FIND'
EXPORTING
bildsequenz = lv_bilds
pflegestatus = mara-pstat
TABLES
bildtab = lt_views[]
EXCEPTIONS
call_wrong = 1
empty_selection = 2
OTHERS = 3.
ls_rmmg1-matnr = mara-matnr.
ls_rmmg1-werks = p_werks.
READ TABLE lt_views INTO lwa_view WITH KEY dytxt = p_dytxt.
CHECK sy-subrc EQ 0.
lwa_auswg-auswg = lwa_view-auswg.
APPEND lwa_auswg TO lt_auswg.
CALL FUNCTION 'MATERIAL_MAINTAIN_DIALOGUE'
EXPORTING
irmmg1 = ls_rmmg1
IRMMG1_REF = ' '
KZ_EIN_DARK = 'X'
t_tcode = 'MM03'
FLG_MATNR_RES = ' '
p_pstat = mara-pstat
FLG_STAT_ALL = ' '
CALL_MODE2 = ' '
IMPORTING
MATERIAL_NO =
UPDATE_OK =
TABLES
iauswg = lt_auswg[]
EXCEPTIONS
no_authority = 1
OTHERS = 2.
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Try with a material, plant and "MRP 2" as p_dytxt. Use this code as reference to arrive at your own logic based on the data you have at hand at the time of call.
Regards,
Atish

Similar Messages

  • How to skip digital signature for sap qa11 t-code in bdc

    Dear all,
            I am doing usage decision for sap QA11 t-code through BDC...when I am doing bdc recording, it asks for digital signature(user password) through a
    pop up..how to skip that digital signature in BDC or any other solution..
    Please provide your valuable suggestions..
    Thanks..
    Warm Regards,
    Nellai Muthu..

    Dear all,
            I am doing usage decision for sap QA11 t-code through BDC...when I am doing bdc recording, it asks for digital signature(user password) through a
    pop up..how to skip that digital signature in BDC or any other solution..
    Please provide your valuable suggestions..
    Thanks..
    Warm Regards,
    Nellai Muthu..

  • Transaction codes in BDC

    Hi Experts,
    CAn someone please explain how to use a transaction code in BDC???

    Hi Manpreet,
    I think you are asking how to call transaction using BDC.
    If I am not wrong , hope this code will be helpful for u.
    Thanks.
    REPORT  ZBDC_EXAMPLE  NO STANDARD PAGE HEADING
                          LINE-SIZE 132.
    Data declaration
    TABLES: ekko, ekpo.
    TYPES: BEGIN OF t_ekko,
        ebeln TYPE ekko-ebeln,
        waers TYPE ekko-waers,
        netpr TYPE ekpo-netpr,
        err_msg(73) TYPE c,
    END OF t_ekko.
    DATA: it_ekko  TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko  TYPE t_ekko,
          it_error TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_error TYPE t_ekko,
          it_success TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_success TYPE t_ekko.
    DATA: w_textout            LIKE t100-text.
    DATA: gd_update TYPE i,
          gd_lines TYPE i.
    *Used to store BDC data
    DATA: BEGIN OF bdc_tab OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdc_tab.
    *Used to stores error information from CALL TRANSACTION Function Module
    DATA: BEGIN OF messtab OCCURS 0.
            INCLUDE STRUCTURE bdcmsgcoll.
    DATA: END OF messtab.
    *Screen declaration
    SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
                                        TITLE text-001. "Purchase order Num
    SELECT-OPTIONS: so_ebeln FOR ekko-ebeln OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK block1.
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME
                                        TITLE text-002. "New NETPR value
    PARAMETERS:  p_newpr(14)   TYPE c obligatory.  "LIKE ekpo-netpr.
    SELECTION-SCREEN END OF BLOCK block2.
    *START-OF-SELECTION
    START-OF-SELECTION.
    Retrieve data from Purchase order table(EKKO)
      SELECT ekkoebeln ekkowaers ekpo~netpr
        INTO TABLE it_ekko
        FROM ekko AS ekko INNER JOIN ekpo AS ekpo
          ON ekpoebeln EQ ekkoebeln
       WHERE ekko~ebeln IN so_ebeln AND
             ekpo~ebelp EQ '10'.
    *END-OF-SELECTION
    END-OF-SELECTION.
    Check data has been retrieved ready for processing
      DESCRIBE TABLE it_ekko LINES gd_lines.
      IF gd_lines LE 0.
      Display message if no data has been retrieved
        MESSAGE i003(zp) WITH 'No Records Found'(001).
        LEAVE TO SCREEN 0.
      ELSE.
      Update Customer master data (instalment text)
        LOOP AT it_ekko INTO wa_ekko.
          PERFORM bdc_update.
        ENDLOOP.
      Display message confirming number of records updated
        IF gd_update GT 1.
          MESSAGE i003(zp) WITH gd_update 'Records updated'(002).
        ELSE.
          MESSAGE i003(zp) WITH gd_update 'Record updated'(003).
        ENDIF.
    Display Success Report
      Check Success table
        DESCRIBE TABLE it_success LINES gd_lines.
        IF gd_lines GT 0.
        Display result report column headings
          PERFORM display_column_headings.
        Display result report
          PERFORM display_report.
        ENDIF.
    Display Error Report
      Check errors table
        DESCRIBE TABLE it_error LINES gd_lines.
      If errors exist then display errors report
        IF gd_lines GT 0.
        Display errors report
          PERFORM display_error_headings.
          PERFORM display_error_report.
        ENDIF.
      ENDIF.
    *&      Form  DISPLAY_COLUMN_HEADINGS
          Display column headings
    FORM display_column_headings.
      WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.
      SKIP.
      WRITE:2 'The following records updated successfully:'(013).
      WRITE:/ sy-uline(42).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
              (10) 'Purchase Order'(004), sy-vline,
              (11) 'Old Netpr'(005), sy-vline,
              (11) 'New Netpr'(006), sy-vline.
      WRITE:/ sy-uline(42).
    ENDFORM.                    " DISPLAY_COLUMN_HEADINGS
    *&      Form  BDC_UPDATE
          Populate BDC table and call transaction ME22
    FORM bdc_update.
      PERFORM dynpro USING:
          'X'   'SAPMM06E'        '0105',
          ' '   'BDC_CURSOR'      'RM06E-BSTNR',
          ' '   'RM06E-BSTNR'     wa_ekko-ebeln,
          ' '   'BDC_OKCODE'      '/00',                      "OK code
          'X'   'SAPMM06E'        '0120',
          ' '   'BDC_CURSOR'      'EKPO-NETPR(01)',
          ' '   'EKPO-NETPR(01)'  p_newpr,
          ' '   'BDC_OKCODE'      '=BU'.                      "OK code
    Call transaction to update customer instalment text
      CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'
             MESSAGES INTO messtab.
    Check if update was succesful
      IF sy-subrc EQ 0.
        ADD 1 TO gd_update.
        APPEND wa_ekko TO it_success.
      ELSE.
      Retrieve error messages displayed during BDC update
        LOOP AT messtab WHERE msgtyp = 'E'.
        Builds actual message based on info returned from Call transaction
          CALL FUNCTION 'MESSAGE_TEXT_BUILD'
               EXPORTING
                    msgid               = messtab-msgid
                    msgnr               = messtab-msgnr
                    msgv1               = messtab-msgv1
                    msgv2               = messtab-msgv2
                    msgv3               = messtab-msgv3
                    msgv4               = messtab-msgv4
               IMPORTING
                    message_text_output = w_textout.
        ENDLOOP.
      Build error table ready for output
        wa_error = wa_ekko.
        wa_error-err_msg = w_textout.
        APPEND wa_error TO it_error.
        CLEAR: wa_error.
      ENDIF.
    Clear bdc date table
      CLEAR: bdc_tab.
      REFRESH: bdc_tab.
    ENDFORM.                    " BDC_UPDATE
          FORM DYNPRO                                                   *
          stores values to bdc table                                    *
    -->  DYNBEGIN                                                      *
    -->  NAME                                                          *
    -->  VALUE                                                         *
    FORM dynpro USING    dynbegin name value.
      IF dynbegin = 'X'.
        CLEAR bdc_tab.
        MOVE:  name TO bdc_tab-program,
               value TO bdc_tab-dynpro,
               'X'  TO bdc_tab-dynbegin.
        APPEND bdc_tab.
      ELSE.
        CLEAR bdc_tab.
        MOVE:  name TO bdc_tab-fnam,
               value TO bdc_tab-fval.
        APPEND bdc_tab.
      ENDIF.
    ENDFORM.                               " DYNPRO
    *&      Form  DISPLAY_REPORT
          Display Report
    FORM display_report.
      FORMAT COLOR COL_NORMAL.
    Loop at data table
      LOOP AT it_success INTO wa_success.
        WRITE:/      sy-vline,
                (10) wa_success-ebeln, sy-vline,
                (11) wa_success-netpr CURRENCY wa_success-waers, sy-vline,
                (11) p_newpr, sy-vline.
        CLEAR: wa_success.
      ENDLOOP.
      WRITE:/ sy-uline(42).
      REFRESH: it_success.
      FORMAT COLOR COL_BACKGROUND.
    ENDFORM.                    " DISPLAY_REPORT
    *&      Form  DISPLAY_ERROR_REPORT
          Display error report data
    FORM display_error_report.
      LOOP AT it_error INTO wa_error.
        WRITE:/      sy-vline,
                (10) wa_error-ebeln, sy-vline,
                (11) wa_error-netpr CURRENCY wa_error-waers, sy-vline,
                (73) wa_error-err_msg, sy-vline.
      ENDLOOP.
      WRITE:/ sy-uline(104).
      REFRESH: it_error.
    ENDFORM.                    " DISPLAY_ERROR_REPORT
    *&      Form  DISPLAY_ERROR_HEADINGS
          Display error report headings
    FORM display_error_headings.
      SKIP.
      WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.
      SKIP.
      WRITE:2 'The following records failed during update:'(008).
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
              (10) 'Purchase Order'(009), sy-vline,
              (11) 'Netpr'(010), sy-vline,
              (73) 'Error Message'(012), sy-vline.
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_NORMAL.
    ENDFORM.                    " DISPLAY_ERROR_HEADINGS
    Edited by: Navdeep Malik on Dec 24, 2008 6:33 AM
    Edited by: Navdeep Malik on Dec 24, 2008 7:02 AM

  • How can we know the return code of BDC Program ?

    Hi All,
    Please tell me : How can we know the return code of BDC Program when being exceuted in Session or in Transaction mode.
    In my program, we are uploading data from Excel sheet to SAP via BDC
    The records that are not updated we want to create a log file.
    Now to know whether a record is updated ot not, wat syst field shloud be used?
    Its urgent....
    <b>Reward Point will be there ....</b>
    Thanks,
    Harish

    Hi harish,
    try the logic in this code ...
    i had attached input file in the end.
    TYPES: begin of errmess,
            msgnr type t100-msgnr,
            text type t100-text,
           end of errmess.
    TABLES : t100.
    DATA: BEGIN OF DD_VA01,
           AUART TYPE VBAK-AUART,
           KUNNR TYPE RV45A-KUNNR,
           BSTKD TYPE VBKD-BSTKD,
           MABNR TYPE RV45A-MABNR,
           KWMENG(2) type C,
           KBETR(2) type C,
          END OF DD_VA01.
    DATA:IT_VA01     Like TABLE OF DD_VA01,
         WA_VA01     Like LINE  OF IT_VA01,
         WA_VA01_F   Like LINE  OF IT_VA01,
         IT_BDCDATA  TYPE TABLE OF BDCDATA,
         WA_BDCDATA  Like Line  OF IT_BDCDATA,
         W_FNAME     TYPE STRING,
         messtab like bdcmsgcoll occurs 0 with header line,
         it_errmess type table of errmess,
         wa_errmess like line of it_errmess,
         err_message type string.
    data: zf1 type i,
          zc1 type c value '2',
          fn(20) type c.
    Main Code ************************************************************
    PERFORM get_input using 'C:\Documents and Settings\ic881592\Desktop\Daran_bdc_VA01-e.txt'.
    SORT IT_VA01 BY AUART KUNNR BSTKD.
    LOOP AT IT_VA01 INTO WA_VA01.
      if WA_VA01_F-AUART <> WA_VA01-AUART OR
         WA_VA01_F-KUNNR <> WA_VA01-KUNNR OR
         WA_VA01_F-BSTKD <> WA_VA01-BSTKD.
           PERFORM set_header_flag.
           PERFORM create_bdc_header_data.
      endif.
      PERFORM create_bdc_item_data.
    ENDLOOP.
    PERFORM call_transaction.
    PERFORM errorlog.
    Procedures ***********************************************************
    form get_input using w_fname.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME            = W_FNAME
          HAS_FIELD_SEPARATOR = '#'
        TABLES
          DATA_TAB            = IT_VA01.
    endform.
    form call_transaction.
        PERFORM bdc_field       using 'BDC_OKCODE' '/11'.
        CALL TRANSACTION 'VA01' USING IT_BDCDATA MODE 'A' messages into messtab.
        refresh it_bdcdata.
    endform.
    FORM set_header_flag.
           WA_VA01_F-AUART = WA_VA01-AUART.
           WA_VA01_F-KUNNR = WA_VA01-KUNNR.
           WA_VA01_F-BSTKD = WA_VA01-BSTKD.
           if zf1 = 1.
               PERFORM call_transaction.
           endif.
           zf1 = 1.
    endform.   "set_header_flag.
    form create_bdc_header_data.
         perform bdc_dynpro      using 'SAPMV45A' '0101'.
         perform bdc_field       using 'VBAK-AUART' WA_VA01-AUART.
         perform bdc_field       using 'BDC_OKCODE' '/00'.
         perform bdc_dynpro      using 'SAPMV45A' '4001'.
         perform bdc_field       using 'KUAGV-KUNNR' WA_VA01-KUNNR.
         perform bdc_field       using 'VBKD-BSTKD' WA_VA01-BSTKD.
         perform bdc_field       using 'BDC_OKCODE' '/00'.
         perform bdc_dynpro      using 'SAPMSSY0' '0120'.
         perform bdc_field       using 'BDC_CURSOR' '04/06'.
         perform bdc_field       using 'BDC_OKCODE' '=CHOO'.
         perform bdc_dynpro      using 'SAPMV45A' '4001'.
         PERFORM bdc_field       USING 'BDC_OKCODE' '=POAN'.
    endform. "create_bdcdata
    FORM create_bdc_item_data.
         CONCATENATE 'RV45A-KWMENG(' zc1 ')' INTO FN.
         perform bdc_field       using 'BDC_CURSOR' FN.
         perform bdc_field       using FN WA_VA01-KWMENG.
         CONCATENATE 'KOMV-KBETR(' zc1 ')' INTO FN.
         perform bdc_field       using FN WA_VA01-KBETR.
         CONCATENATE 'RV45A-MABNR(' zc1 ')' INTO FN.
         perform bdc_field       using FN WA_VA01-MABNR.
         perform bdc_dynpro      using 'SAPMV45A' '4001'.
         PERFORM bdc_field       USING 'BDC_OKCODE' '=POAN'.
    ENDFORM.
    form errorlog.
      LOOP AT MESSTAB .
        if MESSTAB-MSGNR = '311' or MESSTAB-MSGTYP = 'E'.
            SELECT SINGLE msgnr text FROM T100
                            into wa_errmess
                            WHERE SPRSL = MESSTAB-MSGSPRA
                              AND ARBGB = MESSTAB-MSGID
                              AND MSGNR = MESSTAB-MSGNR.
            IF SY-SUBRC = 0.
              err_message = wa_errmess-TEXT.
              IF err_message CS '&1'.
                REPLACE '&1' WITH MESSTAB-MSGV1 INTO err_message.
                REPLACE '&2' WITH MESSTAB-MSGV2 INTO err_message.
                REPLACE '&3' WITH MESSTAB-MSGV3 INTO err_message.
                REPLACE '&4' WITH MESSTAB-MSGV4 INTO err_message.
              ELSE.
                REPLACE '&' WITH MESSTAB-MSGV1 INTO err_message.
                REPLACE '&' WITH MESSTAB-MSGV2 INTO err_message.
                REPLACE '&' WITH MESSTAB-MSGV3 INTO err_message.
                REPLACE '&' WITH MESSTAB-MSGV4 INTO err_message.
              ENDIF.
              CONDENSE err_message.
              WRITE: / MESSTAB-MSGTYP, err_message .
            ELSE.
              WRITE: / MESSTAB.
            ENDIF.
        endif.
      ENDLOOP.
    endform. "errorlog
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      WA_BDCDATA-PROGRAM  = PROGRAM.
      WA_BDCDATA-DYNPRO   = DYNPRO.
      WA_BDCDATA-DYNBEGIN = 'X'.
      APPEND WA_BDCDATA TO IT_BDCDATA.
      CLEAR  WA_BDCDATA.
    ENDFORM.
    FORM BDC_FIELD USING FNAM FVAL.
      WA_BDCDATA-FNAM = FNAM.
      WA_BDCDATA-FVAL = FVAL.
      APPEND WA_BDCDATA TO IT_BDCDATA.
      CLEAR  WA_BDCDATA.
    ENDFORM.
    input file :
    OR     2148     0001235     R-1162     8     17
    OR     2148     0001235     R-1161     2     30
    OR     2148     0001235     100-400     6     25
    OR     2148     0001235     R-1162     4     12
    OR     2148     0001236     R-1162     3     12
    OR     2148     0001236     R-1161     2     30
    OR     2148     0001236     100-400     1     25
    OR     2148     0001236     R-1162     7     12
    OR     2148     0001236     R-1161     8     30
    OR     2148     0001236     100-400     10     25
    OR     2148     0001235     R-1161     5     30
    OR     2148     0001235     100-400     2     25
    OR     2148     0001235     R-11621     3     12
    OR     2148     0001235     R-1161     2     30
    OR     2148     0001235     100-400     1     25
    OR     2148     0001235     R-1162     7     12
    OR     2148     0001235     R-1161     8     30
    OR     2148     0001235     100-400     10     25
    OR     2148     0001236     R-1162     8     17
    OR     2148     0001236     R-1161     2     30
    OR     2148     0001236     100-400     6     25
    OR     2148     0001236     R-1162     4     12
    OR     2148     0001236     R-1161     5     30
    OR     2148     0001236     100-400     2     25

  • OK Codes for Custom T Codes in BDC

    Hi,
    We were trying to post an IDOC through a CUSTOM T-CODE developed as per requrement. For this purpose we are using a BDC recording for posting the IDOC.
    However in case of Sales Order with multiple line item we need to Scroll down and the OKCodes (P+ and /00 as per the recording) for the same is not working.
    Anyone with any experience regarding the OK Codes and BDC, could you please help.
    Thanks

    Hi,
    The problem is that we are not Creating Sales Order through this CUSTOM TCode. We are creating it thought a BAPI only.
    After The sales order has been created, we are doing the Shipment and Delivery through this Custom TCODE and hence need the OKCODE for the Scroll in case of MULTIPLE LINE ITEMS in Sales Order.
    Do the OK Codes vary based on the TCodes(if it is a Custom TCode or a standard)?
    Also have tried running the recording again and the OkCode (/00) recorded does not work when it is rerun in the forground or Background.
    Any help/ opinion on the same is welcome.
    Thanks

  • Is it possible to skip the screen in BDC using IF statement.

    Hi Friends,
    I have written a report using BDC for tcode CO11 thru recording using CALL TRANSACTION.
    Case 1:
    If I go to transaction CO11 (screen number 100) and give the  order number which has more than 1 operations to be partially confirmed and press ENTER a pop-up screen (screen number 140) appears where in I need to select the operation number and after selecting the required operation number it automatically takes me to another screen (screen number 150).
    Case 2:
    If I go to transaction CO11 (screen number 100) and give the  order number which has only 1 operation to be partially confirmed and press ENTER it directly takes me to screen 150 skiping screen 140.
    When I enter the order number which has more than 1 operations to be partially confirmed on my selection screen, my code is working fine as needed.
    But, when I enter the order number which has 1 operation to be partially confirmed on my selection screen, it is giving me error in my BDCMSGCOLL saying that the screen 140 doesn't exist.
    Is there any way, Can I skip screen 140 using IF statement?
    My thoughts:
    1. calling screen 100.
          After calling screen 100, I have put the pop-up operation numbers in an ITAB.
          DESCRIBE table lines ITAB <variable>.
          At NEW <order-field>.
          IF <variable> = 1.
    2. calling screen 140. "I need some help here to skip the screen 140
                                        " Will this logic work?
          ENDIF.
          ENDAT.
    3. calling screen 150.
    Rest everything is working fine.
    Will my above logic works correctly? I would appreciate if someone could help me with this.
    Thanks in Advance.

    Hi,
    Try something like this:
    1. Call Screen 100.
    Check if screen 140 needs to be called depending on your custom logic. Lets say you populate a variable as 'X' if it needs to be called.
    Then write:
    if valiable = 'X'.
      Call screen 140.
      Enter Screen 140 details.
    endif.
    Call screen 150.
    Here the 'Call Screen' is nothing but the code you extracted after BDC recording.
    Thanks.
    Ravi'

  • How to put a report which contains code for  BDC in background

    Hello Experts ,
    Please provide your valuable opinions on following issue,
    My BDC execution is taking longer time and it gives time out error. To avoid this problem i have created a separate report which l contains the BDC code (Call transaction ) and  i have put this report for background execution. But upon doing this My BDC code is not performing the transaction call which it was performing when it was executed individually.  In sm37 it shown the job that i am creating but nothing is actually happening as a result of transaction call.
    The code that i have written is :
    RFC code
    SUBMIT ZREPORT AND RETURN.
    RFC end
    Z_REPORT .
    PERFORM open_job.
    PERFORM get_print_parameters.
    PERFORM job_submit. here in Submit i have specified the another report name(zbdcreport) which contains the actual logic for bdc 
    PERFORM job_close.
    Report END.
    zbdcreport
    The call transaction is as follows :
    ( CALL TRANSACTION TCODE USING BDCDATA
                         MODE   'N' "CTUMODE "N
                         UPDATE 'S' "CUPDATE "S
                         MESSAGES INTO MESSTAB .)
    end zbdcreport
    Can anybody provide the reason for the error . 
    Regards,
    Uma

    Hi
    Check the code using this...
    DATA: number           TYPE tbtcjob-jobcount,
          name             TYPE tbtcjob-jobname VALUE 'JOB_TEST',
          print_parameters TYPE pri_params.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = name
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc = 0.
      SUBMIT submitable TO SAP-SPOOL
                        SPOOL PARAMETERS print_parameters
                        WITHOUT SPOOL DYNPRO
                        VIA JOB name NUMBER number
                        AND RETURN.
      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = number
            jobname              = name
            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.
        ENDIF.
      ENDIF.
    ENDIF.

  • Is possible to skip first screen in BDC Session

    Hi all,
    Is it possible like  in call transaction method to skip first screen in Batch input session?
    Syntax----
    call transaction MM01 and skip first screen.
    I want same result By using Batch input session.
    Suggess..........
    Thanks
    Sanket sethi

    Actually i am open transaction SE38 and execute an Standard Report.In the selectiion screen I am changing something in layout.
    I recorded it by BDC.
    And use batch input session.
    Now i want to skip the se38 window i want to drop user on the execution of the report.
    I also do it by submit report but i want to know that is there any possibilities to use with BDC session.
    Thanks
    Sanket

  • Urgent,need for code in bdc for co02

    hi all,
    im in urgent need of code for developing bdc tcode co02.
    Thanks for your help..

    1. Please record the transaction which you need to change the data in Co02 (Shop Order/Prod. Order)
    2. Create BDC program as normally you do it for normal BDC programs..
    Smaple Code with Recording.
    clear: bdcdata,messtab.
      perform bdc_dynpro using: 'SAPLCOKO1' '0110'.
      perform bdc_field using: 'CAUFVD-AUFNR' t_aufk-aufnr.
      perform bdc_field using: 'R62CLORD-FLG_OVIEW' 'X'.
      perform bdc_field using: 'BDC_OKCODE' '/00'.
      perform bdc_dynpro using: 'SAPLCOKO1' '0115'.
      perform bdc_field using: 'BDC_SUBSCR' 'SAPLCOKO1'.
      perform bdc_field using: 'BDC_OKCODE' '=KOWE'.
      perform bdc_dynpro using: 'SAPLCOKO1' '0115'.
      perform bdc_field using: 'BDC_SUBSCR' 'SAPLCOKO1'.
      perform bdc_field using: 'BDC_CURSOR' 'AFPOD-INSMK'.
       perform bdc_field using: 'AFPOD-INSMK' 'S'.
      perform bdc_field using: 'BDC_OKCODE' '=BU'.
      call transaction 'CO02' using bdcdata mode 'A'
                                            update 'S'
                                            messages into messtab.
    Thanks,

  • Problem in uploading data in so10 tr.code uding BDC method

    Hi Experts,
    i am uploadign data into the tr.code SO10. by usimg BDC call transaction method. The data is in the flat file.
    now my problem is when the text length is more than 72 characters the program is not creating the text. and it is saying that text length is more.
    but in my flat file the text length is more tha 72 characters.how can i do it?
    my porgram is:
    types: begin of i_so10,
           TDNAME  type TDOBNAME,
           TDID    type TDID,
           TDSPRAS type TDSPRAS,
           TEXT    type STRING,
           end of i_s010.
    data: it_so10 type standard table of i_so10,
          wa_so10 type i_so10.
    loop at it_so10 into wa_so10.
    perform bdc_dynpro      using 'SAPMSSCE' '1100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RSSCE-TDNAME'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=CREA'.
    perform bdc_field       using 'RSSCE-TDNAME'
                                  wa_so10-TDNAME.
    perform bdc_field       using 'RSSCE-TDID'
                                  wa_so10-TDID.
    perform bdc_field       using 'RSSCE-TDSPRAS'
                                  wa_so10-TDSPRAS.
    perform bdc_dynpro      using 'SAPLSTXX' '1100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RSTXT-TXLINE(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=EDNP'.
    perform bdc_field       using 'RSTXT-TXLINE(02)'
                                  wa_so10-text.
    call transaction 'so10' using it_bdcdata
                                    MODE 'A'
                                    UPDATE 'S'.
    endloop.
    perform bdc_field       using 'RSTXT-TXLINE(02)'
                                  wa_so10-text.
    the text stored in wa_so10-text is more than 72 characters.but RSTXT-TXLINE(02) length is only 72 characters.
    the recording code at the screen of store text is:
    perform bdc_field       using 'RSTXT-TXLINE(02)'
                                  'tttttttttttttttttttttttttttttttttttttt'
                                & 'tttttttttttttttttttttttttttttttttt'.
    perform bdc_dynpro      using 'SAPLSTXX' '1100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RSTXT-TXLINE(03)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=EDNP'.
    perform bdc_field       using 'RSTXT-TXLINE(03)'
                                  'tttttttttttttttttttttttttttttttttttttt'
                                & 'tttttttttttttttttttttttttttttttttt'.
    perform bdc_dynpro      using 'SAPLSTXX' '1100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RSTXT-TXLINE(04)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=EDNP'.
    perform bdc_field       using 'RSTXT-TXLINE(04)'
                                  'tttttttttttttttttttttttttttttttttttttt'
                                & 'tttttttttttttttttttttttttttttttttt'.
    perform bdc_dynpro      using 'SAPLSTXX' '1100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RSTXT-TXLINE(05)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TXSV'.
    perform bdc_field       using 'RSTXT-TXLINE(05)'
                                  'tttttttttttttttttttttttttttttttttttttt'.
    perform bdc_dynpro      using 'SAPLSTXX' '1100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RSTXT-TXLINE(05)'.
    give solution for this.
    thanks in advance,
    Mythily.

    Hi all,
    i am not getting any useful  answers. will help me this regard.
    thanks

  • Handling dynamic OK Codes in BDC

    Hello,
    I am calling a transaction using BDCDATA. But some OK codes are dynamic. EX: '=%_GC 309 1'.
    Actually, I have call a transaction CJ20N(Project builder in PS module)and I should be able to open a Project definition/WBS element automatically(using open button).
    I would request to help me in this regard.
    Thank You in advance,
    Manjunadh.

    I faced similar issue and was able to resolve it.
    '%_GC N N' is a dummy okcode dynamically generated and assigned during screen generation. SAP determines the actual okcode once PAI event is triggered.
    To determine actual okcode, switch on debugger and navigate to method OKCODE_DISPATCH. Corresponding okcode can be determined from static variable mt_registered_okcodes  or through method GET_EVENT_PARAMETER.
    Once the FCODE (such as 'SAVE' , 'OIP_CHECK' etc.) is determined, replace '%_GC okcode' with corresponding 'FCODE' in the BDC recording.

  • 3 Screen's Recording 1 Screen appering in 1 T.Code using BDC

    Hi All,
          while recording a T.Code , let say T.Code (yx02) having 4 screen's (100,200,300,400), in this T.Code i need to record only 100 to 300 and 400 screen has to appear in the report, in that screen (400) they will save the data.
    Please advice on this, it is  VERY URGENT.
    Many Thanks in advance for u r Answer
    Regards
    Naren

    hi narender,
       record ur transaction till 300 screen and then click back after u see 400 screen
    in ur program remove ok code for 400.
    in ur bdc program  use call transaction yx02
                                         mode 'A'.....
    then u just have to press enter for first three screens and can save in 400 screen

  • Skip First Screen in BDC

    Hi Experts,
    I am using BDC for transaction PA20 where i am passing employee no and infotype.
    My requirement is to display directly second screen which is obtained by pressing display button (F7) button.
    Is it possible?
    Please suggest.
    Regards,
    Kaustubh.

    Hi, Kabre
    Please Check the following sample code it will solve out your problem,
    DATA: it_bdcdata TYPE TABLE OF bdcdata,
          wa_it_bdcdata LIKE LINE OF it_bdcdata.
    DATA opt TYPE ctu_params.
    CLEAR wa_it_bdcdata.
    wa_it_bdcdata-program  = 'SAPMP50A'.
    wa_it_bdcdata-dynpro   = '1000'.
    wa_it_bdcdata-dynbegin = 'X'.
    APPEND wa_it_bdcdata TO it_bdcdata.
    CLEAR wa_it_bdcdata.
    wa_it_bdcdata-fnam = 'BDC_CURSOR'.
    wa_it_bdcdata-fval = 'RP50G-PERNR'.
    APPEND wa_it_bdcdata TO it_bdcdata.
    CLEAR wa_it_bdcdata.
    wa_it_bdcdata-fnam = 'RP50G-PERNR'.
    wa_it_bdcdata-fval = '1'. " Your Pernr Here.
    APPEND wa_it_bdcdata TO it_bdcdata.
    CLEAR wa_it_bdcdata.
    wa_it_bdcdata-fnam = 'BDC_CURSOR'.
    wa_it_bdcdata-fval = 'RP50G-CHOIC'.
    APPEND wa_it_bdcdata TO it_bdcdata.
    CLEAR wa_it_bdcdata.
    wa_it_bdcdata-fnam = 'RP50G-CHOIC'.
    wa_it_bdcdata-fval = '8'. " Your Infotype Here.
    APPEND wa_it_bdcdata TO it_bdcdata.
    CLEAR wa_it_bdcdata.
    wa_it_bdcdata-fnam = 'BDC_OKCODE'.
    wa_it_bdcdata-fval = 'DIS'.
    APPEND wa_it_bdcdata TO it_bdcdata.
    opt-dismode = 'E'.
    CALL TRANSACTION 'PA20' USING it_bdcdata OPTIONS FROM opt.
    Please Reply if any problem.
    Best Regards,
    Faisal

  • To find Function Code in BDC

    Hi,
    I am creating a BDC program for transaction FB09....
    How can I identify the function code for a BUTTON?
    And also, how can I know the function key number for the button?

    Hi Vin,
    go to t-code FB09>go to menu>system> status>select program-->double clcik ..
    it takes you to se38 program..
    copy program name -->go to se80 and enter the program name and enter..
    it shows you the all includes in the right hand side..
    expand the GUI status in the right hand side..
    now you will get the all gui status's according to the description doudble click and see the Fucntion key's assigned to the Buttons..
    Regards,
    Prabhudas

  • DMEE format: skipping few codes

    Hi all,
    I have created a new DMEE format which is in SWIFT u2013 MT100 format.
    and have tested it by generating the file.
    the Header informations are displaying correctly.
    but in the transaction only first few segments are displaying in the file, then the file got ended.
    i am not getting why do last 3-4 codes are not get displayed in the file.
    please share your suggestions. if you want more information please let me know.
    thanks,
    Vidya

    Hi,
    Please write condition using condition argument.
    Please follow the below steps:-
    At attributes tab select DMEE: existence status of a format tree node as 2(Optional: if object has no value, object is skipped) and in mapping procedure select radio button Constant.
    At Source tab provide constant as N06(as per your example).
    At Conditions tab write a condition that if FPAYH-RZAWE = 'N'.
    Copy the node for other payment methods.
    Regards,
    Anand Raichura

Maybe you are looking for

  • How do you see what version of PDK you are using?

    how do you see what version of PDK you are using? I'd like to know where I can look to see the full version number and understand what version I am on.

  • Need to fix the exchange rate in KB15N

    Hi Gurus, We are actually posting actual to WBS element using cost center using KB15N in different currency. We want to fixed value of exchange rate before posting (means overwrite actual exchange rate). Can anyone tell can we fixed value of exchange

  • No cache in ui:head tag

    Hi, I have problem with caching in JSF page in Java Studio Creator 2 tag <ui:head/> return this: <head> <meta content="no-cache" http-equiv="Pragma" /> <meta content="no-cache" http-equiv="Cache-Control" /> <meta content="no-store" http-equiv="Cache-

  • Installing CS6 Extended on a New MAC i've purchased.

    I think I already know the answer to my question, but I recently I ventured into a MAC system and have already installed CS6 extended on 2 seperate windows based machines at home , Can I install this version on my Mac also ?If not how do I set about

  • Spatial Tables and Remote Queries

    Hi Experts, Can anyone explain me when and where to use Spatial Tables and Remote Queries with some examples. Thanks in advance.