How to do bdc for transaction cn22

Hi team,
I had done recording for cn22 for long text.Iam able to upload the data from the excel sheet and i can change the long text.But my problem is my long text is a paragraph and iam not able to do for a paragragh.my sample code is
REPORT ZCN22_TEST
       NO STANDARD PAGE HEADING LINE-SIZE 255.
TYPE-POOLS: TRUXS.
*include bdcrecx1.
Generated data section with specific formatting - DO NOT CHANGE  ***
TYPES: BEGIN OF TH_CAUFVD,
data element: AUFNR
        AUFNR_001(012),
        END OF TH_CAUFVD.
TYPES : BEGIN OF T_CAUFVD,
         AUFNR_001(012),
        VORNR_002(004),
       FLG_SEL_01_003,
data element: TXLINE
       TXLINE_02_004 type txline,
        TXLINE_02_004 TYPE STRING,
      END OF T_CAUFVD.
DATA :FLG_SEL_01_003 TYPE C.
*FLG_SEL_01_003 = X.
*& Internal Table
DATA :IH_CAUFVD TYPE STANDARD TABLE OF TH_CAUFVD,
      I_CAUFVD TYPE STANDARD TABLE OF T_CAUFVD,
      I_BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE,
      MESSTAB   TYPE TABLE OF BDCMSGCOLL WITH HEADER LINE.
*& Work Area
DATA :WH_CAUFVD TYPE TH_CAUFVD,
      W_CAUFVD TYPE T_CAUFVD ,
      W_TEXT TYPE TABLE OF TLINE WITH HEADER LINE,
      W_HEADER TYPE TABLE OF THEAD WITH HEADER LINE.
Gloable Variable
DATA : V_FILENAME TYPE STRING,
       V_MSG      TYPE STRING,
       V_COUNT(2) TYPE N,
       V_VAL(15).
SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-001.
PARAMETERS: FILENAME LIKE RLGRAP-FILENAME.
SELECTION-SCREEN END OF BLOCK A.
SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-002.
PARAMETERS P_FRMLIN TYPE I DEFAULT 2.                         " From Line No
PARAMETERS P_TOLINE TYPE I.                                   " To Line No
SELECTION-SCREEN END OF BLOCK B.
*& At Selection Screen on value-request
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME.
*For F4 Help for the file.
  PERFORM GET_FILE.
*& Start-of-selection
START-OF-SELECTION.
*For transfering the data from flatfile to internal table.
  PERFORM UPLOAD_FILE.
*start of recording
  DATA L_CAUFVD LIKE W_CAUFVD.
*Read TABLE I_caufvd into l_caufvd index 1.
  LOOP AT IH_CAUFVD INTO WH_CAUFVD.
    ON CHANGE OF WH_CAUFVD-AUFNR_001.
      PERFORM BDC_DYNPRO      USING 'SAPLCOKO' '2000'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'CAUFVD-AUFNR'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '=LIST'.
      PERFORM BDC_FIELD       USING 'CAUFVD-AUFNR'
                                    WH_CAUFVD-AUFNR_001.
      PERFORM BDC_DYNPRO      USING 'SAPLCOVG' '2000'.
*start loop for n items
      LOOP AT I_CAUFVD INTO W_CAUFVD
        WHERE AUFNR_001 = WH_CAUFVD-AUFNR_001.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=POSI'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'AFVGD-VORNR(01)'.
        PERFORM BDC_DYNPRO      USING 'SAPLCOVG' '2200'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENT1'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'AFVGD-VORNR'.
        PERFORM BDC_FIELD       USING 'AFVGD-VORNR'
                                     W_CAUFVD-VORNR_002.
        PERFORM BDC_DYNPRO      USING 'SAPLCOVG' '2000'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=LTXT'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'AFVGD-VORNR(01)'.
        PERFORM BDC_FIELD       USING 'RC27X-FLG_SEL(01)'
                                      'X'.
        PERFORM BDC_DYNPRO      USING 'SAPLSTXX' '1100'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RSTXT-TXLINE(02)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=TXBA'.
        PERFORM BDC_FIELD       USING 'RSTXT-TXLINE(02)'
                                       W_CAUFVD-TXLINE_02_004.
        PERFORM BDC_DYNPRO      USING 'SAPLCOVG' '2000'.
*perform bdc_field       using 'BDC_OKCODE'
                             '=POSI'.
