How to handle  user exits while using BAPI

HI experts can any one help me on how to handle user exits while using BAPI. Do we need to handle it explicitly or standard  BAPI will take care of it??.
Regards,
Hari Krishna

If you have added some fields using append structures for screen enhancements, then you have to use appropriate user exits to fill these data while calling BAPI.  Some BAPIs have EXTENSION structures to fill the custom data which can be processed using user exists or enhancements.
Regards
Vinod

Similar Messages

  • How to handle user exits in Standalone BIP 10.1.3.4.1

    Hi,
    I tried converting our Oracle 11i (6i reports) report to BI Publisher. Our user exits calls are commented by the BIPBatchConversionUtility.
    Wondering how can we handle user exits part to set the organization id and input the key flexfield information.
    Any help would be greatly appreciated.
    Thanks in advance.
    Thanks & Regards,
    Rama Krishna. P

    Try using BI Publisher beforeReport trigger to set values needed to be set.
    Regards,
    Gareth

  • How to create service PO while using BAPI

    Dear Experts
    I am getting error while creating Service PO using BAPI
    E 518
    No account assignment exists for service line 0000000010
    E 518
    No account assignment exists for service line 0000000010
    TYPES : BEGIN OF ty_header,
            po_no(10)   TYPE n,
            purch_org   TYPE bapimepoheader-purch_org,
            pur_group   TYPE bapimepoheader-pur_group,
            doc_type    TYPE bapimepoheader-doc_type,
            vendor      TYPE bapimepoheader-vendor,
            doc_date    TYPE bapimepoheader-doc_date,
            currency    TYPE bapimepoheader-currency,
            comp_code   TYPE bapimepoheader-comp_code,
            END OF ty_header,
            BEGIN OF ty_item,
            po_no(10)   TYPE n,                             " Internal Use
            po_item     TYPE bapimepoitem-po_item,
            acctasscat  TYPE bapimepoitem-acctasscat,
            short_text  TYPE bapimepoitem-short_text,
            plant       TYPE bapimepoitem-plant,
            pckg_no     TYPE bapimepoitem-pckg_no,
            stge_loc    TYPE bapimepoitem-stge_loc,
            quantity    TYPE bapimepoitem-quantity,
            po_unit     TYPE bapimepoitem-po_unit,
            po_price    TYPE bapimepoitem-po_price,
            net_price   TYPE bapimepoitem-net_price,
            price_unit  TYPE bapimepoitem-price_unit,
            orderpr_un  TYPE bapimepoitem-orderpr_un,
            delivery_date TYPE bapimeposchedule-delivery_date,              " bapimeposchedule
            matl_group  TYPE bapimepoitem-matl_group,
            tax_code    TYPE bapimepoitem-tax_code,
            END OF ty_item,
            BEGIN OF ty_service,
            po_no(10)   TYPE  n,                            " Internal Use
            po_item     TYPE  bapimepoitem-po_item,         " Internal Use
            pckg_no     TYPE  bapiesllc-pckg_no,
            line_no     TYPE  bapiesllc-line_no,
            ext_line    TYPE  bapiesllc-ext_line,
            outl_ind    TYPE  bapiesllc-outl_ind,
            subpckg_no  TYPE  bapiesllc-subpckg_no,
            serial_no   TYPE  bapiesklc-serial_no,           " bapiesklc
            short_text  TYPE  bapiesllc-short_text,
            quantity    TYPE  bapiesllc-quantity,
            base_uom    TYPE  bapiesllc-base_uom,
            gr_price    TYPE  bapiesllc-gr_price,
            matl_group  TYPE  bapiesllc-matl_group,
            END OF ty_service,
            BEGIN OF ty_poaccount,
            po_no(10)   TYPE n,                             " Internal Use
            po_item      TYPE bapimepoaccount-po_item,
            serial_no    TYPE bapimepoaccount-serial_no,
            gl_account   TYPE bapimepoaccount-gl_account,
            costcenter   TYPE bapimepoaccount-costcenter,
            asset_no     TYPE bapimepoaccount-asset_no,
            orderid      TYPE bapimepoaccount-orderid,
            END OF ty_poaccount.
    DATA : it_header TYPE TABLE OF ty_header,
           wa_header TYPE ty_header,
           it_item   TYPE TABLE OF ty_item,
           wa_item   TYPE ty_item,
           it_service TYPE TABLE OF ty_service,
           wa_service TYPE ty_service,
           it_account TYPE TABLE OF ty_poaccount,
           wa_account TYPE ty_poaccount.
    DATA : it_excel1 TYPE TABLE OF alsmex_tabline,
           wa_excel1 TYPE alsmex_tabline,
           it_excel2 TYPE TABLE OF alsmex_tabline,
           wa_excel2 TYPE alsmex_tabline,
           it_excel3 TYPE TABLE OF alsmex_tabline,
           wa_excel3 TYPE alsmex_tabline,
           it_excel4 TYPE TABLE OF alsmex_tabline,
           wa_excel4 TYPE alsmex_tabline.
    DATA : number TYPE string,
           number1 TYPE string.
    ********** BAPI**************
    CONSTANTS : c_x VALUE 'X'.
    *Structures to hold PO header data
    DATA : header LIKE bapimepoheader ,
           headerx LIKE bapimepoheaderx .
    *Internal Tables to hold PO ITEM DATA
    DATA : item LIKE bapimepoitem OCCURS 0 WITH HEADER LINE,
           itemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE.
    *Structures to hold PO schedule data
    DATA : itemschedule LIKE bapimeposchedule OCCURS 0 WITH HEADER LINE ,
           itemschedulex LIKE bapimeposchedulx OCCURS 0 WITH HEADER LINE .
    *Structures to hold PO services data
    DATA : services LIKE bapiesllc OCCURS 0 WITH HEADER LINE .
    *Structures to hold PO (distrib.imputac.lín.servicios) data
    DATA : posrvaccessvalues LIKE bapiesklc OCCURS 0 WITH HEADER LINE .
    *Structures to hold PO account data
    DATA : account  LIKE bapimepoaccount OCCURS 0 WITH HEADER LINE ,
           accountx LIKE bapimepoaccountx OCCURS 0 WITH HEADER LINE .
    *Internal table to hold messages from BAPI call
    DATA : return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
           purchaseorder LIKE bapimepoheader-po_number.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_file1 TYPE rlgrap-filename OBLIGATORY,
                 p_brow1 TYPE i,
                 p_erow1 TYPE i.
    SELECTION-SCREEN : END OF BLOCK b1.
    SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS : p_file2 TYPE rlgrap-filename OBLIGATORY,
                 p_brow2 TYPE i,
                 p_erow2 TYPE i.
    SELECTION-SCREEN : END OF BLOCK b2.
    SELECTION-SCREEN : BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS : p_file3 TYPE rlgrap-filename OBLIGATORY,
                 p_brow3 TYPE i,
                 p_erow3 TYPE i.
    SELECTION-SCREEN : END OF BLOCK b3.
    SELECTION-SCREEN : BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
    PARAMETERS : p_file4 TYPE rlgrap-filename OBLIGATORY,
                 p_brow4 TYPE i,
                 p_erow4 TYPE i.
    SELECTION-SCREEN : END OF BLOCK b4.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ' '
        IMPORTING
          file_name     = p_file1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file2.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ' '
        IMPORTING
          file_name     = p_file2.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file3.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ' '
        IMPORTING
          file_name     = p_file3.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file4.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ' '
        IMPORTING
          file_name     = p_file4.
    START-OF-SELECTION.
      PERFORM excel_to_itab.
      PERFORM get_final.
    *&      Form  excel_to_itab
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM excel_to_itab .
    ************** Excel 1
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                      = p_file1
          i_begin_col                   = '1'
          i_begin_row                   = p_brow1
          i_end_col                     = '08'
          i_end_row                     = p_erow1
        TABLES
          intern                        = it_excel1
    * EXCEPTIONS
    *   INCONSISTENT_PARAMETERS       = 1
    *   UPLOAD_OLE                    = 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.
      LOOP AT it_excel1  INTO wa_excel1.
        CASE wa_excel1-col.
          WHEN '0001'.
            wa_header-po_no = wa_excel1-value.
          WHEN '0002'.
            wa_header-purch_org = wa_excel1-value.
          WHEN '0003'.
            wa_header-pur_group = wa_excel1-value.
          WHEN '0004'.
            wa_header-doc_type = wa_excel1-value.
          WHEN '0005'.
            wa_header-vendor = wa_excel1-value.
          WHEN '0006'.
            wa_header-doc_date = wa_excel1-value.
          WHEN '0007'.
            wa_header-currency = wa_excel1-value.
          WHEN '0008'.
            wa_header-comp_code = wa_excel1-value.
        ENDCASE.
        AT END OF row.
          APPEND wa_header TO it_header.
          CLEAR wa_header.
        ENDAT.
      ENDLOOP.
    ************** Excel 2
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
          EXPORTING
            filename                      = p_file2
            i_begin_col                   = '1'
            i_begin_row                   = p_brow2
            i_end_col                     = '16'
            i_end_row                     = p_erow2
          TABLES
            intern                        = it_excel2
    * EXCEPTIONS
    *   INCONSISTENT_PARAMETERS       = 1
    *   UPLOAD_OLE                    = 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.
      LOOP AT it_excel2 INTO wa_excel2.
        CASE wa_excel2-col.
          WHEN '0001'.
            wa_item-po_no = wa_excel2-value.
          WHEN '0002'.
            wa_item-po_item = wa_excel2-value.
          WHEN '0003'.
            wa_item-acctasscat = wa_excel2-value.
          WHEN '0004'.
            wa_item-short_text = wa_excel2-value.
          WHEN '0005'.
            wa_item-plant = wa_excel2-value.
          WHEN '0006'.
            wa_item-pckg_no  = wa_excel2-value.
          WHEN '0007'.
            wa_item-stge_loc = wa_excel2-value.
          WHEN '0008'.
            wa_item-quantity = wa_excel2-value.
          WHEN '0009'.
            wa_item-po_unit = wa_excel2-value.
          WHEN '0010'.
            wa_item-po_price = wa_excel2-value.
          WHEN '0011'.
            wa_item-net_price = wa_excel2-value.
          WHEN '0012'.
            wa_item-price_unit = wa_excel2-value.
          WHEN '0013'.
            wa_item-orderpr_un = wa_excel2-value.
          WHEN '0014'.
            wa_item-delivery_date  = wa_excel2-value.
          WHEN '0015'.
            wa_item-matl_group = wa_excel2-value.
          WHEN '0016'.
            wa_item-tax_code  = wa_excel2-value.
        ENDCASE.
        AT END OF row.
          APPEND wa_item TO it_item.
          CLEAR wa_item.
        ENDAT.
      ENDLOOP.
    ************** Excel 3
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
          EXPORTING
            filename                      = p_file3
            i_begin_col                   = '1'
            i_begin_row                   = p_brow3
            i_end_col                     = '13'
            i_end_row                     = p_erow3
          TABLES
            intern                        = it_excel3
    * EXCEPTIONS
    *   INCONSISTENT_PARAMETERS       = 1
    *   UPLOAD_OLE                    = 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.
      LOOP AT it_excel3 INTO wa_excel3.
        CASE wa_excel3-col.
          WHEN '0001'.
            wa_service-po_no = wa_excel3-value.
          WHEN '0002'.
            wa_service-po_item = wa_excel3-value.
          WHEN '0003'.
            wa_service-pckg_no = wa_excel3-value.
          WHEN '0004'.
            wa_service-line_no = wa_excel3-value.
          WHEN '0005'.
            wa_service-ext_line = wa_excel3-value.
          WHEN '0006'.
            wa_service-outl_ind = wa_excel3-value.
          WHEN '0007'.
            wa_service-subpckg_no = wa_excel3-value.
          WHEN '0008'.
            wa_service-serial_no = wa_excel3-value.
          WHEN '0009'.
            wa_service-short_text = wa_excel3-value.
          WHEN '0010'.
            wa_service-quantity = wa_excel3-value.
          WHEN '0011'.
            wa_service-base_uom = wa_excel3-value.
          WHEN '0012'.
            wa_service-gr_price = wa_excel3-value.
          WHEN '0013'.
            wa_service-matl_group = wa_excel3-value.
        ENDCASE.
        AT END OF row.
          APPEND wa_service TO it_service.
          CLEAR wa_service.
        ENDAT.
      ENDLOOP.
    ************** Excel 3
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
          EXPORTING
            filename                      = p_file4
            i_begin_col                   = '1'
            i_begin_row                   = p_brow4
            i_end_col                     = '07'
            i_end_row                     = p_erow4
          TABLES
            intern                        = it_excel4
    * EXCEPTIONS
    *   INCONSISTENT_PARAMETERS       = 1
    *   UPLOAD_OLE                    = 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.
      LOOP AT it_excel4 INTO wa_excel4.
        CASE wa_excel4-col.
          WHEN '0001'.
            wa_account-po_no  = wa_excel4-value.
          WHEN '0002'.
            wa_account-po_item  = wa_excel4-value.
          WHEN '0003'.
            wa_account-serial_no = wa_excel4-value.
          WHEN '0004'.
            wa_account-gl_account = wa_excel4-value.
          WHEN '0005'.
            wa_account-costcenter = wa_excel4-value.
          WHEN '0006'.
            wa_account-asset_no = wa_excel4-value.
          WHEN '0007'.
            wa_account-orderid  = wa_excel4-value.
        ENDCASE.
        AT END OF row.
          APPEND wa_account TO it_account.
          CLEAR wa_account.
        ENDAT.
      ENDLOOP.
    ENDFORM.                    " excel_to_itab
    *&      Form  GET_FINAL
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_final .
      LOOP AT it_header INTO wa_header.
    *  BAPI HEADER
        header-purch_org  = wa_header-purch_org.
        header-pur_group  = wa_header-pur_group.
        header-doc_type   = wa_header-doc_type.
        header-vendor     = wa_header-vendor.
        header-doc_date   = wa_header-doc_date.
        header-currency   = wa_header-currency.
        header-comp_code  = wa_header-comp_code.
    * BAPI HEADERX
        headerx-comp_code = c_x.
        headerx-doc_type = c_x.
        headerx-vendor = c_x.
        headerx-creat_date = c_x.
        headerx-created_by = c_x.
        headerx-purch_org = c_x.
        headerx-pur_group = c_x.
        headerx-langu = c_x.
        headerx-sales_pers = c_x.
        headerx-currency = c_x.
        headerx-doc_date = c_x.           " Added
        LOOP AT it_item INTO wa_item WHERE po_no = wa_header-po_no.
          CALL FUNCTION 'NUMBER_GET_NEXT'
             EXPORTING
               nr_range_nr                   = '01'
               object                        = 'SERVICE'
    *   quantity                      = '1'
    *   SUBOBJECT                     = ' '
    *   TOYEAR                        = '0000'
    *   IGNORE_BUFFER                 = ' '
              IMPORTING
              number                        =    number
    *   QUANTITY                      =
    *   RETURNCODE                    =
    * EXCEPTIONS
    *   INTERVAL_NOT_FOUND            = 1
    *   NUMBER_RANGE_NOT_INTERN       = 2
    *   OBJECT_NOT_FOUND              = 3
    *   QUANTITY_IS_0                 = 4
    *   QUANTITY_IS_NOT_1             = 5
    *   INTERVAL_OVERFLOW             = 6
    *   BUFFER_OVERFLOW               = 7
    *   OTHERS                        = 8
          IF sy-subrc <> 0.
    * Implement suitable error handling here
          ENDIF.
          item-po_item        =     wa_item-po_item.
          item-acctasscat     =     wa_item-acctasscat.
          item-item_cat       =     '9'.
          item-short_text     =     wa_item-short_text.
          item-plant          =     wa_item-plant.
          item-pckg_no        =     number.
          item-stge_loc       =     wa_item-stge_loc.
          item-quantity       =     wa_item-quantity.
          item-po_unit        =     wa_item-po_unit.
          item-po_price       =     wa_item-po_price.
          item-net_price      =     wa_item-net_price.
          item-price_unit     =     wa_item-price_unit.
          item-orderpr_un     =     wa_item-orderpr_un.
          item-matl_group     =     wa_item-matl_group.
          item-tax_code       =     wa_item-tax_code.
          APPEND item.
          CLEAR item.
          itemx-po_item = wa_item-po_item.
          itemx-item_cat =  c_x.
          itemx-po_itemx = c_x.
          itemx-short_text = c_x.
          itemx-quantity = c_x.
          itemx-tax_code = c_x.
          itemx-acctasscat = c_x.
          itemx-item_cat = c_x.
          itemx-matl_group = c_x.
          itemx-plant = c_x.
          itemx-trackingno = c_x.
          itemx-agreement = c_x.
          itemx-agmt_item = c_x.
          itemx-stge_loc = c_x.
          itemx-quantity = c_x.
          itemx-po_unit = c_x.
          itemx-conv_num1 = c_x.
          itemx-conv_den1 = c_x.
          itemx-net_price = c_x.
          itemx-price_unit = c_x.
          itemx-gr_pr_time = c_x.
          itemx-prnt_price = c_x.
          itemx-unlimited_dlv = c_x.
          itemx-gr_ind = c_x .
          itemx-ir_ind = c_x .
          itemx-gr_basediv = c_x .
          itemx-pckg_no = c_x.
          itemx-po_price = c_x.         " Added
          itemx-orderpr_un = c_x.         " Added
          APPEND itemx.
          CLEAR itemx.
          itemschedule-po_item = wa_item-po_item.
          itemschedule-del_datcat_ext = 'D'.
          itemschedule-delivery_date =  wa_item-delivery_date.
          APPEND itemschedule.
          CLEAR itemschedule.
          itemschedulex-po_item = wa_item-po_item.
          itemschedulex-po_itemx = c_x .
          itemschedulex-del_datcat_ext = c_x.
          itemschedulex-delivery_date = c_x .
          APPEND itemschedulex.
          CLEAR itemschedulex.
          LOOP AT  it_service INTO wa_service WHERE po_no = wa_item-po_no AND po_item = wa_item-po_item.
            IF  wa_service-outl_ind IS INITIAL.
    IF number1 IS INITIAL.
              CALL FUNCTION 'NUMBER_GET_NEXT'
                EXPORTING
                  nr_range_nr                   = '01'
                  object                        = 'SERVICE'
    *   quantity                      = '1'
    *   SUBOBJECT                     = ' '
    *   TOYEAR                        = '0000'
    *   IGNORE_BUFFER                 = ' '
                 IMPORTING
                 number                        =    number1
    *   QUANTITY                      =
    *   RETURNCODE                    =
    * EXCEPTIONS
    *   INTERVAL_NOT_FOUND            = 1
    *   NUMBER_RANGE_NOT_INTERN       = 2
    *   OBJECT_NOT_FOUND              = 3
    *   QUANTITY_IS_0                 = 4
    *   QUANTITY_IS_NOT_1             = 5
    *   INTERVAL_OVERFLOW             = 6
    *   BUFFER_OVERFLOW               = 7
    *   OTHERS                        = 8
              IF sy-subrc <> 0.
    * Implement suitable error handling here
              ENDIF.
              services-pckg_no      =  number.
              services-line_no      =  '1'.
              services-ext_line     =  '0'.
              services-outl_ind     =  'X'.
              services-subpckg_no   =  number1.
    *          services-short_text   =  wa_service-short_text.
    *          services-quantity     =  wa_service-quantity.
    *          services-base_uom     =  wa_service-base_uom.
    *          services-gr_price     =  wa_service-gr_price.
    *          services-matl_group   =  wa_service-matl_group.
              APPEND  services.
              CLEAR services.
    ENDIF.
    *        ELSE.
              services-pckg_no      =  number1.
              services-line_no      =  wa_service-line_no.
              services-ext_line     =  wa_service-ext_line.
    *          services-outl_ind     =  wa_service-outl_ind.
              services-subpckg_no   =  '0'.
              services-short_text   =  wa_service-short_text.
              services-quantity     =  wa_service-quantity.
              services-base_uom     =  wa_service-base_uom.
              services-gr_price     =  wa_service-gr_price.
              services-matl_group   =  wa_service-matl_group.
              APPEND  services.
              CLEAR services.
            ENDIF.
            IF wa_service-outl_ind IS INITIAL.
              posrvaccessvalues-pckg_no =  number1.
              posrvaccessvalues-line_no = wa_service-line_no.
              posrvaccessvalues-serno_line = '01'.
              posrvaccessvalues-serial_no = wa_service-serial_no.
    *          posrvaccessvalues-percentage = '100'.
              APPEND posrvaccessvalues . CLEAR posrvaccessvalues.
            ENDIF.
          ENDLOOP.
          LOOP AT it_account INTO wa_account WHERE po_no = wa_item-po_no AND po_item = wa_item-po_item.
            account-po_item         =       wa_account-po_item.
            account-serial_no       =       wa_account-serial_no.
            account-gl_account      =       wa_account-gl_account.
            account-costcenter      =       wa_account-costcenter.
            account-asset_no        =       wa_account-asset_no.
            account-orderid         =       wa_account-orderid.
            APPEND account.
            CLEAR account.
            accountx-po_item = wa_account-po_item.
            accountx-po_itemx = c_x .
            accountx-serial_no = wa_account-serial_no.
            accountx-serial_nox = c_x .
    *        accountx-creat_date = c_x .
            accountx-costcenter = c_x .
            accountx-gl_account = c_x .
    *        accountx-co_area = c_x .
    *        accountx-tax_code = c_x .
    *        accountx-asset_no        = c_x .   " Added
    *        accountx-orderid         = c_x .   " Added
            APPEND accountx. CLEAR accountx.
          ENDLOOP.
        ENDLOOP.
        CALL FUNCTION 'BAPI_PO_CREATE1'
          EXPORTING
            poheader          = header
            poheaderx         = headerx
    *       POADDRVENDOR      =
    *       TESTRUN           =
          IMPORTING
            exppurchaseorder  = purchaseorder
    *       EXPHEADER         =
    *       EXPPOEXPIMPHEADER =
          TABLES
            return            = return
            poitem            = item
            poitemx           = itemx
            poschedule        = itemschedule
            poschedulex       = itemschedulex
            poaccount         = account
            poaccountx        = accountx
            poservices        = services.
        posrvaccessvalues = posrvaccessvalues.
        IF purchaseorder IS NOT INITIAL.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              wait = 'X'.
        ENDIF.
        LOOP AT return.
          WRITE : / return-type, return-number, return-message.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    " GET_FINAL

    Hi ganesh,
    Please look at the SAP note 376424 - BAPI_PO_CREATE1: Error messages for parked POs.
    Sap recommends to install the support service pack. Take a look at the note for detailed understanding.
    Also take a look at SAP NOte
    767284 - SE518 occurs although account assignment is supplied to BAPI (this requires Note 552114 must be applied as a prerequisite)
    Consider contacting basis team after your analysis about the issue.
    Regards,
    Sivaganesh

  • How to handle user exit sequence

    how do handle the userexit sequence i,e in which order the user exits are stored?

    one  and state solution
    go to debugger mode make  breakponint on statement call fm.
    and press f8 continiously and check exit fm one by one.

  • How to handle an error while using classes.

    Hi gurus,
               when i tried to copy the code from function module into report and execute it, it is giving some error message as
    Error: components of classes declared using u201CCLASSLCL_TREE_EVENT_HANDLER
    DEFINITION DEFERREDu201D can only be accessed after you have defined the class
    (CLASS LCL_TREE_EVENT_HANDLER DEFINITION)..
    i included the declarations include and forms include which are standards.
    i copied the function module 'HR_CH_PERS_FILE'  to get the employee infotype details in tree structure.
    thank you..

    Hi,
        You must put the INCLUDE that contains the class object instantiation code (CREATE OBJECT) after the INCLUDE which contains the CLASS DEFINITION.
    This error is coming due to the fact the your program is trying to create an instance of the class whose definition is not found at the time of the instantiation.
    That is
    Before you write
    DATA obj TYPE REF TO cl_XXXxx.
    CREATE OBJECT obj.
    You need to have
    CLASS cl_XXXxx DEFINITION.
    ENDCLASS.
    Best Regards,
    Sesh

  • How do we handle User exits in XML Publisher

    Hi,
    Can anyone tell me how do we handle user exits in XML Publisher ?
    Thanks,
    Kiran.

    Do tyou mean the original Oracle Reports user exits ?
    If so then the flexfield ones are handled in the data template, check the user guide. Format currency should be called in the template layer. You do not need srw.init with data templates.
    Regards, Tim

  • How to find whether user exits are  used in the query or not??

    Hi ,
    I have to make the list of queris in which user exits are used.
    Please any body help me how to find the queries in which user exits are used.
    Thanks
    Maruthi

    Hi Maruthi,
    Using table RSZGLOBV you can find out the queries that have customer exit variables.
    Set filter VRPROCTP (processing type) = 3 means customer exit.
    and the field COMPID will give you the Query name.
    Best Wishes,
    Mayank

  • How can we fnd wich user exit yo use for

    hi ABAP masters
    how can we find out which user exit to use or a particular requirment.

    Hello Devender,
    The procedure followed is usually by reading the documentation
    eg: consider a user exit or BADI definition
    We get a hint from the text of the same...if not we refer the documentation given
    if documentation is not available we check the signature of the enhancement i.e, which all fields are importing,exporting,which tables can be changed which cannot ....etc
    Finally ,if none works out we do what abapers do best
    Put a break point and see if it works or in case of BADI ,create a test implementation and see if it works out..
    so here is the summary
    Check description ->  Check documentation  -> Check signatures -> debugg/Trial and error
    Hope it helped you out
    Regards
    Byju

  • How user exit is used to populate the Profit center field in  Sales order?

    Hi All,
    Please let me know :
    How the user exit is used to populate the Profit center field in the Sales order?
    Please gurus answer as quickly as possible as I require this urgently.

    Hi,
    To derive the correct profit center in the Sales Order, you customize in 0KEM.
    Trust this helps much and do encourage our efforts!
    Cheers!

  • How to create the sales order using BAPI's ....?

    Hi Guru's,
    could you please provide how to create the sales order using BAPI's .....i need step by step process and please provide the details from scratch....basically  i don't have basic knowledge on this....please provide required inputs ....:)
    thanks in advance
    Srinivas......

    Hi Guru's thanks for your inouts and your valuble time...
    please find the program logic below...
    *& Report  ZAREPAS30
    REPORT  zarepas30.
    DATA : gs_vbeln                   TYPE  vbak-vbeln,
           gs_order_header_in         TYPE  bapisdhd1,
           gs_order_header_inx        TYPE  bapisdhd1x,
           gt_order_items_in          TYPE  STANDARD TABLE OF bapisditm,
           gwa_itab1                  TYPE  bapisditm,
           gt_order_items_inx         TYPE  STANDARD TABLE OF bapisditmx,
           gwa_itab2                  TYPE  bapisditmx,
           gt_order_partners          TYPE  STANDARD TABLE OF bapiparnr,
           gwa_itab3                  TYPE  bapiparnr,
           gt_return                  TYPE  STANDARD TABLE OF bapiret2,
           gwa_itab4                  TYPE  bapiret2.
    Sales document type
      PARAMETERS: p_auart TYPE auart OBLIGATORY.
    Sales organization
      PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    Distribution channel
      PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    Division.
      PARAMETERS: p_spart TYPE spart OBLIGATORY.
    Requested Delivery Date
      PARAMETERS: p_edatu  TYPE edatu OBLIGATORY.
    Sold-to
      PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    Ship-to
      PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    Material
      PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    Quantity.
      PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    Plant
      PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    Start-of-selection.
      START-OF-SELECTION.
    Header data
    Sales document type
      gs_order_header_in-doc_type = p_auart.
      gs_order_header_inx-doc_type = 'X'.
    Sales organization
      gs_order_header_in-sales_org = p_vkorg.
      gs_order_header_inx-sales_org = 'X'.
    Distribution channel
      gs_order_header_in-distr_chan  = p_vtweg.
      gs_order_header_inx-distr_chan = 'X'.
    Division
      gs_order_header_in-division = p_spart.
      gs_order_header_inx-division = 'X'.
    Reguested Delivery Date
      gs_order_header_in-req_date_h = p_edatu.
      gs_order_header_inx-req_date_h = 'X'.
      gs_order_header_inx-updateflag = 'I'.
    Partner data
    Sold to
      gwa_itab3-partn_role = 'AG'.
      gwa_itab3-partn_numb = p_sold.
      APPEND gwa_itab3 TO  gt_order_partners .
    ship to
      gwa_itab3-partn_role = 'WE'.
      gwa_itab3-partn_numb = p_ship.
      APPEND gwa_itab3 TO  gt_order_partners .
    ITEM DATA
      gwa_itab2-updateflag = 'I'.
    Line item number.
      gwa_itab1-itm_number = '000010'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    Line item number.
      gwa_itab1-itm_number = '000020'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
        order_header_in               = gs_order_header_in
        ORDER_HEADER_INX              = gs_order_header_inx
      IMPORTING
        SALESDOCUMENT                 = gs_vbeln
      tables
        RETURN                        = gt_return
        ORDER_ITEMS_IN                = gt_order_items_in
        ORDER_ITEMS_INX               = gt_order_items_inx
        order_partners                = gt_order_partners.
    Check the return table.
      LOOP AT gt_return into gwa_itab4 WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error occured while creating sales order '.
      ELSE.
    Commit the work.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE: / 'Document ', gs_vbeln, ' created'.
      ENDIF.

  • User exit while creating delivery (VL01N)

    Hi Experts,
    Is there any User Exit, While creating Outbound Delivery with reference to Sales order using VL01N,subitem cannot be created without the related H.Level item.
    So my requirement is:
    Check Higher Level Item (VBAP-UEPOS), If Higher Level Item value is set for an item, ensure that the related item that the Higher Level Item value refers to is also on the same delivery. If not, then issue an error that sub item cannot be created without the related HLI item.
    How to achieve this, Any user exit ? Help will be appreciated.
    Thanks,
    Ranjith.

    Hi,
    You may use Report ZNEGI16 given in below link to find out the user exits and BADIs associated with the above T code.
    How to find BADIs
    Kindly let me know if this was of any help to you.
    Regards,
    Shayeree

  • How to Handle user Session in JSP

    Help me,
    How to handle user session in JSP.......

    Prakash_Pune wrote:
    tell me some Debugging tech. so i can overcome from my problem.....Do you use an IDE? Any IDE ships with a decent debugger where in you can just execute the code step by step, explore the current variable values and check what exactly is happening. For example Eclipse or IntelliJ. If you don´t use an IDE, then just place some System.out.println() or Logger.debug() statements at strategic locations printing the variables of relevance so that you can track in logs what exactly is happening.
    or tell any other way to find is my page is thread safe or not...Just write correct code and narrow the scope of the variables as much as possible. If you for example assigned the user object to a static variable or as a servlet´s instance variable, then exactly the same user object would be used everywhere in the application. That kind of logical things.

  • BAdi or User exit to use in MB26 to avoid posting before saving of mat doc?

    Hello Experts,
    Can anyone tell me which BAdi or User exit to use in MB26 to avoid posting before saving of material document?
    I have requirement to stop posting incase of negative invetory in issuing storag location.
    Thanks

    Hello,
    The issue is currently we alllowing the negetaive stock at storage location level.At this movement , we want to avoid the negetive stock creation while posting the Mat doc with MB26.Before saving the material document I want check the stock levels in MARD , if the stock levels goes negative from this posting, then I want to stop the document posting.
    Thanks

  • How to add USER EXIT in CMOD??

    Basically I've copied IDOC_OUTPUT_DELVRY FM code from another system.
    in that code I found user exit (EXIT_SAPLV56K_002).
    Now my lead asked me to add this exit to his project(ZLE_PROJ) in CMOD.
    anyone can help me how to add this exit and activate to ZLE_PROJ please....

    Hi Mr. Bond,
    Please check the sample given below.
    User exits :
    1. Introduction
    2. How to find user exits
    3. Using Project management of SAP Enhancements 
    1. Introduction:
    User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.
    The naming standard of function modules for functionmodule exits is: 
    EXIT_<program name><3 digit suffix> 
    The call to a functionmodule exit is implemented as:
    CALL CUSTOMER.-FUNCTION <3 digit suffix>
    Example:
    The program for transaction VA01 Create salesorder is SAPMV45A
    If you search for CALL CUSTOMER-FUNCTION i program
    SAPMV45A you will find ( Among other user exits):
    CALL CUSTOMER-FUNCTION '003'
      exporting
        xvbak   = vbak
        xvbuk   = vbuk
        xkomk   = tkomk
      importing
        lvf_subrc = lvf_subrc
      tables
        xvbfa = xvbfa
        xvbap = xvbap
        xvbup = xvbup.
    The exit calls function module EXIT_SAPMV45A_003
    2. How to find user exits?
    Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT
    If you know the Exit name, go to transaction CMOD.
    Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.
    You will now come to a screen that shows the function module exits for the exit.
    3. Using Project management of SAP Enhancements, we want to create a project to enahance trasnaction VA01 .
    - Go to transaction CMOD
    - Create a project called ZVA01
    - Choose the Enhancement assign radio button and press the Change button
    In the first column enter V45A0002 Predefine sold-to party in sales document. 
    Note that an enhancement can only be used in 1 project. If the enhancement is already in use, and error message will be displayed
    Press Save
    Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit.
    Now the function module is displayed. Double click on include ZXVVAU04 in the function module
    Insert the following code into the include: E_KUNNR = '2155'.
    Activate the include program. Go back to CMOD and activate the project. 
    Goto transaction VA01 and craete a salesorder. 
    Note that Sold-to-party now automatically is "2155"
    Regards,
    Renjith Michael.

  • How to find user exit for a perticular screen?

    Dear all,
    Can some one tell me how to find user exit for a perticular screen?
    ex: MC88 screen can we figure out are there any user exit for that screen!!
    Regards,
    Vj

    User exits are built into the Standard SAP code. You just activate them and insert your code into the include programs.
    Here is a program that will list the user exits per transaction code. Not perfect, but it may help.
    report z_find_user_exit no standard page heading.
    tables: tstc, tadir, modsapt, modact,
            trdir, tfdir, enlfdir, tstct.
    data : jtab like tadir occurs 0 with header line.
    data : hotspot(30).
    parameters : p_tcode like tstc-tcode obligatory.
    at line-selection.
      get cursor field hotspot.
      check hotspot(4) eq 'JTAB'.
      set parameter id 'MON' field sy-lisel+1(10).
      call transaction 'SMOD' and skip first screen.
    start-of-selection.
      perform get_data.
      perform write_list.
          FORM get_data                                                 *
    form get_data.
      select single * from tstc
                  where tcode eq p_tcode.
      check sy-subrc eq 0.
      select single * from tadir
                where pgmid = 'R3TR'
                  and object = 'PROG'
                  and obj_name = tstc-pgmna.
      if sy-subrc ne 0.
        select single * from trdir
                 where name = tstc-pgmna.
        if trdir-subc eq 'F'.
          select single * from tfdir
                         where pname = tstc-pgmna.
          select single * from enlfdir
                         where funcname = tfdir-funcname.
          select single * from tadir
                         where pgmid = 'R3TR'
                           and object = 'FUGR'
                           and obj_name eq enlfdir-area.
        endif.
      endif.
      select * from tadir into table jtab
                 where pgmid = 'R3TR'
                   and object = 'SMOD'
                   and devclass = tadir-devclass.
      select single * from tstct
              where sprsl eq sy-langu
                and tcode eq p_tcode.
    endform.
          FORM write_list                                               *
    form write_list.
      format color col_positive intensified off.
      write:/(19) 'Transaction Code - ',
      20(20) p_tcode,
      45(50) tstct-ttext.
      skip.
      if not jtab[] is initial.
        write:/(95) sy-uline.
        format color col_heading intensified on.
        write:/1 sy-vline,
        2 'Exit Name',
        21 sy-vline ,
        22 'Description',
        95 sy-vline.
        write:/(95) sy-uline.
        loop at jtab.
          select single * from modsapt
          where sprsl = sy-langu and
          name = jtab-obj_name.
          format color col_normal intensified off.
          write:/1 sy-vline,
          2 jtab-obj_name hotspot on,
          21 sy-vline ,
          22 modsapt-modtext,
          95 sy-vline.
        endloop.
        write:/(95) sy-uline.
        describe table jtab.
        skip.
        format color col_total intensified on.
        write:/ 'No of Exits:' , sy-tfill.
      else.
        format color col_negative intensified on.
        write:/(95) 'No User Exit exists'.
      endif.
    endform.
    SMOD, is where you can find the system modifications provided by SAP. CMOD is where you will implement them. If you are looking for all the enhancements provided, then go to CMOD, follow the menu, 'Utilities-->SAP Enhancements'. This will take you to a screen where if you just execute it, you will get all the enhancements provided by SAP.
    It is always difficult to find a user exit if all you have is a program name or a transaction code, unless you do a program like Rich suggested. But even there, you will not be able to find user exits that are implemented as sub-routines(also called forms not sapscript forms). Most of the user exits are documented under the corresponding task under IMG structure. So use transaction code SPRO, go to the IMG structure, choose the application area that your program or transaction might be and then you should find a task that talks about enhancements. If you execute that task most often it will take you to CMOD and sometimes to SE38. But all you want to know is there in the documentation attached to the task. Then you can go to CMOD and see which components are there.
    Regards,
    Amey

