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 = CORRESPONDING #( lt_sourcelist ).
    ASSIGN lt_update[ 1 ] TO FIELD-SYMBOL(<ls_adapt>).
    <ls_adapt>-%data-SupplierIsFixed = 'X'.
    <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 step' ).
    ENDIF.


=== Orderbuch löschen ===
=== Orderbuch löschen ===

Version vom 7. Dezember 2024, 11:55 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 = CORRESPONDING #( lt_sourcelist ).

   ASSIGN lt_update[ 1 ] TO FIELD-SYMBOL(<ls_adapt>).
    <ls_adapt>-%data-SupplierIsFixed = 'X'.
    <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 step' ).
   ENDIF.

Orderbuch löschen