<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Uploading valuation class using BAPI_MATERIAL_SAVEDATA in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5052000#M1174348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tats wat i did thanks for your reply.&lt;/P&gt;&lt;P&gt;nw its working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2009 10:50:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-16T10:50:05Z</dc:date>
    <item>
      <title>Uploading valuation class using BAPI_MATERIAL_SAVEDATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051993#M1174341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SDNers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am uploading valuation class using BAPI_MATERIAL_SAVEDATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my excel file I had 25 material of different types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Out of 25 records 13 were uploaded to DB for remaining I got these kinds of errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) The field  MBEW-BKLAS/ BAPI_MBEW-VAL_CLASS is defined as a required field; it does not contain an entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) No description transferred&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could be the reason for the following error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

* Declaration of tables internal tables and bapi structure.

tables : mbew.      " Material valuation

data : begin of t_matvclass occurs 0,
       material type matnr,     " Material
       ind_sec type mbrsh,      " Industry sector
       mat_typ type mtart,      " Material type
       val_class type BKLAS,    " Valuation class
       end of t_matvclass.
data : wa like line of t_matvclass.


data :bapi_head like bapimathead, " Header Segment with Control Info
      bapi_valclass like BAPI_MBEW,   " Valuation class
      bapi_valclassx like BAPI_MBEWx, " Checkbox Structure for BAPI_MBEW
      bapi_return like bapiret2,      " Bapi return structrue
      returnm type table of bapi_matreturn2 with header line.

data : it_excel type alsmex_tabline occurs 0 with header line.

data: begin of it_ret occurs 0.
       include structure bapiret2.
      data end of it_ret.

* Data objects for exception handling.
data : lv_converr type ref to CX_SY_CONVERSION_ERROR,
       lv_dynerr type ref to CX_SY_DYN_CALL_ERROR.
data : txt_converr type string,
       txt_converr_l type string,
       txt_dynerr type string,
       txt_dynerr_l type string.

* Declaring selection screen for selecting a data file
* for uploading valuation class
selection-screen begin of block b1 with frame title text-001.
parameter : file_nam type rlgrap-filename obligatory default
              'C:\master data UPDATED_test.xls'.
parameter : p_begcol type i default 1 no-display,
            p_begrow type i default 2 no-display,
            p_endcol type i default 4 no-display,
            p_endrow type i default 26 no-display.
parameters: p_valare type mbew-bwkey obligatory.    " Valuation area
selection-screen end of block b1.

at selection-screen on value-request for file_nam.
perform F_get_file using file_nam.

start-of-selection.
perform F_xls_itab using file_nam changing it_excel.
perform F_move_data.
perform F_get_data.

form F_xls_itab  using    p_file_nam changing p_it_excel.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  EXPORTING
    filename                      = file_nam
    i_begin_col                   = p_begcol
    i_begin_row                   = p_begrow
    i_end_col                     = p_endcol
    i_end_row                     = p_endrow
  tables
    intern                        = it_excel
 EXCEPTIONS
   INCONSISTENT_PARAMETERS       = 1
   UPLOAD_OLE                    = 2
   OTHERS                        = 3.
endform.                    " F_xls_itab

form F_get_file  using    p_file_nam.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
 EXPORTING
   PROGRAM_NAME        = SYST-REPID
   DYNPRO_NUMBER       = SYST-DYNNR
*   FIELD_NAME          = ' '
*   STATIC              = ' '
*   MASK                = ' '
  CHANGING
    file_name           = file_nam
 EXCEPTIONS
   MASK_TOO_LONG       = 1
   OTHERS              = 2.
endform.                    " F_get_file

form F_move_data .

data : lv_index type i.
field-symbols &amp;lt;fs&amp;gt;.

* Sorting the internal table
sort it_excel by row col.
clear it_excel.

loop at it_excel.
  move it_excel-col to lv_index.
* Assigning each record to the internal table row.
  assign component lv_index of structure wa to &amp;lt;fs&amp;gt;.

* Assigning the field value to a field symbol
  move it_excel-value to &amp;lt;fs&amp;gt;.

  at end of row.
  append wa to t_matvclass.
  clear wa.
  endat.
endloop.
endform.                    " F_move_data

form F_get_data .

loop at t_matvclass into wa.
try.

* BAPIHEAD --- &amp;gt; Header Segment with Control Information
bapi_head-material = wa-material.
bapi_head-ind_sector = wa-ind_sec.
bapi_head-matl_type = wa-mat_typ.
bapi_head-account_view = 'X'.


