Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

No description transfered for material... using BAPI_MATERIAL_SAVEREPLICA Background

$
0
0

Hello guys,

 

I have a little issue with this BAPI. I get the error "no description transferred for material' when I process multiple records at the same time or when I run the program in the background with multiple (1500) records to create or change materials. Now the strange part is when I run this program for the each of the material that generates this error one by one (single record), the program process the record and creates the material with the description as well. But these particular materials when run in batch, multiple records and background errors out with the above message.

 

This is a part of the code for this program:

 

DATA: BEGIN OF it_makt OCCURS 100.
   INCLUDE STRUCTURE bapie1makt.
DATA: END OF it_makt.


  * Material Description
CLEAR it_makt.
REFRESH it_makt.
LOOP AT it_desc INTO wa_desc WHERE artnr = it_data1-artnr.
IF sy-subrc = 0.
it_makt-function = 'INS'.
it_makt-material = wa_desc-artnr.
it_makt-langu = wa_desc-lang.
it_makt-langu_iso = wa_desc-lang.
it_makt-matl_desc = wa_desc-bez.
APPEND it_makt.
ENDIF.
CLEAR: wa_desc.
ENDLOOP.


  CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA'
  EXPORTING
    noappllog                  = 'X'
    nochangedoc                = 'X'
    testrun                    = ' '
    inpfldcheck                = ' '
    flag_cad_call              = ' '
    no_rollback_work           = ' '
    flag_online                = ' '
   IMPORTING
     return                     = bapi_return
   TABLES
     headdata                   = bapi_head
     clientdata                 = bapi_mara1
     clientdatax                = bapi_marax
     plantdata                  = bapi_marc1
     plantdatax                 = bapi_marcx
*   FORECASTPARAMETERS         =
*   FORECASTPARAMETERSX        =
*   PLANNINGDATA               =
*   PLANNINGDATAX              =
     storagelocationdata        = bapi_mard
     storagelocationdatax       = bapi_mardx
     valuationdata              = bapi_mbew1
     valuationdatax             = bapi_mbewx
*   WAREHOUSENUMBERDATA        =
*   WAREHOUSENUMBERDATAX       =
     salesdata                  = bapi_mvke
     salesdatax                 = bapi_mvkex
*   STORAGETYPEDATA            =
*   STORAGETYPEDATAX           =
     materialdescription        = it_makt
     unitsofmeasure             = it_unitofmeas
     unitsofmeasurex            = it_unitofmeasx
     internationalartnos        = it_intartnum
*   MATERIALLONGTEXT           =
     taxclassifications         = it_mlan
*   PRTDATA                    =
*   PRTDATAX                   =
*   EXTENSIONIN                =
*   EXTENSIONINX               =
*   FORECASTVALUES             =
*   UNPLNDCONSUMPTION          =
*   TOTALCONSUMPTION           =
*   RETURNMESSAGES             =
           .

  IF bapi_return-type = 'E'.

WRITE:/ 'Error:' ,bapi_return-message ,'for material:' ,it_data1-artnr ,'in plant' ,it_data1-werks.
ELSEIF bapi_return-type = 'S'.

   PERFORM bapi_commit.

WRITE: 'Successfully created material' ,it_data1-artnr ,'in plant' ,it_data1-werks.
  MOVE-CORRESPONDING it_data1 TO wa_data2.
  APPEND wa_data2 TO it_data2.
ENDIF.

CLEAR it_data1.
ENDLOOP.



I don't know what else to do especially since this works for processing each of the record but doesn't work when I have multiple record or run it in background mode.


Viewing all articles
Browse latest Browse all 3184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>