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

Update makt table description using fm

hassimkhan
Explorer
0 Likes
3,459

Hello expert,

I want to update material description (MAKTX) into table makt. i have all the updated data in an internal table gt_bapi of structure:

MATNR
SPRAS
MAKTX

I've search and found out this bapi function module.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
    
EXPORTING
       headdata                  
= ???
*    IMPORTING
*      RETURN                     =
   TABLES
      MATERIALDESCRIPTION        = ????

.



Can anyone tell me how to use this fm? what need to be passed in headdata & materialdescription?

2 REPLIES 2
Read only

Former Member
0 Likes
1,776

Hi Hassim, you can use as below:

LS_HEADDATA-MATERIAL    = 'matnr'.

LS_HEADDATA-BASIC_VIEW  = 'X'.

LS_MATDESC-LANGU = 'spras'.

LS_MATDESC-MATL_DESC = 'maktx'.

APPEND LS_MATDESC TO LT_MATDESC.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

  EXPORTING

    HEADDATA                   = LS_HEADDATA

  IMPORTING

    RETURN                     = LS_RETURN

  TABLES

    MATERIALDESCRIPTION        = LT_MATDESC

    RETURNMESSAGES             = LT_RETURNMESSAGES.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

Regards,

Felipe

Read only

sivaganesh_krishnan
Contributor
0 Likes
1,776

Hi,

just pass the header data such as the material name and X in basic view

In material description table , do pass the language and new description. and try executing .

Regards,

Sivaganesh