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

To add write statement in BAPI_MATERIALSAVEDATA

Former Member
0 Likes
726

Hello Experts,

i m using BAPI_MATERIALSAVEDATA for MM02 T.code.

After execution of BAPI,it displays the default message that the material 30006578 has been created or extended.

I want to change this default message produced by BAPI_MATERIAL_SAVEDATA.

Can anybody help regarding this.

Ravi

1 ACCEPTED SOLUTION
Read only

mahaboob_pathan
Contributor
0 Likes
662

hi,

do like this but was not sure whether we can change it.

LOOP AT it_return INTO wa_return WHERE type EQ 'E'.

v_error_desc = wa_return-message.

over lay v_error_desc with u r own message and

now display u r message.

ENDLOOP.

Hello Experts,

i m using BAPI_MATERIALSAVEDATA for MM02 T.code.

After execution of BAPI,it displays the default message that the material 30006578 has been created or extended.

I want to change this default message produced by BAPI_MATERIAL_SAVEDATA.

Can anybody help regarding this.

Ravi

5 REPLIES 5
Read only

Former Member
0 Likes
662

Hello,

It means you want to dispaly that message in the output ie In the Report.

We cannot change the standard message but 1 thing is that we can BAPI_MATERIAL_SAVEDATA is copied to Z or YBAPI_MATERIAL_SAVEDATA and check message from where it is generating then in that place comment the standard message write your own message.

Read only

0 Likes
662

Hello all,

PLz help how to proceed.

Ravi

Read only

former_member206439
Contributor
0 Likes
662

Hi

If you want to customise the standard BAPI you need to copy it to ZBapi and change the message accordingly.

Read only

mahaboob_pathan
Contributor
0 Likes
663

hi,

do like this but was not sure whether we can change it.

LOOP AT it_return INTO wa_return WHERE type EQ 'E'.

v_error_desc = wa_return-message.

over lay v_error_desc with u r own message and

now display u r message.

ENDLOOP.

Read only

0 Likes
662

what is the problem exactly, you can put anything in the write statement you want. your are not forced to use tha bapi message ??



      CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
          headdata                   = h_headdata
          clientdata                 = h_bapi_mara
          clientdatax                = h_bapi_marax
          plantdata                  = h_bapi_marc
          plantdatax                 = h_bapi_marcx
*   FORECASTPARAMETERS         =
*   FORECASTPARAMETERSX        =
*   PLANNINGDATA               =
*   PLANNINGDATAX              =
          storagelocationdata        = h_bapi_mard
          storagelocationdatax       = h_bapi_mardx
          valuationdata              = h_bapi_mbew
          valuationdatax             = h_bapi_mbewx
*   WAREHOUSENUMBERDATA        =
*   WAREHOUSENUMBERDATAX       =
         salesdata                  = h_bapi_mvke
         salesdatax                 = h_bapi_mvkx
*   STORAGETYPEDATA            =
*   STORAGETYPEDATAX           =
*   FLAG_ONLINE                = ' '
*   FLAG_CAD_CALL              = ' '
*   NO_DEQUEUE                 = ' '
       IMPORTING
         return                     = wa_return
       TABLES
         materialdescription        = ta_bapi_makt
*   UNITSOFMEASURE             =
*   UNITSOFMEASUREX            =
*   INTERNATIONALARTNOS        =
*   MATERIALLONGTEXT           =
          taxclassifications         = ta_bapi_mlan
*   RETURNMESSAGES             =
*   PRTDATA                    =
*   PRTDATAX                   =
*   EXTENSIONIN                =
*   EXTENSIONINX               =
                .


      WRITE wa_return-message.

this is my code, here I use the bapi message but you can also write


concatenate 'hello this material' h_headdata-material 'is now created with my own message' into youremessage seperated by space.
write youremessage.

kind regards

arthur de smidt