Regarding bapi to issue PGI BAPI_OUTB_DELIVERY_CHANGE,sample code please

Can you send me the sample code of this bapiBAPI_OUTB_DELIVERY_CHANGE ,if any one have used this.it's urgent please..

Hi,
BAPI_OUTB_DELIVERY_CHANGE - BAPI for Change to Outbound Delivery
BAPI_INB_DELIVERY_SAVEREPLICA - Create Inbound Delivery
RV_DELIVERY_CREATE - Create Delivery
GN_DELIVERY_CREATE - Create an Outbound Delivery
Код:
FORM xkomdlgn_fill USING p_open_qty LIKE ekpo-menge
                                       p_eindt LIKE eket-eindt
                                       p_licha LIKE eket-licha
                                       p_charg LIKE eket-charg
                                       p_uzeit LIKE eket-uzeit.
  STATICS: h_grkor LIKE lips-grkor,
  h_bsmng LIKE ekpo-menge.
  CLEAR t_xkomdlgn.
  CHECK t_ekpo-uptyp NE '5' " Lot
  AND t_ekpo-uptyp NE '6' " Display
  AND t_ekpo-uptyp NE '7' " VK-Set
  AND t_ekpo-uptyp NE 'H'. " GT-Stuckliste
  IF t_ekpo-uebpo IS INITIAL AND t_ekpo-upvor CA '1I'.
    CHECK 1 = 2.
  ENDIF.
  IF NOT ekko-lifnr IS INITIAL.
    CALL FUNCTION 'VENDOR_MASTER_DATA_SELECT_12'
      EXPORTING
        pi_lifnr       = ekko-lifnr
        pi_ekorg       = ekko-ekorg
      IMPORTING
        pe_lfm1        = lfm1
      EXCEPTIONS
        no_entry_found = 1
        OTHERS         = 2.
    t_xkomdlgn-vsbed = lfm1-vsbed.
  ELSE.
    CLEAR t_xkomdlgn-vsbed.
  ENDIF.
  t_xkomdlgn-adrnr_li = ekko-adrnr.
  t_xkomdlgn-lifnr = ekko-lifnr.
  t_xkomdlgn-inco1 = ekko-inco1.
  t_xkomdlgn-inco2 = ekko-inco2.
  t_xkomdlgn-exnum = ekko-exnum.
  t_xkomdlgn-bukrs_best = ekko-bukrs.
  t_xkomdlgn-matnr = t_ekpo-matnr.
  t_xkomdlgn-werks = t_ekpo-werks.
*IF STORAGE LOCATION IS MISSING APPEND
*FG01 As storage location
  IF t_ekpo-lgort IS INITIAL .
    t_xkomdlgn-lgort = 'FG01' .
  ELSE .
    t_xkomdlgn-lgort = t_ekpo-lgort.
  ENDIF.
  xkomdlgn-charg = ?
  T_XKOMDLGN-VRKME = T_EKPO-MEINS.
  t_xkomdlgn-meins = t_ekpo-lmein.
  t_xkomdlgn-umvkz = t_ekpo-umrez.
  t_xkomdlgn-umvkn = t_ekpo-umren.
  IF t_ekpo-matnr EQ space.
    t_xkomdlgn-meins = t_ekpo-meins.
    t_xkomdlgn-umvkz = 1.
    t_xkomdlgn-umvkn = 1.
  ENDIF.
  t_xkomdlgn-insmk = t_ekpo-insmk.
  t_xkomdlgn-kzfme = t_ekpo-kzfme.
  t_xkomdlgn-kzvbr = t_ekpo-kzvbr.
  t_xkomdlgn-lfimg = p_open_qty.
  t_xkomdlgn-lfdat = p_eindt.
  t_xkomdlgn-lfuhr = p_uzeit.
  xkomdlgn-vstel = ?
  XKOMDLGN-VKORG = ?
  xkomdlgn-vtweg = ?
  XKOMDLGN-SPART = ?
  t_xkomdlgn-traid = t_ekpo-traid."CARRIER CODE
  t_xkomdlgn-lifex = t_ekpo-lifex."External ID
  t_xkomdlgn-bolnr = t_ekpo-bolnr."Bill Of Lading
  t_xkomdlgn-xabln = t_ekpo-xabln."Goods Receipt/Issue Slip Number
  t_xkomdlgn-vgbel = t_ekpo-ebeln.
  t_xkomdlgn-vgpos = t_ekpo-ebelp.
  t_xkomdlgn-lfart = gf_dlv_type.
  t_xkomdlgn-vgtyp = 'V'.
  t_xkomdlgn-kzazu = 'X'.
  t_xkomdlgn-knttp = t_ekpo-knttp.
  t_xkomdlgn-sobkz = t_ekpo-sobkz.
  SELECT * FROM t163g WHERE bstae EQ t_ekpo-bstae
  AND ebtyp EQ gf_ebtyp.
    EXIT.
  ENDSELECT.
  IF sy-subrc = 0.
    prufen, ob lieferavis we-zuordnung hat (vorauss. fur we uber vl32)
    und wepos prufen
    if t163g-wezuo eq space or t_ekpo-wepos eq space.
    t_xkomdlgn-nowab = 'X'.
  ELSE.
    CLEAR t_xkomdlgn-nowab.
  ENDIF.
ENDIF.
IF t_ekpo-matnr IS INITIAL OR t_ekpo-pstyp = '6'.
  t_xkomdlgn-posar = 'B'.
