Skip to Content

BAPI_MATERIAL_SAVEDATA BAPIMATHEAD Query

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

BAPIMATHEAD.jpg (181.4 kB)
SPRO.jpg (50.8 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Aug 20, 2015 at 04:27 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.