*perform bdc_field       using 'BDC_CURSOR'
                             'AFVGD-VORNR(01)'.
        PERFORM BDC_FIELD       USING 'RC27X-FLG_SEL(01)'
      ENDLOOP.
      PERFORM BDC_DYNPRO      USING 'SAPLCOVG' '2000'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '=BU'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'AFVGD-VORNR(01)'.
      PERFORM BDC_FIELD       USING 'RC27X-FLG_SEL(01)'
      PERFORM BDC_TRANSACTION USING 'CN22'.
    ENDON.
    WRITE:/ V_MSG.
  ENDLOOP.
*&      Form  GET_FILE
      text
-->  p1        text
<--  p2        text
FORM GET_FILE .
  CALL FUNCTION 'F4_FILENAME'
    IMPORTING
      FILE_NAME = FILENAME.
ENDFORM.                    " GET_FILE
*&      Form  UPLOAD_FILE
      text
-->  p1        text
<--  p2        text
FORM UPLOAD_FILE .
  V_FILENAME = FILENAME.
  DATA: LWA_INTERN TYPE ALSMEX_TABLINE,
        LIT_INTERN TYPE STANDARD TABLE OF ALSMEX_TABLINE INITIAL SIZE 0.
  DATA: IT_RAW TYPE TRUXS_T_TEXT_DATA.
  TYPES : BEGIN OF T_RETURN,
          ROW      TYPE      KCD_EX_ROW_N,
          COL     TYPE      KCD_EX_COL_N,
          VALUE(1000),
          END OF T_RETURN.
  DATA : I_RETURN TYPE TABLE OF T_RETURN.
  DATA L_ROW TYPE KCD_EX_ROW_N. " Row
  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      FILENAME                = FILENAME
      I_BEGIN_COL             = 1
      I_BEGIN_ROW             = P_FRMLIN
      I_END_COL               = 3
      I_END_ROW               = P_TOLINE
    TABLES
      INTERN                  = LIT_INTERN "i_record
    EXCEPTIONS
      INCONSISTENT_PARAMETERS = 1
      UPLOAD_OLE              = 2
      OTHERS                  = 3.
  IF SY-SUBRC <> 0.
    WRITE: 'Error in opening the File'.
  ELSE.
    SORT LIT_INTERN BY ROW ASCENDING
                       COL ASCENDING.
    L_ROW = 1.
For total records
    LOOP AT LIT_INTERN INTO LWA_INTERN.
      IF L_ROW = LWA_INTERN-ROW.
        IF LWA_INTERN-COL = 1.
          WH_CAUFVD-AUFNR_001 = LWA_INTERN-VALUE.
       ELSEIF LWA_INTERN-COL = 4.
         K_RECORD-DOKVR_004 = LWA_INTERN-VALUE.
        ENDIF.
        AT END OF ROW.
          L_ROW = L_ROW + 1.
          APPEND WH_CAUFVD TO IH_CAUFVD.
          CLEAR WH_CAUFVD.
        ENDAT.
      ENDIF.
    ENDLOOP.
  ENDIF.
  L_ROW = 1.
*For total records
  LOOP AT LIT_INTERN INTO LWA_INTERN.
    IF L_ROW = LWA_INTERN-ROW.
      IF LWA_INTERN-COL = 1.
        W_CAUFVD-AUFNR_001 = LWA_INTERN-VALUE.
      ELSEIF LWA_INTERN-COL = 2.
        W_CAUFVD-VORNR_002 = LWA_INTERN-VALUE.
      ELSEIF LWA_INTERN-COL = 3.
        W_CAUFVD-TXLINE_02_004 = LWA_INTERN-VALUE.
      ENDIF.
      AT END OF ROW.
        L_ROW = L_ROW + 1.
        APPEND W_CAUFVD TO I_CAUFVD.
        CLEAR W_CAUFVD.
      ENDAT.
    ENDIF.
  ENDLOOP.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
     EXPORTING
    I_FIELD_SEPERATOR        =
       I_LINE_HEADER            =  'X'
       I_TAB_RAW_DATA           =  IT_RAW       " WORK TABLE
       I_FILENAME               =  FILENAME
     TABLES
       I_TAB_CONVERTED_DATA     = I_CAUFVD[]    "ACTUAL DATA
    EXCEPTIONS
       CONVERSION_FAILED        = 1
       OTHERS                   = 2.
IF SY-SUBRC <> 0.
   WRITE: 'Error in opening the File'.
ENDIF.
ENDFORM.                    " UPLOAD_FILE
*&      Form  BDC_FIELD
      text
     -->P_0377   text
     -->P_WI_RECORD_REKRS_023  text
