Précédent   Forum des professionnels en informatique > Logiciels > Solutions d'entreprise > ERP > SAP
SAP Forum d'entraide sur SAP et sur la programmation avec le langage ABAP
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 29/05/2007, 13h51   #1
Membre du Club
 
Avatar de cybercrisp
 
Inscription : octobre 2006
Messages : 104
Détails du profil
Informations forums :
Inscription : octobre 2006
Messages : 104
Points : 69
Points : 69
Par défaut Probleme de sous programme

Bonjour, je suis entrain de faire un module fonction qui doit appelé deux sous fonctions (une qui verifie la periode comptable),quand je veux activer ma fonction: erreur:la sous-fonction n'existe pas! pourtant, elle a bien été crée et bien sauvegardé.



Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FUNCTION ZSFUN.
*"----------------------------------------------------------------------
*"*"Interface locale :
*"  IMPORTING
*"     VALUE(MAGASIN) TYPE  LGORT_D OPTIONAL
*"     VALUE(ARTICLE) TYPE  MATNR OPTIONAL
*"     VALUE(DIVISION) TYPE  WERKS_D OPTIONAL
*"     VALUE(CENTRE) TYPE  KOSTL OPTIONAL
*"  EXPORTING
*"     VALUE(RETURN) TYPE  BAPIRET2
*"  TABLES
*"      TMARD STRUCTURE  MARD OPTIONAL
*"      TMARA STRUCTURE  MARA OPTIONAL
*"      TMAKT STRUCTURE  MAKT OPTIONAL
*"      TMSEG STRUCTURE  MSEG OPTIONAL
*"      TMCHB STRUCTURE  MCHB OPTIONAL
*"      TPRCTR STRUCTURE  MARC OPTIONAL
*"      TCSKT STRUCTURE  CSKT OPTIONAL
*"----------------------------------------------------------------------


* Definition des données
DATA : EXISTE(1) TYPE C,
       BLOQUE(1) TYPE C.
* Test si l'article est bloqué (oui:bloque = 1)
  PERFORM BLOKARTICLE USING ARTICLE.* Test la période comptable (oui:bloque = 2)
  PERFORM PERIODE_COMPTABLE USING SY-DATUM.


IF BLOQUE = 1 OR BLOQUE = 2.
ELSE.

 SELECT * FROM MARD into table TMARD
           WHERE  MATNR = ARTICLE
           AND WERKS = DIVISION
           AND LGORT = MAGASIN.
           EXISTE = '1'.

IF EXISTE = '1'.
* Champs désignation MAKTX
  SELECT * FROM MAKT into table TMAKT
           WHERE MATNR = ARTICLE.

* Champs UQ de base MEINS
  SELECT  * FROM MARA into table TMARA
            WHERE MATNR = ARTICLE.

* Champs Emplacement LGPLA
  SELECT * FROM  MSEG INTO TABLE TMSEG
           WHERE  MATNR  = ARTICLE
           AND    WERKS  = DIVISION.

  SELECT * FROM  MARD INTO  table TMARD
           WHERE MATNR = ARTICLE
           AND  WERKS = DIVISION
           AND  LGORT = MAGASIN.

* Dipo. Neuf
  SELECT * FROM  MCHB INTO table TMCHB
   WHERE    MATNR  = ARTICLE
            AND WERKS = DIVISION
            AND LGORT = MAGASIN
            AND CHARG = 'N'.

* Dispo. Réparé
  SELECT * FROM  MCHB INTO TABLE TMCHB
  WHERE    MATNR  = ARTICLE
           AND WERKS = DIVISION
           AND LGORT = MAGASIN
           AND CHARG = 'R'.

* Récupération du centre de cout
  SELECT * INTO TABLE TPRCTR
           FROM MARC WHERE MATNR = ARTICLE
           AND WERKS = DIVISION.

  IF SY-SUBRC = 0.
  SELECT * FROM CSKT INTO TABLE TCSKT
           WHERE KOSTL = CENTRE
           AND   KOKRS = DIVISION.
  ENDIF.

 ENDIF.
 ENDIF.

ENDFUNCTION.

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
*----------------------------------------------------------------------*
***INCLUDE LZSGROUPF02 .
*----------------------------------------------------------------------*
FORM periode_comptable using date_a_tester.

  data : annee(4), mois(2).

* Date de saisie <= date du jour
  if date_a_tester > sy-datum.
  endif.

* Période comptable ouverte ?
  clear : marv, annee, mois.
  move date_a_tester(4)   to annee.
  move date_a_tester+4(2) to mois.
  select single * from marv where bukrs = buk
                            and lfgja = annee
                            and lfmon = mois.
  if sy-subrc <> 0.
  select single * from marv where bukrs = buk
                            and vmgja = annee
                            and vmmon = mois
                            and xruev = ''
                            and xruem = 'X'.
  if sy-subrc <> 0.
                   bloque = 2.
  endif.
  endif.
ENDFORM.                    " periode_comptable
cybercrisp est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/05/2007, 14h16   #2
Membre du Club
 
Avatar de cybercrisp
 
Inscription : octobre 2006
Messages : 104
Détails du profil
Informations forums :
Inscription : octobre 2006
Messages : 104
Points : 69
Points : 69
J'ai simplement oublié de cocher un element lors de l'activation ...
cybercrisp est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 06h58.


 
 
 
 
Partenaires

Hébergement Web