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

BAPI_MATERIAL_SAVEDATA BAPIMATHEAD Query

ankeshjindal
Participant
0 Likes
1,043

Hi ,

Functional team has added one field in Plant/Stock View of Material Master and extended that field in MARC. My requirement is to update this field.

For this I have extended BAPI_TE_MARC & BAPI_TE_MARCX and I am using BAPI_MATERIAL_SAVEDATA for updating the data.

My query is

If you check BAPIMATHEAD Structure below, it does not have Plant/Stock View.

In SPRO, Logistic-General--> Material Master --> Field Selection --> Assign field to field selection group, Functional team has maintained 'X' that is for Plant/Stock View but in structure above there is no Plant/Stock View, So how I will save data which exist in this view.

Code which I am using to update this this field is:-


    WA_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MARC'.

     WA_EXTENSIONIN-VALUEPART1+0(4) = WA_DCS-WERKS.

     WA_EXTENSIONIN-VALUEPART1+4(8) = WA_DCS-ZZDCBNR.

     APPEND WA_EXTENSIONIN TO IT_EXTENSIONIN.

     WA_EXTENSIONINX-STRUCTURE = 'BAPI_TE_MARCX'.

     WA_EXTENSIONINX-VALUEPART1+0(4) = WA_DCS-WERKS.

     WA_EXTENSIONINX-VALUEPART1+4(1) = 'X'.

     APPEND WA_EXTENSIONINX TO IT_EXTENSIONINX.

     WA_PLANTDATA-PLANT = WA_DCS-WERKS.

     WA_PLANTDATAX-PLANT = WA_DCS-WERKS.

     WA_HEADDATA-MATERIAL = WA_DCS-MATNR.

     WA_HEADDATA-PURCHASE_VIEW = 'X'. " Here Plant/Stock View should come but in Headdata it is not present

     CLEAR : WA_RETURN, WA_RETURN1, GV_STRING, GV_STRING1.

     CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

       EXPORTING

         HEADDATA     = WA_HEADDATA

       IMPORTING

         RETURN       = WA_RETURN

       TABLES

         EXTENSIONIN  = IT_EXTENSIONIN

         EXTENSIONINX = IT_EXTENSIONINX.

Please Suggest.

Rgds,

Ankesh

1 REPLY 1
Read only

arivazhagan_sivasamy
Active Contributor
0 Likes
721

Hi,

What are you gettig in WA_RETURN.

Debug the program and find the value of WA_RETURN.

Also get the

   TABLES
      returnmessages       = it_return.

Arivazhagan S