‎2005 Apr 28 4:27 AM
i have to create a material without user intervention. i am using BAPI_MATERIAL_SAVEDATA for this. it is not showing any error. but the return is having the message 'No description found'. how to transfer the description to this bapi.
this is the code i am trying:
DATA: mnum like zmara01-mno,
mat_data like BAPIMATHEAD,
plantx_data like BAPI_MARCX,
salesx_data like BAPI_MVKEX,
sale_data like bapi_mvke,
plant_data like bapi_marc,
mate_data like bapi_makt,
E1BP_MAKT like E1BP_MAKT,
cli_data like bapi_mara.
DATA: E_RETURN LIKE BAPIRET2.
data: MATERIALDESCRIPTION like BAPI_MAKT
occurs 0 with header line.
*data: m(18) type c.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
NR_RANGE_NR = '01'
OBJECT = 'ZMNUMBER'
QUANTITY = '1'
IMPORTING
NUMBER = mnum.
message i003(zmsg) with mnum.
mat_data-material = mnum.
mat_data-ind_sector = 'I'.
mat_data-matl_type = 'DIEN'.
mat_data-basic_view = 'X'.
cli_data-base_uom = 'EA'.
cli_data-base_uom_iso = 'X'.
sale_data-sales_org = 'EISO'.
sale_data-distr_chan = 'SR'.
salesx_data-sales_org = 'EISO'.
salesx_data-distr_chan = 'SR'.
plant_data-plant = 'EIHO'.
plantx_data-plant = 'EIHO'.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = mat_data
CLIENTDATA = cli_data
CLIENTDATAX =
PLANTDATA = plant_data
PLANTDATAX = plantx_data
FORECASTPARAMETERS =
FORECASTPARAMETERSX =
PLANNINGDATA =
PLANNINGDATAX =
STORAGELOCATIONDATA =
STORAGELOCATIONDATAX =
VALUATIONDATA =
VALUATIONDATAX =
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA = sale_data
SALESDATAX = salesx_data
STORAGETYPEDATA =
STORAGETYPEDATAX =
FLAG_ONLINE = ' '
FLAG_CAD_CALL = ' '
NO_DEQUEUE = ' '
IMPORTING
RETURN = E_RETURN
TABLES
MATERIALDESCRIPTION = MATERIALDESCRIPTION
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
.
loop at materialdescription.
message I004(I) with materialdescription-matl_desc.
endloop .
MESSAGE I004(I) WITH E_RETURN-TYPE.
if sy-subrc = 0.
message i005(zmsg).
elseif sy-subrc <> 0.
message e006(zmsg).
endif.
i am trying to give direct entries to test it . please help in this issue immediately.
‎2005 Apr 28 7:02 AM
Hello,
please do not double post questions. Also don't use phrases like "help immediately" or "urgent", they will not make you get answers faster, it only annoys users that are maybe willing to help.
Do as Roberto Negro told you in your other thread - go look for a forum that is more appropriate, this forum here deals with suggestions for SDN itself, not any specific problems anyone has.
‎2007 May 23 7:20 PM
Try filling the field MATL_DESC of the table MATERIALDESCRIPTION.
hope it helps u!