Ansicht
Dokumentation

MMPUR_PO_STD_ITEM_TE - Gesendeten Standardtext für Bestellausgabeposition ermitteln

MMPUR_PO_STD_ITEM_TE - Gesendeten Standardtext für Bestellausgabeposition ermitteln

TXBHW - Original Tax Base Amount in Local Currency   rdisp/max_wprun_time - Maximum work process run time  
Diese Dokumentation steht unter dem Copyright der SAP AG.
SAP E-Book

Der in einer Ausgabe der Bestellposition verwendete Standardtext wird direkt aus der Bestellung übernommen. Mit diesem BAdI ändern Sie den Standard-Bestellpositionstext, der in der Bestellausgabe verwendet wird.

Parameter

Importparameter:

PURCHASE_ORDER_NO: Dieser Parameter enthält die Bestellnummer.

ITEM_TEXT_DETAILS: Dieser Parameter enthält den Standard-Bestellpositionstext.

Änderungsparameter:

ITEM_TEXT_DETAILS_ENH: Mit diesem Parameter ändern Sie den Standard-Bestellpositionstext, der in der Bestellausgabe verwendet wird.

  METHOD if_mmpur_po_std_item_text~enrich_po_std_item_text.
* IMPORTING PURCHASE_ORDER_NO            Purchase Order Number
*           ITEM_TEXT_DETAILS            Text ID Fetched Based on SSCUIfor Text Object
*  CHANGING ITEM_TEXT_DETAILS_ENH        Modified Text IDs for Text Object

*Item Category: 0 -Standard, 2 -Consignment, 3 -Subcontracting, A  -Enhanced Limit,5 -Third-party

    DATA(lt_item_text_detail) = item_text_details.
    DATA(lt_item_text_detail_enh) = item_text_details_enh.
    DATA : ls_item_text_detail_enh LIKE LINE OF lt_item_text_detail_enh.

* Moving input table item text to output table item text
    LOOP AT lt_item_text_detail INTO DATA(ls_item_txt_det).
      CLEAR ls_item_text_detail_enh.
      MOVE-CORRESPONDING ls_item_txt_det TO ls_item_text_detail_enh.
      ls_item_text_detail_enh-purchaseorderitemcategory = ls_item_txt_det-purchasingdocumentitemcategory.
      APPEND ls_item_text_detail_enh TO lt_item_text_detail_enh.
    ENDLOOP.

    SORT lt_item_text_detail_enh BY purchaseorderitem
                                    purchaseorderitemcategory
                                    textobjecttype
                                    textobjectkey.

*Use Select Statements to read data from CDS Views i_purchaseorderapi01and i_purchaseorderitemapi01
    IF mo_po_data IS INITIAL.
      mo_po_data = NEW lcl_po_detail( ).
    ENDIF.
*Get Purchase Order and Supplier details
    mo_po_data->get_po_data( EXPORTING iv_purchase_order      = purchase_order_no
                             IMPORTING es_purchase_order_data = DATA(ls_purchase_order_details)
                                       et_purchase_order_item_data = DATA(lt_item_detail) ).


*deleting the enhanced limit items - "A is internal format for limit item
    DELETE lt_item_detail WHERE purchaseorderitemcategory = 'A'.

* Loop through the items to add or delete standard text
    LOOP AT lt_item_detail INTO DATA(ls_item_detail).
* Checking company code '1001'
        IF ls_item_detail-companycode = 'C100'.
* For material 1 adding a new text for other items no change
          IF ls_item_detail-material = 'Material1'.
            APPEND VALUE #( purchaseorderitem              = ls_item_detail-purchaseorderitem
                            purchaseorderitemcategory      = ls_item_detail-purchaseorderitemcategory
                            textobjecttype                 = 'MF03'
                            purgtextprintsequencevalue     = '99'
                            purgtextprintpriorityvalue     = '1'
                            textobjectkey                  = 'ZMM_PUR_PO_STD_TEXT_PG_001'
                            purgtexttitleisprinted         = abap_true ) TO lt_item_text_detail_enh.
          ENDIF.
        ELSE.
* For material6 deleting the standard text that was read with SSCUI
          IF ls_item_detail-material = 'Material6'.
            DELETE lt_item_text_detail_enh WHERE purchaseorderitem  = ls_item_detail-purchaseorderitem AND
                                                 textobjecttype  = 'MF01' AND
                                                 textobjectkey  = 'ZTEST_RJ_STD_INSTRUCTION_SUPPLIER'.
          ENDIF.
        ENDIF.

    ENDLOOP.

* Moving the entries to changing parameter
    item_text_details_enh = lt_item_text_detail_enh.

  ENDMETHOD.






ROGBILLS - Synchronize billing plans   Addresses (Business Address Services)  
Diese Dokumentation steht unter dem Copyright der SAP AG.

Length: 8071 Date: 20240520 Time: 212235     sap01-206 ( 50 ms )