ENDIF.
t_xkomdlgn-ematn = t_ekpo-ematn.
t_xkomdlgn-mfrnr = t_ekpo-mfrnr.
t_xkomdlgn-mfrpn = t_ekpo-mfrpn.
t_xkomdlgn-emnfr = t_ekpo-emnfr.
t_xkomdlgn-cuobj = t_ekpo-cuobj.
t_xkomdlgn-uebto = t_ekpo-uebto.
t_xkomdlgn-untto = t_ekpo-untto.
t_xkomdlgn-uebtk = t_ekpo-uebtk.
t_xkomdlgn-lichn = p_licha.
t_xkomdlgn-charg = p_charg.
t_xkomdlgn-bwtar = t_ekpo-bwtar.
t_xkomdlgn-kdmat = t_ekpo-idnlf.
t_xkomdlgn-arktx = t_ekpo-txz01.
t_xkomdlgn-mfrgr = t_ekpo-mfrgr.
t_xkomdlgn-gewei = t_ekpo-gewei.
t_xkomdlgn-voleh = t_ekpo-voleh.
t_xkomdlgn-ntgew = t_ekpo-ntgew * t_xkomdlgn-lfimg.
t_xkomdlgn-brgew = t_ekpo-brgew * t_xkomdlgn-lfimg.
t_xkomdlgn-volum = t_ekpo-volum * t_xkomdlgn-lfimg.
t_xkomdlgn-ean11 = t_ekpo-ean11.
t_xkomdlgn-podrel = t163l-podrel.
t_xkomdlgn-aktnr = t_ekpo-aktnr.
t_xkomdlgn-abeln = t_ekpo-abeln.
t_xkomdlgn-abelp = t_ekpo-abelp.
xkomdlgn-ltssf = only SORT criteria IN vl31n
T_XKOMDLGN-AUREL = T_EKPO-AUREL.
t_xkomdlgn-idnlf = t_ekpo-idnlf.
t_xkomdlgn-matkl = t_ekpo-matkl.
leergut-stuckliste ubernehmen
clear t_xkomdlgn-grkor.
CLEAR t_xkomdlgn-kmpmg.
CLEAR t_xkomdlgn-uepos.
CLEAR t_xkomdlgn-uepvw.                                     "549736
IF t_ekpo-upvor CA '3X'.
  h_grkor = h_grkor + 1.
  t_xkomdlgn-grkor = h_grkor.
  h_bsmng = t_ekpo-menge.
ENDIF.
IF NOT t_ekpo-uebpo IS INITIAL AND
t_ekpo-uptyp CA '3X'.
  t_xkomdlgn-uepvw = 'G'.                                   "549736
  t_xkomdlgn-uepos = t_ekpo-uebpo.
  t_xkomdlgn-grkor = h_grkor.
  IF h_bsmng NE 0.
    t_xkomdlgn-kmpmg = t_ekpo-menge / h_bsmng.
  ENDIF.
ENDIF.
IF t_ekpo-pstyp EQ '2'.
  t_xkomdlgn-sobkz = 'K'.
ENDIF.
kontierungsfelder
if t_ekpo-sobkz eq 'E' or t_ekpo-sobkz eq 'Q'.
CALL FUNCTION 'MMPUR_EKKN_READ_EBELN_EBELP'
  EXPORTING
    pi_ebeln             = t_ekpo-ebeln
    pi_ebelp             = t_ekpo-ebelp
    pi_bypassing_buffer  = pi_refresh_buffer
    =
  tables
    pto_ekkn_po          = xekkn
  EXCEPTIONS
    no_records_requested = 1
    OTHERS               = 2.
IF sy-subrc EQ 0.
  READ TABLE xekkn INDEX 1.
  t_xkomdlgn-ps_psp_pnr = xekkn-ps_psp_pnr.
  t_xkomdlgn-vbelv = xekkn-vbeln.
  t_xkomdlgn-posnv = xekkn-vbelp.
ENDIF.
ENDIF.
APPEND t_xkomdlgn.
ENDFORM. "xkomdlgn_fill
LOOP AT t_xkomdlgn.
set default parameter
t_xkomdlgn-vgtyp = 'V'.
t_xkomdlgn-kzazu = 'X'.
IF t_xkomdlgn-lfart IS INITIAL.
t_xkomdlgn-lfart = 'EL'.
ENDIF.
MODIFY t_xkomdlgn.
ENDLOOP.
SELECT SINGLE * FROM tvsa WHERE smart = xvbsk-smart.
IF sy-subrc 0.
Error Handling To be Done
Meldung ins Protokoll
ENDIF.
l_nrnr = tvsa-numki.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = l_nrnr
object      = 'RV_SAMMG'
IMPORTING
number      = xvbsk-sammg
EXCEPTIONS
OTHERS      = 1.
IF sy-subrc 0.
error hadling tbd
meldung ins protokoll
endif.
CALL FUNCTION 'GN_DELIVERY_CREATE'
EXPORTING
no_commit = 'X'
vbsk_i = xvbsk
if_no_deque = 'X'
IF_MASS_READ_MAT_SW = 'X'
vbls_pos_rueck = 'X'
TABLES
xkomdlgn = t_xkomdlgn
xvbfs = xvbfs
xvbls = xvbls
xxlips = xlips.
get informatioin from ekpo table and fill T_xkomdlgn

