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 and MM02 for Basic text in Display mode

Former Member
0 Likes
2,259

Hi,

I am using BAPI_MATERIAL_SAVEDATA to save Material Basic text and Sales data text only from a custom developed screen with text editor.. The text is updated correctly, no issues.. However when opened in MM02 the basic data text and sales text whichever are update through the custom program are in display mode. This should be in change mode. Am i missing something??

I am not interested to use create_text, save_text as these doest not gives me a material change logs..

Please throw some light on this..

Thanks.

Hi,

I am using BAPI_MATERIAL_SAVEDATA to save Material Basic text and Sales data text only from a custom developed screen with text editor.. The text is updated correctly, no issues.. However when opened in MM02 the basic data text and sales text whichever are update through the custom program are in display mode. This should be in change mode. Am i missing something??

I am not interested to use create_text, save_text as these doest not gives me a material change logs..

Please throw some light on this..

Thanks.

2 REPLIES 2
Read only

Former Member
0 Likes
1,345

can you let us know the values you are passing in BAPI ?

Read only

0 Likes
1,345

Here is my code. the values passed to BAPI. Text saved good, But showing grayed out in MM02.

CLEAR gs_headdata.
  gs_headdata-material = s_matnr-low.
  gs_headdata-basic_view = 'X'.

  CLEAR: gt_mltx, gv_line.
  REFRESH: gt_mltx.
  gt_mltx-applobject = 'MATERIAL'.
  gt_mltx-text_name = s_matnr-low.
  gt_mltx-text_id = 'GRUN'.
  gt_mltx-langu = 'E'.
  gt_mltx-langu_iso = 'EN'.
  gt_mltx-format_col = '*'.

  IF NOT gt_text_in[] IS INITIAL.
    LOOP AT gt_text_in INTO gv_line.
      CLEAR : gt_mltx-text_line.
      gt_mltx-text_line = gv_line.
      APPEND gt_mltx TO gt_mltx.
    ENDLOOP.
* Start of MK01+  "For deleting whole text
  ELSE.
    gt_mltx-del_flag = 'X'.
    APPEND gt_mltx TO gt_mltx.
  ENDIF.
* End of MK01+
  REFRESH : gt_return1, gt_return. "gt_bapi_matreturn2 .

  CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
       EXPORTING
            headdata         = gs_headdata
       IMPORTING
            return           = gt_return1
       TABLES
            materiallongtext = gt_mltx
            returnmessages   = gt_return. "gt_bapi_matreturn2.

  READ TABLE gt_return WITH KEY type = 'S'.
  IF sy-subrc = 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
         EXPORTING
              wait   = 'X'
         IMPORTING
              return = gt_return.
    gv_chg = 'X'.                                           
  ENDIF.

Thanks.

Edited by: senthil kumar on Mar 2, 2012 4:27 AM