FORM BDC_DYNPRO  USING    PROGRAM
                          DYNPRO.
  CLEAR I_BDCDATA.
  I_BDCDATA-PROGRAM  = PROGRAM.
  I_BDCDATA-DYNPRO   = DYNPRO.
  I_BDCDATA-DYNBEGIN = 'X'.
  APPEND I_BDCDATA.
ENDFORM.                    " BDC_DYNPRO
*&      Form  BDC_FIELD
      text
     -->P_0377   text
     -->P_WI_RECORD_REKRS_023  text
FORM BDC_FIELD  USING    NAME
                         VALUE.
  CLEAR I_BDCDATA.
  I_BDCDATA-FNAM    = NAME.
  I_BDCDATA-FVAL    = VALUE.
  APPEND I_BDCDATA.
CLEAR I_BDCDATA.
ENDFORM.                    " BDC_FIELD
*&      Form  BDC_TRANSACTION
      text
     -->P_0412   text
FORM BDC_TRANSACTION  USING  TCODE.
  CALL TRANSACTION TCODE USING I_BDCDATA MODE 'N' MESSAGES INTO MESSTAB.
  REFRESH I_BDCDATA[].
  CLEAR I_BDCDATA.
IF SY-SUBRC <> 0.
  DESCRIBE TABLE MESSTAB.
  READ TABLE MESSTAB INDEX SY-TFILL.
  IF SY-SUBRC = 0.
    CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        ID        = SY-MSGID
        LANG      = '-D'
        NO        = SY-MSGNO
        V1        = SY-MSGV1
        V2        = SY-MSGV2
        V3        = SY-MSGV3
        V4        = SY-MSGV4
      IMPORTING
        MSG       = V_MSG
      EXCEPTIONS
        NOT_FOUND = 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.
  ENDIF.
ENDIF.
ENDFORM.                    " BDC_TRANSACTION
and if  iam giving a long text which is a paragraph iam getting an error
"Field RSTXT-TXLINE(2) input value is longer than screen field."
please do needful help as soon as possibe.

Hi!
Instead of using a BDC, use FM CREATE_TEXT for creating the long text. With this you can easily create the text using the text id, name, object and language. To get these details, use the editor button (icon - clipboard with a pencil) and in the text Goto-->Header.
Hope this resolves your issue.
Cheers!

