Académique Documents
Professionnel Documents
Culture Documents
SAP ZNOTES
RAM
WRITE : / ZNOTES -NOM,
ZNOTES -PRENOM,
BASE DE data etudiants like ZNOTES -NOTE. ALAMI ALI 16
DONNEES ZNOTES occurs 100 ETUDIANTS ALAOUI AHMED 12
ENDLOOP.
SAP with header line
Identique à
ZNOTES
ZNOTES
select *
from ZNOTES INTO TABLE ETUDIANTS
1
PROGICIELS APPLIQUÉS A LA GESTION DES OPÉRATIONS
TP4 4ème Année Management N. ZIDANE
5.4 EXERCICE4 :Tri
*---------------------------------------------------------------------*
* programme de tri de la table *
*---------------------------------------------------------------------*
REPORT ZLECTURE4.
data etudiants like ZNOTES occurs 100 with header line.
select * from ZNOTES into table etudiants order by nom DESCENDING.
loop at etudiants. " boucle sur tous les enregistrements
write:/ etudiants-NOM,etudiants-PRENOM.
endloop.
2
PROGICIELS APPLIQUÉS A LA GESTION DES OPÉRATIONS
TP4 4ème Année Management N. ZIDANE
Début 1
Znotes 2
Etudiant Znotes 3
moyenne 0 4
7 Fin de la table
OUI Etudiant
EOF ?
8
NON
Moyenne moyenne / sy-dbcnt. 5
6
Fin
,1 Report zmoyenne .
2 Tables znotes .
5 Loop at etudiant.
3
PROGICIELS APPLIQUÉS A LA GESTION DES OPÉRATIONS
TP4 4ème Année Management N. ZIDANE
7 ENDLOOP.
REPORT ZMAJPRODUITS .
Tables zproduitsmc .
data produits like zproduitsmc occurs 100 with header line.
parameters p_code(10).
parameters p_pu(10).
UPDATE zproduitsmc SET pu = p_pu WHERE code_p = p_code.
select * from zproduitsmc into table produits.
if sy-subrc = 0.
write: / 'trouvé'.
LOOP at produits.
WRITE:/ produits-code_p, produits-designation.
WRITE:/10(15) produits-q, produits-pu COLOR COL_TOTAL.
ENDLOOP.
4
PROGICIELS APPLIQUÉS A LA GESTION DES OPÉRATIONS
TP4 4ème Année Management N. ZIDANE
5
PROGICIELS APPLIQUÉS A LA GESTION DES OPÉRATIONS
TP4 4ème Année Management N. ZIDANE
Programme de lecture:
REPORT ZLECTURE9 .
tables zproduits9.
select * from zproduits9.
write:/ zproduit-refproduit ,zproduits9-nomproduit,
zproduits9-prixunitaire.
endselect.
----------------------------------------------------------------------------------
*Programme de lecture et de mise à jour:
REPORT ZPRODUITSMAJ9 .
tables ZPRODUITS9.
data produit like ZPRODUITS9 occurs 100 with header line.
parametersp_nom(30).
parametersp_prix(10).
UPDATE ZPRODUITS9 SET prixunitaire = p_prix WHERE NOMproduit = p_nom.
select * from ZPRODUITS9 into table produit.
if sy-subrc = 0.
write: / 'trouvé'.
loop at produit.
write:/ produit-refproduit,produit-NOMproduit.
WRITE:/10(15) produit-prixunitaire.
endloop.
write: / 'nombre enregistrements:',sy-dbcnt.
else.
write : / 'aucunenr'.
endif.
----------------------------------------------------------------------------------
Faites un programme ABAP qui permet d’afficher la facture de la table Zcommande ayant la
structure suivante :
6
PROGICIELS APPLIQUÉS A LA GESTION DES OPÉRATIONS
TP4 4ème Année Management N. ZIDANE
WRITE: /5(15) 'REF' COLOR 1,21(10) 'intitulé' COLOR 1 ,33(10) 'quantite' COLOR
1,44(10) 'prix ht' COLOR 1,55(10) 'prix ttc' COLOR 1.
loop at commande.
prix_ht = commande-quantite * commande-prix_achat * commande-coef.
prix_ttc = prix_ht * 120 / 100.
prix_ttc = prix_ttc * ( 1 - commande-remise / 100 ).
WRITE: /5(15) commande-ref,21(10) commande-intitule,
33(10) commande-quantite,44(10) prix_ht,
55(10) prix_ttc COLOR COL_TOTAL.
7
PROGICIELS APPLIQUÉS A LA GESTION DES OPÉRATIONS
TP4 4ème Année Management N. ZIDANE