Page tree
Skip to end of metadata
Go to start of metadata

Additional attributes for the attributes exchange / attribute transfer from SAP (attributes_from_sap.xml) can be realized via a BAdI-Implementation.


BAdI: /DSCSAG/ENH_DOC


Method: DOC_GET_ATTRIBS_AFTER

Simple example 1 for the BAdI-Implementation

DATA: ls_attribute TYPE /dscsag/doc_customer_attribs,
      lf_zusatz TYPE mara-zzusatz.
CLEAR ls_attribute.
SELECT zzusatz FROM mara
 INTO lf_zusatz
 WHERE matnr = material.
 
ls_attribute-name = 'MARA-ZZUSATZ'.
MOVE lf_zusatz TO ls_attribute-value.
APPEND ls_attribute TO ct_customerattributes.

 

Simple example 2 for the BAdI-Implementation

  DATA ls_cust_attr            TYPE /dscsag/doc_customer_attribs.
  FIELD-SYMBOLS: <ls_expression> TYPE /dscsag/doc_customer_attribs.

  IF is_documentkey-documenttype EQ 'NXM'.

    READ TABLE ct_expressions ASSIGNING <ls_expression> WITH KEY name = 'GEWICHT'.
    IF sy-uname EQ 0.
      CLEAR ls_cust_attr.
      ls_cust_attr-name   = 'TB_WEIGHT'.
      ls_cust_attr-value  = <ls_expression>-value.
      APPEND ls_cust_attr TO ct_customerattributes.
    ENDIF.

  ENDIF.