BDC on ME22N

Hi Frnds,
I am trying to do the BDC program for the trnasaction ME22N to undelete all the purchase order line items. Also I have to check "GOODS RECEIPT" check box, for the same line itme, which is present in the "DELIVERY" tab.
Here i am facing two problems,
1. The cursor is not being placed on the specified line item, That means, I am not able to locate the cursor on the particular line item which is to be undeleted, the cursor is always placed on the first line item.
2. How can we choose the particualr line item value while trying to mark the checkbox(GOODS RECEIPT)as i explained above?
If anyone has any idea, please let me know,
Many thanks in advance and regards,
Karthick.c

You cannot write a BDC on ME22n (ITs a enjoy transaction using ALV controls which will not work in the background). Use BAPI_PO_CHANGE instead.
Or do your BDC on the old transaction ME22.
REgards,
Ravi
Note : Please mark the helpful answers
Message was edited by: Ravikumar Allampallam

Similar Messages

  • Issue with BDC of ME22N to change gross price of service.

    Hi,
    I have a requirement where I have to undelete the PO > services tab of the item details > change the gross price to the value thats calculated by the program  for each of the services of the PO > set the deletion indicator to the PO.
    The spec says to use a BDC of ME22N to acheive this but after creating the recording I have had several issues with some PO's that interrupt the BDC because they bejave differently from the recording I did.
    On most cases when im running the BDC in foreground after changing the gross price and pressing enter I get a new windowthat appears asking for the account assingment of service, on this window the G/L account information is ussualy passed automatically then the bdc clicks back and the process continues normally. On other services after changing the gross price and pressing enter I get the account assignment of service window but the G/L information is not passed and when the bdc clicks back the G/L account information gets passed instead of going back and the BDC stops, if I manually click back again the process will continue.
    With single service PO's the process is completing, this issue is happening with PO's that have multiple services.
    I know ME22 should be used for BDC and not ME22N, but the functional insists to correct the issues with the BDC of ME22N. Also I atempted to use BAPI_PO_CHANGE but I dont think this bapi can not update the gross price of each of the services, it can change the net price but this is not my requirement.
    Is there a bapi that can change the gross price of each of the services of the PO?
    Please advice me on this.
    Edited by: bodyboarder1 on Dec 2, 2010 3:33 PM

    Hi
    If you really need a BDC program, try to simulate ME22  instead of ME22N
    Max

  • BDC for ME22n vendor confirmation

    i am facing problem while doing BDC for ME22N . i am going for itemwise vendor confirmation.
    for first line item it is happening. but for 2nd line item it is not going.
    any help?
    this is my code. i guess some loop i have to add but where? can any body give idea?
    REPORT  ZMM_VC_UPLOAD.
    TABLES :  t100.
           Internal table declaration                                    *
    DATA : BEGIN OF it_upload OCCURS 0,
                  index(4),      "Index
                  EBELN(10),     "PO number
                 EBELP(5),      "line item PO
                  LIST(1),       "item number
                  BSTAE(4),      "Confirmation control key
                  EBTYP(2),      "Confirmation Category
                 BSTAE(4),      "Confirmation control key
                  LPEIN(1),      "Category of delivery date
                  EEIND(10),     "delivery date
                  MENGE(13),     "QTY Quantity as per vendor confirmation
                  XBLNR(20),     "ext doc
                  ERDAT(10),     "doc date
                  er_message(100),
           END OF it_upload.
    DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
          MSGDATA LIKE BDCMSGCOLL  OCCURS 0 WITH HEADER LINE.
    *Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER: P_FILE LIKE IBIPPARMS-PATH OBLIGATORY.  "to select a file.
    SELECTION-SCREEN END OF BLOCK B1.
    *Initialization
    INITIALIZATION.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE .
      PERFORM GET_FILENAME.
    start-of-selection
    START-OF-SELECTION.
      PERFORM MAKE_FILE_NAME .
      PERFORM UPLOAD_FILE.
        PERFORM BDC_PROCESS.
    perform read_messages.
    *&      Form  UPLOAD_FILE
    FORM UPLOAD_FILE .
      CALL FUNCTION 'WS_UPLOAD'
        EXPORTING
          FILENAME                = P_FILE
          FILETYPE                = 'DAT'
        TABLES
          DATA_TAB                = IT_UPLOAD .
            IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    " UPLOAD_FILE
    *&      Form  bdc_process
    FORM BDC_PROCESS .
    loop at it_upload.
    LOOP AT IT_header.
    refresh bdcdata.
      perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MECHOB'.
    perform bdc_field       using 'MEPO_TOPLINE-BSART'
                                  'NB'.
    perform bdc_field       using 'DYN_6000-LIST'
                                  it_upload-list.    "'   1'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MEPO1319-MATKL'.
    perform bdc_field       using 'MEPO1319-SPINF'
                                  'X'.
    perform bdc_dynpro      using 'SAPLMEGUI' '0002'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MEOK'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MEPO_SELECT-EBELN'.
    perform bdc_field       using 'MEPO_SELECT-EBELN'
                                  it_upload-EBELN.              "'4500195517'.
    perform bdc_field       using 'MEPO_SELECT-BSTYP_F'
                                  'X'.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TABIDT14'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MEPO_TOPLINE-BSART'.
    perform bdc_field       using 'MEPO_TOPLINE-BSART'
                                  'NB'.
    perform bdc_field       using 'DYN_6000-LIST'
                                  it_upload-list.    "'   1'.
    perform bdc_field       using 'MEPO1319-SPINF'
                                  'X'.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'             "first time
                                  '/00'.
    perform bdc_field       using 'MEPO_TOPLINE-BSART'
                                  'NB'.
    perform bdc_field       using 'DYN_6000-LIST'
                                 it_upload-list.    " '   1'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MEPO1334-BSTAE'.
    perform bdc_field       using 'MEPO1334-BSTAE'
                                  it_upload-BSTAE  .                "'0005'.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MEPO_TOPLINE-BSART'
                                  'NB'.
    *loop at it_item where ebeln = it_upload-ebeln.
    perform bdc_field       using 'BDC_CURSOR'
                                  'DYN_6000-LIST'.
    perform bdc_field       using 'DYN_6000-LIST'
                                  it_upload-list.    "'   1'.
    perform bdc_field       using 'MEPO1334-BSTAE'
                                  it_upload-BSTAE.                 "'0005'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'EKES-ERDAT(01)'.
    perform bdc_field       using 'EKES-EBTYP(01)'
                                  it_upload-EBTYP.                 "'vc'.
    perform bdc_field       using 'RM06E-LPEIN(01)'
                                  it_upload-LPEIN.                 "'D'.
    perform bdc_field       using 'RM06E-EEIND(01)'
                                  it_upload-EEIND.                 "'15.02.2009'.
    perform bdc_field       using 'EKES-MENGE(01)'
                                  it_upload-MENGE.                 "'10'.
    perform bdc_field       using 'EKES-XBLNR(01)'
                                  it_upload-XBLNR.                 "'inv 9'.
    perform bdc_field       using 'EKES-ERDAT(01)'
                                  it_upload-ERDAT.                 "'15.02.2009'.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MESAVE'.
    CALL TRANSACTION 'ME22N' USING BDCDATA MODE 'A' UPDATE 'A' MESSAGES INTO MSGDATA. 
        CLEAR: BDCDATA,BDCDATA[].
        refresh BDCDATA.
      ENDLOOP.
    ENDFORM.                    " bdc_process
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> ''.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.                    "BDC_FIELD
    *To get file name                                                      *
    FORM GET_FILENAME .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
        IMPORTING
          FILE_NAME     = P_FILE.
      IF SY-SUBRC NE 0  .
        WRITE : / 'Enter File Name'.
      ENDIF.
    ENDFORM.                    "GET_FILENAME

    Hi Dude,
      When ur looping the item information , in your code ur
    loop at it_item where ebeln = it_upload-ebeln.
    perform bdc_field using 'BDC_CURSOR'
    'DYN_6000-LIST'.
    perform bdc_field using 'DYN_6000-LIST'
    it_upload-list. "' 1'.
    perform bdc_field using 'MEPO1334-BSTAE'
    it_upload-BSTAE. "'0005'.
    perform bdc_field using 'BDC_CURSOR'
    'EKES-ERDAT(01)'.
    perform bdc_field using 'EKES-EBTYP(01)'
    it_upload-EBTYP. "'vc'.
    perform bdc_field using 'RM06E-LPEIN(01)'
    it_upload-LPEIN. "'D'.
    perform bdc_field using 'RM06E-EEIND(01)'
    it_upload-EEIND. "'15.02.2009'.
    perform bdc_field using 'EKES-MENGE(01)'
    it_upload-MENGE. "'10'.
    perform bdc_field using 'EKES-XBLNR(01)'
    it_upload-XBLNR. "'inv 9'.
    perform bdc_field using 'EKES-ERDAT(01)'
    it_upload-ERDAT. "'15.02.2009'.
    perform bdc_dynpro using 'SAPLMEGUI' '0014'.
    perform bdc_field using 'BDC_OKCODE'
    '=MESAVE'.
    ->(01) you have to replace to variable , and every loop pass increment the varialbe value with 1.
    ex : -
    V1 = 1.
    loop at item.
    perform bdc_data using 'xyz(V1)' 
                                   it_upload-variable.
    V1 = V1 + 1.
    endloop.
    This is called as index , the table control fields are differ the field name by index only...

  • User Exit and BDC for ME22N

    Hello All,
    A code has been written in the User exit for Tcode ME22N, Which sets the indicator on PO line item. This has been done by modifying the standard itab POT by using field symbols, because the fields to be modified are shown in display mode in the tcode ME22N and cannot be done in BDC. See the below code in user exit ZXM06U43.
    DATA char(50) VALUE '(SAPLMEPO)POT[]'.
    CLEAR wa_ind.
        FIELD-SYMBOLS <f1> TYPE ANY.
    Move memory of internal table POT to field symbol f1.
        ASSIGN (char) TO <f1>.
    Move content of f1 to internal table i_ind
        i_ind[] = <f1> .
        LOOP AT i_ind INTO wa_ind.
          IF wa_ind-pstyp = '9'.            " Service PO - item category
    IF PO Line item has History per Purchasing Document as 'D'
    Set indicators on, for the line item.
            CLEAR v_cnt.
            SELECT COUNT( * ) INTO v_cnt FROM ent5100
                                         WHERE ebeln = wa_ind-ebeln
                                           AND ebelp = wa_ind-ebelp
                                           AND bewtp = 'D'.
            IF sy-subrc = 0.
              wa_ind-wepos = 'X'.            " Set Goods Receipt Indicator
              wa_ind-webre = 'X'.            " Set GR-based IV Indicator
              wa_ind-lebre = 'X'.            " Set Srv-based IV Indicator
            ELSE.
    *End of addition SAP-20070910104025 - SL36 - D01K963369
              wa_ind-wepos = ' '.            " Clear Goods Receipt Indicator
              wa_ind-webre = ' '.            " Clear GR-based IV Indicator
              wa_ind-lebre = ' '.            " Clear Srv-based IV Indicator
              wa_ind-xersy = ' '.            " Clear ERS Indicator
            ENDIF.                                           
            MODIFY i_ind FROM wa_ind INDEX sy-tabix.
          ENDIF.
        ENDLOOP.
        <f1> = i_ind[].
      ENDIF.          
    ENDIF.
    This code is in production and has been working fine.
    The requirnment is now to make this indicator work for all the Purchase order before this code has been written in the Exit. For this my functional suggests that to write a separate program using BDC for PO change and jus add a period/dot  in the short text and save it. The code has been written, the user exit and the above code is getting triggrred values are updated in internal table correctly.
    However the flags was not set or cleared when seen in the tcode ME22N . This works fine if the tcode me22n is run directly and not working in BDC.
    I have tried with ME22 without enjoy transaction in BDC changing the POT Program to SAPMM06E. It does not work.
    Please help me as why it is not uodating in the table when using BDC.
    Thanks in Advance.
    Senthil Kumar

    Hi All,
    Any luck on this??
    Thanks

  • Scrolling not working in BDC for ME22N

    Dear All,
    i record BDC using Tcode "SHDB" for ME22N ( only for Type stock transfer ).
    in recording i select tab "delivery schedule" and it showing 4 rows as default rows and
    after that i scroll one by  one to put requisition Closed Flag.
    after successfull completion of recording when run "Process" to test (without change any coding),
    it's not working for scrolling even if i tried for page down the result is same.
    can you please suggest for :
    1- what could be the problem, though BDC recorded with scrolling but process not working.
    2- is there any option to increase no. of fixed rows in tab "schedule delivery"
    Pls help.
    Thanks a lot,
    Radhashyam

    see my code below it might help you, i have also used a flag and i have populated the data manually from where i need scrolling, i guess in recording you cannot catch sscorlling you have to do it manually.
    loop at t_final_data into fs_final_data.
        if fs_final_data-acopc = 'Y'.
          lw_flag = 'X'.
        elseif fs_final_data-acopc = 'N'.
          lw_flag = ' '.
        endif.                            
    refresh t_bdcdata.
    perform bdc_dynpro      using 'SAPMP50A' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=INS'.
    perform bdc_field       using 'RP50G-PERNR'
                                  fs_final_data-pernr.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RP50G-ENDDA'.
    perform bdc_field       using 'RP50G-BEGDA'
                                  fs_final_data-begda.
    perform bdc_field       using 'RP50G-ENDDA'
                                  fs_final_data-endda.
    perform bdc_field       using 'RP50G-CHOIC'
                                  lw_info.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMP50A' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=INS'.
    perform bdc_dynpro      using 'MP058500' '2000'.
    clear w_curr.
    w_curr =  fs_final_data-pcntr1.
    perform bdc_field       using 'Q0585-PCNTR(01)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr1.
    perform bdc_field       using 'Q0585-ACNTR(01)'
                                 w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr2.
    perform bdc_field       using 'Q0585-PCNTR(02)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr2.
    perform bdc_field       using 'Q0585-ACNTR(02)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr3.
    perform bdc_field       using 'Q0585-PCNTR(03)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr3.
    perform bdc_field       using 'Q0585-ACNTR(03)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr4.
    perform bdc_field       using 'Q0585-PCNTR(04)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr4.
    perform bdc_field       using 'Q0585-ACNTR(04)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr5.
    perform bdc_field       using 'Q0585-PCNTR(05)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr5.
    perform bdc_field       using 'Q0585-ACNTR(05)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr6.
    perform bdc_field       using 'Q0585-PCNTR(06)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr6.
    perform bdc_field       using 'Q0585-ACNTR(06)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr7.
    perform bdc_field       using 'Q0585-PCNTR(07)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr6.
    perform bdc_field       using 'Q0585-ACNTR(07)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr8.
    perform bdc_field       using 'Q0585-PCNTR(08)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr8.
    perform bdc_field       using 'Q0585-ACNTR(08)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr9.
    perform bdc_field       using 'Q0585-PCNTR(09)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr9.
    perform bdc_field       using 'Q0585-ACNTR(09)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr10.
    perform bdc_field       using 'Q0585-PCNTR(10)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr10.
    perform bdc_field       using 'Q0585-ACNTR(10)'
                                   w_curr.
    *" from here i have done it manually
    perform bdc_field       using 'BDC_OKCODE'
                                  'P+' .
    perform bdc_dynpro      using 'MP058500' '2000'.
    clear w_curr.
    w_curr =  fs_final_data-pcntr11.
    perform bdc_field       using 'Q0585-PCNTR(01)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr11.
    perform bdc_field       using 'Q0585-ACNTR(01)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr12.
    perform bdc_field       using 'Q0585-PCNTR(02)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr12.
    perform bdc_field       using 'Q0585-ACNTR(02)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr13.
    perform bdc_field       using 'Q0585-PCNTR(03)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr13.
    perform bdc_field       using 'Q0585-ACNTR(03)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr14.
    perform bdc_field       using 'Q0585-PCNTR(04)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr14.
    perform bdc_field       using 'Q0585-ACNTR(04)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr15.
    perform bdc_field       using 'Q0585-PCNTR(05)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr15.
    perform bdc_field       using 'Q0585-ACNTR(05)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr16.
    perform bdc_field       using 'Q0585-PCNTR(06)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr16.
    perform bdc_field       using 'Q0585-ACNTR(06)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-pcntr17.
    perform bdc_field       using 'Q0585-PCNTR(07)'
                                   w_curr.
    clear w_curr.
    w_curr =  fs_final_data-acntr17.
    perform bdc_field       using 'Q0585-ACNTR(07)'
                                   w_curr.
    *" i have used a flag here
    perform bdc_field       using 'Q0585-ACOPC'
                                   lw_flag.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UPD'.
    perform bdc_dynpro      using 'MP058500' '2000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EBCK'.
    perform bdc_dynpro      using 'SAPMP50A' '1000'.
      call transaction 'PA30' using t_bdcdata
                               mode 'A'
                           messages into t_messtab.

  • BDC for ME22N not working in background but working fine in foreground

    Hi guys,
    I have done a BDC recording for ME22N.
    Its working fine in foreground but failing in background.
    Can anyone sugesst a solution.
    Thanks!

    There is a note on this subject, BDC with control may (and of course will) not perform correctly in background, they need the Sapgui) [Note 381630 - Batch input for Enjoy transaction in MM not possible|https://service.sap.com/sap/support/notes/381630]
    You may need to use the old ME22 transaction or BAPI like BAPI_PO_CHANGE [Note 217437 - ME21N/ME51N: Batch input and CATT not possible|https://service.sap.com/sap/support/notes/217437]
    Regards
    Regards

  • Po line items in bdc

    requirment: to load a file filed with ean no and populate line item of me23n with the respective eans number and their quan and it shuld populate the line items and not save them so user can check a few things and then save it manually while creating the sto (return). iam running a bdc in error mode so that it popultes the sto line item s wtih matnr and quantity and stop at the po screen so it can be saved manually.
    but iam unable to populate all the line item. they only populate till number 13 how can i populate further on . i even tried recording a page down.
    any ideas?

    Hi,
    The number of displayed items depends on the screen resolution.
    In fact a solution consist in filling the field "position" (RM06E-EBELP) at the bottom of the screen for <u>each</u> item.
    * Code to position on the right line :
      PERFORM FIELD_BDC TABLES WT_BDCDATA USING
         'RM06E-EBELP' WT_POSITION .
      PERFORM FIELD_BDC TABLES WT_BDCDATA USING
         'BDC_OKCODE' '/00' '0'.
    Hope it helps,
    Ps : ME22 for BDC, not ME22N.
    Erwan.
    Message was edited by: Erwan LE BRUN

  • Problem in po creation

    Hi guys,
    We are trying to create a new line item in the existing PO.  This new line item will be with reference to contract.  is it possible to create a new line item with tcode ME22 (not ME22n)
    Also can we use bdc for ME22n txn?
    please suggest

    Hi Jurgen,
    Thanks for ur reply.  We are facing one more problem.
    Actually we are doing BDC for mE22 transaction.  Our requirement is to create a new line item in existing PO with ref to a contract.  In ME22 we are able to do this.  But our problem is, we want to give some external number as line item number.  When we do anything in PO line item i.e. change line number and select "create with ref to option", it is giving error that "Enter material number or short text".  If we do no change the item number and select create wrt option, then it is working fine.  But numbers are generated at the interval specified in config
    how to overcome this problem
    please suggest

  • Does BDC supports to update Confirmation in PO through ME22N

    Hi,
       Can any one suggest wether BDC supports to update Confirmation details in PO by using ME22N transaction. The standard BAPI, BAPI_PO_CHANGE does't support for updating confirmation details in PO. We are currently using BDC with ME22, we need to replace ME22 with enjoy transaction to support Event management functionality. Can any one help us in this?
    Thanks and Regards
    Raghu

    HI,
    SAP recommends not to record enjoy transactions and hence BDC doesn't support ME23N.
    Only way is to use BAPI..
    regards,
    Naveen

  • "BDC for multiple line items of PO"

    I am using this code to move data for multiple line items of a PO. But only one is getting transferred. I am using BDC for this.
    FORM transaction_bdc .
      DATA :
      v_cnt(2) TYPE n,
      v_bst(2) TYPE n,
      v_bn TYPE i,
      v_bstpo(25),
      v_ebtyp(25),
      v_menge(25),
      v_eeind(25),
      v_xblnr(25),
      v_xblnr1(25),
      v_ebelp(2) TYPE n,
      v_ebelpt(2),
      v_menge1(11),
      v_ebt TYPE i,
      v_vebtyp LIKE ekes-ebtyp,
      v_eb(2) TYPE n,
      v_tcselflag(40),
      v_tem(2) TYPE n,
      v_correct TYPE i,
      v_file TYPE string.
      DATA: ls_outtab TYPE tb_struc.
      DATA: l_valid TYPE c,
            l_locked TYPE c.
      CALL METHOD g_grid->check_changed_data
        IMPORTING
          e_valid = l_valid.
      IF l_valid EQ 'X'.
        LOOP AT tb_output WHERE check EQ 'X' .
          MOVE-CORRESPONDING tb_output TO itab_output.
          APPEND itab_output.
          CLEAR itab_output.
        ENDLOOP.
        IF tb_output-check <> 'X'.
          MESSAGE e003 WITH text-004.
        ENDIF.
      ENDIF.
      IF itab_output[] IS NOT INITIAL.
        PERFORM open_group.
    ***looping at purchase order level.
        LOOP AT itab_output where ebelp is not initial .
          CLEAR v_bn.
          CLEAR v_ebt.
          PERFORM bdc_dynpro USING 'SAPMM06E' '0105'.
          PERFORM bdc_field USING 'BDC_CURSOR'
          'RM06E-BSTNR'.
          PERFORM bdc_field USING 'BDC_OKCODE'
          '/00'.
          PERFORM bdc_field USING 'RM06E-BSTNR'
          itab_output-ebeln.
    ***Changing alphanumeric fields and quantity fields to character type**
    *v_ebelp = tB_OUTPUT-ebelp.
    *clear v_ebelpt.
    *v_menge1 = tB_OUTPUT-menge.
    *v_ebelpt = v_ebelp.
    ***End Of Changing**
    *Checking for the exact number of the item**
          LOOP AT tb_output where ebeln = itab_output-ebeln.
            READ TABLE itab_output INDEX 1.
            IF tb_output-ebelp = itab_output-ebelp.
              exit.
            ELSE.
              v_bn = v_bn + 1.
            ENDIF.
          ENDLOOP.
    v_bst = v_bn + 1.
    *End Of Checking**
    **Mapping items**
            v_tem = 1.
            CONCATENATE 'RM06E-BSTPO(' v_bst ')' INTO v_bstpo.
            CONCATENATE 'RM06E-TCSELFLAG(' v_tem ')' INTO v_tcselflag.
            PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
            PERFORM bdc_field USING 'BDC_CURSOR'
            v_bstpo.
            PERFORM bdc_field USING 'BDC_OKCODE'
            '=DETA'.
            PERFORM bdc_field USING 'RM06E-EBELP'
            v_ebelpt.
            PERFORM bdc_dynpro USING 'SAPMM06E' '0111'.
            PERFORM bdc_field USING 'BDC_CURSOR'
            'EKPO-BSTAE'.
            PERFORM bdc_field USING 'BDC_OKCODE'
            '/00'.
            PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
            PERFORM bdc_field USING 'BDC_CURSOR'
            v_bstpo.
            PERFORM bdc_field USING 'BDC_OKCODE'
            '=BSTA'.
            PERFORM bdc_field USING 'RM06E-EBELP'
            v_ebelpt.
            PERFORM bdc_field USING v_tcselflag
            'X'.
    **Checking weather Confirmation category already exists**
            SELECT ebtyp FROM ekes INTO v_vebtyp WHERE ebelp =
            itab_output-ebelp AND ebeln = itab_output-ebeln.
            ENDSELECT.
            IF sy-dbcnt > 0.
              v_ebt = sy-dbcnt.
            ENDIF.
            v_eb = v_ebt + 1.
    **End Of Checking**
    **For Line items**
            CONCATENATE 'EKES-EBTYP(' v_eb ')' INTO v_ebtyp.
            CONCATENATE 'EKES-MENGE(' v_eb ')' INTO v_menge.
            CONCATENATE 'RM06E-EEIND(' v_eb ')' INTO v_eeind.
            CONCATENATE 'EKES-XBLNR(' v_eb ')' INTO v_xblnr.
    **End**
            PERFORM bdc_dynpro USING 'SAPLEINB' '0200'.
            PERFORM bdc_field USING 'BDC_CURSOR'
            v_xblnr.
            PERFORM bdc_field USING 'BDC_OKCODE'
            '=BU'.
            PERFORM bdc_field USING v_ebtyp
            itab_output-ebtyp.
            PERFORM bdc_field USING v_eeind
            itab_output-eindt.
            PERFORM bdc_field USING v_menge
            v_menge1.
            PERFORM bdc_field USING v_xblnr
            itab_output-xblnr.
    **End Of Mappings**
    *loop at itab_output.
            MOVE-CORRESPONDING itab_output TO ekes.
            modify ekes.
           MOVE-CORRESPONDING itab_output TO eket.
           MODIFY eket.
           MOVE-CORRESPONDING tb_output TO ekpo.
           MODIFY ekpo.
         ENDLOOP.
          CALL TRANSACTION 'ME22N'
          USING itbdc
          MODE   'E'.
          commit work.
    perform bdc_transaction using 'ME22N'.
    **End Of Purchase Order Loop**
        PERFORM close_group.
        endloop.
         endif.

    Hi Asha,
    check the below code once...
    LOOP AT tb_output where ebeln = itab_output-ebeln.
    READ TABLE itab_output INDEX 1.
    IF tb_output-ebelp = itab_output-ebelp.
    exit.
    ELSE.
    v_bn = v_bn + 1.
    ENDIF.
    ENDLOOP.
    Here you are reading the table itab_output with index 1, it means you alway reading the first record of that internal table.
    Regards,
    Satya.

  • Mass maintenance and BDC Recodring of custom fields added in PO header.

    Hello Experts,
    I have created a custom fields in PO header and used  Structure for BADI implementation to update the header with values enterd in custom table.
    My requirement is for some selected PO i want to fix the value of one of my custom field at header level.
    I have tried both the options Mass maintenance and BDC recording but the issue i'm facing is when i go for mass maintenance it is giving me the ERROR and it seems that we can only do the mass maintenance for sap-standard fields only.
    When i go for BDC recording i'm facing the issue that when i do SHDB and start recording  for ME22N my custom field is coming  grayed out and i'm not able to input the desired value in custom field and complete my recording.
    Let me know your valuable inputs .
    Thanks,
    Naveen

    Hello,
    Instead of BDC i'm doing it through the BAPI   "BAPI_PO_CHANGE" by populating the structure extensionin but here i'm facing the error as below:-
    W     ME     887     Error transferring ExtensionIn data for enhancement CI_EKKODB
    E     BAPI     003     Instance 4500001544 of object type PurchaseOrder could not be changed
    below is my code:-
    ls_extensionin-structure = 'BAPI_TE_MEPOHEADER'.
        ls_extensionin-valuepart1+0(10) = wa_po-ebeln.
        ls_extensionin-valuepart1+14(3) = no.
        append ls_extensionin to lt_extensionin.
        clear:ls_bapi_te_bg,ls_extensionin.
        ls_extensionin-structure = 'BAPI_TE_MEPOHEADERX'.
        ls_extensionin-valuepart1+0(10) = wa_po-ebeln.
        ls_extensionin-valuepart1+10(1) = 'X'.
        append ls_extensionin to lt_extensionin.
        clear:ls_bapi_te_bg,ls_extensionin.
        call function 'BAPI_PO_CHANGE'
            exporting
              purchaseorder                = wa_po-ebeln
            tables
              return                       = it_bapireturn
              extensionin                  = lt_extensionin
        if it_bapireturn[] is initial.
          call function 'BAPI_TRANSACTION_COMMIT'
            exporting
              wait   = ' '
            importing
              return = it_bapireturn.
        endif.
        refresh lt_extensionin[].
      endloop.
    Please let me know if there is any way to achieve this.
    Thanks,
    naveen

  • Additional code for PO(purchase order) BDC

    Hi All,
    I wrote a BDC for uploading Open PO(purchase order). I did it using recording. But when coming to upload it can take only one line item for material. In a PO we can include any number of materials. So inorder to get such upload functionality where do we need to add the code and how to? The coding is stated as follows....The bold text is the line item data to upload in which multiple materials need to be uploaded.
    TYPE-POOLS: TRUXS.
    DATA: IT_RAW TYPE truxs_t_text_data.
    TYPES: begin of SPORD,
    BSART(004),
    SUPERFIELD(030),
    BEDAT(010),
    EKORG(004),
    EKGRP(003),
    BUKRS(004),
    EBELP_01(005),
    KNTTP_01(001),
    EMATN_01(018),
    MENGE_01(017),
    MEINS_01(003),
    EEIND_01(010),
    NETPR_01(014),
    WAERS(004),
    PEINH_01(006),
    NAME1_01(030),
    SAKTO(010),
    KOSTL(010),
    REPOS(001),
    MWSKZ(002),
    WEBRE(001),
          end of SPORD.
    DATA: T_PORD TYPE TABLE OF SPORD,
          PORD TYPE SPORD.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS: FILENAME TYPE RLGRAP-FILENAME.
    SELECTION-SCREEN END OF BLOCK B1.
    include ZBdcrecx1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          FIELD_NAME = 'FILENAME'
        IMPORTING
          FILE_NAME  = FILENAME.
    start-of-selection.
    PERFORM GET_DATA.
    perform open_group.
    LOOP AT T_PORD INTO PORD.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MEDOCTYPE'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MEPO_TOPLINE-BSART'.
    perform bdc_field       using 'MEPO_TOPLINE-BSART'
                                  PORD-BSART.
    perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                                  PORD-BEDAT.
    perform bdc_field       using 'DYN_6000-LIST'
                                  '   1'.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MEV4001BUTTON'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MEPO_TOPLINE-SUPERFIELD'.
    perform bdc_field       using 'MEPO_TOPLINE-BSART'
                                  PORD-BSART.
    perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                                  PORD-SUPERFIELD.
    perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                                  PORD-BEDAT.
    perform bdc_field       using 'MEPO1222-EKORG'
                                  PORD-EKORG.
    perform bdc_field       using 'MEPO1222-EKGRP'
                                  PORD-EKGRP.
    perform bdc_field       using 'MEPO1222-BUKRS'
                                  PORD-BUKRS.
    perform bdc_field       using 'DYN_6000-LIST'
                                  '   1'.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MEPO_TOPLINE-BSART'
                                  PORD-BSART.
    perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                                  PORD-SUPERFIELD.
    perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                                  PORD-BEDAT.
    perform bdc_field       using 'MEPO1222-EKORG'
                                  PORD-EKORG.
    perform bdc_field       using 'MEPO1222-EKGRP'
                                  PORD-EKGRP.
    perform bdc_field       using 'MEPO1222-BUKRS'
                                  PORD-BUKRS.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MEPO1211-NAME1(01)'.
    perform bdc_field       using 'MEPO1211-EBELP(01)'
                                  PORD-EBELP_01.
    perform bdc_field       using 'MEPO1211-KNTTP(01)'
                                  PORD-KNTTP_01.
    perform bdc_field       using 'MEPO1211-EMATN(01)'
                                  PORD-EMATN_01.
    perform bdc_field       using 'MEPO1211-MENGE(01)'
                                  PORD-MENGE_01.
    perform bdc_field       using 'MEPO1211-MEINS(01)'
                                  PORD-MEINS_01.
    perform bdc_field       using 'MEPO1211-EEIND(01)'
                                  PORD-EEIND_01.
    perform bdc_field       using 'MEPO1211-NETPR(01)'
                                  PORD-NETPR_01.
    *perform bdc_field       using 'MEPO1211-WAERS(01)'
                                 PORD-WAERS.*
    perform bdc_field       using 'MEPO1211-PEINH(01)'
                                  PORD-PEINH_01.
    perform bdc_field       using 'MEPO1211-NAME1(01)'
                                  PORD-NAME1_01.perform bdc_field       using 'DYN_6000-LIST'
                                  '   1'.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'MEPO_TOPLINE-BSART'
                                  PORD-BSART.
    perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                                  PORD-SUPERFIELD.
    perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                                  PORD-BEDAT.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MEPO1211-EEIND(01)'.
    perform bdc_field       using 'DYN_6000-LIST'
                                  '   1'.
    perform bdc_field       using 'MEPO1317-REPOS'
                                  PORD-REPOS.
    perform bdc_field       using 'MEPO1317-MWSKZ'
                                  PORD-MWSKZ.
    perform bdc_field       using 'MEPO1317-WEBRE'
                                  PORD-WEBRE.
    perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TABIDT7'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=MESAVE'.
    perform bdc_field       using 'MEPO_TOPLINE-BSART'
                                  PORD-BSART.
    perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                                  PORD-SUPERFIELD.
    perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                                  PORD-BEDAT.
    perform bdc_field       using 'DYN_6000-LIST'
                                  '   1'.
    perform bdc_field       using 'MEACCT1200-KNTTP'
                                  PORD-KNTTP_01.
    perform bdc_field       using 'MEACCT1100-SAKTO'
                                  PORD-SAKTO.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-KOSTL'.
    perform bdc_field       using 'COBL-KOSTL'
                                  PORD-KOSTL.
    perform bdc_dynpro      using 'SAPLSPO2' '0101'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=OPT1'.
    perform bdc_transaction using 'ME21N'.
    ENDLOOP.
    perform close_group.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA .
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
       I_LINE_HEADER              = 'X'
        I_TAB_RAW_DATA             = IT_RAW
        I_FILENAME                 = FILENAME
      TABLES
        I_TAB_CONVERTED_DATA       = T_PORD.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " GET_DATA
    regards
    PSNG
    Edited by: PSNG on Jun 11, 2008 3:28 PM

    ME_PROCESS_PO_CUST
    use above BADI for ME22N/ME21N,often we use method PROCESS_HEADER
    PROCESS_ITEM our most of the requirement meet by these methods only,check once if your requirement does meets with these two methods?
    if not than you may implement some more method which are in ME_PROCESS_PO_CUST, for more help you may read documentation,there is well enough documentation already there for each method.
    and for ME22/ME21 you may use
    ME_PURCHDOC_POSTED
    and method POSTED.

  • ME22N - How to scroll down the purchase order items

    Hi,
    I have to make a function with call transaction (ME22N) and when I use the SHDB transaction to build the script, I can´t find the scroll down command for the items list. I have to use because we will have many items to edit / exclude / finalize in a purchase order. How can I solve this problem?
    Thanks.

    Hi,
    It is not suggested to make a recording for a BDC in tx: ME22N, ( EnjoySAP transactions are not suitable for SHDB recording ) instead use ME22 and on the table control scrolling, you find an "ITEM" field where you enter the item which should be positioned in first line of the table control where you could double click the first line in table control to view the details.
    Also you could achieve the change of a PO by BAPI: BAPI_PO_CHANGE.
    Hope this helps.
    Best Regards, Murugesh

  • BDC OK CODE To select PO Line Item

    Hello,
    Can anyone tell me the BDC OkCode to select a particular line item in a PO.
    Thanks
    Viky

    are you using me22 or me22n ?
    if me22, just below the table control,  you can see a field 'Item' .  if you key in 50 in this item,  item 50 will come to the top line.
    so while doing recording, pass the line item number to this field, RM06E-EBELP, and then hit enter....
    loop at your internal table with bdcdata, and pass each item numbers one by one to this field, and do the bdc.
    Message was edited by:
            Sujamol Augustine

  • Exception while calling a BDC from webdynpro

    Hi All,
    I am getting an exception 'Exception condition "CNTL_ERROR" raised' while calling a BDC from the WD application, though i am calling the transaction in background mode. The statment which was throwing the exception was a create object statement in the function module DOC_DISPLAY_INITIALIZE. Can u please tell me, what is the reason for this?
    Thanks in Advance,
    Laxmikanth

    >
    amit saini wrote:
    > hi ,
    > The message "CNTL_ERROR" appear when you are using some of  the SAP enjoy transaction code like ME21N / ME22N / ME23N.
    >
    > This are bugs cause by the earlier version of the SAPGUI. It  usually occurs when you are running a BDC session
    > for a transaction that has 'fancy' screen elements like table controls ortabstrips. These work fine in the foreground, but not so well in the background.
    >
    >
    > To solve it, goto OSS and apply the SAPGUI's latest front end patch to your PC.
    >
    > rgds,
    > amit
    There is a mixture of accurate information here.
    This is NOT a SAPGUI problem.  It can not be fixed with a newer version fo the SAPGUI.  It is caused by transactions that were created with Enjoy Controls.  Enjoy controls are not the table control or the tabstrip.  They are controls that used ActiveX components on the desktop as part of the SAPGUI - like the ALV Grid, the Tree, the ABAP Editor, etc. 
    You can not use call transaction/BDC against such transactions in the background or in WDA because there is no connection to the frontend to create instances of these controls.  These transactions with the enjoy controls should have appropriate BAPIs or Enterprise Services that you should call instead in order to make data updates or creations.
    For instance see SAP Note 304122 that discusses this issue for transaction MIGO.

Maybe you are looking for