Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

material creation without user intervention

Former Member
0 Likes
383

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.

2 REPLIES 2
Read only

maximilian_schaufler
Active Contributor
0 Likes
356

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.

Read only

Former Member
0 Likes
356

Try filling the field MATL_DESC of the table MATERIALDESCRIPTION.

hope it helps u!