on 04-27-2005 1:28 PM
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.
Hi dear,
welcome on board!
If you want an answer immediately I think you have to post your question in a more appropriate forum...
take a look to https://www.sdn.sap.com/sdn/collaboration.sdn and choose one of the available forums !
Good luck!
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.