Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ls_poitem-po_item = ls_poste_commande-ebelp.
- ls_poitemx-po_item = ls_poste_commande-ebelp.
- "Modification du prix du poste
- IF NOT ls_poste_commande-netpr IS INITIAL.
- IF ls_poste_commande-netpr LT ls_ekpo-netpr.
- " La modif n'est possible que pour les Hors Catalogue
- " -> Pour déterminer le HC, on va regarder le type d'article d'un poste qui doit etre a ZNCS
- IF ls_ekpo-mtart EQ c_mtart_zncs.
- ls_poitem-net_price = ls_poste_commande-netpr.
- ls_poitemx-net_price = c_abap_true.
- lw_flag_reload_wf = c_abap_true. "Flag de redéclenchement du WF.
- ELSE.
- CLEAR ls_return.
- ls_return-type = 'E'.
- MESSAGE i106(zdgre) INTO ls_return-message WITH ls_poste_commande-ebelp.
- APPEND ls_return TO et_return.
- ENDIF.
- ELSEIF ls_poste_commande-netpr GT ls_ekpo-netpr.
- CLEAR ls_return.
- ls_return-type = 'E'.
- MESSAGE i101(zdgre) INTO ls_return-message WITH ls_poste_commande-ebelp.
- APPEND ls_return TO et_return.
- ELSE.
- "même prix = rien
- ENDIF.
- ENDIF.
- "Modification qté du poste
- IF NOT ls_poste_commande-menge IS INITIAL.
- IF ls_poste_commande-menge LT ls_ekpo-menge.
- ls_poitem-quantity = ls_poste_commande-menge.
- ls_poitemx-quantity = c_abap_true.
- lw_flag_reload_wf = c_abap_true. "Flag de redéclenchement du WF.
- ELSEIF ls_poste_commande-menge GT ls_ekpo-menge.
- CLEAR ls_return.
- ls_return-type = 'E'.
- MESSAGE i104(zdgre) INTO ls_return-message WITH ls_poste_commande-ebelp.
- APPEND ls_return TO et_return.
- ELSE.
- "même qté = rien
- ENDIF.
- ELSE.
- * Début modif - ALEG001 - 02/10/2014 (+)
- CLEAR ls_return.
- ls_return-type = 'E'.
- MESSAGE i109(zdgre) INTO ls_return-message WITH ls_poste_commande-ebelp.
- APPEND ls_return TO et_return.
- * Fin modif - ALEG001 - 02/10/2014 (+)
- ENDIF.
- "Modificaiton du type d'imputation
- IF NOT ls_poste_commande-knttp IS INITIAL.
- IF ls_poste_commande-knttp NE ls_ekpo-knttp.
- ls_poitem-acctasscat = ls_poste_commande-knttp.
- ls_poitemx-acctasscat = c_abap_true.
- ENDIF.
- ENDIF.
- **Modification du type d'imputation
- IF ls_poste_commande-aufnr IS NOT INITIAL.
- SELECT SINGLE auart FROM coas INTO lw_auart
- WHERE aufnr = ls_poste_commande-aufnr.
- READ TABLE lt_zdgre_otp_type INTO ls_zdgre_otp_type WITH KEY auart = lw_auart.
- IF sy-subrc EQ 0.
- ls_poaccount-po_item = ls_poste_commande-ebelp.
- ls_poaccount-serial_no = '01'.
- ls_poaccount-orderid = ls_poste_commande-aufnr.
- APPEND ls_poaccount TO lt_poaccount.
- ls_poaccountx-po_item = ls_poste_commande-ebelp.
- ls_poaccountx-serial_no = '01'.
- ls_poaccountx-orderid = c_abap_true.
- ls_poaccountx-po_itemx = c_abap_true.
- APPEND ls_poaccountx TO lt_poaccountx.
- ELSE.
- CLEAR ls_return.
- ls_return-type = 'E'.
- "Le type de la catégorie imputation n'est pas un type DGRE (zdgre_otp_type)
- MESSAGE i103(zdgre) INTO ls_return-message WITH ls_poste_commande-ebelp.
- APPEND ls_return TO et_return.
- ENDIF.
- * Début modif - GHAR002 - 11/08/2017 (+)
- IF ls_poste_commande-aufnr+3(1) = 'I'.
- CLEAR ls_zmax_main.
- IF lt_zmax_main[] IS NOT INITIAL.
- READ TABLE lt_zmax_main INTO ls_zmax_main
- WITH KEY aufnr = ls_poste_commande-aufnr
- BINARY SEARCH.
- ENDIF.
- IF ls_zmax_main IS NOT INITIAL.
- " Si l'OI est saturé
- IF ls_zmax_main-sat_oi = 'X'.
- CLEAR ls_return.
- MOVE 'E' TO ls_return-type.
- MESSAGE e063(zdsrm) WITH ls_poste_commande-aufnr
- INTO ls_return-message.
- APPEND ls_return TO et_return.
- ELSE.
- " Recherche d'un OI non-saturé du même axe analytique que
- " l'OI en entrée et ayant moins de GRR disponibles dans
- " la ZMAX
- CLEAR ls_zmax_temp.
- READ TABLE lt_zmax_temp INTO ls_zmax_temp
- WITH KEY aufnr(10) = ls_poste_commande-aufnr(10)
- BINARY SEARCH.
- IF ls_zmax_temp IS NOT INITIAL
- AND ls_zmax_temp-grr_dispo LT ls_zmax_main-grr_dispo.
- CLEAR ls_return.
- MOVE 'E' TO ls_return-type.
- MESSAGE e066(zdsrm) WITH ls_zmax_temp-aufnr
- ls_zmax_main-aufnr
- INTO ls_return-message.
- APPEND ls_return TO et_return.
- ENDIF.
- ENDIF.
- ENDIF.
- ENDIF.
- * Fin modif - GHAR002 - 11/08/2017 (+)
- ENDIF.
- APPEND ls_poitem TO lt_poitem.
- APPEND ls_poitemx TO lt_poitemx.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement