adesso orange🍊Stellenangebote:
Software Engineer Trainee · Senior | (Senior) Cloud Software Engineer BTP
(Senior) Consultant Technologie
Werkstudent Softwareentwicklung · Fiori / UI5 · Consulting

R PURCHASINGSOURCELISTTP: Unterschied zwischen den Versionen

Aus SAP Wiki ツ
M1ch3lde (Diskussion | Beiträge)
M1ch3lde (Diskussion | Beiträge)
Zeile 21: Zeile 21:


=== Orderbuch ändern ===
=== Orderbuch ändern ===
lt_update    TYPE TABLE FOR UPDATE r_purchasingsourcelistitemtp.
  lt_update = CORRESPONDING #( lt_sourcelist ).
  lt_update = CORRESPONDING #( lt_sourcelist ).
  ASSIGN lt_update[ 1 ] TO FIELD-SYMBOL(<ls_adapt>).
  ASSIGN lt_update[ 1 ] TO FIELD-SYMBOL(<ls_adapt>).

Version vom 7. Dezember 2024, 12:00 Uhr

Orderbuch erstellen

Orderbuch lesen

 DATA lt_selection TYPE TABLE FOR READ IMPORT r_purchasingsourcelistitemtp.
 
 lt_selection = VALUE #( ( sourcelistrecord = 00001
                           material = '000000000000000001'
                           plant    = '1990' ) ).

 READ ENTITIES OF r_purchasingsourcelisttp 
  ENTITY purchasingsourceitem
   ALL FIELDS WITH lt_selection
    RESULT DATA(lt_sourcelist)
    FAILED DATA(ls_failed)
    REPORTED DATA(ls_reported).

Orderbuch ändern

lt_update    TYPE TABLE FOR UPDATE r_purchasingsourcelistitemtp.

lt_update = CORRESPONDING #( lt_sourcelist ).
ASSIGN lt_update[ 1 ] TO FIELD-SYMBOL(<ls_adapt>).
<ls_adapt>-%data-SupplierIsFixed = abap_true.
<ls_adapt>-%control-SupplierIsFixed = if_abap_behv=>mk-on.

MODIFY ENTITIES OF r_purchasingsourcelisttp 
 ENTITY purchasingsourceitem
  UPDATE FROM lt_update
   FAILED ls_failed
   MAPPED DATA(ls_mapped)
   REPORTED ls_reported.

IF ls_failed-purchasingsourceitem IS INITIAL.
 COMMIT ENTITIES.
 IF sy-subrc = 0.
  out->write( 'Updated' ).
 ELSE.
  out->write( 'Failed Commmit' ).
 ENDIF.
 ELSE.
  out->write( 'Failed Modify' ).
 ENDIF.

Orderbuch löschen

All in One