DMS - BAPI - BAPI_DOCUMENT_CHECKIN2 - No upload to server

Hi,
I am having a problem with BAPI_DOCUMENT_CHECKIN2. I use it to checkin a document into an existing Document info record.
Example of how I am using the BAPI:
REPORT ztestdms .
DATA: it_files  LIKE TABLE OF bapi_doc_files2 WITH HEADER LINE.
DATA: ln_return LIKE bapiret2.
it_files-docfile       = 'C:tempDMS_Test.txt'.
it_files-wsapplication = 'TXT'.
APPEND it_files.
CALL FUNCTION 'BAPI_DOCUMENT_SETCOMMITMODE'
     EXPORTING
          auto_commit = 'X'.
CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
  EXPORTING
    documenttype            = 'TEK'
    documentnumber          = '0000000000000010000000046'
    documentpart            = '000'
    documentversion         = '00'
*   HOSTNAME                = ' '
*   STATUSINTERN            = ' '
*   STATUSEXTERN            = ' '
    statuslog               = 'test mb'
*   REVLEVEL                = ' '
*   AENNR                   = ' '
*   PF_FTP_DEST             = ' '
*   PF_HTTP_DEST            = ' '
  IMPORTING
    return                  = ln_return
  TABLES
    documentfiles           = it_files
*   COMPONENTS              =
*   DOCUMENTSTRUCTURE       =
WRITE ln_return.
The BAPI links the file to the DIR but does not upload it, the lock symbol in transaction CV02N is still open and the file is still available at the client. A manual checkin completes the process but this is not wanted.
What I would like to happen is the file to be uploaded (actually checked in) and removed from the client.
Any help is welcome and thanks in advance.

Sunil,
I am having the same problem and have already created an OSS note for SAP in which they reply:
<i>However, as you use Visual Basic, your query represents
a consulting issue rather than a problem based on a
software error in R/3 (as you said, the BAPI works in TA
se37). Therefore, I would ask you to contact our Remote
Consulting and to open a new call under component XX-RC.
Our consultants will assist you.
Nevertheless, you could also try to use CVAPI_DOC_CHECKIN
instead of BAPI_DOCUMENT_CHECKIN2, API-s are much more
flexible than BAPI-s.
Thank you for your understanding.!
</i>
I have just finished testing this other function but it has the same result. Below you will find an example program with this other function.
Function SAPCheckinExample()
Dim R3 As Object
Dim conn As Connection
Dim rfcFunc As SAPFunctionsOCX.Function
Dim PF_DOKAR As Object, PF_DOKNR As Object, PF_DOKTL As Object
Dim PF_DOKVR As Object, PSX_MESSAGE As Object, PT_FILES_X As Object
Dim PS_DOC_STATUS As Object
Dim blnResult As Boolean
Dim strMsg As String, strTtl As String, intStl As Integer, strTyp As String
'**** Change these constants as desired *************************************
Const strApplicationServer = "ur_server"
Const strSystemNumber = "XX"
Const strClient = "XXX"
Const strLanguage = "EN"
Const strDocTyp As String = "TEK"
Const strDocNum As String = "0000000000000010000000045"
Const strDocPrt As String = "000"
Const strDocVer As String = "06"
Const strFile As String = "C:CADDEV_RFC.TXT"
Const strApplication As String = "TXT"
Const strStorage As String = "DMS_C1_ST"
'**** Program extract *******************************************************
' Create a new connection object
Set R3 = CreateObject("SAP.Functions")
Set conn = R3.Connection
' Set the logon parameters
'R3.LogFileName = "C:WINDOWSDESKTOPSAPLOG.TXT"
  conn.ApplicationServer = strApplicationServer
  conn.SystemNumber = strSystemNumber
  conn.Client = strClient
  conn.Language = strLanguage
  conn.AutoLogon = True
  ' Logon
  If conn.Logon(0, False) <> True Then
      strMsg = "Logon failure!"
      strTtl = "Logon"
      intStl = vbOKOnly & vbExclamation
      MsgBox strMsg, intStl, strTtl
      Exit Function
  End If
  ' Create the checkin rfc in the connection object
  Set rfcFunc = R3.Add("CVAPI_DOC_CHECKIN")
  ' Link the parameters from the rfc to the objects called in this function
  With rfcFunc
      Set PF_DOKAR = .Exports("PF_DOKAR")
      Set PF_DOKNR = .Exports("PF_DOKNR")
      Set PF_DOKTL = .Exports("PF_DOKTL")
      Set PF_DOKVR = .Exports("PF_DOKVR")
      Set PS_DOC_STATUS = .Exports("PS_DOC_STATUS")
      Set PSX_MESSAGE = .Imports("PSX_MESSAGE")
      Set PT_FILES_X = .Tables("PT_FILES_X")
  End With
  ' Set the parameters for the rfc
  PF_DOKAR.Value = strDocTyp     ' Document Type
  PF_DOKNR.Value = strDocNum     ' Document number
  PF_DOKTL.Value = strDocPrt     ' Document Part
  PF_DOKVR.Value = strDocVer     ' Document Version
  With PT_FILES_X
    .Rows.Add
    .Value(1, "PATHNAME") = strFile
    .Value(1, "DAPPL") = strApplication
    .Value(1, "STORAGE_CAT") = strStorage
  End With
  ' Call the rfc
  blnResult = rfcFunc.Call
  Debug.Print blnResult ' True if the function is called succesfully
  'Check if the rfc is executed correctly
  Set PSX_MESSAGE = rfcFunc.Imports("PSX_MESSAGE")
  Debug.Print PSX_MESSAGE("MSG_TYPE"); PSX_MESSAGE("MSG_ID"); PSX_MESSAGE("MSG_NO"); PSX_MESSAGE("MSG_TXT")
  strTyp = PSX_MESSAGE("MSG_TYPE")
  strMsg = PSX_MESSAGE("MSG_TXT")
  Select Case strTyp
    Case "S"
      intStl = vbOKOnly + vbInformation
      strTtl = "Info"
    Case "I"
      intStl = vbOKOnly + vbInformation
      strTtl = "Info"
    Case "E"
      intStl = vbOKOnly + vbExclamation
      strTtl = "Error!"
    Case "W"
      intStl = vbOKOnly + vbExclamation
      strTtl = "Error!"
    Case "A"
      intStl = vbOKOnly + vbCritical
      strTtl = "Critical error!"
  End Select
  conn.Logoff
  If strMsg = "" Then
    strMsg = "File checked in!"
    strTtl = "Info"
    intStl = vbOKOnly + vbInformation
    MsgBox strMsg, intStl, strTtl
  Else
    MsgBox strMsg, intStl, strTtl
  End If
End Function
Message was edited by: Maurice Brouwers

