Skip to Content
avatar image
Former Member

Use of BAPI_MATERIAL_SAVEDATA without modifiing BAPI_TE_MARA possible?

Hi,

i will use BAPI: BAPI_MATERIAL_SAVEDATA to update own fields in MARA (append-fields).

As i have read i have to modify structures BAPI_TE_MARA and BAPI_TE_MARAX.

Is there a way to do this without modifiing?

Regards, Dieter

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 21, 2010 at 03:07 PM

    You can populate Customer Defined Fields only via extension parameters .

    For example in MARC

    TYPES  BEGIN OF type_extin.
              INCLUDE STRUCTURE bapiparex.
      TYPES  END OF type_extin.
    
      TYPES  BEGIN OF type_extinx.
              INCLUDE STRUCTURE bapiparexx.
      TYPES  END OF type_extinx.
    
      DATA: la_bapi_head   LIKE bapimathead,
            la_bapi_return LIKE bapiret2,
            la_extin TYPE type_extin,
            la_extinx TYPE type_extinx.
    
      DATA : i_extin  TYPE STANDARD TABLE OF type_extin,
             i_extinx TYPE STANDARD TABLE OF type_extinx.
    
      CLEAR:la_bapi_head,
            la_extin,
            la_extinx,
            i_extin[],
            i_extinx[].
    
      la_extin-structure  = 'BAPI_TE_MARC'.
      la_extinx-structure = 'BAPI_TE_MARCX'.
    
      la_extin-valuepart1+0(4) = <fs_upload>-werks.
      la_extinx-valuepart1+0(4) = <fs_upload>-werks.
      la_extinx-valuepart1+13(1) = abap_true.
    
    
      IF <fs_upload>-on_off  = abap_off. "Switch Off
        la_extin-valuepart1+41(1) = abap_off.
      ELSEIF <fs_upload>-on_off  = abap_on. "Switch On
        la_extin-valuepart1+41(1) = abap_on.
      ENDIF.
    
      APPEND la_extin  TO i_extin.
      APPEND la_extinx TO i_extinx.
    
      la_bapi_head-mrp_view     = abap_true.
      la_bapi_head-material     = <fs_upload>-matnr.
    
    
      CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
          headdata       = la_bapi_head
          flag_online    = p_simu
          flag_cad_call  = p_simu
        IMPORTING
          return         = pc_return
        TABLES
          extensionin    = i_extin[]
          extensioninx   = i_extinx[]
          returnmessages = pt_return[].
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 21, 2010 at 04:58 PM

    NO Dieter, I dont think there is any other way, you have to modify the structures BAPI_TE_MARA and BAPI_TE_MARAX.

    Add comment
    10|10000 characters needed characters exceeded