Similar Messages

  • BDC for Transaction F-02

    Hi,
    Any idea how to write BDC for transaction F-02?
    The problem is how do we upload one item after another within the same loop?
    Regards,
    Naba

    You may solve easily your problem writing the data in the LOOP like
    LOOP AT IT_BSEG
      " if first line, fill BDCDATA for header and the first line call
      " if not first line, fill BDCDATA for the bottom of the previous line
      " fill ok code for next line
      " fill BDCDATA for the current line
    ENDLOOP.
    " fill ok code for save and call transaction
    But it should be easier to use FM like [POSTING_INTERFACE_START|https://www.sdn.sap.com/irj/scn/advancedsearch?query=posting_interface_start&cat=sdn_all]; [POSTING_INTERFACE_DOCUMENT|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=posting_interface_document&adv=false&sortby=cm_rnd_rankvalue] and [POSTING_INTERFACE_END|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=posting_interface_end&adv=false&sortby=cm_rnd_rankvalue], those function modules will build the BDC flow.
    Another, and better solution is to use [BAPI_ACC_DOCUMENT_POST|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=bapi_acc_document_post&adv=false&sortby=cm_rnd_rankvalue].
    Regards

  • How to handle bdc for more than one transaction?

    how to handle bdc for more than one transaction?

    Hi srk,
    I am providing you with some references below. Hope this prove to be helpful to you.
    Method 1:
    Use one BDC_OPEN_GROUP
    Multiple BDC_INSERT 
    One BDC_CLOSE_GROUP.
    Call function BDC_OPENGROUP.
    Build BDC data and call lBDC_INSERT for transaction 1
    Build BDC data and call lBDC_INSERT for transaction 2
    Build BDC data and call lBDC_INSERT for transaction 3
    paas the tcodes to bdc_insert.
    call function BDC_CLOSE_GROUP.
    Also check this out:
    Here we need to record 2 transactions (shdb).
    Once completion of the recording. Populate the data into input internal table .
    Loop the internal table and process the 2 transactions
    like
    1. BDC_OPEN_GROUP
    2. LOOP AT ITAB
    a. Populate first transaction recording data
    and pass transaction to the BDC_INSERT_GROUP.
    BDC_INSERT_GROUP.
    b. Populate second transaction recording data
    and pass transaction to the BDC_INSERT_GROUP.
    BDC_INSERT_GROUP.
    ENDLOOP.
    3. BDC_CLOSE_GROUP
    the above info can be found at : How to use 2 transactions in BDC?
    Also check this out:
    Suppose u have created recordings for transactions 'MM01' 'XK01' and 'VA01'.
    Then do this:
    bdc_open_group.
    after this we have to fill the bdcdata structure for one transaction.here 'MM01'.
    bdc_insert.
    refresh bdcdata.
    after this we have to fill the bdcdata structure for one transaction.here 'xk01'.
    bdc_insert .
    refresh bdcdata.
    after this we have to fill the bdcdata structure for one transaction.here 'va01'.
    bdc_insert.
    bdc_close_group.
    Hope these are useful to you.
    Please reward if any of the above are useful.
    Regards,
    Kalyan

  • Creating bdc for transaction f-02 ?

    Hi People,
    I am going a bdc for transaction f-02 ..... my template involves 7 posting keys ( 40 50 31 01 29 09 70 ) ... depending up
    on the posting key the next screen will change .......... can you people tel me how to do this and what are all the logic
    involved in this program ?
    thanks u all in advance.
    Siva

    Hi,
    Please use the following format for your upload file template
    DocDate1    ComCd1    Currency1    pstky1
    DocDate1    ComCd1    Currency1    pstky2
    DocDate1    ComCd1    Currency1    pstky3
    DocDate2    ComCd2    Currency2    pstky1
    DocDate2    ComCd2    Currency2    pstky2
    Then use the following logic.
    At New Currency1
    add the header data
    DocDate1    ComCd1    Currency1
    Thus this code will run only once for every new Header
    and remain in the screen till posting key are entered.
    Regards,
    Lokesh
    Edited by: Lokesh Tibbani on Sep 5, 2008 12:17 PM

  • How to Make BDC for transcation KKS1

    Hi dear,
    can any one tell me that how to make BDC for KKS1.
    because i have recorded the BDC and converted into the program logic than it is showing the first window but not showing the window with ALV and futher more. So what coding i have to apply.
    Please help.
    Siddarth Jain

    Hi,
    U can record the flow in using SHDB transaction recorder.
    U can record and it will generate the program, u can copy and paste the part of the code that is generated, in ur ALV report. this will call the transaction.
    Do as follows:
    <b>SHDB > New Recording > Specify Recording Name YTEST > Transaction code KKS1 > STRAT RECORDING BUTTON></b>
    then speciy the vales u want to give to run the transaction. U can save and come back as soon as u reach the screen when u want to stop it.
    EG:
    Declare a messtab
    DATA: i_bdcdata TYPE STANDARD TABLE OF bdcdata,
    * Internal table to hold BDC messages
    i_messtab TYPE STANDARD TABLE OF bdcmsgcoll
    * Work area to hold bdcdata value
    DATA: w_bdcdata TYPE bdcdata,
    * Work area to hold BDC messages
    w_messtab TYPE bdcmsgcoll.
    CONSTANTS : c_e type bdcmsgcoll-msgtyp value 'E', "E
    c_a type bdcmsgcoll-msgtyp value 'A', "A
    nodata type c value '/'. "/
    perform f1000_bdc_mm03 using lv_matnr lv_werks.
    FORM f1000_bdc_mm03 USING P_LV_MATNR
    P_LV_WERKS.
    perform bdc_dynpro using 'SAPLMGMM' '0060'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RMMG1-MATNR'
    p_lv_matnr.
    perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(15)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(15)'
    'X'.
    perform bdc_dynpro using 'SAPLMGMM' '0080'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-WERKS'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'RMMG1-WERKS'
    p_lv_werks.
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=ZU01'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_dynpro using 'SAPLMGMM' '4300'.
    perform bdc_field using 'BDC_OKCODE'
    '=ZU08'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_dynpro using 'SAPLMGMM' '4110'.
    perform bdc_field using 'BDC_OKCODE'
    '=GESV'.
    *perform bdc_field using 'BDC_CURSOR'
    * 'RMMG1-MATNR'.
    call transaction c_transaction_call_MM03 using i_bdcdata MODE 'N'MESSAGES INTO i_messtab.
    <b>Kindly close the previous threads opened by u.</b>
    Message was edited by: Judith Jessie Selvi

  • How to write BDC for KP06

    Hi,
    How to write BDC, for Tcode KP06, How to handle the table control in that Tcode.
    or any other way to upload data for this Tcode.
    Regards
    Manohar

    Hi,
    check the sample code for transaction ME51 and ME21.
    PARAMETERS:
      p_fname TYPE ibipparms-path.
    *" Data declarations...................................................
    Work variables                                                      *
    DATA:
      fs_bdc TYPE bdcdata,
      fs_msg TYPE bdcmsgcoll.
    Internal table to hold bdc data                                     *
    DATA:
         t_bdc LIKE
      STANDARD TABLE
            OF fs_bdc.
    Internal table to hold bdcmessage data                              *
    DATA:
         t_msg LIKE
      STANDARD TABLE
            OF fs_msg.
    DATA:
      w_string(50)  TYPE c,
      w_string1(19) TYPE c,
      w_message(72) TYPE c,
      w_num         TYPE i VALUE 1,
      w_num1        TYPE i.
    *" Type declarations...................................................
    Type declaration of the structure to hold  header data              *
    DATA:
      BEGIN OF t_header  OCCURS 0,
        ftype      TYPE c,
        doctype(10) TYPE c,
        acctcat(4) TYPE c,
        date(10)    TYPE c,
        plant(4)   TYPE n,
        text(10)   TYPE c,
        qty(5)     TYPE n,
        units(5)   TYPE c,
        pgrp(3)    TYPE n,
        mgrp(3)    TYPE n,
        price(2)   TYPE n,
       gacct(6)   TYPE n,
        cost(4)    TYPE n,
      END OF t_header.
                          START-OF-SELECTION EVENT                      *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
      CALL FUNCTION 'F4_FILENAME'
       EXPORTING
         program_name        = syst-cprog
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
       IMPORTING
         file_name           = p_fname
    START-OF-SELECTION.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = 'c:\temp\item2.txt'
      FILETYPE                      = 'ASC'
         has_field_separator           = 'X'
        TABLES
          data_tab                      = t_header
       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.                                 " IF SY-SUBRC <> 0
      LOOP AT t_header WHERE ftype = 'H'..
        CLEAR fs_msg.
        IF t_header-ftype = 'H'.
          PERFORM bdc_program USING 'SAPMM06B' '0100'.
          PERFORM bdc_field   USING 'eban-BSART' t_header-doctype.
          PERFORM bdc_field   USING 'eban-KNTTP' t_header-acctcat.
          PERFORM bdc_field   USING 'RM06B-EEIND' t_header-date.
          PERFORM bdc_field   USING 'eban-WERKS' t_header-plant.
          PERFORM bdc_field   USING 'BDC_OKCODE' 'AB'.
        ENDIF.
       IF t_header-ftype = 'I'.
        LOOP AT t_header WHERE ftype = 'I'.
          PERFORM bdc_program USING 'SAPMM06B' '0106'.
          w_string = 'EBAN-TXZ01(01)'.
          w_string+12(1) = w_num.
          PERFORM bdc_field   USING w_string t_header-text.
          w_string = 'EBAN-MENGE(01)'.
          w_string+12(1) = w_num.
          PERFORM bdc_field   USING w_string t_header-qty.
          w_string = 'EBAN-MEINS(01)'.
          w_string+12(1) = w_num.
          PERFORM bdc_field   USING w_string t_header-units.
          w_string = 'EBAN-EKGRP(01)'.
          w_string+12(1) = w_num.
          PERFORM bdc_field   USING w_string t_header-pgrp.
          w_string = 'EBAN-MATKL(01)'.
          w_string+12(1) = w_num.
          PERFORM bdc_field   USING w_string t_header-mgrp.
          PERFORM bdc_field   USING 'BDC_OKCODE' '=KN'.
          w_num = w_num + 1.
          PERFORM bdc_program USING 'SAPMM06B' '0102'.
          PERFORM bdc_field   USING 'EBAN-preis' t_header-price.
          PERFORM bdc_field   USING 'BDC_OKCODE' '=KN'.
          PERFORM bdc_program USING 'SAPMM06B' '0505'.
          PERFORM bdc_field   USING 'BDC_OKCODE' '=KWE'.
          PERFORM bdc_program USING 'SAPlkacb' '0002'.
       PERFORM bdc_field   USING 'EBAN-sakto' t_header-gacct.
          PERFORM bdc_field   USING 'cobl-kostl' t_header-cost.
          PERFORM bdc_field   USING 'BDC_OKCODE' '=ENTE'.
         PERFORM bdc_program USING 'SAPMM06B' '0102'.
         PERFORM bdc_field   USING 'BDC_OKCODE' '/00'.
             ENDIF.
        ENDLOOP.
      ENDLOOP.
      PERFORM bdc_program USING 'SAPMM06B' '0106'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'BU'.
         PERFORM BDC_PROGRAM USING 'SAPMM06E' '100'.
    *PERFORM BDC_FIELD USING 'BDC_OKCODE' 'BACK'.
      CALL TRANSACTION 'ME51' USING t_bdc MODE 'N' MESSAGES INTO t_msg.
      LOOP AT t_msg INTO fs_msg.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = fs_msg-msgid
            lang      = sy-langu
            no        = fs_msg-msgnr
            v1        = fs_msg-msgv1
            v2        = fs_msg-msgv2
            v3        = fs_msg-msgv3
            v4        = fs_msg-msgv4
          IMPORTING
            msg       = w_message
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
           WRITE:
             / w_message.
      ENDLOOP.
      CLEAR t_bdc[].
      PERFORM bdc_program USING 'SAPMM06E' '0100'.
      PERFORM bdc_field   USING 'EKKO-LIFNR' '1000'.
      PERFORM bdc_field   USING 'EKKO-EKORG' '1000'.
      PERFORM bdc_field   USING 'EKKO-EKGRP' '100'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'BS'.
      PERFORM bdc_program USING 'SAPMM06E' '0501'.
      PERFORM bdc_field   USING 'EKET-BANFN' fs_msg-msgv1.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=KOPF'.
      PERFORM bdc_program USING 'SAPMM06E' '0125'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'MALL'.
      PERFORM bdc_program USING 'SAPMM06E' '0125'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'REFH'.
      PERFORM bdc_program USING 'SAPMM06E' '0504'.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=ENTE'.
      PERFORM bdc_program USING 'SAPMM06E' '0111'.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=NEXP'.
    *perform bdc_program using 'SAPLSPO1' '0300'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' 'YES'.
      PERFORM bdc_program USING 'SAPMM06E' '0504'.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=ENTE'.
      PERFORM bdc_program USING 'SAPMM06E' '0111'.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=NEXP'.
    *perform bdc_program using 'SAPMM06E' '0504'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' '=ENTE'.
    *perform bdc_program using 'SAPMM06E' '0111'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' '=NEXP'.
    perform bdc_program using 'SAPMM06E' '0504'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' '=ENTE'.
    perform bdc_program using 'SAPMM06E' '0504'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' '=ENTE'.
    *perform bdc_program using 'SAPMM06E' '0111'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' '=NEXP'.
      PERFORM bdc_program USING 'SAPMM06E' '0120'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'BU'.
      CALL TRANSACTION 'ME21' USING t_bdc MODE 'N' MESSAGES INTO t_msg
      LOOP AT t_msg INTO fs_msg.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = fs_msg-msgid
            lang      = sy-langu
            no        = fs_msg-msgnr
            v1        = fs_msg-msgv1
            v2        = fs_msg-msgv2
            v3        = fs_msg-msgv3
            v4        = fs_msg-msgv4
          IMPORTING
            msg       = w_message
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
           WRITE:
             / W_message.
      ENDLOOP.                             " LOOP T_MSG
      CLEAR t_bdc[].
      PERFORM bdc_program USING 'SAPMM06E' '0105'.
      PERFORM bdc_field   USING 'RM06E-BSTNR' fs_msg-msgv2.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'AB'.
      w_num1 = w_num - 1.
      DO w_num1 TIMES.
        w_string1 = 'RM06E-TCSELFLAG(00)'.
        w_string1+17(1) = w_num1.
        PERFORM bdc_program USING 'SAPMM06E' '0120'.
        PERFORM bdc_field   USING w_string1 'X'.
        PERFORM bdc_field   USING 'BDC_OKCODE' 'DL'.
        w_num1 = w_num1 - 1.
      ENDDO.                               " DO W_NUM1
      PERFORM bdc_program USING 'SAPMM06E' '0120'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'BU'.
      CALL TRANSACTION 'ME22' USING t_bdc MODE 'A' MESSAGES INTO t_msg.
      LOOP AT t_msg INTO fs_msg.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = fs_msg-msgid
            lang      = sy-langu
            no        = fs_msg-msgnr
            v1        = fs_msg-msgv1
            v2        = fs_msg-msgv2
            v3        = fs_msg-msgv3
            v4        = fs_msg-msgv4
          IMPORTING
            msg       = w_message
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
        WRITE:
          / w_message.
      ENDLOOP.                             " LOOP T_MSG
    *&      Form  bdc_program
    This subroutine gives screenname and screen number                 *
    There are no interface parameters to be passed to this subroutine. *
    FORM bdc_program  USING    value(p_screen)
                               value(p_num).
      CLEAR fs_bdc.
      fs_bdc-program = p_screen.
      fs_bdc-dynpro = p_num.
      fs_bdc-dynbegin = 'X'.
      APPEND fs_bdc TO t_bdc.
    ENDFORM.                               " FORM BDC_PROGRAM
    *&      Form  BDC_FIELD
    This subroutine gives the field name and field value               *
    There are no interface parameters to be passed to this subroutine. *
    FORM bdc_field  USING    value(p_name)
                             value(p_value).
      CLEAR fs_bdc.
      fs_bdc-fnam = p_name.
      fs_bdc-fval = p_value.
      APPEND fs_bdc TO t_bdc.
    ENDFORM.                               " FORM BDC_FIELD
    Regards,
    jaya

  • Hi All, I developed a BDC for transaction IE02

    Hi All, I developed a BDC for transaction IE02, when i am uploading data into this bdc 'validity period' is automatically taking the present system date, as in program i have not given any validations for this validity from Can anyone guide me on this as so why the data in validity from is taking present system date and how do i avoid it.
    Thanks..!!!
    Regards,
    Swarna

    Hi Swarna,
    AS you mention  IE02  Validity From is not editable.
    If you capturing this field in BDC then you can put hard-code date value sy-datum in this field , no need to chnage in excel or manual update every time.
    and If you are not capturing  this field in BDC  then please try to use BAPI for uploading data.
    like.
    BAPI_EQUI_CHANGE or
    BAPI_EQMT_MODIFY.
    Regards,
    Prasenjit

  • HOW TO Create  variants for transaction MASS on LFA1 object?

    hOW TO Create  variants for transaction MASS on LFA1 object?
    Edited by: cheppalliakr on Nov 10, 2011 1:09 PM
    Moderator message: please do more research before asking, show what you have done yourself and provide more information when asking.
    Edited by: Thomas Zloch on Nov 10, 2011 3:10 PM

    Hi Oscar ,
    You need to create optional date prompt variable  in BW which fills your requirement .
    Ex : If you require report should always run for 1st of the month to last of month .Then create Optional date variable in BW with interval .write customer exit ,
    if from date is left blank it should take 1st of the month and if todate is left blank it should take last of the month .
    when creating webi schedules , leave prompts as blank.

  • HR ABAP How to Write BDC For Infotype 0586

    Hi Experts
    Can Any One tell me how to write BDC for Infotype 0586  and also 585.
    If we enter into the maintaining Screen, the lines in the Screen will dynamically changing depending on the values.
    When I am doing recording , If I press page down after entering values in top lines, the lines are changing and the records are not updating Correctly.
    I need to write BDC to Create Change.
    Can any one please help me in this regard?
    Thanks in Advance.
    Regards
    Avinash.

    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    http://www.google.co.in/search?hl=en&q=SAPBDCtable+control&meta=
    http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm

  • BDC for transaction J1IFQ

    Hi Experts,
    I am trying to develop BDC for transaction J1IFQ .
    When I do recording at the end I press SAVE it give me message that record is reconcilie and then I press logout.
    But when I use same recording in my program it dosn't save data. I am not able to find out what is the problem, please guide me.
    Thanking you.

    Hi Narayani
    It seems you need to inspect the new flow of the transaction and your BDC program more carefully. You might have skiped somethings to change.
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Program does BDC for transaction F-52 or f-53

    Hi GuruI am functional person and working with a developer in a program . The program does BDC for transaction F-52 or f-53 . I am uploading a file ,so that the program picks it and o either F-52 or F-53 based on condition. When i try to upload the program with mulitple record ,i am getting the message difference is too large to clear . If i execute the same program without doing any changes again i can see few more records getting posted . when i do next time remaining records are posted . Insted of getting posted in one ,I have to execute the program more than once .can any one help me out why this is happening

    i think you should ask  your programmer to use transaction SM35 to process the BDC in foreground mode (first changing the mode to A). I would think you will see what's going wrong then. There are a few transactions that look different in foreground mode than in background and you will see where the difference is if you use this method to process

  • BDC for Transaction WB02

    Hi,
       I am trying to write BDC for transaction WB02 , wherein each site(Plant) in our company is to be made a customer of each other, so as to fecilitate inter-site  movement of goods. the transaction works fine normally, but at the time of recording it comes to screen '315' and gets stuck and dont move ahead or either go back, it just gets stuck there, and has to be terminated.. i tried to replicate the transaction thru' BDC but it is getting stuck at the same screen.. can anybody tell me why this is happening and the possible solution for it..
    thanks.
    sharon

    Hi,
    What u can do is Read your Messages table with message types E(Error) and A(Abort). IF NOT sy-subrc IS INITIAlL means your transaction is successfull. So u can give your custom message saying IDOC sent successfully.
    READ TABLE IT_BDCMSGCOLL WITh KEY TYPE = 'E'.
    IF NOT sy-subrc IS INITIAL.
      READ TABLE IT_BDCMSGCOLL WITH KEY TYPE = 'A'
      IF NOT sy-subrc IS INITIAL.
      MESSAGE i000 WITH 'IDOC sent successfully'.
      ELSE.
      MESSAGE i000 WITH 'Problem in sending IDOC'.
      ENDIF.
    ELSE.
      MESSAGE i000 WITH 'Problem in sending IDOC'.
    ENDIF.
    Thanks,
    Vinod.

  • BDC for transaction FAGLSKF

    Hi,
    I need to develop BDC for transaction FAGLSKF. I tried recording the transaction and found that the line items are not getting recorded since the transaction uses an editable ALV and not a table control. I have seen some post regarding this but everyone is saying to use some FM's but all these FM's are not yet released by SAP & even if i use it I still have to seperately take care of validations. Please let me know if anyone has faced this issue and found an alternative.
    Thanks,
    Antony

    Hi ,
    Check this BAPI Function module BAPI_ACC_STAT_KEY_FIG_POST.
    Regards,
    Ashok.

  • How to write BDC for tcode F-32

    Hi Experts,
    How to write BDC for tcode F-32 .
    is it possible i recorded in SHDB BUT IF I AM DOING IT'S COMING WRONG .
    plz guide me sir.
    regars,
    Hari
    Edited by: hari311 on Oct 27, 2009 9:22 AM

    There might be that when u provide the data in the selction screen of F-32 and press process open items some custom program might be attached to it and gets executed...
    chek it out..
    if so..
    pass the bdcdata of the second screen into a memory id
    export t_bdcdata into v_memid.
    in that custoom report jus import this..
    then fill the t_bdcdata with the header information and call the transcation f-32..
    Edited by: imran khan on Oct 27, 2009 9:35 AM

  • How we can upload the data through BDC for transaction J1ID

    Hi guru
    How w can upload the data for Transaction J1ID.In this we want to upload the data for Customer Excise details. I want to upload the data on behalf of Customer (KUNNR) becasue customer is a primary KEY. Table name: J_1IMOCUST
    Fields. 11 Fields.plz provide some code logic.
    KUNNR     J_1IEXCD     J_1IEXRN     J_1IEXRG     J_1IEXDI     J_1IEXCO     J_1ICSTNO     J_1ILSTNO     J_1IPANNO     J_1IEXCICU     J_1ISERN

    Hi,
    I dont see any difficulties in doing BDC upload for J1ID, You have to record by giving the New Entries button and then enter all the details of customers using table control technique.
    SEARCH SCN for Table Control in BDC
    Regards
    Karthik D

Maybe you are looking for

  • Error Message when opening a Workbook

    Hi Gurus, When I open a particular workbook using BeX 3.x, I get the message "<internal error> Workbook Storage fault:(read/open)". Has anyone experienced this kind of error before?And if yes, can you please let me know how this can be corrected? Tha

  • How do i get pictures on my nano?

    I read everthing in the manual and even check online and still can't figure it out. Can someone help me? imac   Mac OS X (10.4.4)   imac   Mac OS X (10.4.4)  

  • APEX - iPhone friendly charts and templates

    Hi gurus, We are using iphones and ipad and apex and it seems that they are having some difficulties to work together. In fact we have found two main problems: * Chart wizards of APEX are flash based and apple solutions doesn't work with flash. The a

  • Various crw32.exe error

    Hi, I am using Crystal Report XI designer(11.0.0.1282) in the MS windows XP service pack3. Whenever I tried to open a repot, I am getting crw32.exe related error and the designer just crashed "R6025 -pure virtual function call" standard MS error with

  • AFCS.java doesn't handle the http redirect request

    Hi AFCS team,      I just tried out the java script for external authentication. By default, when calling new AFCS.AccountManager(accountURL);, I'll get an error like the following: "GET http://connectnow.acrobat.com/myaccount?mode=xml&accountonly=tr