BDC for ME21N Transaction

Dear All,
I have a requirement to create PO using transaction ME21N. I had written a code to create PO using BDC for transaction ME21. But the user wants it to be modified to ME21N. The user wants the PO created in the foreground like the one i created fro ME21. But is it possible to use BDC for ME21N or is there any other way i can change the BAPI to foreground processing like in BDC?
Regards,
Karthik

Hi Raghavender,
This is a report to display and validate the RFQ's. And once the user selects the RFQ and clicks on Create PO from RFQ push button, it should go to transaction 'ME21N' with values from RFQ. ( similar to what we do in ME21N, when we drag RFQ from the documents overview and drop it into cart, the values are populated). I want the similar functionality to happen when the user clicks on clicks on Create PO push button. But it should happen only in the foreground and not background.
Regards,
Karthik

Similar Messages

  • BDC for ME21N (Flat file format)

    Hello,
         I have to write a BDC for ME21N(stock transfer).... Someone pls give me the format of flat file... we need separate files for header and items or only one file is enough??? pls someone send me the format and code......
    my email id is [email protected]
    Thanks in advance...
    Regards,
    Maya.

    Hi
    see this and do accordingly
    REPORT zmm_bdcp_purchaseorderkb02
    NO STANDARD PAGE HEADING LINE-SIZE 255.
    Declaring internal tables *
    *-----Declaring line structure
    DATA : BEGIN OF it_dummy OCCURS 0,
    dummy(255) TYPE c,
    END OF it_dummy.
    *-----Internal table for line items
    DATA : BEGIN OF it_idata OCCURS 0,
    ematn(18), "Material Number.
    menge(13), "Qyantity.
    netpr(11), "Net Price.
    werks(4), "Plant.
    ebelp(5), "Item Number.
    END OF it_idata.
    *-----Deep structure for header data and line items
    DATA : BEGIN OF it_me21 OCCURS 0,
    lifnr(10), "Vendor A/c No.
    bsart(4), "A/c Type.
    bedat(8), "Date of creation of PO.
    ekorg(4), "Purchasing Organisation.
    ekgrp(3), "Purchasing Group.
    x_data LIKE TABLE OF it_idata,
    END OF it_me21.
    DATA : x_idata LIKE LINE OF it_idata.
    DATA : v_delimit VALUE ','.
    DATA : v_indx(3) TYPE n.
    DATA : v_fnam(30) TYPE c.
    DATA : v_count TYPE n.
    DATA : v_ne TYPE i.
    DATA : v_ns TYPE i.
    *include bdcrecx1.
    INCLUDE zmm_incl_purchaseorderkb01.
    Search help for file *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    IMPORTING
    file_name = p_file.
    START-OF-SELECTION.
    To upload the data into line structure *
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    filename = p_file
    filetype = 'DAT'
    TABLES
    data_tab = it_dummy.
    Processing the data from line structure to internal tables *
    REFRESH:it_me21.
    CLEAR :it_me21.
    LOOP AT it_dummy.
    IF it_dummy-dummy+0(01) = 'H'.
    v_indx = v_indx + 1.
    CLEAR it_idata.
    REFRESH it_idata.
    CLEAR it_me21-x_data.
    REFRESH it_me21-x_data.
    SHIFT it_dummy.
    SPLIT it_dummy AT v_delimit INTO it_me21-lifnr
    it_me21-bsart
    it_me21-bedat
    it_me21-ekorg
    it_me21-ekgrp.
    APPEND it_me21.
    ELSEIF it_dummy-dummy+0(01) = 'L'.
    SHIFT it_dummy.
    SPLIT it_dummy AT v_delimit INTO it_idata-ematn
    it_idata-menge
    it_idata-netpr
    it_idata-werks
    it_idata-ebelp.
    APPEND it_idata TO it_me21-x_data.
    MODIFY it_me21 INDEX v_indx.
    ENDIF.
    ENDLOOP.
    To open the group *
    PERFORM open_group.
    To populate the bdcdata table for header data *
    LOOP AT it_me21.
    v_count = v_count + 1.
    REFRESH it_bdcdata.
    PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0100',
    ' ' 'BDC_CURSOR' 'EKKO-LIFNR',
    ' ' 'BDC_OKCODE' '/00',
    ' ' 'EKKO-LIFNR' it_me21-lifnr,
    ' ' 'RM06E-BSART' it_me21-bsart,
    ' ' 'RM06E-BEDAT' it_me21-bedat,
    ' ' 'EKKO-EKORG' it_me21-ekorg,
    ' ' 'EKKO-EKGRP' it_me21-ekgrp,
    ' ' 'RM06E-LPEIN' 'T'.
    PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0120',
    ' ' 'BDC_CURSOR' 'RM06E-EBELP',
    ' ' 'BDC_OKCODE' '/00'.
    MOVE 1 TO v_indx.
    *-----To populate the bdcdata table for line item data
    LOOP AT it_me21-x_data INTO x_idata.
    CONCATENATE 'EKPO-EMATN(' v_indx ')' INTO v_fnam.
    PERFORM subr_bdc_table USING ' ' v_fnam x_idata-ematn.
    CONCATENATE 'EKPO-MENGE(' v_indx ')' INTO v_fnam.
    PERFORM subr_bdc_table USING ' ' v_fnam x_idata-menge.
    CONCATENATE 'EKPO-NETPR(' v_indx ')' INTO v_fnam.
    PERFORM subr_bdc_table USING ' ' v_fnam x_idata-netpr.
    CONCATENATE 'EKPO-WERKS(' v_indx ')' INTO v_fnam.
    PERFORM subr_bdc_table USING ' ' v_fnam x_idata-werks.
    v_indx = v_indx + 1.
    PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0120',
    ' ' 'BDC_CURSOR' 'RM06E-EBELP',
    ' ' 'BDC_OKCODE' '/00'.
    ENDLOOP.
    PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0120',
    ' ' 'BDC_CURSOR' 'RM06E-EBELP',
    ' ' 'BDC_OKCODE' '=BU'.
    PERFORM bdc_transaction USING 'ME21'.
    ENDLOOP.
    PERFORM close_group.
    End of selection event *
    END-OF-SELECTION.
    IF session NE 'X'.
    *-----To display the successful records
    WRITE :/10 text-001. "Sucess records
    WRITE :/10 SY-ULINE(20).
    SKIP.
    IF it_sucess IS INITIAL.
    WRITE :/ text-002.
    ELSE.
    WRITE :/ text-008, "Total number of Succesful records
    35 v_ns.
    SKIP.
    WRITE:/ text-003, "Vendor Number
    17 text-004, "Record number
    30 text-005. "Message
    ENDIF.
    LOOP AT it_sucess.
    WRITE:/4 it_sucess-lifnr,
    17 it_sucess-tabix CENTERED,
    30 it_sucess-sucess_rec.
    ENDLOOP.
    SKIP.
    *-----To display the erroneous records
    WRITE:/10 text-006. "Error Records
    WRITE:/10 SY-ULINE(17).
    SKIP.
    IF it_error IS INITIAL.
    WRITE:/ text-007. "No error records
    ELSE.
    WRITE:/ text-009, "Total number of erroneous records
    35 v_ne.
    SKIP.
    WRITE:/ text-003, "Vendor Number
    17 text-004, "Record number
    30 text-005. "Message
    ENDIF.
    LOOP AT it_error.
    WRITE:/4 it_error-lifnr,
    17 it_error-tabix CENTERED,
    30 it_error-error_rec.
    ENDLOOP.
    REFRESH it_sucess.
    REFRESH it_error.
    ENDIF.
    CODE IN INCLUDE.
    Include ZMM_INCL_PURCHASEORDERKB01
    DATA: it_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    DATA: it_MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA: E_GROUP_OPENED.
    *-----Internal table to store sucess records
    DATA:BEGIN OF it_sucess OCCURS 0,
    msgtyp(1) TYPE c,
    lifnr LIKE ekko-lifnr,
    tabix LIKE sy-tabix,
    sucess_rec(125),
    END OF it_sucess.
    DATA: g_mess(125) type c.
    *-----Internal table to store error records
    DATA:BEGIN OF it_error OCCURS 0,
    msgtyp(1) TYPE c,
    lifnr LIKE ekko-lifnr,
    tabix LIKE sy-tabix,
    error_rec(125),
    END OF it_error.
    Selection screen
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS session RADIOBUTTON GROUP ctu. "create session
    SELECTION-SCREEN COMMENT 3(20) text-s07 FOR FIELD session.
    SELECTION-SCREEN POSITION 45.
    PARAMETERS ctu RADIOBUTTON GROUP ctu. "call transaction
    SELECTION-SCREEN COMMENT 48(20) text-s08 FOR FIELD ctu.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(20) text-s01 FOR FIELD group.
    SELECTION-SCREEN POSITION 25.
    PARAMETERS group(12). "group name of session
    SELECTION-SCREEN COMMENT 48(20) text-s05 FOR FIELD ctumode.
    SELECTION-SCREEN POSITION 70.
    PARAMETERS ctumode LIKE ctu_params-dismode DEFAULT 'N'.
    "A: show all dynpros
    "E: show dynpro on error only
    "N: do not display dynpro
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 48(20) text-s06 FOR FIELD cupdate.
    SELECTION-SCREEN POSITION 70.
    PARAMETERS cupdate LIKE ctu_params-updmode DEFAULT 'L'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(20) text-s03 FOR FIELD keep.
    SELECTION-SCREEN POSITION 25.
    PARAMETERS: keep AS CHECKBOX. "' ' = delete session if finished
    "'X' = keep session if finished
    SELECTION-SCREEN COMMENT 48(20) text-s09 FOR FIELD e_group.
    SELECTION-SCREEN POSITION 70.
    PARAMETERS e_group(12). "group name of error-session
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 51(17) text-s03 FOR FIELD e_keep.
    SELECTION-SCREEN POSITION 70.
    PARAMETERS: e_keep AS CHECKBOX. "' ' = delete session if finished
    "'X' = keep session if finished
    SELECTION-SCREEN END OF LINE.
    PARAMETERS:p_file LIKE rlgrap-filename.
    at selection screen *
    AT SELECTION-SCREEN.
    group and user must be filled for create session
    IF SESSION = 'X' AND
    GROUP = SPACE. "OR USER = SPACE.
    MESSAGE E613(MS).
    ENDIF.
    create batchinput session *
    FORM OPEN_GROUP.
    IF SESSION = 'X'.
    SKIP.
    WRITE: /(20) 'Create group'(I01), GROUP.
    SKIP.
    *----open batchinput group
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    GROUP = GROUP
    USER = sy-uname.
    WRITE:/(30) 'BDC_OPEN_GROUP'(I02),
    (12) 'returncode:'(I05),
    SY-SUBRC.
    ENDIF.
    ENDFORM. "OPEN_GROUP
    end batchinput session *
    FORM CLOSE_GROUP.
    IF SESSION = 'X'.
    *------close batchinput group
    CALL FUNCTION 'BDC_CLOSE_GROUP'.
    WRITE: /(30) 'BDC_CLOSE_GROUP'(I04),
    (12) 'returncode:'(I05),
    SY-SUBRC.
    ELSE.
    IF E_GROUP_OPENED = 'X'.
    CALL FUNCTION 'BDC_CLOSE_GROUP'.
    WRITE: /.
    WRITE: /(30) 'Fehlermappe wurde erzeugt'(I06).
    ENDIF.
    ENDIF.
    ENDFORM. "CLOSE_GROUP
    Start new transaction according to parameters *
    FORM BDC_TRANSACTION USING TCODE TYPE ANY.
    DATA: L_SUBRC LIKE SY-SUBRC.
    *------batch input session
    IF SESSION = 'X'.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = TCODE
    TABLES
    DYNPROTAB = it_BDCDATA.
    WRITE: / 'BDC_INSERT'(I03),
    TCODE,
    'returncode:'(I05),
    SY-SUBRC,
    'RECORD:',
    SY-INDEX.
    ELSE.
    REFRESH it_MESSTAB.
    CALL TRANSACTION TCODE USING it_BDCDATA
    MODE CTUMODE
    UPDATE CUPDATE
    MESSAGES INTO it_MESSTAB.
    L_SUBRC = SY-SUBRC.
    WRITE: / 'CALL_TRANSACTION',
    TCODE,
    'returncode:'(I05),
    L_SUBRC,
    'RECORD:',
    SY-INDEX.
    ENDIF.
    Message handling for Call Transaction *
    perform subr_mess_hand using g_mess.
    *-----Erzeugen fehlermappe
    IF L_SUBRC <> 0 AND E_GROUP <> SPACE.
    IF E_GROUP_OPENED = ' '.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    GROUP = E_GROUP
    USER = sy-uname
    KEEP = E_KEEP.
    E_GROUP_OPENED = 'X'.
    ENDIF.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = TCODE
    TABLES
    DYNPROTAB = it_BDCDATA.
    ENDIF.
    REFRESH it_BDCDATA.
    ENDFORM. "BDC_TRANSACTION
    Form subr_bdc_table *
    text
    -->P_0220 text *
    -->P_0221 text *
    -->P_0222 text *
    FORM subr_bdc_table USING VALUE(P_0220) TYPE ANY
    VALUE(P_0221) TYPE ANY
    VALUE(P_0222) TYPE ANY.
    CLEAR it_bdcdata.
    IF P_0220 = ' '.
    CLEAR it_bdcdata.
    it_bdcdata-fnam = P_0221.
    it_bdcdata-fval = P_0222.
    APPEND it_bdcdata.
    ELSE.
    it_bdcdata-dynbegin = P_0220.
    it_bdcdata-program = P_0221.
    it_bdcdata-dynpro = P_0222.
    APPEND it_bdcdata.
    ENDIF.
    ENDFORM. " subr_bdc_table
    Form subr_mess_hand *
    text *
    -->P_G_MESS text *
    FORM subr_mess_hand USING P_G_MESS TYPE ANY.
    LOOP AT IT_MESSTAB.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    ID = it_messtab-msgid
    LANG = it_messtab-msgspra
    NO = it_messtab-msgnr
    v1 = it_messtab-msgv1
    v2 = it_messtab-msgv2
    IMPORTING
    MSG = P_G_MESS
    EXCEPTIONS
    OTHERS = 0.
    CASE it_messtab-msgtyp.
    when 'E'.
    it_error-error_rec = P_G_MESS.
    it_error-lifnr = it_me21-lifnr.
    it_error-tabix = v_count.
    APPEND IT_ERROR.
    when 'S'.
    it_sucess-sucess_rec = P_G_MESS.
    it_sucess-lifnr = it_me21-lifnr.
    it_sucess-tabix = v_count.
    APPEND IT_SUCESS.
    endcase.
    ENDLOOP.
    Describe table it_sucess lines v_ns.
    Describe table it_error lines v_ne.
    ENDFORM. " subr_mess_hand
    Regards
    Anji

  • Error while running a BDC for the Transaction F-02

    Hi,
           I'm getting an error <b><i>"Parking not possible during Batch Input"</i></b> while running a BDC for the transaction F-02.
           When i click on the error message it displays the message [b<i>]"In Customizing, you can control whether an error message is issued."</b></i>
            How to solve this issue?.
            Waiting for ur replies.........
    Regards
    N.Senthil

    Hi,
    When you are doing the recording in SHDB, and in the same screen where the TCODE to be recorded is given, there are options that you can choose called "Recording Parameters"...Select the checkbox which says "Not a Batch Input Session", this will set the sy-binpt variable to " "(in a recording by default it is "X")...and you will not get this error...
    Also make sure while writing the BDC program to make use of the "bdc options" parameter which has this property to switch of sy-binpt...
        Refer below theard for sample bdc code for f-02.
    https://forums.sdn.sap.com/click.jspa?searchID=5126766&messageID=1538409
    Regards

  • Lsmw for me21n transaction

    Hi ,
    I had a problem while doing lsmw for me21n transaction. My problem is how to handle table control in that. can any one send some screen shots or link, how to do table control
    Thanks & Regards,
    sreehari
    Moderator Message: Search for available information on the web before posting
    Edited by: kishan P on Sep 3, 2010 9:51 AM

    Hi ,
    I had a problem while doing lsmw for me21n transaction. My problem is how to handle table control in that. can any one send some screen shots or link, how to do table control
    Thanks & Regards,
    sreehari
    Moderator Message: Search for available information on the web before posting
    Edited by: kishan P on Sep 3, 2010 9:51 AM

  • Bdc for 3 transactions

    Hi gurus
    I am writing a bdc for 3 transaction , it runs fines if i execute them seperately , can u let me know who do i merge 3 transactions in one BDC . transactions used are FBRA, F.80 and F-04 .
    is their any specific way .... pls send the code if possible.....
    thanks in advance.
    its urgent

    Hi Shweta
    do u want to run all 3 transaction at a time or run separtely..
    If u want 3 at a time then
    define 3 internal table and 3 BDC struture.
    In FM BDC_INSERT use appropriate internal for correct transactio.
    Like...
    FM BDC_OPEN_GROUP..
    Call Function 'BDC_INSERT'
    Exporting
    tcode = 'FRBA'
    importing
    table = itab1.
    Call Function 'BDC_INSERT'
    Exporting
    tcode = 'F-04'
    importing
    table = itab2.
    Call Function 'BDC_INSERT'
    Exporting
    tcode = 'F.80'
    importing
    table = itab3.
    call FM "BDC_CLOSE_GROUP.
    Reward me if its useful
    Regards
    Ravi

  • Clarification relating to BDC for MD61 transaction

    Hi,
        Did  any one made any development for MD61 transaction. I am planning to do an BDC for upload of planning data
    for the different periods and for different materials. DId any one found any complexities in this development and
    how it is suggestible.
      I am planning to bring sales quotation data and upload as demand in MD61
    Regards
    madan

    Hi,
        Sales quotations are the proposals & their is not any reference of delivery date that we could take as production finish date i.e material availablity/ promising date in demand manangement.
        So, you need to rethink on quotation data & try to fix peiod either month or week or day that could reduce development complexity.
    Rgd,
    Chetan

  • Error in ecatt testing for me21n transaction.

    Hi All,
    I have created Test script, test data container and Test configuration for ME21N (create purchase order) transaction
    While executing test configuration, I got below error message.
    S00349 Field COBL-KOSTL. does not exist in the screen SAPLMEGUI 0014
    Please help me for further action.
    Many thanks
    Vikas

    Hi Vikas,
    Before running the test configuration, Please check ME21N transaction manually and find out the field
    COBL-KOSTL and check whether it is mandatory or not.
    If it found check your script whether that field is properly recorded or not.
    May be this field is newly added as mandatory for that transaction
    Regards,
    Santosh.
    Edited by: ABAP Santosh on Oct 19, 2009 9:17 AM

  • About bdc for aiab transaction,urgent plzzzzzzzz

    hi all,
    i m doing BDC for tcode AIAB.
    here the table control is coming in to picture and i don know how to handle table control,
    so if anybody can help me to come over this issue??
    my wrk is still pending,plzz try it n giv me reply,my problm is in 2nd screen in transaction,
    plzz reply asap.
    thanks
    regards
    murty

    hi,
    Following is a sample code of handling table control in BDC.
    REPORT Y730_BDC5 .
    *HANDLING TABLE CONTROL IN BDC
    DATA : BEGIN OF IT_DUMMY OCCURS 0,
           DUMMY(100) TYPE C,
           END OF IT_DUMMY.
    DATA : BEGIN OF IT_XK01 OCCURS 0,
           LIFNR(10) TYPE C,
           BUKRS(4)  TYPE C,
           EKORG(4)  TYPE C,
           KTOKK(4)  TYPE C,
           NAME1(30) TYPE C,
           SORTL(10) TYPE C,
           LAND1(3)  TYPE C,
           SPRAS(2)  TYPE C,
           AKONT(6)  TYPE C,
           FDGRV(2)  TYPE C,
           WAERS(3)  TYPE C,
           END OF IT_XK01,
           BEGIN OF IT_BANK OCCURS 0,
           BANKS(3)  TYPE C,
           BANKL(10) TYPE C,
           BANKN(10) TYPE C,
           KOINH(30) TYPE C,
           LIFNR(10) TYPE C,
           END OF IT_BANK.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           IT_BDCMSGCOLL LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
       FILENAME                      = 'C:\VENDOR.TXT'
       FILETYPE                      = 'ASC'
    TABLES
       DATA_TAB                      = IT_DUMMY.
    LOOP AT IT_DUMMY.
      IF IT_DUMMY-DUMMY+0(2) = '11'.
        IT_XK01-LIFNR = IT_DUMMY-DUMMY+2(10).
        IT_XK01-BUKRS = IT_DUMMY-DUMMY+12(4).
        IT_XK01-EKORG = IT_DUMMY-DUMMY+16(4).
        IT_XK01-KTOKK = IT_DUMMY-DUMMY+20(4).
        IT_XK01-NAME1 = IT_DUMMY-DUMMY+24(30).
        IT_XK01-SORTL = IT_DUMMY-DUMMY+54(10).
        IT_XK01-LAND1 = IT_DUMMY-DUMMY+64(3).
        IT_XK01-SPRAS = IT_DUMMY-DUMMY+67(2).
        IT_XK01-AKONT = IT_DUMMY-DUMMY+69(6).
        IT_XK01-FDGRV = IT_DUMMY-DUMMY+75(2).
        IT_XK01-WAERS = IT_DUMMY-DUMMY+77(3).
        APPEND IT_XK01.
      ELSE.
        IT_BANK-BANKS = IT_DUMMY-DUMMY+2(3).
        IT_BANK-BANKL = IT_DUMMY-DUMMY+5(10).
        IT_BANK-BANKN = IT_DUMMY-DUMMY+15(10).
        IT_BANK-KOINH = IT_DUMMY-DUMMY+25(30).
        IT_BANK-LIFNR = IT_DUMMY-DUMMY+55(10).
        APPEND IT_BANK.
      ENDIF.
    ENDLOOP.
    LOOP AT IT_XK01.
    REFRESH IT_BDCDATA.
    perform bdc_dynpro      using 'SAPMF02K' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-REF_LIFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                  IT_XK01-LIFNR.
    perform bdc_field       using 'RF02K-BUKRS'
                                  IT_XK01-BUKRS.
    perform bdc_field       using 'RF02K-EKORG'
                                  IT_XK01-EKORG.
    perform bdc_field       using 'RF02K-KTOKK'
                                  IT_XK01-KTOKK.
    perform bdc_dynpro      using 'SAPMF02K' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-TELX1'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFA1-NAME1'
                                  IT_XK01-NAME1.
    perform bdc_field       using 'LFA1-SORTL'
                                  IT_XK01-SORTL.
    perform bdc_field       using 'LFA1-LAND1'
                                  IT_XK01-LAND1.
    perform bdc_field       using 'LFA1-SPRAS'
                                  IT_XK01-SPRAS.
    perform bdc_dynpro      using 'SAPMF02K' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-KOINH(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    DATA : FNAM(20) TYPE C,
           IDX      TYPE C.
      MOVE 1 TO IDX.
    LOOP AT IT_BANK WHERE LIFNR = IT_XK01-LIFNR.
      CONCATENATE 'LFBK-BANKS(' IDX ')' INTO FNAM.
      perform bdc_field       using FNAM
                                    IT_BANK-BANKS.
      CONCATENATE 'LFBK-BANKL(' IDX ')' INTO FNAM.
      perform bdc_field       using FNAM
                                    IT_BANK-BANKL.
      CONCATENATE 'LFBK-BANKN(' IDX ')' INTO FNAM.
      perform bdc_field       using FNAM
                                    IT_BANK-BANKN.
      CONCATENATE 'LFBK-KOINH(' IDX ')' INTO FNAM.
      perform bdc_field       using FNAM
                                    IT_BANK-KOINH.
      IDX = IDX + 1.
    ENDLOOP.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-BANKS(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPMF02K' '0210'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB1-FDGRV'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFB1-AKONT'
                                  IT_XK01-AKONT.
    perform bdc_field       using 'LFB1-FDGRV'
                                  IT_XK01-FDGRV.
    perform bdc_dynpro      using 'SAPMF02K' '0215'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB1-ZTERM'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0220'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFB5-MAHNA'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0310'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFM1-WAERS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFM1-WAERS'
                                  IT_XK01-WAERS.
    perform bdc_dynpro      using 'SAPMF02K' '0320'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'WYT3-PARVW(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    CALL TRANSACTION 'XK01' USING IT_BDCDATA
                            MODE  'A'
                           UPDATE 'S'
                         MESSAGES INTO IT_BDCMSGCOLL.
    ENDLOOP.
    FORM BDC_DYNPRO USING PROG SCR.
      CLEAR IT_BDCDATA.
      IT_BDCDATA-PROGRAM = PROG.
      IT_BDCDATA-DYNPRO  = SCR.
      IT_BDCDATA-DYNBEGIN = 'X'.
      APPEND IT_BDCDATA.
    ENDFORM.
    FORM BDC_FIELD USING FNAM FVAL.
      CLEAR IT_BDCDATA.
      IT_BDCDATA-FNAM = FNAM.
      IT_BDCDATA-FVAL  = FVAL.
      APPEND IT_BDCDATA.
    ENDFORM.
    <b>Hope this is helpful.</b>

  • User_Exit (Condition Class) for ME21N Transaction

    Hello Gurus !!.
    I need one User_Exit for the ME21N Transaction what
    is activate into the moment of Conditions Class input
    (tax), the idea is to take one value of one Z table, make
    one calculate betwen Z table Value and Condition Class tax
    whose result will be return to the Value of Condition.
    Thank Very Much for yours help.

    Hi,
    You can try any one of the user exit;
    MM06E005 - Customer fields in purchasing document
    MEQUERY1 - Enhancement to Document Overview ME21N/ME51N
    Bye,
    Muralidhara

  • Need help on BDC  for MB1A transaction.

    Hello Abapers,
    I need to create a BDC for t-code MB1A to do the Goods Issue with reference to reservation.
    I am not able to use the BAPI 'BAPI_GOODSMVT_CREATE' to do the goods issue as there are some additional functionalities (Stock Determination) to be included.
    The problem I am facing is, The stock determination will determine the Quantity, Storage Location and Valuation type for every item of the reservation. The quantity will be picked up from multiple storage locations and as a result the line item of reservation will be split into two or more for Goods Issue.
    When this happens, If the reservation is having multiple line items, tracking the next item becomes a problem.
    Please suggest a way to approach this problem.
    Usefull answers will be rewarded.
    Thanks in Advance,
    Vinutha.

    Hi
    The COMMIT before and after CALL TRANSACTION is useless, The transaction FB01 calls the commit by itself, so u need only:
    CALL TRANSACTION 'FB01' USING BDC_TAB
                                                   MODE 'N'
                                                   UPDATE 'S'
                                                   MESSAGE ITAB.
    Now ITAB is like structure BDCMSGCOLL, so after CALL Transaction u can use message statament in order to show a popup with message:
    CALL TRANSACTION 'FB01' USING BDC_TAB
                                                   MODE 'N'
                                                   UPDATE 'S'
                                                   MESSAGE ITAB.
    LOOP AT ITAB.
    MESSAGE ID ITAB-MSGID TYPE 'I' NUMBER ITAB-MSGNR
             WITH ITAB-MSGV1 ITAB-MSGV2 ITAB-MSGV3 ITAB-MSGV4.
    ENDLOOP.
    Max

  • BDC for TS01 Transaction

    Dear All
    Manual entry in the TS01(Create Security) transaction behaves for entering the amount values differently as manual entry in the amount field will get saved but the entry through program is not getting saved.
    Data is availabe in BDCDATA table but when it when it populates and gets saved, amount will be blank and transaction gets saved.
    Need urgent on this issue.
    Help is greatly appreciated.
    Thanks,
    Azhar.

    Hi Mohammed,
        The main program associated to this program is a report type program. You cannot do a BDC for such programs.
    Instead try the bapi: BAPI_FTR_SECURITY_CREATE
    Regards,
    Ravi

  • Problem with OPERATION TEXT(LTXA1) uploading using BDC For C202 Transaction

    Hi Experts,
    Im presently doing a BDC for the trransaction C202 (Change Master Recipe),my task was to upload the 'OPERATION TEXT' field PLPOD-LTXA1 which is actually Long text to an existing master recipe from a flat file during updation of the 'OPERATION TEXT the number of lines i was able to were 34 which we number lines on the displayed page and while updating the 35th line using the concept of bdc table control it is failing to insert the update text.
    I used all the ok codes but failed to update more than 34 lines.So,can someone tell me how to update the longtext beyound it.
    This is the Screenshot of my problem:
    [BDC_C202_error|http://www.freeimagehosting.net/uploads/79af6bac49.jpg]
    Thanx in advance.

    Hi,
    There is a better way of doing the long text upload in SAP. In your BDC, if I change the text editor, the BDC will not work.
    Hence ,
    Use function module " Save_Text" to update long texts in SAP.
    Please check its FM documentation or perform a search for this FM in SDN for more clarity.
    Write back in case you face further issues.
    Regards,
    Rijuraj
    Edited by: Rijuraj Raju on Sep 10, 2010 3:05 PM

  • BDC for ME21n

    Hi All,
    I need to create a BDC program for the creation of purchase orders using tcode ME21n.
    I have Header data & Item data to upload while creating the purchase order.
    How to handle the uploading of header data & item data.
    How should we code the program & how the flatfile should be designed.
    Regards,
    Sudhir

    Hi
    Here I am giving you a sample code..where we need to create PO's from Z table...
    Regarding the structure of the flat file, it is purely based on the client and the functional team.. they will know better which fields are to be filled. So, you have to sit with the functional guy and do the recording using SHDB tcode and then decide with the flat file.
    *& Report  ZZPO_BDC
    REPORT  ZZPO_BDC no standard page heading line-size 255.
    tables: zzpo_staging.
    DATA  id type string..
    DATA: fnam(20) type c,
           matnr type bstmg.
    data: quan(13) type c,
          netpr(15) type c,
          qty(13) type c,
          gp(15) type c.
    DATA  idx type string.
    data: i_bdcdata like bdcdata occurs 1 with header line,
          i_msg like bdcmsgcoll occurs 1 with header line.
    DATA  W_STR type string.
    DATA: IT_STAGING TYPE STANDARD TABLE OF ZZPO_STAGING WITH HEADER LINE,
          ti_staging type standard table of zzpo_staging with header line,
          KT_STAGING TYPE STANDARD TABLE OF ZZPO_STAGING WITH HEADER LINE.
    *CALL FUNCTION 'BDC_OPEN_GROUP'
    * EXPORTING
    *   CLIENT                    = SY-MANDT
    *   DEST                      = 'zzpo'
    *   GROUP                     =  'zzpo'
    **   HOLDDATE                  = FILLER8
    *   KEEP                      = 'X'
    *   USER                      =  sy-uname
    **   RECORD                    = FILLER1
    **   PROG                      = SY-CPROG
    **   DCPFM                     = '%'
    **   DATFM                     = '%'
    ** IMPORTING
    **   QID                       =
    ** EXCEPTIONS
    **   CLIENT_INVALID            = 1
    **   DESTINATION_INVALID       = 2
    **   GROUP_INVALID             = 3
    **   GROUP_IS_LOCKED           = 4
    **   HOLDDATE_INVALID          = 5
    **   INTERNAL_ERROR            = 6
    **   QUEUE_ERROR               = 7
    **   RUNNING                   = 8
    **   SYSTEM_LOCK_ERROR         = 9
    **   USER_INVALID              = 10
    **   OTHERS                    = 11
    *IF SY-SUBRC <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    start-of-selection.
    *perform open_group.
      SELECT * FROM ZZPO_STAGING INTO TABLE IT_STAGING.
      select * from zzpo_staging into table ti_staging.
      SELECT * fROM ZZPO_STAGING INTO TABLE KT_sTAGING.
        delete adjacent duplicates from it_staging comparing vendor docdate.
      loop at IT_STAGING.
        perform bdc_dynpro      using 'SAPMM06E' '0100'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'EKKO-EKGRP'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'EKKO-LIFNR'
                                       IT_STAGING-vendor.
        perform bdc_field       using 'RM06E-BSART'
                                      'NB'.
        perform bdc_field       using 'RM06E-BEDAT'
                                       IT_STAGING-docdate.
        perform bdc_field       using 'EKKO-EKORG'
                                       IT_STAGING-purorg.
        perform bdc_field       using 'EKKO-EKGRP'
                                       IT_STAGING-purgrp.
        perform bdc_field       using 'RM06E-LPEIN'
                                      'T'.
    *  endloop.
        perform bdc_dynpro      using 'SAPMM06E' '0120'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RM06E-EPSTP(01)'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=DETA'.
        perform bdc_dynpro      using 'SAPMM06E' '0120'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'EKPO-WERKS(01)'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        move 1 to id.
        loop at TI_STAGING WHERE VENDOR = IT_STAGING-VENDOR AND DOCDATE = IT_STAGING-DOCDATE.
          concatenate 'RM06E-EPSTP(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-itmcategory.
          concatenate 'EKPO-KNTTP(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-accassignment.
          concatenate 'EKPO-EMATN(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-material.
          concatenate 'EKPO-TXZ01(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-shortxt.
          quan = ti_staging-poqty.
          concatenate 'EKPO-MENGE(0' id ')' into fnam.
          perform bdc_field       using fnam quan.
          concatenate 'RM06E-EEIND(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-deliverydate.
          netpr = ti_staging-netpr.
          concatenate 'EKPO-NETPR(0' id ')' into fnam.
          perform bdc_field       using fnam netpr.
          concatenate 'EKPO-MATKL(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-mategroup.
          concatenate 'EKPO-WERKS(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-plant.
          ID = ID + 1.
        ENDLOOP.
    *    perform bdc_dynpro      using 'SAPMM06E' '0111'.
    *    perform bdc_field       using 'BDC_CURSOR'
    *                                  'EKPO-MENGE'.
    *    perform bdc_field       using 'BDC_OKCODE'
    *                                  '/00'.
    *perform bdc_field       using 'EKPO-KNTTP'
    *                              'N'.
    *perform bdc_field       using 'EKPO-TXZ01'
    *                              'Office Supplies'.
    *perform bdc_field       using 'EKPO-MENGE'
    *                              '2'.
    *    perform bdc_field       using 'EKPO-SPINF'
    *                                  'B'.
    *    perform bdc_field       using 'EKPO-BPUMN'
    *                                  '1'.
    *    perform bdc_field       using 'EKPO-BPUMZ'
    *                                  '1'.
    *    perform bdc_field       using 'EKPO-PRSDR'
    *                                  'X'.
    *perform bdc_field       using 'RM06E-EEIND'
    *                              '06/24/2008'.
    *perform bdc_field       using 'RM06E-LPEIN'
    *                              'D'.
    *    perform bdc_field       using 'EKPO-WEPOS'
    *                                  'X'.
    *    perform bdc_field       using 'EKPO-REPOS'
    *                                  'X'.
        loop at TI_STAGING where vendor = it_staging-vendor and docdate = it_staging-docdate.
          perform bdc_dynpro      using 'SAPMM06E' '0511'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=ENTE'.
          perform bdc_field       using 'EKKN-SAKTO'
                                         TI_STAGING-glaccount.
          perform bdc_field       using 'BDC_CURSOR'
                                        'DKACB-FMORE'.
          perform bdc_field       using 'DKACB-FMORE'
                                        'X'.
          perform bdc_dynpro      using 'SAPLKACB' '0002'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'COBL-VORNR'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=ENTE'.
          perform bdc_field       using 'COBL-NPLNR'
                                         TI_STAGING-networkid.
          perform bdc_field       using 'COBL-VORNR'
                                         TI_STAGING-activity.
    *    perform bdc_dynpro      using 'SAPMM06E' '0120'.
    *    perform bdc_field       using 'BDC_CURSOR'
    *                                  'RM06E-EPSTP(02)'.
    *    perform bdc_field       using 'BDC_OKCODE'
    *                                  '=DETA'.
    *    perform bdc_field       using 'RM06E-EBELP'
    *                                  '10'.
    *    perform bdc_dynpro      using 'SAPMM06E' '0120'.
    *    perform bdc_field       using 'BDC_CURSOR'
    *                                  'EKPO-WERKS(02)'.
    *    perform bdc_field       using 'BDC_OKCODE'
    *                                  '/00'.
    *    perform bdc_field       using 'RM06E-EBELP'
    *                                  '10'.
    *perform bdc_field       using 'RM06E-EPSTP(02)'
    *                              'd'.
    *perform bdc_field       using 'EKPO-KNTTP(02)'
    *                              'n'.
    *perform bdc_field       using 'EKPO-TXZ01(02)'
    *                              'adage artwork'.
    *perform bdc_field       using 'EKPO-MENGE(02)'
    *                              '                1'.
    *perform bdc_field       using 'RM06E-EEIND(02)'
    *                              '06242008'.
    *perform bdc_field       using 'EKPO-MATKL(02)'
    *                              'm1'.
    *perform bdc_field       using 'EKPO-WERKS(02)'
    *                              'a001'.
    *    perform bdc_field       using 'BDC_OKCODE'
    *                                  '/00'.
          perform bdc_dynpro      using 'SAPMM06E' '0111'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'EKPO-MENGE'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '/00'.
    *    perform bdc_field       using 'EKPO-MATKL'
    *                                  'M1'.
    *    perform bdc_field       using 'EKPO-TXZ01'
    *                                   wa_jtab-j4.
    *    perform bdc_field       using 'EKPO-PRSDR'
    *                                  'X'.
    *    perform bdc_field       using 'RM06E-EEIND'
    *                                   wa_jtab-j6.
          perform bdc_field       using 'RM06E-LPEIN'
                                        'D'.
          perform bdc_field       using 'EKPO-WEPOS'
                                        'X'.
          perform bdc_field       using 'EKPO-UEBTK'
                                        'X'.
          perform bdc_field       using 'EKPO-WEBRE'
                                        'X'.
          perform bdc_field       using 'BDC_OKCODE'
                                       '/00'.
          perform bdc_field       using 'BDC_OKCODE'
                                         '=ENTE'.
          move 1 to idx.
          perform bdc_dynpro      using 'SAPLMLSP' '0200'.
          perform bdc_field       using 'BDC_OKCODE'
                                       '/00'.
          perform bdc_field       using 'BDC_OKCODE'
                                         '=ENTE'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '/00'.
          perform bdc_field       using 'RM11P-HEADTEXT'
                                          'adage'.
          perform bdc_field       using  'BDC_CURSOR' 'ESLL-TBTWR(01)'.
          perform bdc_field       using 'RM11P-NEW_ROW'
                                         '10'.
    *      concatenate 'ESLL-KTEXT1(0' idx ')' into fnaml.
    *      perform bdc_field       using fnaml wa_ktab-k1.
    *      concatenate 'ESLL-MENGE(0' idx ')' into fnaml.
    *      perform bdc_field       using fnaml wa_ktab-k2.
    *      concatenate 'ESLL-MEINS(0' idx ')' into fnaml.
    *      perform bdc_field       using fnaml wa_ktab-k3.
    *      concatenate 'ESLL-TBTWR(0' idx ')' into fnaml.
    *      perform bdc_field       using fnaml wa_ktab-k4.
    *      IDX = IDX + 1.
    *      loop at KT_STAGING where vendor = it_staging-vendor and docdate = it_staging-docdate and itmcategory is not initial.
            IF TI_STAGING-ITMCATEGORY IS NOT INITIAL.
            qty = ti_staging-serqty.
            gp  = ti_staging-sergrossprice.
            perform bdc_field       using 'ESLL-KTEXT1(01)' TI_STAGING-sertext.
            perform bdc_field       using 'ESLL-MENGE(01)'  qty.
            perform bdc_field       using 'ESLL-MEINS(01)'  TI_STAGING-seruom.
            perform bdc_field      using 'ESLL-TBTWR(01)'   gp.
    *    endloop.
    *    move 1 to cnt.
    *    loop at KT_STAGING WHERE VENDOR = IT_STAGING-VENDOR AND DOCDATE = IT_STAGING-DOCDATE and itmcategory is not initial.
            perform bdc_dynpro      using 'SAPLMLSK' '0200'.
            perform bdc_field       using 'BDC_CURSOR'
                                          'RM11K-VORNR(01)'.
            perform bdc_field       using 'BDC_OKCODE'
                                          '/00'.
            perform bdc_field       using 'VRTKZ1'
                                          'X'.
    *      concatenate 'ESKN-SAKTO(0' IDX ')' into fnamk.
    *      perform bdc_field       using fnam wa_ktab-k5.
    *      concatenate 'ESKN-NPLNR(0' IDX ')' into fnamk.
    *      perform bdc_field       using fnam wa_ktab-k6.
    *      concatenate 'RM11K-VORNR(0' IDX ')' into fnamk.
    *      perform bdc_field       using fnam wa_ktab-k7.
    *      cnt = cnt + 1.
            PERFORM BDC_FIELD USING 'ESKN-SAKTO(01)' TI_STAGING-serglaccount.
            PERFORM BDC_FIELD USING 'ESKN-NPLNR(01)' TI_STAGING-sernetwork.
            PERFORM BDC_FIELD USING 'RM11K-VORNR(01)' TI_STAGING-seractivity.
    *      endloop.
          perform bdc_dynpro      using 'SAPLKACB' '0002'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'COBL-NPLNR'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=ENTE'.
          perform bdc_field       using 'COBL-NPLNR'
                                         kt_STAGING-sernetwork.
          perform bdc_field       using 'COBL-VORNR'
                                         kt_STAGING-seractivity.
          perform bdc_dynpro      using 'SAPLMLSK' '0200'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'ESLL-INTROW'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '/00'.
          perform bdc_field       using 'VRTKZ1'
                                        'X'.
        perform bdc_dynpro      using 'SAPMM06E' '0200'.
        perform bdc_field       using 'BDC_CURSOR'
                                  'RM06E-EBELP'.
        perform bdc_field       using 'BDC_OKCODE'
                                  '=BACK'.
        perform bdc_dynpro      using 'SAPLMLSP' '0200'.
        perform bdc_field       using 'BDC_OKCODE'
                                         '=SAV'.
      ELSE.
        perform bdc_dynpro      using 'SAPMM06E' '0100'.
        perform bdc_field       using 'BDC_OKCODE'
                                         '=SAV'.
      ENDIF.
    endloop.
    *perform bdc_field       using 'RM11P-HEADTEXT'
    *                              'adage artwork'.
    *    perform bdc_field       using 'BDC_CURSOR'
    *                                  'ESLL-KTEXT1(01)'.
    *perform bdc_field       using 'RM11P-NEW_ROW'
    *                              '10'.
    *perform bdc_transaction using 'ME21'.
    CALL TRANSACTION 'ME21' USING I_BDCDATA MODE 'A' messages into i_msg.
    *clear: kt_staging,ti_staging,it_staging,i_bdcdata.
      endloop.
    *    CALL FUNCTION 'BDC_INSERT'
    *     EXPORTING
    *       TCODE                  = 'ME21'
    **    POST_LOCAL             = NOVBLOCAL
    **    PRINTING               = NOPRINT
    **    SIMUBATCH              = ' '
    **    CTUPARAMS              = ' '
    *      TABLES
    *        DYNPROTAB              = I_BDCDATA
    **  EXCEPTIONS
    **    INTERNAL_ERROR         = 1
    **    NOT_OPEN               = 2
    **    QUEUE_ERROR            = 3
    **    TCODE_INVALID          = 4
    **    PRINTING_INVALID       = 5
    **    POSTING_INVALID        = 6
    **    OTHERS                 = 7
    *    IF SY-SUBRC <> 0.
    *      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *    ENDIF.
    *Using Call Transaction Statement Call the transaction in back ground mode/fore ground mode
      LOOP AT I_MSG.
        CALL FUNCTION 'FORMAT_MESSAGE'
         EXPORTING
           ID              = I_MSG-MSGID
           LANG            = SY-LANGU
           NO              = I_MSG-MSGNR
           V1              = I_MSG-MSGV1
           V2              = I_MSG-MSGV2
           V3              = I_MSG-MSGV3
           V4              = I_MSG-MSGV4
         IMPORTING
           MSG             = W_STR
    *  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.
        WRITE:/ i_msg-msgnr,w_str.
      endloop.
    *  CALL FUNCTION 'BDC_CLOSE_GROUP'.
    *** EXCEPTIONS
    ***   NOT_OPEN          = 1
    ***   QUEUE_ERROR       = 2
    ***   OTHERS            = 3
    **  IF SY-SUBRC <> 0.
    *** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    ***         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    **  ENDIF.
    *perform close_group.
    *        Start new screen                                              *
    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
    *        Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
    *  IF FVAL <> SPACE.
      CLEAR I_BDCDATA.
      I_BDCDATA-FNAM = FNAM.
      I_BDCDATA-FVAL = FVAL.
      APPEND I_BDCDATA.
    *  ENDIF.
    ENDFORM.                    "BDC_FIELD

  • Problem in BDC for VA01 transaction TEXTS tab(Upgrading from 4.5b to ECC6)

    Hi All,
    I am working in upgrade project from 4.5b version to ECC6 version.
    I am facing problem in TEXTS tab of VA01 transaction. In earlier version it is a table control containing of Language, Description & First line but, in ECC6 the screen is modified with texteditor, a list box for language key and a Text type at the left.
    Now my problem is how to record this in BDC and how to read the text in the texteditor?
    Thanks in Advance,
    Ravi Kiran.

    Hi Seshagiri,
    In this case i would suggest the use of BAPI if there's no compulsion to use BDC.
    BAPI_SALESORDER_CHANGE                     Sales order: Change Sales Order
    BAPI_SALESORDER_CONFIRMDELVRY
    BAPI_SALESORDER_CREATEFROMDAT1    Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDAT2    Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDATA    Create Sales Order, No More
    BAPI_SALESORDER_GETLIST        Sales order: List of all Orders for Customer
    BAPI_SALESORDER_GETSTATUS      Sales Order: Display Status
    BAPI_SALESORDER_SIMULATE       Sales Order: Simulate Sales Order
    try using these for creation or change of orders instead of bdcs.
    hope this helps and revert for more clarifications if any.
    <b>Always reward points to useful suggestions.</b>
    regards,
    Vikas

  • Bdc for cs12 transaction.

    Hi all
      i am working in a object called cs12(bdc). In this transaction i am downloading the datas into a excel file and i have given the file path in my coding . when this bdc is running in a A MODE  i am getting a message that the file name already exists and if i click expand its writing the recors in the file. if the case is for some small amount of dats means each and everytime i can go with the above option if that is the case of 10000 records what needs to be done???
    Thanks in advance
    Arun.J

    try this BAPI   BAPI_EQUI_CREATE

Maybe you are looking for

  • How do I close the white box with a keyhole, gear, and lock that sometimes randomly pops up in the upper left of my screen?

    Every now and then, a weird white box with a keyhole, gear, and lock pops up in the upper left of my screen. I can't seem to close it or move it, and when I try to use another application, it stays there and blocks features. The only way I've found t

  • Downloads folder missing after system restore from Time Machine

    I installed a new HDD, installed Leopard, and the did a system restore from Time Machine. Everything seems to work fine except from a big question mark in the dock, where downloads folder should be. Any suggestions pls?

  • ESB Filter question

    Hi, I'm developing an ESB that polls for a file (unix), truncates a table (using a database adapter) and then uses the data file to re-populate the table (database adapter). My file has 4900 records. The file adapter has been created to process recor

  • Creating Labels in Mail forms

    Hello everyone, I'm currently working on a CRM Marketing implementation. We are using the Segment builder to create target groups and then either send emails or print mails to the Business partners in that target group. Is it possible to create and p

  • Adobe Creative Suite 4 Production Premium OpenGL problems

    Hello, whenever I open any of the programs in Adobe Creative Suite 4 Production Premium I get an error message from my graphics card saying something is wrong with OpenGL. I have a Nvidia GeForce GT 420M with the latest driver. The error messages are