BAPI/FM to upload PGI

hi guys,
any BAPI/FM that can be used to upload PGI, i need to put in the storage location for every DO

Hi,
Please try to use FM WS_DELIVERY_UPDATE.
  DATA:
    L_VBELN LIKE LIKP-VBELN,
    L_VBKOK LIKE VBKOK,
    L_PROTT LIKE PROTT OCCURS 0 WITH HEADER LINE.
* carry out goods issue
  L_VBKOK-VBELN_VL = L_VBELN.   <-- fill this field with your delivery number
  L_VBKOK-WABUC    = 'X'.
  CALL FUNCTION 'WS_DELIVERY_UPDATE'
       EXPORTING
            VBKOK_WA           = L_VBKOK
            SYNCHRON           = 'X'
            NO_MESSAGES_UPDATE = ' '
            UPDATE_PICKING     = 'X'
            COMMIT             = ' '
            DELIVERY           = L_VBELN
            NICHT_SPERREN      = 'X'
       TABLES
            PROT               = L_PROTT
       EXCEPTIONS
            OTHERS             = 0.
  COMMIT WORK AND WAIT.
Regards,
Ferry Lianto

Similar Messages

  • 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

  • VL06P : BAPI/Function Module for PGI

    Hi All,
    Anybody have the information about the BAPI/FM for doing PGI with VL06P for delivery.
    Thanks

    Hi,
    You can do the PGI through following BAPI FM
    BAPI_OUTB_DELIVERY_CONFIRM_DEC
    Regards,
    Krishnakumar

  • 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

  • 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

  • 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

  • Doubt on Good movements using BAPI'S for Uploading

    Hi Experts,
             i am doing a bdc program to upload for mb1a transaction using BAPI..I am new to BAPI area..But with some reference i have finished the program..But i dont know why in clear statement and in gui upload showing error..IN gui upload when i activate the exception its throwing error..Hereby i am pasting the code...Any idea pls share with me..
    <removed by moderator>
    I dont know how to make the code show correctly...any help???????
    Regards
    Karthick
    Moderator message: please post only relevant code parts, observe the maximum of 5000 characters per post to preserve formatting, leave out commented lines, etc.
    Edited by: Thomas Zloch on Feb 10, 2011 6:05 PM
    sorry moderator...it will not happen again..
    my scenario is like this i ahve to upload the serial number with respect to the quantity in unit of measure..i am not getting any idea on this..for example if the quantity for the material is 5 then it has to upload five serial numbers...
    please help me on this!!!!!!!!
    regards
    Karthick
    Edited by: karthicksap on Feb 12, 2011 5:25 AM

    Hi kris,
         Finally i finished the coding..its working fine...but now its throwing material is not maintained in plant..checked with that..but material is maintained there..i dont know why its throwing the error..i checked with debugging and i found that its taking the last serial number only..for every material..my flatfile is like this..
    11.01.2011     11.01.2011     abc     9051     5101     stbdx300     3     600001     0     1000000000000001
    11.01.2011     11.01.2011     abc     9051     5101     stbdx300     3     600001     0     1000000000000002
    11.01.2011     11.01.2011     abc     9051     5101     stbdx300     3     600001     0     1000000000000003
    any idea kris.>?????
    regards
    Karthick

  • Error in bapi BAPI_PR_CREATE while uploading

    HI Gurus,
            I have program for uploading PR with BAPI. BAPI_PR_CREATE.
    while uploading without account assignment category  it is working fine.
    while enter account assignment category  v need to enter sales order no and item no. that is mandatory field for account assignment category..
    if using program its showing error.
    No instance of object type Purchase Requisition has been created. External reference: # 1
    Enter sales order
    Sd document XXXXXXX is not in the database or has been archived.
    but  I tried to create manually it is working fine.
    I tried to upload with bapi directly with out z program.
    tht time also it showing error
    No instance of object type Purchase Requisition has been created. External reference: # 1
    Enter sales order
    If any one give solution
    it is very helpful for me.

    Hi
    Thnaks for the Reply,
    in normal scenario it ll upload base on header.
    if header change it ll generate automatically requisition no.  So in program v used AT END OF pr_type. 
    so if pr_type is diff it will work.
    in my case only one header it will not change. v hav only one pr type.
    it should generate based on Item.
    If item 10 it should generate new requisition No.
    my flat file is ,
    pr type -  material  - pur org - plant - storage loc  - qty -  traking no - ....  pr item
    xxx          abc           pqr        1000       xyz             100         11111               10
    xxx          abc           pqr        1000       xyz              200        11111                20        
    xxx          abc           pqr        1000       xyz              300       11111                 30
    xxx          abc           pqr        1000       xyz              400        11111                10
    xxx          abc           pqr        1000       xyz              500        11111                20
    here header is same.. if pr item 10 it should generate new requisition No, means it should commit before value 10.
    so before commit v hav to give the logic if item 10 it should generate for before value.
    hope u got my requirement.

  • Using bapi how to upload the data into sap database?

    hi dear all,
                  im facing problem with bapi ? let me edcuate on bapi ..
    i will be  waiting for reply.
    my e-id :[email protected]
    thanks&regards
    shiva.

    Hi
    A BAPI is a method of a SAP Business Object. BAPI enables SAP and third party applications to interact and integrate
    with each other at the Business Object / Process level.
    Check this link to know more about BAPI.
    http://www.sapgenie.com/abap/bapi/example.htm
    http://sappoint.com/abap/
    Batch Data Communication (BDC) is the oldest batch interfacing technique that SAP provided since the early versions of R/3. BDC is not a
    typical integration tool, in the sense that, it can be only be used for uploading data into R/3 and so it is not bi-directional.
    BDC works on the principle of simulating user input for transactional screen, via an ABAP program. Typically the input comes in the form
    of a flat file. The ABAP program reads this file and formats the input data screen by screen into an internal table (BDCDATA). The
    transaction is then started using this internal table as the input and executed in the background.
    In ‘Call Transaction’, the transactions are triggered at the time of processing itself and so the ABAP program must do the error handling.
    It can also be used for real-time interfaces and custom error handling & logging features. .
    To know more about BDC,
    check the link.
    http://sappoint.com/abap/
    Main differences are...
    In case of bdc data transfer takes place from flat file into sap system ie the file existing in sap system to sap sytem
    where is bapi's r remotly enabled function modules which are assigned to some business objects n used to transfer the data between different business partners who are using different systems other than sap.
    not only that...
    when you plan to upgrade your system version then bdc willnot support those upgradations where as bapi's will support.
    http://www.sap-img.com/abap/ale-bapi.htm
    SAP BAPI
    BAPI STEPS
    Hope this helps.
    ashish

  • 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

  • BAPI Needed of uploading document in already existing Dispute Case

    Hi,
      I need BAPI for  uploading document in already existing Dispute Case...
    Thanks,
    Ajit

    I tried to use the following program to upload a document and it is not working, any feedback would be helpful:
    *& Report  ZTEMP_DISPUTE_12
    REPORT  ztemp_dispute_12.
    PARAMETER : l_fname TYPE char255.
    DATA : l_file TYPE string,
          lv_xstring  TYPE xstring,
           l_return TYPE  bapiret2,
           l_filecontent TYPE bapiconten,
           i_case TYPE REF TO if_scmg_case_api,
            l_initial_dir     TYPE string,
            l_window_title    TYPE string,
            l_filename_disp   TYPE string,
            l_filename_string TYPE string,
            l_user_action     TYPE i,
            l_rc              TYPE i,
           l_v_lines TYPE i,
           l_mime TYPE skwf_mime,
           l_filelength TYPE i,
           l_component TYPE  bapidoccomp,
           l_skwf_filnm TYPE skwf_filnm,
           li_file_tab        TYPE filetable,
           lwa_file_tab        TYPE file_table,
           li_bin_content  TYPE STANDARD TABLE OF bapiconten,
           l_v_size TYPE i.
    DATA: BEGIN OF itab OCCURS 0,
           line TYPE sdok_sdatx.
    DATA: END OF itab.
    DATA: BEGIN OF i_component OCCURS 0,
            comp_count  TYPE bapipos,
            comp_id     TYPE bapidocid,
            mimetype    TYPE bapimimetype,
            comp_size   TYPE bapipos,
            binary_flag TYPE bapigsbool,
            comp_num    TYPE bapipos.
    DATA: END OF i_component.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR l_fname.
      l_window_title = 'Upload Document'(001).
    Call the file selection dialog
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = l_window_title
          initial_directory       = l_initial_dir
        CHANGING
          file_table              = li_file_tab
          rc                      = l_rc
          user_action             = l_user_action
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5.
      IF sy-subrc = 0.
        READ TABLE li_file_tab INTO lwa_file_tab INDEX 1.
        IF sy-subrc = 0.
          l_file = lwa_file_tab-filename.
          l_fname = lwa_file_tab-filename.
        ENDIF.
      ENDIF.
    START-OF-SELECTION.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = l_file
      FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          data_tab                      = itab
    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.
      ENDIF.
      DESCRIBE TABLE itab  LINES l_v_lines.
      l_v_size = l_v_lines * 255.
      l_filename_string = l_file.
      CALL METHOD cl_gui_frontend_services=>file_get_size
        EXPORTING
          file_name = l_filename_string
        IMPORTING
          file_size = l_v_size
        EXCEPTIONS
          OTHERS    = 1.
    convert binary255 to binary1024 table
      CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
        EXPORTING
          input_length = l_v_size
        IMPORTING
          buffer       = lv_xstring
        TABLES
          binary_tab   = itab
        EXCEPTIONS
          failed       = 1
          OTHERS       = 2.
      IF sy-subrc <> 0.
           rv_failed = 'X'.
           RETURN.
      ENDIF.
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer     = lv_xstring
        TABLES
          binary_tab = li_bin_content.
      l_skwf_filnm = l_file.
      CALL FUNCTION 'SKWF_MIMETYPE_OF_FILE_GET'
        EXPORTING
          filename                   = l_skwf_filnm
      X_USE_LOCAL_REGISTRY       =
       IMPORTING
         mimetype                   = l_mime.
      l_component-comp_count    = 1.
      l_component-comp_id       = l_fname.
      l_component-mimetype      = l_mime.
      l_component-comp_size     =  l_v_size.
      l_component-binary_flag   = 'X'.
      l_component-comp_num      = 1.
      APPEND l_component TO i_component.
      DATA:
      lo_case_api TYPE REF TO  cl_scmg_case_api,
       lo_case_api_intf       TYPE REF TO if_scmg_case_api.
      CALL METHOD cl_scmg_case_api=>if_scmg_case_api~open_case
        EXPORTING
          im_case_guid    = 'E99B284FC272B720E100000092D79319'
          im_enqueue      = 'X'
        RECEIVING
          re_case         = lo_case_api_intf
        EXCEPTIONS
          failed          = 1
          enqueue_failed  = 2
          invalid_guid    = 3
          cx_srm_gsp_back = 4
          OTHERS          = 5.
      lo_case_api ?= lo_case_api_intf.
    *DATA : l_if_case_api      TYPE REF TO if_scmg_case_api.
           CALL METHOD cl_scmg_case_api=>open_case
             EXPORTING
               im_case_guid    = 'E99B284FC272B720E100000092D79319'
             RECEIVING
               re_case         = l_if_case_api
             EXCEPTIONS
               failed          = 1
               enqueue_failed  = 2
               invalid_guid    = 3
               cx_srm_gsp_back = 4
               no_authority    = 5
               OTHERS          = 6.
      CALL FUNCTION 'UDM_BD_CREATE_ATTACHMENT'
        EXPORTING
          i_guid      = 'E99B284FC272B720E100000092D79319'              "E99B284FC272B720E100000092D79319
          i_case      = lo_case_api
          i_testrun   = space           " '003A3A4FAD54D97CE100000092D79319'
        TABLES
          bin_content = li_bin_content
          components  = i_component
        CHANGING
          es_return   = l_return.
      IF sy-subrc = 0.
        COMMIT WORK.
      ENDIF.
      CALL FUNCTION 'DEQUEUE_ALL'.
      break 50120i1120.

  • Issue in condition table passing in BAPI BAPI_PO_CREATE1 when uploading PO

    hi everyone,
      I am trying to upload PO data (header, item, conditions)from file. Some of my main code as follows:
    i have pasted the code for assigning values to condition table and passing in  bapi..once i execute the bapi in debug mode..PO not created, no values in condition tables. rest of the table values are fine..
    W_BAPIMEPOCOND-ITM_NUMBER = '000001'.
      W_BAPIMEPOCOND-COND_ST_NO = '001'.
      W_BAPIMEPOCOND-COND_TYPE = 'PB00'.
      W_BAPIMEPOCOND-COND_VALUE = '1000'.
      W_BAPIMEPOCOND-CURRENCY = 'KES'.
      APPEND W_BAPIMEPOCOND TO I_BAPIMEPOCOND.
      CLEAR W_BAPIMEPOCOND.
    W_BAPIMEPOCOND-ITM_NUMBER = '000001'.
      W_BAPIMEPOCOND-COND_ST_NO = '000'.
      W_BAPIMEPOCONDX-COND_TYPE = 'X'.
      W_BAPIMEPOCONDX-COND_VALUE = 'X'.
      W_BAPIMEPOCONDX-CURRENCY = 'X'.
      APPEND W_BAPIMEPOCONDX TO I_BAPIMEPOCONDX.
      CLEAR W_BAPIMEPOCONDX.
      ENDLOOP.
    LOOP AT I_BAPIMEPOHEADER INTO W_BAPIMEPOHEADER.
    CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        POHEADER                     = W_BAPIMEPOHEADER
       POHEADERX                    = W_BAPIMEPOHEADERx
      POADDRVENDOR                 =
      TESTRUN                      =
      MEMORY_UNCOMPLETE            =
      MEMORY_COMPLETE              =
      POEXPIMPHEADER               =
      POEXPIMPHEADERX              =
      VERSIONS                     =
      NO_MESSAGING                 =
      NO_MESSAGE_REQ               =
      NO_AUTHORITY                 =
      NO_PRICE_FROM_PO             =
      PARK_COMPLETE                =
      PARK_UNCOMPLETE              =
    IMPORTING
       EXPPURCHASEORDER             = EXPPURCHASEORDER
      EXPHEADER                    =
      EXPPOEXPIMPHEADER            =
    TABLES
       RETURN                       = RETURN
       POITEM                       = I_BAPIMEPOITEM
       POITEMX                      = I_BAPIMEPOITEMX
      POADDRDELIVERY               =
       POSCHEDULE                   = I_BAPIMEPOSCHEDULE
       POSCHEDULEX                  = I_BAPIMEPOSCHEDULEX
      POACCOUNT                    =
      POACCOUNTPROFITSEGMENT       =
      POACCOUNTX                   =
      POCONDHEADER                 =
      POCONDHEADERX                =
       POCOND                       = I_BAPIMEPOCOND
       POCONDX                      = I_BAPIMEPOCONDX
      POLIMITS                     =
      POCONTRACTLIMITS             =
      POSERVICES                   =
      POSRVACCESSVALUES            =
      POSERVICESTEXT               =
      EXTENSIONIN                  =
      EXTENSIONOUT                 =
      POEXPIMPITEM                 =
      POEXPIMPITEMX                =
      POTEXTHEADER                 =
      POTEXTITEM                   =
      ALLVERSIONS                  =
      POPARTNER                    =
      POCOMPONENTS                 =
      POCOMPONENTSX                =
      POSHIPPING                   =
      POSHIPPINGX                  =
      POSHIPPINGEXP                =
      SERIALNUMBER                 =
      SERIALNUMBERX                =
      INVPLANHEADER                =
      INVPLANHEADERX               =
      INVPLANITEM                  =
      INVPLANITEMX                 =
      NFMETALLITMS                 =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
    Thanks in advance!!

    Hi Balaji,
    I suppose it's a simple copy paste error. Refer the code higlighted below:
    W_BAPIMEPOCOND-ITM_NUMBER = '000001'.
    W_BAPIMEPOCOND-COND_ST_NO = '001'.
    W_BAPIMEPOCOND-COND_TYPE = 'PB00'.
    W_BAPIMEPOCOND-COND_VALUE = '1000'.
    W_BAPIMEPOCOND-CURRENCY = 'KES'.
    APPEND W_BAPIMEPOCOND TO I_BAPIMEPOCOND.
    CLEAR W_BAPIMEPOCOND.
    W_BAPIMEPOCONDX-ITM_NUMBER = '000001'.
    W_BAPIMEPOCONDX-COND_ST_NO = '000'.
    W_BAPIMEPOCONDX-COND_TYPE = 'X'.
    W_BAPIMEPOCONDX-COND_VALUE = 'X'.
    W_BAPIMEPOCONDX-CURRENCY = 'X'.
    Regards,
    Pranav.
    Edited by: Pranav Mandelia on Sep 30, 2011 1:52 PM

Maybe you are looking for

  • I have purchased apple phone 4s for india (non-carrier). Can i use the same phone in USA with usa based sim

    I have purchased iphone 4s for India from India. Can I use the same phone in usa with usa based sim

  • Prime Infrastructure 2.0 email charset problem

    Dear all, I have question regarding Guest portal managed through PI. Everything is set, but only one thing doesn't work as I expected. When I make an account and print it, everything looks fine. When I sent it via email, then enconding of mail is wro

  • Datasources and Reports

    Hi friends, i need the report on the following datasources (2lis_11_vahdr,  2lis_11_vaitm, 2lis_13_vditm)   By using these 3 datasources i wants to know the possible reports. plz help me in this regard. regards, aravind

  • An update from Adobe...

    ...is located here: Kevin Tieskoetter, "Lightroom 2.0 will not export to Photoshop CS3" #228, 13 Aug 2008 2:59 pm

  • DTP - Sending 1 datapackage manually

    Dear All, I have DTPed 50 data packages from PSA to ODS. But te 42nd data package is still yellow status. All the others are green. So the dtp is showing yellow status. Can I manually send this one datapackage? If so how? I checked another thing. "Ma