Similar Messages

  • Custom data link issues in sample code

    Hi all,
    I had tried to debug/run the sample of custom data link of Indesign SDK CS2. I found issue in this sample code whenever I create a package of the document which having the custom data link, at this time I got the message dialog box having the message "Cannot copy necessary linked file(s)".
    anybody know about this problem that how we can resolve this, Please let me know.

    Pete, I think this is a known issue- see http://support.adobe.com/devsup/devsup.nsf/docs/54028.htm for some workarounds.
    best wishes
    Ian

  • BAPI sample code with flat file.

    Hi everyone,
    I need BAPI sample code to upload data using a flat file which has header and
    item format..
    Its very urgent,
    thanks in advance,
    regards
    stanley

    See the simple example :
    REPORT  ZBAPI.
    DATA: BEGIN OF i_data OCCURS 0,
            text(255),
          END OF i_data.
    DATA: i_ekko TYPE bapiekkoc.
    DATA: it_ekko LIKE TABLE OF i_ekko INITIAL SIZE 0  WITH HEADER LINE.
    DATA: BEGIN OF i_ekpo OCCURS 0,
            po_item(5),
            pur_mat(18),
            plant(4),
            net_price(23),
            disp_quan(13),
         END OF i_ekpo.
    DATA: it_ekpo LIKE TABLE OF bapiekpoc INITIAL SIZE 0 WITH HEADER LINE .
    DATA: BEGIN OF i_eket OCCURS 0,
             po_item(5),
             deliv_date(8),
             quantity(13),
          END OF i_eket.
    DATA: it_eket LIKE TABLE OF bapieket INITIAL SIZE 0 WITH HEADER LINE.
    DATA: v_index TYPE i.
    DATA: return TYPE TABLE OF bapireturn INITIAL SIZE 0 WITH HEADER LINE.
    DATA: po_num(10).
    START-OF-SELECTION.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
      FILENAME                      = ' '
      FILETYPE                      = ' '
      ITEM                          = ' '
      FILEMASK_MASK                 = ' '
      FILEMASK_TEXT                 = ' '
      FILETYPE_NO_CHANGE            = ' '
      FILEMASK_ALL                  = ' '
      FILETYPE_NO_SHOW              = ' '
      LINE_EXIT                     = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      SILENT                        = 'S'
    IMPORTING
      FILESIZE                      =
      CANCEL                        =
      ACT_FILENAME                  =
      ACT_FILETYPE                  =
      TABLES
        data_tab                      = i_data
    EXCEPTIONS
      CONVERSION_ERROR              = 1
      INVALID_TABLE_WIDTH           = 2
      INVALID_TYPE                  = 3
      NO_BATCH                      = 4
      UNKNOWN_ERROR                 = 5
      GUI_REFUSE_FILETRANSFER       = 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.
    loop at i_data.
    if i_data-text(1) = 'H'.
       shift i_data-text.
       v_index = v_index + 1.
       split i_data-text at ',' into i_ekko-doc_type
                                    i_ekko-purch_org
                                    i_ekko-pur_group
                                    i_ekko-vendor.
      append i_ekko to it_ekko.
    elseif i_data-text(1) = 'I'.
    shift i_data-text.
    split i_data-text at ',' into i_ekpo-po_item
                                   i_ekpo-pur_mat
                                   i_ekpo-plant
                                   i_ekpo-net_price
                                   i_ekpo-disp_quan.
    append i_ekpo.
    move-corresponding i_ekpo to it_ekpo.
    append it_ekpo.
    clear it_ekpo.
    else.
    shift i_data-text.
    split i_data-text at ',' into i_eket-po_item
                                   i_eket-deliv_date
                                   i_eket-quantity.
    append it_eket .
    move-corresponding i_eket to it_eket.
    append it_eket.
    clear it_eket.
    endif.
    endloop.
    CALL FUNCTION 'BAPI_PO_CREATE'
      EXPORTING
        po_header                        = i_ekko
      PO_HEADER_ADD_DATA               =
      HEADER_ADD_DATA_RELEVANT         =
      PO_ADDRESS                       =
      SKIP_ITEMS_WITH_ERROR            = 'X'
      ITEM_ADD_DATA_RELEVANT           =
      HEADER_TECH_FIELDS               =
    IMPORTING
      PURCHASEORDER                    =
      tables
        po_items                         = it_ekpo
      PO_ITEM_ADD_DATA                 =
        po_item_schedules                = it_eket
      PO_ITEM_ACCOUNT_ASSIGNMENT       =
      PO_ITEM_TEXT                     =
       RETURN                           = return
      PO_LIMITS                        =
      PO_CONTRACT_LIMITS               =
      PO_SERVICES                      =
      PO_SRV_ACCASS_VALUES             =
      PO_SERVICES_TEXT                 =
      PO_BUSINESS_PARTNER              =
      EXTENSIONIN                      =
      POADDRDELIVERY                   =
    write: po_num.
      loop at return.
      write:/ return-message,return-type.
      endloop.

  • Regarding sample code to update partner function using SD_PARTNER_UPDATE

    Hi All,
    Please provide some sample code to update/add partner function using FM 'SD_PARTNER_UPDATE'.
    regards
    Vishnu

    A better option would be to use a break point on this FM while creating a sales order. That way you will know how standard uses this FM.
    Thanks,
    Vikram.M

  • Issues in Deploying the Sample code

    Hi,
    I downloaded  BusinessObjects Enterprise Java SDK Sample Code from SDK Developer Library.  I unzipped the content to a folder(Sample) in tomcat/webapps.  Now when I launched the application using the following url http://localhost:8080/Sample/start.jsp
    I am getting the following error.
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    Only a type can be imported. com.crystaldecisions.sdk.exception.SDKException resolves to a package
    Generated servlet error:
    Only a type can be imported. com.crystaldecisions.sdk.framework.CrystalEnterprise resolves to a package
    Generated servlet error:
    Only a type can be imported. com.crystaldecisions.sdk.framework.IEnterpriseSession resolves to a package
    Generated servlet error:
    Only a type can be imported. com.crystaldecisions.sdk.framework.ISessionMgr resolves to a package
    An error occurred at line: 36 in the jsp file: /start.jsp
    Generated servlet error:
    ISessionMgr cannot be resolved to a type
    An error occurred at line: 36 in the jsp file: /start.jsp
    Generated servlet error:
    CrystalEnterprise cannot be resolved
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Please let me know whether I have to do any configuration to make this application running.
    Thanks and Regards,
    Subbu S

    You can find the neccessary jar files here:
    C:Program FilesBusiness ObjectsCommon4.0javalib
    Check the developer guide for guidance on exactly which jars are required:
    https://www.sdn.sap.com/irj/boc/sdklibrary
    BusinessObjects Enterprise Java SDK > Developer Guide > Setting up the development environment > Web application setup > JAR files needed for deployment of Business Objects Software

  • Oracle Sample Code Login Issue

    I want to login to Oracle sample code.When i clicked the 'login' link from oracle sample code home page it is redirecting me to a page to 'Create User'. I gave my OTN username and password,but not accepting and showing invalid username/password message. Please help me to solve this.

    Hi,
    I had this issue, so i created a new user like 'user_ext' by providing a valid email id. Then try to login with the new user id created

  • Need sample code with RV_INVOICE_CREATE used

    Hi everybody!
    I need sample code with RV_INVOICE_CREATE or similar FMs used.
    The thing is that I do not know how to populate parametres of this and other invoicing FMs....
    For example, there are some tables to be passed to RV_INVOICE_CREATE
         TABLES
              XKOMFK     = XKOMFK
              XKOMV       = XKOMV
              XTHEAD      = XTHEAD
              XVBFS        = XVBFS
              XVBPA        = XVBPA
              XVBRK        = XVBRK
              XVBRP        = XVBRP
              XVBSS        = XVBSS
    How to populate them? I mean how to fill them with needed values?
    Useful answers will be awarded.
    Kind regards, M.

    RV_INVOICE_CREATE is the function module to create invoice based on delivery .
    when you pass delivery number ,it will create invoice ,see the invoice number in vf02,vf03 transaction. and also see the data vbrk,vbrp tables
    I have done this development and i have cancelled invoice,reverse goods issue,updated the delivery and again i am createing invoice..see the below progrm to get better understanding.
    REPORT ZWM_OVERWEIGHT_FIX  no standard page heading
                               message-id zwm.
    ======================================================================
    Program Name : ZWM_OVERWEIGHT_FIX                                    *
    Description  : Tool to fix Overweight in delivery line item,         *
                   Used All Function module to cancel invoice ,          *
                   Reverse the goods issue  ,Update Delivery qty,Create  *
                   invoice                                               *
    Author       : Seshu                                                 *
    Date         : 05/08/2007                                            *
    MODIFICATION HISTORY                                                 *
    DATE    | AUTHOR   | CHANGE #   | DESCRIPTION OF MODIFICATION        *
    --|||--
    05/08/07| Seshu    | DEVK921979 | Initial                            *
    D A T A - D E C L A R A T I O N     *******************
    Tables
    Tables : vbak,
             vbap,
             vbfa,
             likp,
             lips,
             vbrk,
             vbrp.
    Internal Tables
    data : i_lips like lips occurs 0 with header line,
           i_vbap like vbap occurs 0 with header line.
    Variables
    data : v_deliv like vbfa-vbelv,
           v_invoic like vbfa-vbelv.
    Data Declaration Part for Post Goods Issue
    DATA: l_vbeln LIKE likp-vbeln,
          l_vbkok LIKE vbkok,
          i_prot LIKE prott OCCURS 0 WITH HEADER LINE,
          ef_error_any_0 TYPE c,
          ef_error_in_item_deletion_0 TYPE c,
          ef_error_in_pod_update_0 TYPE c,
          ef_error_in_interface_0 TYPE c,
          ef_error_in_goods_issue_0 TYPE c,
          ef_error_in_final_check_0 TYPE c,
          d_return   LIKE bapireturn1.
    Internal tables for BAPI Function Module
    data : i_cret like BAPIRETURN1 occurs 0 with header line,
           i_csucess like BAPIVBRKSUCcESS occurs 0 with header line,
           i_ret2 like bapiret2 ,
           flag type c,
           i_mesg like mesg occurs 0 with header line.
    Data Declaration for Invoice Creation
    DATA: VBSK_I     LIKE  VBSK.
    data: d_success  type  c.
    DATA: XKOMFK LIKE      KOMFK   OCCURS 0 WITH HEADER LINE,
          XKOMV  LIKE      KOMV    OCCURS 0 WITH HEADER LINE,
          XTHEAD LIKE      THEADVB OCCURS 0 WITH HEADER LINE,
          XVBFS  LIKE      VBFS    OCCURS 0 WITH HEADER LINE,
          XVBPA  LIKE      VBPAVB  OCCURS 0 WITH HEADER LINE,
          XVBRK  LIKE      VBRKVB  OCCURS 0 WITH HEADER LINE,
          XVBRP  LIKE      VBRPVB  OCCURS 0 WITH HEADER LINE,
          XVBSS  LIKE      VBSS    OCCURS 0 WITH HEADER LINE,
          XKOMFKGN LIKE    KOMFKGN OCCURS 0 WITH HEADER LINE.
    S E L E C T I O N  -  S C R E E N   ******************
    Selection-screen
    Selection-screen : begin of block blk with frame title text-001.
    parameters : p_vbeln like vbak-vbeln obligatory.
    selection-screen : end of block blk.
    A T -  S E L E C T I O N  - S C R E E N ***************
    Validation on Sales order
    at selection-screen on p_vbeln.
    Check the data on VBAK Table
      select single vbeln from vbak into vbak-vbeln
                                where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message e006 with p_vbeln.
      endif.
    S T A R T  - O F - S E L E C T I O N *******************
    Start-of-selection.
      break sreddy.
    Get the Invoice Number corresponding Sales Order Number
      perform get_invoice.
    Step 1.
    Cancel the Invoice  - Transaction VF11
      perform cancel_invoice.
    Reverse the goods issue
      perform reverse_goodsissue.
    Get the Order and Delivery Items
      perform get_sales_deliv.
    Delivery Change
      perform Delivery_change.
    Create Invoice document
      perform invoice_create.
    E N D  -  O F -  S E L E C T I O N  *******************
    end-of-selection.
    if flag = 'X'.
    message i012 with p_vbeln.
    endif.
    *&      Form  get_invoice
          Get Invoice Number
    FORM get_invoice.
    Clear Variables
      clear : v_deliv,
              v_invoic,
              flag.
    Get the Delivery Number First
      select single vbeln from vbfa into v_deliv
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'J'.
      if sy-subrc ne 0.
        message i004 with p_vbeln.
        stop.
      endif.
    Get the Invoice Number
      select single vbeln from vbfa into v_invoic
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'M'.
      if sy-subrc ne 0.
        message i003 with p_vbeln.
        stop.
      endif.
    ENDFORM.                    " get_invoice
    *&      Form  cancel_invoice
          Cancel the Invoice
    FORM cancel_invoice.
      clear : i_ret2,
              i_cret,
              i_csucess.
      refresh : i_cret,
                i_csucess.
      CALL FUNCTION 'BAPI_BILLINGDOC_CANCEL1'
        EXPORTING
          BILLINGDOCUMENT       = v_invoic
      TESTRUN               =
      NO_COMMIT             =
      BILLINGDATE           =
        TABLES
          RETURN                = i_cret
          SUCCESS               = i_csucess
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
                WAIT   = space
           IMPORTING
                RETURN = i_ret2.
    read table i_cret with key type = 'E'.
      if sy-subrc ne 0.
        message i005 with v_invoic.
        stop.
      endif.
    ENDFORM.                    " cancel_invoice
    *&      Form  reverse_goodsissue
          Reverse the goods Issue
    FORM reverse_goodsissue.
    Local Variable
      data : lv_vbtyp like likp-vbtyp.
      clear : i_mesg,
              lv_vbtyp.
      refresh : i_mesg.
      select single vbtyp from likp into lv_vbtyp
                               where vbeln = v_deliv.
      CALL FUNCTION 'WS_REVERSE_GOODS_ISSUE'
        EXPORTING
          I_VBELN                         = v_deliv
          I_BUDAT                         = sy-datum
        I_COUNT                         =
        I_MBLNR                         =
        I_TCODE                         =
          I_VBTYP                         = lv_vbtyp
        TABLES
          T_MESG                          = i_mesg
       EXCEPTIONS
         ERROR_REVERSE_GOODS_ISSUE       = 1
         OTHERS                          = 2
      if sy-subrc ne 0.
        message i007 with v_deliv.
      endif.
    ENDFORM.                    " reverse_goodsissue
    *&      Form  get_sales_deliv
          Get the Sales order and Deliv Items
    FORM get_sales_deliv.
    Local Variables
      data : lv_kwmeng like vbap-kwmeng.
      clear : i_lips,
              i_vbap.
      refresh : i_lips,
                i_vbap.
    Select the data from LIPS
      select * from lips into table i_lips
                         where vbeln = v_deliv.
      if sy-subrc ne 0.
        message i008 with v_deliv.
        stop.
      endif.
      sort i_lips by vbeln posnr.
      Get the Sales order Item Data.
      select * from vbap into table i_vbap
                              where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message i006 with p_vbeln.
        stop.
      endif.
      sort i_vbap by vbeln posnr.
    Compare delivery Item and Order Items
      loop at i_lips.
        clear lv_kwmeng.
        read table i_vbap with key posnr = i_lips-posnr.
        if sy-subrc eq 0.
          lv_kwmeng = i_vbap-kwmeng * 2.
          if lv_kwmeng >= i_lips-lfimg.
            i_lips-lfimg = i_vbap-kwmeng.
            modify i_lips.
          endif.
        endif.
      endloop.
    ENDFORM.                    " get_sales_deliv
    *&      Form  Delivery_change
          Delivery Update
    FORM Delivery_change.
      Clear : i_prot.
      refresh : i_prot.
    Delivery Update
      CALL FUNCTION 'LE_MOB_DELIVERY_UPDATE'
           EXPORTING
                do_commit                = 'X'
           TABLES
                t_delivery_items         = i_lips
                prot                     = i_prot
           EXCEPTIONS
                conversion_overflow      = 1
                essential_data_missing   = 2
                error                    = 3
                nothing_to_update        = 4
                lock_after_update_failed = 5
                error_in_delivery_update = 6
                OTHERS                   = 7.
      COMMIT WORK.
      IF sy-subrc <> 0.
        MESSAGE i009 with v_deliv.
      endif.
    Post Goods Issue
      CLEAR:    d_return,
                i_prot,
                l_vbeln,
                l_vbkok.
      REFRESH i_prot.
      CLEAR:  ef_error_in_item_deletion_0    ,
              ef_error_in_pod_update_0       ,
              ef_error_in_interface_0        ,
              ef_error_in_goods_issue_0      ,
              ef_error_in_final_check_0      .
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    SET UPDATE TASK LOCAL.
      CALL FUNCTION 'WS_DELIVERY_UPDATE'
           EXPORTING
                vbkok_wa                    = l_vbkok
                synchron                    = 'X'
                no_messages_update          = ' '
                update_picking              = 'X'
                commit                      = 'X'
                delivery                    = l_vbeln
                nicht_sperren               = 'X'
                if_error_messages_send_0    = space
           IMPORTING
                ef_error_any_0              = ef_error_any_0
                ef_error_in_item_deletion_0 = ef_error_in_item_deletion_0
                ef_error_in_pod_update_0    = ef_error_in_pod_update_0
                ef_error_in_interface_0     = ef_error_in_interface_0
                ef_error_in_goods_issue_0   = ef_error_in_goods_issue_0
                ef_error_in_final_check_0   = ef_error_in_final_check_0
           TABLES
                prot                        = i_prot
           EXCEPTIONS
                error_message               = 1
                OTHERS                      = 2.
      if sy-subrc ne 0.
        message i010 with v_deliv.
      else.
        COMMIT WORK .
      endif.
    ENDFORM.                    " Delivery_change
    *&      Form  invoice_create
          Invoice Creation
    FORM invoice_create.
      refresh: XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS.
      clear  : XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS,
               VBSK_I.
      VBSK_I-SMART = 'F'.
      XKOMFK-VBELN =  v_deliv.
      XKOMFK-VBTYP = 'J'.
      APPEND XKOMFK.
      CALL FUNCTION 'RV_INVOICE_CREATE'
           EXPORTING
                VBSK_I       = VBSK_I
                WITH_POSTING = 'C'
           TABLES
                XKOMFK       = XKOMFK
                XKOMV        = XKOMV
                XTHEAD       = XTHEAD
                XVBFS        = XVBFS
                XVBPA        = XVBPA
                XVBRK        = XVBRK
                XVBRP        = XVBRP
                XVBSS        = XVBSS.
      if sy-subrc eq 0.
        COMMIT WORK.
       flag = 'X'.
      else.
      message i011 with p_vbeln.
      endif.
    ENDFORM.                    " invoice_create
    Reward Points if it is helpful
    Thanks
    Seshu

  • Need sample code in webdynpro for java

    Hi all
    actually i have one webdynpro form which is having multiple input elements. for example name,address,phoneno,price quantity and amount. and there is update button for that form.
    when i click the update button the multiplication of quantity and price value will be updated by in one input field which is part of the another webdynpro form is part of the same view.
    i want to update the input field in another form only when i change the value of either price or quantity otherwise the value of inputfield in another form should be same.
    now how do we retrieve the event of either price or quantity inputfield which only changes rather than changes of name or adreess.
    only when i modify the value of price or quantity in form and updated button then only the multiplication will be reflected in inputfield of another form.i dont want to reflect that inputfield of another form when i changes of other inputfields except price or quantity.
    please provide the sample code on the same...especially how to retrieve the event of that price or quantity in a form..
    Regards
    Suresh babu

    Hi Suresh,
    please post your issue to the Web Dynpro forum.
    Greetings,
    Carsten

  • Sample code to send a mail from SAP

    Hi guys
    could any one provide me with the
    sample code to send a mail from SAP with text as the main body of that mail via bcs classes

    Hi,
         Please go through this code: U can send mail;
    Tables : zchp_cust-info.
    DATA: OBJCONT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE.
    DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
    DATA: DOC_CHNG LIKE SODOCCHGI1.
    DATA: ENTRIES LIKE SY-TABIX.
    DATA: NAME(15).
    DATA: CON_NAME(20).
    DATA: req_num like zchp_cust_info.
    DATA: I_TAB_CHP LIKE ZCHP_CUST_INFO OCCURS 0 WITH HEADER LINE.
    *data: reno like ZCHP_CUST_INFO-req_num value .
    data input for the mail
    select * from zchp_cust_info
    appending table i_tab_chp where req_num = c_knumv.
    LOOP AT I_TAB_CHP.
    concatenate i_tab_chp-created_by i_tab_chp-req_num into CON_NAME.
    *WRITE: / con_name.
    ENDLOOP.
    Fill the document
    DOC_CHNG-OBJ_NAME = 'Refe'.
    DOC_CHNG-OBJ_DESCR = 'TESCRA Ref Number !'.
    DOC_CHNG-SENSITIVTY = 'P'.
    *OBJCONT = 'Tescra'.
    OBJCONT = CON_NAME.
    APPEND OBJCONT.
    OBJCONT = con_name.
    APPEND OBJCONT.
    DESCRIBE TABLE OBJCONT LINES ENTRIES.
    READ TABLE OBJCONT INDEX ENTRIES.
    DOC_CHNG-DOC_SIZE = ( ENTRIES - 1 ) * 255 + STRLEN( OBJCONT ).
    Fill the receiver list
    CLEAR RECLIST.
    RECLIST-RECEIVER = SY-UNAME.  " replace with <login name>
    RECLIST-REC_TYPE = 'B'.
    RECLIST-EXPRESS = 'X'.
    APPEND RECLIST.
    CLEAR RECLIST.
    RECLIST-RECEIVER = 'sapuser'.
    RECLIST-REC_TYPE = 'U'.
    APPEND RECLIST.
    Send the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_TYPE  = 'RAW'
              DOCUMENT_DATA  = DOC_CHNG
              PUT_IN_OUTBOX  = 'X'
         TABLES
              OBJECT_CONTENT = OBJCONT
              RECEIVERS      = RECLIST
         EXCEPTIONS
              TOO_MANY_RECEIVERS         = 1
                   DOCUMENT_NOT_SENT          = 2
                  OPERATION_NO_AUTHORIZATION = 4
                   OTHERS                     = 99.
        CASE SY-SUBRC.
          WHEN 0.
            LOOP AT RECLIST.
              IF RECLIST-RECEIVER = SPACE.
                NAME = RECLIST-REC_ID.
              ELSE.
                NAME = RECLIST-RECEIVER.
              ENDIF.
              IF RECLIST-RETRN_CODE = 0.
                WRITE: / NAME, ': succesfully sent'.
              ELSE.
                WRITE: / NAME, ': error occured'.
              ENDIF.
            ENDLOOP.
          WHEN 1.
            WRITE: / 'Too many receivers specified !'.
          WHEN 2.
            WRITE: / 'No receiver got the document !'.
          WHEN 4.
            WRITE: / 'Missing send authority !'.
          WHEN OTHERS.
            WRITE: / 'Unexpected error occurred !'.
        ENDCASE.
    <b>Please provide points if the issue is solved.</b>
    Regards,
    Sunil

  • Need case studies and sample code for all concept of ABAP

    Hello,
           Can anybody provide me the case studies and sample code for learning different concepts in ABAP programming like: module pool, ALV, interactive reports, BDC, Smart Form etc.? As I want to do some practical application by which i can learn more.
    Thanks & Regards,
    Vikram Rawal

    In this link You can find Step by Step Scren Shot document :
    http://www.201interviewquestions.com/docs/User%20exits.ppt
    http://erpgenie.com/abaptips/component/option,com_docman/task,doc_details/gid,27/
    <b>
    Reprots</b>
    http://www.sapgenie.com/abap/reports.htm
    http://www.allsaplinks.com/material.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    <b>Dictionary</b>
    http://sapabap.iespana.es/sapabap/manuales/learnabap/
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ea31446011d189700000e8322d00/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBDIC/BCDWBDIC.pdf
    <b>ABAP objects</b>
    Please check this online document (starting page 1291).
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
    Also check this links as well.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    http://www.futureobjects.de/content/intro_oo_e.html
    http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm
    /people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action
    <b>
    SAPScripts</b>
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    SAP SCRIPT FIELDS
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm
    scripts easy material
    http://www.allsaplinks.com/sap_script_made_easy.html
    Check these step-by-step links
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    <b>Smartforms material</b>
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    <b>
    BAPI</b>
    http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    <b>List of all BAPIs</b>
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    <b>ALV programs.</b>
    http://www.geocities.com/mpioud/Abap_programs.html
    . How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    <b>ALV</b>
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - http://www.sapgenie.com/abap/reports.htm
    http://www.allsaplinks.com/material.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    <b>Top-of-page in ALV</b>
    selection-screen and top-of-page in ALV
    <b>ALV Group Heading</b>
    http://www.sap-img.com/fu037.htm
    <b>ALV</b>
    http://www.geocities.com/mpioud/Abap_programs.html
    <b>
    RFC Destination</b>
    Re: SM59
    <b>
    ALE/ IDOC</b>http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    <b>Table Control</b>
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/table%20control%20in%20abap.pdf
    <b>
    ABAP transactions</b>
    http://www.easymarketplace.de/transactions-a-e.php?Area=4soi&name=volker&pw=vg&
    Regards,
    Priyanka.

  • Default XML element - Sample Code

    Hi,
    I am trying to use the sample code for the article "How to default an XML element in an XML document before inserting it into database".
    I am using database 9.2.0.3 and when I try to insert the record into the table, only up to "<Action>" part is inserted into the table and the rest of the XML document is truncated. I've tried inserting the record by disabling the trigger too - but it didn't help.
    Can someone please let me know what could be the problem? Thanks in advance.
    Regards,
    Jatinder

    Hi,
    Could you please tell me you have the queried the inserted record?
    I presume this happens when you issue the query from SQL*Plus to view the inserted record. Let me know if it is otherwise.
    Going by the same example used in the article, just do the following before you issue the query.
    -- you need to set the LONG environment variable to view the full contents in SQL*Plus.
    SQL> set long 20000
    SQL>SELECT VALUE(t) FROM purchaseorder t;
    Hope that helps.
    Savitha.

  • Sample code CONVERT_RTF_TO_ITF

    hi Guys.
    I have a requirement that I need to upload RTF file in to SAP Script format. For that I am using the FM CONVERT_RTF_TO_ITF I donu2019t know how to use it .
    Can you please provide me sample code and sample data what data needs to pass to FM.  After some analysis I have observed the below points.
    1.     RTF should be converted into RAW data (HEXA)
    2.     RAW data needs to pass FM CONVERT_RTF_TO_ITF
    I tried by above steps but no luck. plz do need full. 
    ~YSR
    Moderator Message: No Sample codes will be provided here. First construct a code of your own. If you have any issues with it, post the relevant portions here and ask for clarifications.
    Edited by: kishan P on May 19, 2011 12:29 PM

    Hi,
    <<removed by moderator>>
    checkout this,may help u..
    regards.
    Edited by: kishan P on May 19, 2011 12:29 PM

  • Regarding BAPI Info

    Hi @ ,
    I have a bapi which i am using in my interface .Now i need to know the tables associated with it and if there are any return parameters .I have chk se37 there is no export parameter present .So the problem ?
    Also i have to chk some test cases created previously by another user for that bapi,how to search for those test cases and verify the table entries
    thx in advance

    Hi
    Go through the doc of BAPI, it will be helpful to solve your issue
    BAPI-step by step
    http://www.sapgenie.com/abap/bapi/example.htm
    list of all bapis
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    for BAPI's
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    Also refer to the following links..
    www.sappoint.com/abap/bapiintro.pdf
    www.sap-img.com/bapi.htm
    www.sap-img.com/abap/bapi-conventions.htm
    www.planetsap.com/Bapi_main_page.htm
    www.sapgenie.com/abap/bapi/index.htm
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    u can check the below the material also
    what is BAPI?
    BAPI stands for Business API(Application Program Interface).
    I have answered this question before..
    A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    The following standardized BAPIs are provided:
    Reading instances of SAP business objects
    GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
    The BAPI GetList() is a class method.
    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
    Create( ) and CreateFromData! ( )
    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
    Change( )
    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
    Example Code
    U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
    U can find these parameters for a particular condition type in table KONV.
    *& Form saveTransactionJOCR
    text
    --> p1 text
    <-- p2 text
    FORM saveTransactionJOCR .
    data: salesdocument like BAPIVBELN-VBELN,
    order_header_inx like bapisdh1x,
    order_header_in like bapisdh1,
    return type standard table of bapiret2 with header line,
    conditions_in type standard table of bapicond with header line,
    conditions_inx type standard table of bapicondx with header line,
    logic_switch like BAPISDLS,
    step_nr like conditions_in-cond_st_no,
    item_nr like conditions_in-itm_number,
    cond_count like conditions_in-cond_count,
    cond_type like conditions_in-cond_type.
    salesdocument = wa_order_information-VBELN.
    LOGIC_SWITCH-COND_HANDL = 'X'.
    order_header_inx-updateflag = 'U'.
    conditions
    clear conditions_in[].
    clear conditions_inx[].
    clear: step_nr,
    item_nr,
    cond_count,
    cond_type.
    step_nr = '710'.
    item_nr = '000000'.
    cond_count = '01'.
    cond_type = 'ZCP2'.
    CONDITIONS_IN-ITM_NUMBER = item_nr.
    conditions_in-cond_st_no = step_nr.
    CONDITIONS_IN-COND_COUNT = cond_count.
    CONDITIONS_IN-COND_TYPE = cond_type.
    CONDITIONS_IN-COND_VALUE = 666.
    CONDITIONS_IN-CURRENCY = 'EUR'.
    append conditions_in.
    CONDITIONS_INX-ITM_NUMBER = item_nr.
    conditions_inx-cond_st_no = step_nr.
    CONDITIONS_INX-COND_COUNT = cond_count.
    CONDITIONS_INX-COND_TYPE = cond_type.
    CONDITIONS_INX-UPDATEFLAG = 'U'.
    CONDITIONS_INX-COND_VALUE = 'X'.
    CONDITIONS_INX-CURRENCY = 'X'.
    append conditions_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = salesdocument
    ORDER_HEADER_IN = order_header_in
    ORDER_HEADER_INX = order_header_inx
    LOGIC_SWITCH = logic_switch
    TABLES
    RETURN = return
    CONDITIONS_IN = conditions_in
    CONDITIONS_INX = conditions_inx
    if return-type ne 'E'.
    commit work and wait.
    endif.
    ENDFORM. " saveTransactionJOCR
    Bdc to Bapi
    The steps to be followed are :
    1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
    [for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
    2. Create a Z program and call the BAPi (same as a Funtion module call).
    2. Now, if you see this BAPi, it has
    -> Importing structures.
    eg: SALESDOCUMENT: this will take the Sales order header data as input.
    -> Tables parameters:
    eg: ORDER_ITEM_IN: this will take the line item data as input.
    Note :
    Only specify fields that should be changed
    Select these fields by entering an X in the checkboxes
    Enter a U in the UPDATEFLAG field
    Always specify key fields when changing the data, including in the checkboxes
    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
    Maintain quantities and dates in the schedule line data
    Possible UPDATEFLAGS:
    U = change
    D = delete
    I = add
    Example
    1. Delete the whole order
    2. Delete order items
    3. Change the order
    4. Change the configuration
    Notes
    1. Minimum entry:
    You must enter the order number in the SALESDOCUMENT structure.
    You must always enter key fields for changes.
    You must always specify the update indicator in the ORDER_HEADER_INX.
    2. Commit control:
    The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
    For further details... refer to the Function Module documentation for the BAPi.
    Bapi to VB(Visual Basic)
    Long back I had used the following flow structure to acheive the same.
    Report -> SM59 RFC destination -> COM4ABAP -> VB.exe
    my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.
    You need to have com4abap.exe
    If com4abap is installed you will find it in sapgui installatin directory , C:\Program Files\SAPpc\sapgui\RFCSDK\com4abap.
    else refer OSS note 419822 for installation of com4abap
    after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code.
    for setting up com4abap and rfc destination please refer to the documentation for com4abap.
    Invoke NEW DCOM session
    call function 'BEGIN_COM_SESSION'
    exporting
    service_dest = service_dest "(this will be a RFC destination created in SM59)
    importing
    worker_dest = worker_dest
    exceptions
    connect_to_dcom_service_failed = 1
    connect_to_dcom_worker_failed = 2
    others = 3.
    call function 'create_com_instance' destination worker_dest
    exporting
    clsid = g_c_clsid
    typelib = g_c_typelib
    importing
    instid = g_f_oid
    exceptions
    communication_failure = 1 message g_f_msg
    system_failure = 2 message g_f_msg
    invalid_instance_id = 3
    others = 4.
    call function 'com_invoke' destination worker_dest
    exporting
    %instid = g_f_oid
    %method = 'UpdatePDF'
    sntemp = g_v_const_filent
    snsysid = sy-sysid
    snflag = 'N'
    tables
    rssaptable = g_t_pdfdetail1
    %return = g_t_pdfdetail1 "t_test
    exceptions
    communication_failure = 1 message g_f_msg
    system_failure = 2 message g_f_msg
    invalid_instance_id = 3
    others = 4.
    then close the com session , using
    FM delete_com_instance
    FM END_COM_SESSION
    reward if sueful
    regards,
    Anji

  • Where can I get the sample code of gantt chart?

    hi, all
    I want to use gantt chart component.I find this video http://download.oracle.com/otn_hosted_doc/jdeveloper/11/demos/DVT_Gantt_Chart/ADFDVTGanttChartDemo.html.
    where can I get the sample code in this video?
    I have got the demo <strong>dvt-faces-demo.ear</strong>.but in this demo, the code of events process is too simple.I want more detail code of date change, denpendency change and so on.
    this is my mail [email protected]
    Thanks
    Best Regards
    kenshin
    Edited by: Himura Kenshin on 2010-8-20 上午4:57
    Edited by: Himura Kenshin on 2010-8-20 上午9:03

    Hi Katia,
    Essentially the same sample app which was referenced above (http://download.oracle.com/otn_hosted_doc/jdeveloper/11/demos/DVT_Gantt_Chart/ADFDVTGanttChartDemo.html). There are many features implemented in this sample which I'll be "reinventing the wheel" with. Its been a bit since I worked with the gantt component as I had to abandon for other development but will be getting back into it here shortly.
    Namely as I remember, I had difficult time getting the gantt to load quickly with large amount of tasks, difficulty getting the selected item when using context menus or buttons defined within the control, and a few other minor issues which could be fixed as I was using the first release of 11g and cannot remember specifics. I'll let you know as I get back into it if I see similar problems.
    For example, if you go to the ADF Demo Site (http://jdevadf.oracle.com/adf-richclient-demo/faces/feature/index.jspx) and click on "Project Gantt Custom Menu and Toolbar - add menus and buttons on the Project Gantt Menu and Toolbar". The buttons work, however if you first select a row in the left and then click the button, you have to click twice for it to work (in my findings the action listener never "fires"). So in my case I want to select a row and then have a custom event for that selected row when I click the button. There were other similar findings I had when I tried to go off of the examples.
    Hope this helps.
    Thank you,
    Kris

  • ARB PHP Sample Code SOAP Exception

    Hello Everybody
    I m using ARB PHP Sample Code.
    I m using it as it is provided with my login id and transaction key
    I m using PHP 5.2 version
    I m quite new to SOAP.
    Everything seems fine but the script is throwing following exception.
    SoapFault exception: [soap:Client] Server was unable to read request.
    ---> There is an error in XML document (2, 584). ---> Input string was
    not in a correct format. in /mysite//php_arb/PHP/
    api_authorize_net_soap_v1.php:1869 Stack trace: #0 /mysite//php_arb/
    PHP/api_authorize_net_soap_v1.php(1869): SoapClient-
    >__soapCall('ARBCreateSubscr...', Array) #1 /mysite//php_arb/PHP/
    subscription_create.php(24): AuthorizeNetWS-
    >ARBCreateSubscription(Object(ARBCreateSubscription)) #2
    May i please have some help on how to resolve this and get the code
    working for me?
    I m trying to trace out the issue but my efforts are in vain.
    I look forward to recieve some help from everybody in this group
    Pls reply
    Thanking You in advance

    Hello Devster,
    Thank you to post your question on TechNet forum.
    After reviewing the whole post, I have a question to you. You can access the report via the link, http://myServer/Reports_DEVPROJECT/Pages/Report.aspx?ItemPath=%2fData+Mgmt%2fSample+Letter.
    From the URL, I can see that the report is located at: /Data Mgmt/Sample Letter, instead of /DataMgmt/Sample Letter. In addition, I found that the target report is "/DataMgmt/Sample HAP Letter" instead of "/DataMgmt/Sample Letter" as the error described. I
    am not sure whether you post out the correct code segment.
    Please check the above things on your side, and hope it is helpful to you.
    Regards,
    Edward
    Edward Zhu
    TechNet Community Support

Maybe you are looking for

  • Workflow mailer error

    Hi , I was getting the workflow mailer error from R12. I tried to start,but failed......after that I got a confirmation from my client that somebody changed a table, then I checked again  and found Workflow mailer working fine....I didnt get what hap

  • Is SAP BODS the best ETL tool for a complex BI Environment

    Hi All We are in the process of rationilising our BI / Analytics environment. We currently have SAP ECC6 as our ERP system, SAP BW as our Warehouse and BO for WEB and Dashboard fron ends. In additon we have a small instance of COGNOS which is largely

  • What's "SAVE" configuration command for Cisco switch/ router?

    What's "SAVE" configuration command for Cisco switch / router? I know Switch#copy running-config startup-config works well, but so long, any other command that easy to remenber?

  • Modbook with Mac OS X Leopard

    Have Modbook with Mac OS X Leopard. I remove some drawing of mine and accidentally toke some file with it.  When start unit it stop boot up and shows apple logo and a error sign what to do Thanks

  • Help with Internet Connection

    Hi, Have just installed a NetgearDG834G to my imac G5 with success as far as the connection was concerned. Safari works a treat and it's nice to have a permanent connection. However when I log onto AOL I cannot get any websites to open no matter how