* For Valuation Class.
bapi_valclass-val_area = p_valare.
bapi_valclass-val_class = wa-val_class.

bapi_valclassx-val_area = p_valare.
bapi_valclassx-std_price = 'X'.

catch CX_SY_CONVERSION_ERROR into lv_converr.
   txt_converr = lv_converr-&amp;gt;get_text( ).
   txt_converr_l = lv_converr-&amp;gt;get_longtext( ).
   write:/ 'Error:', txt_converr color 5.
   write:/ 'Error:', txt_converr_l color 3.
endtry.

perform F_call_bapi.

read table it_ret with key type = 'S'.    " Success
if sy-subrc eq 0.
  perform F_bapi_commit.
  write:/10 'Valuation Class created or updated successfully' color 4.
else.
*loop at it_ret.
  write:/1 it_ret-type,
         8 it_ret-id,
         30 it_ret-number,
         38 it_ret-message,
         190 it_ret-parameter,
         210 it_ret-row,
         220 it_ret-field.
*endloop.
endif.
endloop.
endform.                    " F_get_data

form F_bapi_commit.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =
.
endform.                    " F_bapi_commit

form F_call_bapi .

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
  EXPORTING
    headdata                  = bapi_head
   VALUATIONDATA              = bapi_valclass
   VALUATIONDATAX             = bapi_valclassx
 IMPORTING
   RETURN                     = it_ret
 TABLES
   RETURNMESSAGES        =  returnm.
endform.                    " F_call_bapi
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me out SDNers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ranjith N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2009 12:08:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051993#M1174341</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-06T12:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading valuation class using BAPI_MATERIAL_SAVEDATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051994#M1174342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;VALUATIONDATA-VAL_CLASS = '*'.  " fill this field
VALUATIONDATAX-VAL_CLASS = 'X'.


MATERIALDESCRIPTION-LANGU = '*'.                "language of text
MATERIALDESCRIPTION-MATL_DESC = '*'. "material description&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of asterisks pass necessary values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2009 05:08:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051994#M1174342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-08T05:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading valuation class using BAPI_MATERIAL_SAVEDATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051995#M1174343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My excel file as 25 records out of 13 are created and for remaining I ma getting the following 2 errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) The field MBEW-BKLAS/BAPI_MBEW-VAL_CLASS is defined as a required field, it doesnt contain an entry&lt;/P&gt;&lt;P&gt;2) The field MARA-MEINS/BAPI_MARA-BASE_UOM(_ISO)  is defined as a required field, it doesnt contain an entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also checked the corresponding BAPI&lt;/P&gt;&lt;P&gt;BAPI_MBEW it doesn't contain BASE_UOM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And for the valuation class do we need to pass client data for material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ranjith N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2009 06:03:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051995#M1174343</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-08T06:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading valuation class using BAPI_MATERIAL_SAVEDATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051996#M1174344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;BASE_UOM&lt;/STRONG&gt; is field of &lt;STRONG&gt;CLIENTDATA&lt;/STRONG&gt; structure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2009 06:27:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051996#M1174344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-08T06:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading valuation class using BAPI_MATERIAL_SAVEDATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051997#M1174345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am uploading valuation data.&lt;/P&gt;&lt;P&gt;Eg Val class, std price, moving price&lt;/P&gt;&lt;P&gt;when i execute the program it gives me an error &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E curreny initial, currency amount 110.0000 in moving price was transfered without a currency.&lt;/P&gt;&lt;P&gt;E curreny initial, currency amount 450.0000 in std price was transfered without a currency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ranjith N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 09:35:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051997#M1174345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T09:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading valuation class using BAPI_MATERIAL_SAVEDATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051998#M1174346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where do i maintain the currency eg INR into BAPI_MATERIAL_SAVEDATA..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ranjith N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 09:46:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051998#M1174346</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T09:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading valuation class using BAPI_MATERIAL_SAVEDATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051999#M1174347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must fill these importing parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VALUATIONDATA-VAL_AREA,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VALUATIONDATAX-VAL_AREA&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 10:23:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5051999#M1174347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T10:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading valuation class using BAPI_MATERIAL_SAVEDATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5052000#M1174348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tats wat i did thanks for your reply.&lt;/P&gt;&lt;P&gt;nw its working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 10:50:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5052000#M1174348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T10:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading valuation class using BAPI_MATERIAL_SAVEDATA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5052001#M1174349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;answered&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2009 12:20:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-valuation-class-using-bapi-material-savedata/m-p/5052001#M1174349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-30T12:20:43Z</dc:date>
    </item>
  </channel>
</rss>

