adesso business consulting Stellenangebote
Software Engineer Trainee · Senior
| (Senior) Cloud Software Engineer BTP | Senior Frontend Software Engineer SAP BTP
| (Senior) Consultant Technologie
Werkstudent Softwareentwicklung · Consulting
I PURCHASEREQUISITIONTP: Unterschied zwischen den Versionen
Aus SAP Wiki ツ
Die Seite wurde neu angelegt: „Kategorie:Behavior Definitionen und Implementierungen === Bestellanforderung anlegen === <syntaxhighlight line copy> </syntaxhighlight> === Bestellanforderung lesen === <syntaxhighlight line copy> </syntaxhighlight> === Bestellanforderung ändern === <syntaxhighlight line copy> </syntaxhighlight> === Bestellanforderungsposition als gelöscht markieren === <syntaxhighlight line copy> DATA lt_delete TYPE TABLE FOR UPDATE I_PurchaseRequisitionTP\…“ |
(kein Unterschied)
|
Version vom 4. Juni 2025, 10:17 Uhr
Bestellanforderung anlegen
Bestellanforderung lesen
Bestellanforderung ändern
Bestellanforderungsposition als gelöscht markieren
DATA lt_delete TYPE TABLE FOR UPDATE I_PurchaseRequisitionTP\\PurchaseRequisitionItem.
lt_delete = CORRESPONDING #( keys ).
LOOP AT lt_delete ASSIGNING FIELD-SYMBOL(<ls_delete>).
<ls_delete>-IsDeleted = abap_true.
<ls_delete>-%data-IsDeleted = abap_true.
<ls_delete>-%control-IsDeleted = if_abap_behv=>mk-on.
ENDLOOP.
MODIFY ENTITIES OF i_purchaserequisitiontp
ENTITY PurchaseRequisitionItem UPDATE FROM lt_delete
MAPPED DATA(ls_mapped) REPORTED DATA(ls_reported) FAILED DATA(ls_failed).
IF ls_failed IS INITIAL.
APPEND VALUE #( %msg = new_message( id = ycl_p2p_prmonitor_constants=>cv_message_class
number = '049'
severity = if_abap_behv_message=>severity-success ) )
TO reported-prmonitor.
ELSE.
IF ls_reported-PurchaseRequisitionItem IS NOT INITIAL.
APPEND VALUE #( %msg = new_message_with_text(
severity = ls_reported-PurchaseRequisition[ 1 ]-%msg->m_severity
text = ls_reported-PurchaseRequisition[ 1 ]-%msg->if_message~get_text( ) ) )
TO reported-prmonitor.
ENDIF.
IF ls_reported-PurchaseRequisitionItem IS NOT INITIAL.
LOOP AT ls_reported-PurchaseRequisitionItem ASSIGNING FIELD-SYMBOL(<ls_rep_po_item>).
APPEND VALUE #(
%msg = new_message_with_text(
severity = ls_reported-PurchaseRequisitionItem[ sy-tabix ]-%msg->m_severity
text = ls_reported-PurchaseRequisitionItem[ sy-tabix ]-%msg->if_message~get_text( ) ) )
TO reported-prmonitor.
ENDLOOP.
ENDIF.
APPEND VALUE #( PurchaseRequisition = keys[ 1 ]-PurchaseRequisition
PurchaseRequisitionItem = keys[ 1 ]-PurchaseRequisitionItem )
TO failed-prmonitor.
ENDIF.
LOOP AT keys ASSIGNING FIELD-SYMBOL(<ls_keys>).
APPEND VALUE #( "%cid = <ls_keys>-%cid
PurchaseRequisition = <ls_keys>-PurchaseRequisition
PurchaseRequisitionItem = <ls_keys>-PurchaseRequisitionItem ) TO mapped-prmonitor.
ENDLOOP.
Bestellanforderungsposition Löschkennzeichen zurücknehmen
DATA lt_undo TYPE TABLE FOR UPDATE I_PurchaseRequisitionTP\\PurchaseRequisitionItem.
lt_undo = CORRESPONDING #( keys ).
LOOP AT lt_undo ASSIGNING FIELD-SYMBOL(<ls_undo>).
<ls_undo>-IsDeleted = abap_false.
<ls_undo>-%data-IsDeleted = abap_false.
<ls_undo>-%control-IsDeleted = if_abap_behv=>mk-on.
ENDLOOP.
MODIFY ENTITIES OF i_purchaserequisitiontp
ENTITY PurchaseRequisitionItem UPDATE FROM lt_undo
MAPPED DATA(ls_mapped) REPORTED DATA(ls_reported) FAILED DATA(ls_failed).
IF ls_failed IS INITIAL.
APPEND VALUE #( %msg = new_message( id = ycl_p2p_prmonitor_constants=>cv_message_class
number = '044'
severity = if_abap_behv_message=>severity-success ) )
TO reported-prmonitor.
ELSE.
IF ls_reported-PurchaseRequisitionItem IS NOT INITIAL.
APPEND VALUE #( %msg = new_message_with_text(
severity = ls_reported-PurchaseRequisition[ 1 ]-%msg->m_severity
text = ls_reported-PurchaseRequisition[ 1 ]-%msg->if_message~get_text( ) ) )
TO reported-prmonitor.
ENDIF.
IF ls_reported-PurchaseRequisitionItem IS NOT INITIAL.
" TODO: variable is assigned but never used (ABAP cleaner)
LOOP AT ls_reported-PurchaseRequisitionItem ASSIGNING FIELD-SYMBOL(<ls_rep_po_item>).
APPEND VALUE #(
%msg = new_message_with_text(
severity = ls_reported-PurchaseRequisitionItem[ sy-tabix ]-%msg->m_severity
text = ls_reported-PurchaseRequisitionItem[ sy-tabix ]-%msg->if_message~get_text( ) ) )
TO reported-prmonitor.
ENDLOOP.
ENDIF.
APPEND VALUE #( PurchaseRequisition = keys[ 1 ]-PurchaseRequisition
PurchaseRequisitionItem = keys[ 1 ]-PurchaseRequisitionItem )
TO failed-prmonitor.
ENDIF.
LOOP AT keys ASSIGNING FIELD-SYMBOL(<ls_keys>).
APPEND VALUE #( %cid = <ls_keys>-%cid
PurchaseRequisition = <ls_keys>-PurchaseRequisition
PurchaseRequisitionItem = <ls_keys>-PurchaseRequisitionItem ) TO mapped-prmonitor.
ENDLOOP.