Maybe you are looking for

  • HP Officejet Pro 8500A Premium will not print docs from computer, but will print a test page.

    HP Officejet Pro 8500A Premium will not print docs from computer, but will print a test page.  I continually get a message that the computer cannot communicate with the printer.   Not only will it not print docs, it will not print web pages using IE

  • Replacement Question: Ipod 20G 4th Gen Vs. Ipod 30G 5th Gen

    The 20G non-color display Ipod that I owned for 18 months died mysteriously last Sunday. I lifted it out of the charge dock after it fully charged and the click wheel had become completely unresponsive. The video display was fully functional.... but

  • Ken Burn pictures look really low quality

    Putting high quality pictures into movie and when I ad ken Burns affect they look very low quality as the effect is in process. Do I need to add a lower quality pic? Any suggestions would be very much appreciated. Keith

  • Chart x values normalized

    Can I normalize the chart x axis range from 0 to 100 regardless of the number of samples while the program is running ?  I think it needs to be done dynamically each time a point of data after 100 is plotted.  I don't want to reinitialize the chart e

  • Transaction Launcher for WebUI

    Hi, hope anybody can help. Is it possible to open a external WebPage in a WebUI assignment block by using the transaction launcher? We need to add a custom assignment block to the appointment WebUI which show informations from a other system. This ot