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)
Keine Bearbeitungszusammenfassung
Zeile 22: Zeile 22:
=== Orderbuch ändern ===
=== Orderbuch ändern ===
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>).
    <ls_adapt>-%data-SupplierIsFixed = 'X'.
<ls_adapt>-%data-SupplierIsFixed = 'X'.
    <ls_adapt>-%control-SupplierIsFixed = if_abap_behv=>mk-on.
<ls_adapt>-%control-SupplierIsFixed = if_abap_behv=>mk-on.


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


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


=== Orderbuch löschen ===
=== Orderbuch löschen ===
=== All in One ===

Version vom 7. Dezember 2024, 11:57 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' ).
 ENDIF.

Orderbuch löschen

All in One