Similar Messages

  • Swf is not working properly when upload to server

    I develop 1.swf which is having 3 buttons each one having
    anather .swf to call 2.swf, 3.swf respectively.
    This application is running perfectly on my PC, but
    While uploading the swf to server the 2.swf and 3.swf is
    not running. Can any one tell how to recover from this kind
    of problem.

    justbipin wrote:
    > basically my code working perfectly,
    > but its not working properly when upload to server
    > can anybody having any ref. or link to solve this
    issues.
    why is that we insist on seeing the source file ?
    There is no one way of doing things in flash and no one can
    help
    you based on "does not work description".
    This is way to broad of a subject to even try to guess.
    Same as asking "my car does not work, what's up with
    that"....
    Please upload the problematic file and provide url for us to
    check.
    Otherwise you need to try to troubleshoot it yourself as we
    can't
    guess from here what possibly is wrong with that file.
    Regards
    Urami
    Happy New Year guys - all the best there is in the 2006 :)
    <urami>
    http://www.Flashfugitive.com
    </urami>
    <web junk free>
    http://www.firefox.com
    </web junk free>

  • Can we use BAPI BAPI_ACC_DOCUMENT_POST to upload the vendor invoice?

    Hi,
    Can anybody tell me, can we use bapi BAPI_ACC_DOCUMENT_POST to upload the vender invoice?
    If yes, then which parameters we have to pass, and if no, then which is the other BAPI which is used for
    this purpose?
    Regards,
    Mrunal

    Hi Mrunal,
    Yes you can use BAPI_ACC_DOCUMENT_POST to upload vendor invoices.
    Parameters which are required to be passed are :
    Import tab :
    DOCUMENTHEADER: Mandatory fields for this specififed in documentation for this.
    Table tab:
    ACCOUNTGL: Enteries aganist GL account will be populated in this(check documentation for mandatory fields)
    ACCOUNTPAYABLE: Enteries aganist vendors will be populated in this(check documentation for mandatory fields)
    CURRENCYAMOUNT: in this currency amount aganist GL and vendor entries will specified.
    ITEMNO_ACC field will act as identifier as to amount belongs to which GL or vendor enteries.
    This much parameter are required to post vendor invoices.
    Regards,
    Brajvir

  • IS THERE ANY SUITABLE BAPI'S To Upload data to F-02  ..OR we should use BDC

    HI FRIENDS,
    IS THERE ANY SUITABLE BAPI'S To Upload data to F-02  ..OR we should use BDC..
    WAITING FOR UR REPLY?
    THANKS.
    KIRAN

    Hi,
    I need to change the BDC program which is already written for F-02 in 4.7E.The changes are like I need to add 8 new posting keys, Kindly let me know how I can do it ,if already have the coding for the same please share with me.
    Thanks in advance,
    Jyoti

  • Need BAPI program to upload PO creation with flatfile having HEADER N  ITEM

    Hi abap experts,
    I Need sample BAPI program to upload PO creation(ME21) with flatfile having HEADER AND   ITEM datas.
    arun

    Hi,
    Look at the below links
    Re: BAPI_PO_CREATE1 and net price
    Re: Using BAPI_PO_CREATE1 : Linking service, and account assignment
    Regards
    Sudheer

  • Is the Upload to Server feature working in CS6 for Mac . . . or any of the export modules?

    Is the Upload to Server feature working in CS6 for Mac . . . or any of the export modules?

    No, unfortunately the photomerge ui plugin will not work in photoshop cs6 on the mac side.
    You can always use photoshop cs5 for those times when you really need it.
    In photoshop cs6 you could align your photos manually as best you can, then select all the layers and go to Edit>Auto-Blend Layers>Panorama with Seamless Tones and Colors checked

  • BAPI in MM01 uploading

    Hi Friends..
    Iam using BAPI for to upload data from flatfile to sap instead of BDC.
    But after execute this method "BAPI_MATERIAL_SAVEDATA"
    Finally no data was updated in master table...
    so how can i store the value into base table..
    some one told need to give commit statement..
    But i dont know where i give the commit statement..
    plz reply to me..
    Thanks
    Gowrishankar

    Hi Gowrishankar,
    Check the program I have written for MM01 upload using BAPI. Maybe it will be of some help to you.
    *& Report  ZCN_MM_MATMASTER_BASICVIEW
    REPORT  zcn_mm_matmaster_basicview MESSAGE-ID zmc_mm_messages.
    TABLES: t001l, "Storage Locations
            mara,  "General Material Data
            makt,  "Material Descriptions
            mbew,  "Material Valuation
            marc.  "Plant Data for Material
    DATA: bapi_head   LIKE bapimathead,
          bapi_makt   LIKE bapi_makt,    "Material Description
          bapi_mara1  LIKE bapi_mara,    "Client Data
          bapi_marax  LIKE bapi_marax,
          bapi_marc1  LIKE bapi_marc,    "Plant View
          bapi_marcx  LIKE bapi_marcx,
          bapi_mbew1  LIKE bapi_mbew,    "Accounting View
          bapi_mbewx  LIKE bapi_mbewx,
          bapi_mard1  LIKE bapi_mard,    "Storage View
          bapi_mardx  LIKE bapi_mardx,
          bapi_return LIKE bapiret2.
    DATA: BEGIN OF int_makt OCCURS 100.
            INCLUDE STRUCTURE bapi_makt.
    DATA: END OF int_makt.
    DATA: BEGIN OF it_data OCCURS 0,
          mat_type(4),
          ind_sec(1),
          plant(4),
          stge_loc(4),
          mat_desc(40),
          base_uom(3),
          old_matno(18),
          matl_group(9),
          document(22),
          po_unit(3),
          pur_valkey(4),
          mfr_no(10),
          manu_mat(40),
          vendor_lookup(10),
          mrp_type(2),
          mrp_ctrler(3),
          sm_key(3),
          proc_type(1),
          sloc_exprc(4),
          stge_bin(10),
          issue_unit(3),
          cc_ph_inv(1),
          price_ctrl(1),
          val_class(4),
          moving_pr(11),
          price_unit(5),
          profit_ctr(10),
          matnr(18),
          END OF it_data,
          is_data LIKE it_data.
    DATA: BEGIN OF it_error OCCURS 0,
          mat_type(4),
          ind_sec(1),
          plant(4),
          stge_loc(4),
          mat_desc(40),
          base_uom(3),
          old_matno(18),
          matl_group(9),
          document(22),
          po_unit(3),
          pur_valkey(4),
          mfr_no(10),
          manu_mat(40),
          vendor_lookup(10),
          mrp_type(2),
          mrp_ctrler(3),
          sm_key(3),
          proc_type(1),
          sloc_exprc(4),
          stge_bin(10),
          issue_unit(3),
          cc_ph_inv(1),
          price_ctrl(1),
          val_class(4),
          moving_pr(11),
          price_unit(5),
          profit_ctr(10),
          matnr(18),
          END OF it_error,
          is_error LIKE it_error.
    DATA: bdc_tab LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    DATA : g_file TYPE string.
    DATA : BEGIN OF data_mat OCCURS 0,
           datastring TYPE string,
           END OF data_mat.
    DATA: record(500).
    DATA: gv_count TYPE i VALUE 0.
    DATA  lv_string TYPE string.
    TYPES: BEGIN OF ty_string_tab,
             line(255),
           END OF ty_string_tab.
    DATA  i_string_tab TYPE STANDARD TABLE OF ty_string_tab.
    ********************------SELECTION SCREEN----**************************
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_file TYPE ibipparms-path.
    PARAMETERS: r_local RADIOBUTTON GROUP radi,
                r_apps  RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
    PARAMETERS : p_downld LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b2.
    *******************AT SELECTION SCREEN *********************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_downld.
      PERFORM get_local_file USING p_downld.
    * S T A R T   O F   S E L E C T I O N
    START-OF-SELECTION.
      g_file = p_file.
      PERFORM upload USING g_file.    "Upload takes the file from the presentation
      PERFORM conversion_extendedview.
      PERFORM download_errors.
    *&      Form  upload
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM upload USING lv_file .
      IF r_apps = 'X'.
        OPEN DATASET lv_file
                     FOR INPUT IN TEXT MODE
                     ENCODING DEFAULT.
        IF sy-subrc <> 0.
          WRITE: / text-002, sy-subrc.
          STOP.
        ELSE.
          DO.
            READ DATASET lv_file INTO record.
            SPLIT record AT '~' INTO
                               it_data-mat_type
                               it_data-ind_sec
                               it_data-plant
                               it_data-stge_loc
                               it_data-mat_desc
                               it_data-base_uom
                               it_data-old_matno
                               it_data-matl_group
                               it_data-document
                               it_data-po_unit
                               it_data-pur_valkey
                               it_data-mfr_no
                               it_data-manu_mat
                               it_data-vendor_lookup
                               it_data-mrp_type
                               it_data-mrp_ctrler
                               it_data-sm_key
                               it_data-proc_type
                               it_data-sloc_exprc
                               it_data-stge_bin
                               it_data-issue_unit
                               it_data-cc_ph_inv
                               it_data-price_ctrl
                               it_data-val_class
                               it_data-moving_pr
                               it_data-price_unit
                               it_data-profit_ctr
                               it_data-matnr.
            APPEND it_data.
            CLEAR  it_data.
          ENDDO.
          CLOSE DATASET lv_file.
        ENDIF.
      ELSEIF r_local = 'X'.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename                      = lv_file
            filetype                      = 'ASC'
            has_field_separator           = '~'
            header_length                 = 0
            read_by_line                  = 'X'
    *    DAT_MODE                      = ' '
    *    CODEPAGE                      = ' '
            ignore_cerr                   = 'X'
            replacement                   = '#'
    *    CHECK_BOM                     = ' '
    *    VIRUS_SCAN_PROFILE            =
    *    NO_AUTH_CHECK                 = ' '
    *  IMPORTING
    *    FILELENGTH                    =
    *    HEADER                        =
          TABLES
            data_tab                      = data_mat
    *  EXCEPTIONS
    *    FILE_OPEN_ERROR               = 1
    *    FILE_READ_ERROR               = 2
    *    NO_BATCH                      = 3
    *    GUI_REFUSE_FILETRANSFER       = 4
    *    INVALID_TYPE                  = 5
    *    NO_AUTHORITY                  = 6
    *    UNKNOWN_ERROR                 = 7
    *    BAD_DATA_FORMAT               = 8
    *    HEADER_NOT_ALLOWED            = 9
    *    SEPARATOR_NOT_ALLOWED         = 10
    *    HEADER_TOO_LONG               = 11
    *    UNKNOWN_DP_ERROR              = 12
    *    ACCESS_DENIED                 = 13
    *    DP_OUT_OF_MEMORY              = 14
    *    DISK_FULL                     = 15
    *    DP_TIMEOUT                    = 16
    *    OTHERS                        = 17
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ELSE.
          LOOP AT data_mat.
            SPLIT data_mat-datastring AT '~' INTO
                                          it_data-mat_type
                                          it_data-ind_sec
                                          it_data-plant
                                          it_data-stge_loc
                                          it_data-mat_desc
                                          it_data-base_uom
                                          it_data-old_matno
                                          it_data-matl_group
                                          it_data-document
                                          it_data-po_unit
                                          it_data-pur_valkey
                                          it_data-mfr_no
                                          it_data-manu_mat
                                          it_data-vendor_lookup
                                          it_data-mrp_type
                                          it_data-mrp_ctrler
                                          it_data-sm_key
                                          it_data-proc_type
                                          it_data-sloc_exprc
                                          it_data-stge_bin
                                          it_data-issue_unit
                                          it_data-cc_ph_inv
                                          it_data-price_ctrl
                                          it_data-val_class
                                          it_data-moving_pr
                                          it_data-price_unit
                                          it_data-profit_ctr
                                          it_data-matnr.
            APPEND it_data.
            CLEAR  it_data.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.                    " upload
    *&      Form  conversion_extendedview
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM conversion_extendedview .
      DATA: lv_matnr LIKE mara-matnr,
            lv_lifnr LIKE lfb1-lifnr.
      LOOP AT it_data INTO is_data.
        CLEAR: lv_matnr,
              lv_lifnr.
        SELECT SINGLE matnr FROM mara INTO lv_matnr
                       WHERE bismt = is_data-old_matno AND
                             meins = is_data-base_uom.
        IF sy-subrc NE 0.
          MOVE is_data TO is_error.
          APPEND is_error TO it_error.
          CLEAR is_error.
          CONTINUE.
        ENDIF.
        SELECT SINGLE lifnr INTO lv_lifnr FROM lfb1
                    WHERE altkn = is_data-vendor_lookup.
        IF sy-subrc EQ 0.
          SELECT SINGLE lifnr INTO lv_lifnr FROM lfa1
                        WHERE lifnr = lv_lifnr AND
                              ktokk = 'ZMNF'.
          IF sy-subrc NE 0.
            lv_lifnr  = ' '.
          ENDIF.
        ELSE.
          lv_lifnr = ' '.
        ENDIF.
    * Header
        bapi_head-material        = lv_matnr.
        bapi_head-ind_sector      = 'C'.
        bapi_head-matl_type       = is_data-mat_type.
        bapi_head-basic_view      = 'X'.
        bapi_head-purchase_view   = 'X'.
        bapi_head-account_view    = 'X'.
        bapi_head-storage_view    = 'X'.
        IF is_data-mat_type = 'ROH'.
          bapi_head-mrp_view = 'X'.
          bapi_head-cost_view = 'X'.
        ENDIF.
    * Material Description
        REFRESH int_makt.
        int_makt-langu           = 'EN'.
        int_makt-matl_desc       = is_data-mat_desc.
        APPEND int_makt.
    * Client Data - Basic
        bapi_mara1-matl_group     = is_data-matl_group.
        bapi_mara1-base_uom       = is_data-base_uom.
        bapi_mara1-old_mat_no     = is_data-old_matno.
        bapi_mara1-document       = is_data-document.
        bapi_mara1-po_unit        = is_data-po_unit.
        bapi_mara1-pur_valkey     = is_data-pur_valkey.
        bapi_mara1-mfr_no         = lv_lifnr.
        bapi_mara1-manu_mat       = is_data-manu_mat.
        bapi_marax-old_mat_no     = 'X'.
        bapi_marax-document       = 'X'.
        bapi_marax-po_unit        = 'X'.
        bapi_marax-pur_valkey     = 'X'.
        bapi_marax-mfr_no         = 'X'.
        bapi_marax-manu_mat       = 'X'.
        bapi_marax-matl_group     = 'X'.
        bapi_marax-base_uom       = 'X'.
    * Plant - Purchasing
        bapi_marc1-plant      = is_data-plant.
        bapi_marc1-mrp_type   = 'ND'.
        bapi_marc1-mrp_ctrler = is_data-plant.
        bapi_marc1-sm_key     = '000'.
        bapi_marc1-proc_type  = 'F'.
        bapi_marc1-issue_unit = is_data-issue_unit.
        bapi_marc1-cc_ph_inv  = is_data-cc_ph_inv.
        bapi_marc1-profit_ctr = is_data-profit_ctr.
        IF is_data-mat_type = 'ROH'.
          bapi_marc1-availcheck = 'KP'.
          bapi_marcx-availcheck = 'X'.
        ENDIF.
        bapi_marcx-plant      = is_data-plant.
        bapi_marcx-mrp_type   = 'X'.
        bapi_marcx-mrp_ctrler = 'X'.
        bapi_marcx-sm_key     = 'X'.
        bapi_marcx-proc_type  = 'X'.
        bapi_marcx-issue_unit = 'X'.
        bapi_marcx-cc_ph_inv  = 'X'.
        bapi_marcx-profit_ctr = 'X'.
    * Storage View
        bapi_mard1-plant        = is_data-plant.
        bapi_mard1-stge_loc     = is_data-stge_loc.
        bapi_mard1-stge_bin     = is_data-stge_bin.
        bapi_mardx-plant        = is_data-plant.
        bapi_mardx-stge_loc     = is_data-stge_loc.
        bapi_mardx-stge_bin     = 'X'.
    * Accounting
        bapi_mbew1-val_area   = is_data-plant.
        IF is_data-mat_type = 'ROH'.
          bapi_mbew1-val_class  = '1000'.
        ELSEIF is_data-mat_type = 'ERSA'.
          bapi_mbew1-val_class  = '1001'.
        ENDIF.
        bapi_mbew1-price_ctrl = 'V'.
        bapi_mbew1-moving_pr  = is_data-moving_pr.
        bapi_mbew1-price_unit = '1'.
        bapi_mbewx-val_area   = is_data-plant.
        bapi_mbewx-val_class  = 'X'.
        bapi_mbewx-moving_pr  = 'X'.
        bapi_mbewx-price_ctrl = 'X'.
        bapi_mbewx-price_unit = 'X'.
    *    WRITE:/ bapi_head, bapi_marc1.
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
          EXPORTING
            headdata                   = bapi_head
            clientdata                 = bapi_mara1
            clientdatax                = bapi_marax
            plantdata                  = bapi_marc1
            plantdatax                 = bapi_marcx
    *       FORECASTPARAMETERS         =
    *       FORECASTPARAMETERSX        =
    *       PLANNINGDATA               =
    *       PLANNINGDATAX              =
            storagelocationdata        = bapi_mard1
            storagelocationdatax       = bapi_mardx
            valuationdata              = bapi_mbew1
            valuationdatax             = bapi_mbewx
    *       WAREHOUSENUMBERDATA        =
    *       WAREHOUSENUMBERDATAX       =
    *       SALESDATA                  = BAPI_MVKE1
    *       SALESDATAX                 = BAPI_MVKEX
    *       STORAGETYPEDATA            =
    *       STORAGETYPEDATAX           =
          IMPORTING
            return                     = bapi_return
          TABLES
            materialdescription        = int_makt
    *       UNITSOFMEASURE             =
    *       UNITSOFMEASUREX            =
    *       INTERNATIONALARTNOS        =
    *       MATERIALLONGTEXT           =
    *       TAXCLASSIFICATIONS         =
    *       RETURNMESSAGES             =
    *       PRTDATA                    =
    *       PRTDATAX                   =
    *       EXTENSIONIN                =
    *       EXTENSIONINX               =
    *    IF sy-subrc EQ 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    *    ENDIF.
    *    IF bapi_return-type = 'E'.
    *      gv_count = gv_count + 1.
    *      is_error-old_matno = is_data-old_matno.
    *      is_error-plant = is_data-plant.
    *      is_error-stge_loc = is_data-stge_loc.
    *      APPEND is_error TO it_error.
    *      CLEAR is_error.
    *     WRITE:/'For Old Material Number',is_data-old_matno,bapi_return-message.
    *    ENDIF.
      ENDLOOP.
    *  WRITE: 'Total Records in Error', gv_count.
      PERFORM concatenate_into_string.
      PERFORM download_data.
    ENDFORM.                    "conversion_extendedview
    *&      Form  get_local_file
    *       text
    *      -->P_P_DOWNLOAD  text
    FORM get_local_file  USING    p_p_download.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          mask             = ',*.*,*.*.'
          mode             = 'S'
          title            = 'Lookup for Upload file'(013)
        IMPORTING
          filename         = p_p_download
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.                    " get_local_file
    *&      Form  concatenate_into_string
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM concatenate_into_string .
      DATA: lw_error LIKE LINE OF it_error.
      DATA: lw_tab_string LIKE LINE OF i_string_tab,
            lw_matnr(10),
            lw_plant(3),
            lw_stloc(4).
      LOOP AT it_error INTO is_error.
        MOVE is_error-old_matno TO lw_matnr.
        MOVE is_error-plant TO lw_plant.
        MOVE is_error-stge_loc TO lw_stloc.
        CONCATENATE lw_matnr lw_plant lw_stloc INTO lv_string SEPARATED BY '~'.
        MOVE lv_string TO lw_tab_string.
        APPEND  lw_tab_string TO i_string_tab.
        CLEAR: lv_string, lw_tab_string.
      ENDLOOP.
    ENDFORM.                    " concatenate_into_string
    *&      Form  download_data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM download_data .
      DATA: lv_file TYPE string.
    * Move file name to filename of type string acceptable by GUI_DOWNLOAD
      lv_file = p_downld.
      CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                  =
        filename                      = lv_file
        filetype                      = 'ASC'
    *   APPEND                        = ' '
    *   WRITE_FIELD_SEPARATOR         = ' '
    *   HEADER                        = '00'
    *   TRUNC_TRAILING_BLANKS         = ' '
    *   WRITE_LF                      = 'X'
    *   COL_SELECT                    = ' '
    *   COL_SELECT_MASK               = ' '
    *   DAT_MODE                      = ' '
    * IMPORTING
    *   FILELENGTH                    =
      TABLES
    *    data_tab                      = i_empdata
        data_tab                      = i_string_tab
    EXCEPTIONS
    file_write_error              = 1
    no_batch                      = 2
    gui_refuse_filetransfer       = 3
    invalid_type                  = 4
    no_authority                  = 5
    unknown_error                 = 6
    header_not_allowed            = 7
    separator_not_allowed         = 8
    filesize_not_allowed          = 9
    header_too_long               = 10
    dp_error_create               = 11
    dp_error_send                 = 12
    dp_error_write                = 13
    unknown_dp_error              = 14
    access_denied                 = 15
    dp_out_of_memory              = 16
    disk_full                     = 17
    dp_timeout                    = 18
    file_not_found                = 19
    dataprovider_exception        = 20
    control_flush_error           = 21
    OTHERS                        = 22.
      IF sy-subrc EQ 0.
        MESSAGE s999 WITH 'File saved successfully'(001) 'to' p_file.
      ELSE.
        MESSAGE s999 WITH 'Error in creating File'(002).
      ENDIF.
    ENDFORM.                    " download_data
    *&      Form  download_errors
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM download_errors .
      DATA: gv_file TYPE string.
      gv_file = p_downld.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
    *   BIN_FILESIZE                    =
          filename                        = gv_file
          filetype                        = 'ASC'
    *   APPEND                          = ' '
          write_field_separator           = '~'
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    *   WRITE_EOL                       = ABAP_TRUE
    * IMPORTING
    *   FILELENGTH                      =
        TABLES
          data_tab                        = it_error
    *   FIELDNAMES                      =
    * EXCEPTIONS
    *   FILE_WRITE_ERROR                = 1
    *   NO_BATCH                        = 2
    *   GUI_REFUSE_FILETRANSFER         = 3
    *   INVALID_TYPE                    = 4
    *   NO_AUTHORITY                    = 5
    *   UNKNOWN_ERROR                   = 6
    *   HEADER_NOT_ALLOWED              = 7
    *   SEPARATOR_NOT_ALLOWED           = 8
    *   FILESIZE_NOT_ALLOWED            = 9
    *   HEADER_TOO_LONG                 = 10
    *   DP_ERROR_CREATE                 = 11
    *   DP_ERROR_SEND                   = 12
    *   DP_ERROR_WRITE                  = 13
    *   UNKNOWN_DP_ERROR                = 14
    *   ACCESS_DENIED                   = 15
    *   DP_OUT_OF_MEMORY                = 16
    *   DISK_FULL                       = 17
    *   DP_TIMEOUT                      = 18
    *   FILE_NOT_FOUND                  = 19
    *   DATAPROVIDER_EXCEPTION          = 20
    *   CONTROL_FLUSH_ERROR             = 21
    *   OTHERS                          = 22
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " download_errors
    Regards
    Aneesh.

  • Suitable BAPI interface to upload data intoKP26 T.code (CO)

    Hi All I need to know the BAPI interface to upload the data into KP26 Co Activity type /Price Planning
    I have these fields to create entries in KP26 t.code.
    The Fields are as follows:
    Layout (could use the standard layout 1-201)
    1.Version --
    2. Period from / to --
    3. Fiscal Year -
    4. Cost Center -
    5.  Activity type-
    6. Fixed price-
    7. Variable price-
    8. Price unit--- 
    PLease any body help me which BAPI is suitable for KP26 T.Code .. Its Urgent ...
    Regards
    Purushotham.Ineni.

    Hi thank you  for kind reply i need to create the entries  for CO Activity /Price planning .
    i have to upload data to KP26 which i have posted the fields ..
    i already cheked the function modules which you have been given .. it is not suitable ..
    Is there any ohter  BAPI is there ... le t me know ...
    regards
    purushotham.ineni

  • Remote enabled BAPI/RFC to upload a Resume

    Is there any Remote enabled BAPI/RFC to upload a Resume and how to assign it to Applicant ?
    I need to upload Resume from a .Net program and assign it as attachment or otherwise to Applicant.

    The reason for posting it here is this:
    I used Remote Enabled FM BDS_BUSINESSDOCUMENT_CREATEF to create an attachment (.DOC word document) to APPLICANT Object. It works fine when executed from SE37.
    When I execute(call) from .Net code, I get exception "ERROR_KPRO".
    So I am looking for ANY way to attach or send Resume document into SAP and some how associating it with APPLICANT object, either by solving ERROR_KPRO or by suggesting any other way...
    Thanks for the response

  • Frequent upload to server errors. How do I make it stop?

    For a few weeks now I have been having frequent upload to server errors. Please try again. Some files upload fine the first couple of times and then the errors start when I go to upload revisions. Sometime after a few trys it works other times it takes way more than I would consider acceptable.
    I was contacted by a Adobe tech (Laxman) via email but we can't seem to get in touch with one another during the week during normal 9-5 EST hours. I have no call back phone # for him etc.
    Can anybody give me a idea why these errors happen? And how do I go about making them stop. Using Indesign CS 5. If that matters any.

    I was fine with that... now Firefox doesn't do this... I want the exact opposite...
    Anyone knows how to able or disable this stuff about dragging images?

  • Send email with attachment, without upload to server

    Hi,
    I'm desperately seeking an answer to this question - but current threads don't appear to give a clear answer. Does anyone know how to do this, and if so, would they mind sharing the code? Would really be appreciated.

    How about explaining your problem first? Especilly the "upload to server" part, since you have to send your email to a mail server. That's how it works.

  • Reading XML file using BAPI and then uploading that xml file data into SAP

    I am getting a xml file from Java server. I need to take
    data from this file using BAPI and need to upload into SAP using SAP.
    Please tell me how to read XML files using BAPI's.

    <b>SDIXML_DATA_TO_DOM</b> Convert SAP data (elementary/structured/table types) into DOM (XML
    <b>SDIXML_DOM_TO_XML</b>  Convert DOM (XML) into string of bytes that can be downloaded to PC or application server
    <b>SDIXML_DOM_TO_SCREEN</b> Display DOM (XML)
    <b>SDIXML_DOM_TO_DATA</b>
    data: it_table like t001 occurs 0.
    data: l_dom      TYPE REF TO IF_IXML_ELEMENT,
          m_document TYPE REF TO IF_IXML_DOCUMENT,
          g_ixml     TYPE REF TO IF_IXML,
          w_string   TYPE XSTRING,
          w_size     TYPE I,
          w_result   TYPE I,
          w_line     TYPE STRING,
          it_xml     TYPE DCXMLLINES,
          s_xml      like line of it_xml,
          w_rc       like sy-subrc.
    start-of-selection.
      select * from t001 into table it_table.
    end-of-selection.
    initialize iXML-Framework          ****
      write: / 'initialiazing iXML:'.
      class cl_ixml definition load.
      g_ixml = cl_ixml=>create( ).
      check not g_ixml is initial.
      write: 'ok'.
    create DOM from SAP data           ****
      write: / 'creating iXML doc:'.
      m_document = g_ixml->create_document( ).
      check not m_document is initial.
      write: 'ok'.
      write: / 'converting DATA TO DOM 1:'.
      CALL FUNCTION 'SDIXML_DATA_TO_DOM'
        EXPORTING
          NAME               = 'IT_TABLE'
          DATAOBJECT         = it_table[]
        IMPORTING
          DATA_AS_DOM        = l_dom
        CHANGING
          DOCUMENT           = m_document
        EXCEPTIONS
          ILLEGAL_NAME       = 1
          OTHERS             = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
      check not l_dom is initial.
      write: / 'appending DOM to iXML doc:'.
      w_rc = m_document->append_child( new_child = l_dom ).
      if w_rc is initial.  write  'ok'.
      else.                write: 'Err =', w_rc.
      endif.
    visualize iXML (DOM)               ****
      write: / 'displaying DOM:'.
      CALL FUNCTION 'SDIXML_DOM_TO_SCREEN'
        EXPORTING
          DOCUMENT          = m_document
        EXCEPTIONS
          NO_DOCUMENT       = 1
          OTHERS            = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
    convert DOM to XML doc (table)     ****
      write: / 'converting DOM TO XML:'.
      CALL FUNCTION 'SDIXML_DOM_TO_XML'
        EXPORTING
          DOCUMENT            = m_document
        PRETTY_PRINT        = ' '
        IMPORTING
          XML_AS_STRING       = w_string
          SIZE                = w_size
        TABLES
          XML_AS_TABLE        = it_xml
        EXCEPTIONS
          NO_DOCUMENT         = 1
          OTHERS              = 2.
      if sy-subrc = 0.   write  'ok'.
      else.              write: 'Err =', sy-subrc.
      endif.
      write: / 'XML as string of size:', w_size, / w_string.
      describe table it_xml lines w_result.
      write: / 'XML as table of', w_result, 'lines:'..
      loop at it_xml into s_xml.
        write s_xml.
      endloop.
      write: / 'end of processing'.
    end of code
    Hope this will be useful.
    regards
    vinod

  • DMS BAPI RFC Open DMS document from external application

    Hello,
    I want open a document stored in DMS through RFC BAPI, from an external application (for example .NET)
    EasyDNS run OK: I have included the bapi Z_EASYDMS_ECL_OPEN_DOCUMENT (code from a SAP note)  in the system and I can open ECL/EAI & local documents (pdf, word, ...)
    If I run Z_EASYDMS_ECL_OPEN_DOCUMENT from SE37 run OK: I can see every document, document is downloaded to local system and then open.
    But when I call bapi Z_EASYDMS_ECL_OPEN_DOCUMENT from my external application through RFC I don't receive any result: document is not download to local system.
    I have debugged the bapi (with SM50) and I have see that the calling entry in bapi, run and then ... crash.
    I have detected the fail in OLE_FLUSH_CALL: system has a dump.
    Summary:
    - EasyDMS run Ok
    - SE37 Z_EASYDMS_ECL_OPEN_DOCUMENT run ok
    - Z_EASYDMS_ECL_OPEN_DOCUMENT dump at OLE_FLUSH_CALL
    Any idea?
    thanks in advance,

    Hello,
    it is possible to extract DMS's file to application server directory:
    FUNCTION Z_DMS_VIEW.
    ""Interfase local
    *"  IMPORTING
    *"     VALUE(DOC_NUMBER) LIKE  BAPI_DOC_DRAW2-DOCUMENTNUMBER OPTIONAL
    *"     VALUE(DOC_PART) LIKE  BAPI_DOC_DRAW2-DOCUMENTPART OPTIONAL
    *"     VALUE(DOC_TYPE) LIKE  BAPI_DOC_DRAW2-DOCUMENTTYPE OPTIONAL
    *"     VALUE(DOC_VERS) LIKE  BAPI_DOC_DRAW2-DOCUMENTVERSION OPTIONAL
    *"     VALUE(ORIGINAL_PATH) LIKE  BAPI_DOC_AUX-FILENAME OPTIONAL
    *"  EXPORTING
    *"     VALUE(P_RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2
    *"  TABLES
    *"      DOC_FILES STRUCTURE  BAPI_DOC_FILES2 OPTIONAL
      CLEAR:   doc_files.
      REFRESH: doc_files.
      DATA: i_doc_files like bapi_doc_files2.
    DATA: i  type i.
    i = 2.
    while i = 2.
       i = 2.
    endwhile.
      CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTVIEW2'
        EXPORTING
          DOCUMENTTYPE    = DOC_TYPE
          DOCUMENTNUMBER  = DOC_NUMBER
          DOCUMENTPART    = DOC_PART
          DOCUMENTVERSION = DOC_VERS
          DOCUMENTFILE    = i_doc_files
          GETSTRUCTURE    = '0'
          GETCOMPONENTS   = 'X'
          ORIGINALPATH    = ORIGINAL_PATH
          HOSTNAME        = ' '
          GETHEADER       = 'X'
          PF_HTTP_DEST    = 'SAPHTTPA'
          PF_FTP_DEST     = 'SAPFTPA'
        IMPORTING
          RETURN          = P_RETURN
        TABLES
          DOCUMENTFILES   = DOC_FILES.
    ENDFUNCTION.
    ORIGINAL_PATH must be a directory of application server.
    By background is not possible (I don't know how can we do that) download thsi file to PC.
    Then with the file in application server we can :
    - to map application server directory in a drive unit of Pc
    - to transfer with a ftp client from Pc
    - rfcexec
    But always the bapi can not download the file: it must be a process in Pc who transfer the file.

  • I am trying to save a DMS File through File upload UI element to CV01n Transactions....It works fine for .TXT file but other files it is not downloading coorectly and file is getting damaged

    Hi, I am downloading DMS file using following code and the file contents are getting damaged and cannot be retieved back. I am also getting hard time to open a DMS file in seperate browser.
    Can anybody please help me.
      TYPES : BEGIN OF ty_ts_raw_line,
    *                 line TYPE sdokcntbin ,
                line(2550) TYPE x,
               END OF ty_ts_raw_line.
      DATA: ls_documentdata TYPE bapi_doc_draw2,
            lv_doctype TYPE   bapi_doc_aux-doctype,
            lv_docnumber TYPE bapi_doc_aux-docnumber,
            lv_documentpart TYPE bapi_doc_aux-docpart,
            lv_documentversion TYPE bapi_doc_aux-docversion,
            ls_return TYPE bapiret2,
            gt_bapi_doc_files2 TYPE TABLE OF bapi_doc_files2,
            gs_bapi_doc_files2 LIKE LINE OF gt_bapi_doc_files2,
            lo_nd_nd_cost_rate TYPE REF TO if_wd_context_node,
            lt_nd_cost_rate TYPE wd_this->elements_nd_cost_rate,
            ls_nd_cost_rate TYPE wd_this->element_nd_cost_rate,
            lv_string TYPE string,
            lv_temp TYPE string,
            lv_input_file_name TYPE string,
            lv_size TYPE i ,
            lt_bindata TYPE STANDARD TABLE OF ty_ts_raw_line,"  STANDARD TABLE  OF zst_ts_raw_line,
            ls_bindata TYPE  sdokcntbin,
            ls_drao TYPE drao,
            lt_drao TYPE TABLE OF drao,
            lt_files TYPE cvapi_tbl_doc_files,
            ls_files TYPE cvapi_doc_file,
            ls_api_ctrl TYPE cvapi_api_control,
            ls_message TYPE messages,
            lv_dappl TYPE draw-dappl,
            lv_filename TYPE char200,
            lv_filename_draw_filep TYPE draw-filep,
            lv_doc_succ TYPE c,
            lv_tabix TYPE sy-tabix,
            lv_char_tabix(5) TYPE c,
    * get message manager
            lo_api_controller     TYPE REF TO if_wd_controller,
            lo_message_manager    TYPE REF TO if_wd_message_manager,
            lv_text TYPE string,
            lt_tabix TYPE STANDARD TABLE OF sytabix,
            lv_api_ctrl TYPE cvapi_api_control VALUE 'CV01N',
            lv_documentnumber TYPE draw-doknr,
            lt_drat TYPE TABLE OF dms_db_drat,
            ls_drat TYPE dms_db_drat.
      CONSTANTS: lc_cst(3) TYPE c VALUE 'CST',
                 lc_000(3) TYPE c VALUE '000',
                 lc_00(2) TYPE c VALUE '00',
                 lc_zng_test(8) TYPE c VALUE  'ZNG-TEST',
                 lc_desc(11)  TYPE c VALUE 'Cost Rate',
                 lc_test(4)  TYPE c VALUE 'Test',
    *             lc_file_path(31) TYPE c VALUE 'C:\FAKEPATH\COST_RATE_TABLE.TXT',
                 lc_x TYPE c VALUE 'X',
                 lc_blank TYPE c VALUE '',
                 lc_nd(2) TYPE c VALUE '&1'.
      FIELD-SYMBOLS <ls_wd_assist_mt_input> LIKE LINE OF wd_assist->mt_input.
      lo_api_controller ?= wd_this->wd_get_api( ).
      CALL METHOD lo_api_controller->get_message_manager
        RECEIVING
          message_manager = lo_message_manager.
    * navigate from <CONTEXT> to <ND_COST_RATE> via lead selection
      lo_nd_nd_cost_rate = wd_context->get_child_node( name = wd_this->wdctx_nd_cost_rate ).
    * @TODO handle non existant child
      IF lo_nd_nd_cost_rate IS NOT INITIAL.
        lo_nd_nd_cost_rate->get_static_attributes_table( IMPORTING table = lt_nd_cost_rate ).
      ENDIF.
      ls_documentdata-documenttype = lc_cst.
      ls_documentdata-documentnumber = lc_cst.
      ls_documentdata-documentversion = lc_00.
      ls_documentdata-documentpart  = lc_000.
      ls_documentdata-description  = lc_desc.
    *  ls_documentdata-
    *  ls_drat-dktxt = lc_desc.
    *  append ls_drat to lt_drat.
    *  clear ls_drat.
    *  lv_api_ctrl = 'CV01N'.
      LOOP AT lt_nd_cost_rate INTO ls_nd_cost_rate WHERE row_index IS NOT INITIAL.
        lv_tabix = sy-tabix.
    *           CALL FUNCTION 'CVAPI_DOC_CREATE'
    *         EXPORTING
    *           ps_draw              = ls_documentdata " wa_documentfiles
    *           ps_api_control       = lv_api_ctrl
    *         IMPORTING
    *           psx_message          = ls_message
    *           pfx_doknr            = lv_documentnumber.
    **         TABLES
    **           pt_drat_x            = it_drat.
        CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
          EXPORTING
            documentdata    = ls_documentdata
            defaultclass    = 'X'
          IMPORTING
            documenttype    = lv_doctype
            documentnumber  = lv_docnumber
            documentpart    = lv_documentpart
            documentversion = lv_documentversion
            return          = ls_return.
        IF ls_return-type CA 'EA'.
          ROLLBACK WORK.
        ELSE.
          COMMIT WORK.
        ENDIF.
        LOOP AT wd_assist->mt_input ASSIGNING <ls_wd_assist_mt_input> WHERE row_index = ls_nd_cost_rate-row_index.
          CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
            EXPORTING
              buffer        = <ls_wd_assist_mt_input>-file_data
            IMPORTING
              output_length = lv_size
            TABLES
              binary_tab    = lt_bindata.
          lv_filename_draw_filep = <ls_wd_assist_mt_input>-filename.
          WHILE lv_filename_draw_filep CA '\'.
            SPLIT lv_filename_draw_filep AT '\'
            INTO lv_temp lv_filename_draw_filep.
          ENDWHILE.
          LOOP AT lt_bindata INTO ls_bindata.
            CLEAR ls_drao.
            ls_drao-orblk = ls_bindata-line.
            ls_drao-orln = lv_size.
            ls_drao-dokar = lv_doctype.
            ls_drao-doknr = lv_docnumber.
            ls_drao-dokvr = lv_documentversion.
            ls_drao-doktl = lv_documentpart.
            ls_drao-appnr = '1'.
            APPEND ls_drao TO lt_drao.
            CLEAR ls_drao.
          ENDLOOP.
          CONDENSE lv_input_file_name.
    *      lv_input_file_name = 'Test.txt'.
          CALL FUNCTION 'CV120_DOC_GET_APPL'
            EXPORTING
              pf_file   = lv_filename_draw_filep
            IMPORTING
              pfx_dappl = lv_dappl.
          ls_files-appnr = '1'.
          ls_files-dappl = lv_dappl.
          ls_files-filename = lv_filename_draw_filep.
          ls_files-updateflag = 'I'.
          ls_files-langu = sy-langu.
          ls_files-storage_cat = 'SAP-SYSTEM'.
          ls_files-description = lv_filename_draw_filep..
          APPEND ls_files TO lt_files.
          CLEAR ls_files.
          ls_api_ctrl-tcode = 'CV01N'.
          CALL FUNCTION 'CVAPI_DOC_CHECKIN'
            EXPORTING
              pf_dokar           = lv_doctype
              pf_doknr           = lv_docnumber
              pf_dokvr           = lv_documentversion
              pf_doktl           = lv_documentpart
              ps_api_control     = ls_api_ctrl
              pf_content_provide = 'TBL'
              pf_http_dest       = 'SAPHTTPA'
              pf_ftp_dest        = 'SAPFTPA'
            IMPORTING
              psx_message        = ls_message
            TABLES
              pt_files_x         = lt_files
              pt_content         = lt_drao.
          IF ls_message-msg_type CA 'EA'.
            lv_doc_succ = lc_blank.
          ELSE.
            COMMIT WORK.
            lv_doc_succ = lc_x.
            CLEAR lv_text .
            lv_text = <ls_wd_assist_mt_input>-comments.
          ENDIF.
          CLEAR: ls_api_ctrl,ls_message,lt_files[],lt_drao[].
        ENDLOOP.
        IF lv_doc_succ = lc_x.
          ls_nd_cost_rate-dokar = lv_doctype.
          ls_nd_cost_rate-doknr = lv_docnumber.
          ls_nd_cost_rate-doktl = lv_documentpart.
          ls_nd_cost_rate-dokvr = lv_documentversion.
          ls_nd_cost_rate-comments = lv_text.
          MODIFY lt_nd_cost_rate FROM ls_nd_cost_rate INDEX lv_tabix TRANSPORTING dokar doknr doktl dokvr comments.
        ELSE.
          APPEND lv_tabix TO lt_tabix.
        ENDIF.
        CLEAR ls_nd_cost_rate.
      ENDLOOP.
    I am also having hardtime to show DMS file on browser.

    Hi I've done DMS Creation like below code. Just check it .
          LS_DOC-DOCUMENTTYPE    = LW_DMS_APP-DOCUMENTTYPE.
          LS_DOC-DOCUMENTVERSION = LW_DMS_APP-DOCUMENTVERSION.
          LS_DOC-DOCUMENTPART    = LW_DMS_APP-DOCUMENTPART.
          LS_DOC-STATUSEXTERN    = LW_DMS_APP-STATUSEXTERN.
          LS_DOC-LABORATORY      = '  '.
    CONCATENATE WD_THIS->LW_REQ-BUKRS LS_DMS-REQ_NO LS_DMS-CR_YR INTO LW_OBJKEY SEPARATED BY '\'.
          LW_DRAD-OBJECTKEY = LW_OBJKEY.
          LW_DRAD-OBJECTTYPE = 'ZAPR_REQ'.
          APPEND LW_DRAD TO LT_DRAD.
          LW_DRAT-LANGUAGE = SY-LANGU.
          LW_DRAT-DESCRIPTION = LS_STRIPPEDNAME.
          APPEND LW_DRAT TO LT_DRAT.
          CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
            EXPORTING
              DOCUMENTDATA         = LS_DOC
            IMPORTING
              DOCUMENTTYPE         = LF_DOCTYPE
              DOCUMENTNUMBER       = LF_DOCNUMBER
              DOCUMENTPART         = LF_DOCPART
              DOCUMENTVERSION      = LF_DOCVERSION
              RETURN               = LS_RETURN
            TABLES
              DOCUMENTDESCRIPTIONS = LT_DRAT
              OBJECTLINKS          = LT_DRAD.
    *--------Creating DMS Document Using BAPI-----------------*
          IF LS_RETURN-TYPE NA 'EA'.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
              EXPORTING
                WAIT = 'X'.
          LS_DRAW-DOKAR = LW_DMS_APP-DOCUMENTTYPE.
          LS_DRAW-DOKVR = LW_DMS_APP-DOCUMENTVERSION.
          LS_DRAW-DOKTL = LW_DMS_APP-DOCUMENTPART.
          LS_DRAW-DWNAM = SY-UNAME.
          LS_DRAW-DOKST = LW_DMS_APP-STATUSEXTERN.
          LV_STORAGE_CAT = LW_DMS_APP-STORAGECATEGORY.
          LS_API_CONTROL-TCODE = 'CV01N'.
          IF LF_DOCNUMBER IS NOT INITIAL.
            CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
              EXPORTING
                BUFFER        = LS_DMS_FILE-FILE_CTGRY
              IMPORTING
                OUTPUT_LENGTH = LV_SIZE
              TABLES
                BINARY_TAB    = LT_BINDATA.
            LOOP AT LT_BINDATA INTO LS_BINDATA.
              CLEAR LS_DRAO.
              LS_DRAO-ORBLK = LS_BINDATA-LINE.
              LS_DRAO-ORLN  = LV_SIZE.
              LS_DRAO-DOKAR = LS_DRAW-DOKAR.
              LS_DRAO-DOKNR = LF_DOCNUMBER.
              LS_DRAO-DOKVR = LS_DRAW-DOKVR.
              LS_DRAO-DOKTL = LS_DRAW-DOKTL.
              LS_DRAO-APPNR = '1'.
              APPEND LS_DRAO TO LT_DRAO.
            ENDLOOP.
            CALL FUNCTION 'CV120_DOC_GET_APPL'
              EXPORTING
                PF_FILE   = LS_STRIPPEDNAME
              IMPORTING
                PFX_DAPPL = LS_FILES-DAPPL.
            LS_DRAW-FILEP = LS_STRIPPEDNAME.
            LS_DRAW-DAPPL = LS_FILES-DAPPL.
            LS_FILES-APPNR = '1'.
            LS_FILES-FILENAME = LS_STRIPPEDNAME.
            LS_FILES-UPDATEFLAG = 'I'.
            LS_FILES-LANGU = SY-LANGU.
            LS_FILES-STORAGE_CAT = LW_DMS_APP-STORAGECATEGORY. "'ZDMS_DI'.
            LS_FILES-DESCRIPTION = LS_STRIPPEDNAME.
            APPEND LS_FILES TO LT_FILES.
            CALL FUNCTION 'CVAPI_DOC_CHECKIN'
              EXPORTING
                PF_DOKAR           = LS_DRAW-DOKAR
                PF_DOKNR           = LF_DOCNUMBER
                PF_DOKVR           = LS_DRAW-DOKVR
                PF_DOKTL           = LS_DRAW-DOKTL
                PS_API_CONTROL     = LS_API_CONTROL
                PF_CONTENT_PROVIDE = 'TBL'
              IMPORTING
                PSX_MESSAGE        = LS_MESSAGE
              TABLES
                PT_FILES_X         = LT_FILES
                PT_CONTENT         = LT_DRAO.
            IF NOT LS_MESSAGE-MSG_TYPE CA 'EA' AND
                   LF_DOCNUMBER IS NOT INITIAL.
              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
           ENDIF.
    Regards,
    Jack.  

  • Spry Vertical Menu does not display properly when uploaded to server.

    I am using Dreamweaver CS5 Version 11.0 Build 4909 on Windows XP.  The website I am working on is displaying the ordered list incorrectly.  The drop down submenus are not lined up underneath each other.
    So I did a basic one and uploaded it to the server and had the same outcome.  Locally it looks fine but uploaded to the hosting server not fine.  Below is the code from the document called deleteme.html.  I am new to all this so I apologize if this seems basic.  Thanks for your help in advanced.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="container">Content for  id "container" Goes Here
      <ul id="MenuBar1" class="MenuBarVertical">
        <li><a class="MenuBarItemSubmenu" href="#">Item 1</a>
          <ul>
            <li><a href="#">Item 1.1</a></li>
            <li><a href="#">Item 1.2</a></li>
            <li><a href="#">Item 1.3</a></li>
          </ul>
        </li>
        <li><a href="#">Item 2</a></li>
        <li><a class="MenuBarItemSubmenu" href="#">Item 3</a>
          <ul>
            <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
              <ul>
                <li><a href="#">Item 3.1.1</a></li>
                <li><a href="#">Item 3.1.2</a></li>
              </ul>
            </li>
            <li><a href="#">Item 3.2</a></li>
            <li><a href="#">Item 3.3</a></li>
          </ul>
        </li>
        <li><a href="#">Item 4</a></li>
      </ul>
    </div>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>

    Hello all,
    Thanks to everyone who replied to my post.  I have it working now but I have other issues that I will post separately.
    Here was my thought process and you can tell me if I am right or wrong.  I was working with multiple pages that I was using Spry.  I had only one folder set that all the Spry Assets were being saved into.  My thinking was that they were getting over written.  So I deleted the folder and re-built the page.  When I deleted Spry Assets folder it showed me I had 6 pages linked to the Spry Assets folder.  I also deleted my Spry Assets folder on my hosting server....thought I would really start from scratch.  When I went to upload the files I created a SpryAssets folder and what I realized I had originally put a space  between the y and a of the folder name.  So I am not sure if the elements in the Spry Assets folder were getting over written or it was because I had a space in the folder name.  Thanks again, Mike

Maybe you are looking for