07-20-2006 8:56 AM
Hi,
I would be really glad if somebody could send me the coding of program LMEQRF29 (we need the CLASS lcl_oa IMPLEMENTATION coding). But it is necessary that you'll have support package level lower than 49 (4.6C)
Thanks in advance!
Kind regards
Nicola
07-20-2006 9:06 AM
sorry,
but i've SP = 48 for basis and appl. but i don't find the class lcl_oa ???
A.
07-20-2006 9:11 AM
Hi Andreas,
thank you for the fast reply; the CLASS lcl_oa IMPLEMENTATION coding starts in line 78 in program LMEQRF29 (our support package level is 51). If you can't find it, could you please copy the whole coding of program LMEQRF29 into your reply? That would help me a lot!
Thanks!
Nicola
07-20-2006 12:33 PM
Anybody out there with support level < 49? I've to solve this task today and I would need the coding very urgently.
Thanks in advance!
Nicola
07-20-2006 1:01 PM
HI
GOOD
HERE IS THE CODE FOR LMEQRF29
CLASS: lcl_docs DEFINITION DEFERRED.
TYPES: gty_ekko TYPE STANDARD TABLE OF ekko.
*----
*
CLASS lcl_oa DEFINITION
*----
*
CLASS lcl_oa DEFINITION.
PUBLIC SECTION.
CLASS-METHODS: class_constructor.
METHODS: constructor,
execute_matnr IMPORTING iv_matnr TYPE bqpim-matnr
iv_werks TYPE bqpim-werks
iv_date TYPE bqpim-nedat,
execute_matkl IMPORTING iv_matkl TYPE bqpim-matkl
iv_werks TYPE bqpim-werks
iv_date TYPE bqpim-nedat.
CLASS-DATA: instance TYPE REF TO lcl_oa READ-ONLY.
PROTECTED SECTION.
TYPES: BEGIN OF lty_matnr_entry,
matnr TYPE ekpo-matnr,
werks TYPE ekpo-werks,
docs TYPE REF TO lcl_docs,
END OF lty_matnr_entry,
BEGIN OF lty_matkl_entry,
matkl TYPE ekpo-matkl,
werks TYPE ekpo-werks,
docs TYPE REF TO lcl_docs,
END OF lty_matkl_entry.
DATA: mv_585 TYPE sysubrc,
mv_586 TYPE sysubrc,
mv_587 TYPE sysubrc,
mv_330 TYPE sysubrc,
mv_331 TYPE sysubrc,
mv_332 TYPE sysubrc,
mt_matnr_entries TYPE SORTED TABLE OF lty_matnr_entry
WITH UNIQUE KEY matnr werks,
mt_matkl_entries TYPE SORTED TABLE OF lty_matkl_entry
WITH UNIQUE KEY matkl werks.
ENDCLASS. "lcl_oa DEFINITION
*----
*
CLASS lcl_docs DEFINITION
*----
*
CLASS lcl_docs DEFINITION.
PUBLIC SECTION.
METHODS: constructor IMPORTING it_ekko TYPE gty_ekko,
test IMPORTING iv_kind TYPE char1
iv_date TYPE bqpim-nedat
RETURNING value(rv_found) TYPE mmpur_bool.
PROTECTED SECTION.
TYPES: BEGIN OF lty_doc,
kind TYPE char1,
ebeln TYPE ekko-ebeln,
kdatb TYPE ekko-kdatb,
kdate TYPE ekko-kdate,
END OF lty_doc.
DATA: mt_docs TYPE SORTED TABLE OF lty_doc
WITH NON-UNIQUE KEY kind.
ENDCLASS. "lcl_docs DEFINITION
*----
*
CLASS lcl_oa IMPLEMENTATION
*----
*
CLASS lcl_oa IMPLEMENTATION.
METHOD class_constructor.
CREATE OBJECT instance.
ENDMETHOD. "class_constructor
METHOD constructor.
PERFORM enaco IN PROGRAM sapfmmex USING 'ME' '330'.
mv_330 = sy-subrc.
PERFORM enaco IN PROGRAM sapfmmex USING 'ME' '331'.
mv_331 = sy-subrc.
PERFORM enaco IN PROGRAM sapfmmex USING 'ME' '332'.
mv_332 = sy-subrc.
PERFORM enaco IN PROGRAM sapfmmex USING '06' '585'.
mv_585 = sy-subrc.
PERFORM enaco IN PROGRAM sapfmmex USING '06' '586'.
mv_586 = sy-subrc.
PERFORM enaco IN PROGRAM sapfmmex USING '06' '587'.
mv_587 = sy-subrc.
ENDMETHOD. "constructor
METHOD execute_matnr.
TYPES: BEGIN OF lty_sel,
matnr LIKE ekpo-matnr,
werks LIKE ekpo-werks,
bstyp LIKE ekpo-bstyp,
END OF lty_sel,
BEGIN OF lty_erg,
werks LIKE ekpo-werks,
bstyp LIKE ekko-bstyp,
ebeln LIKE ekko-ebeln,
END OF lty_erg.
DATA: lt_sel TYPE STANDARD TABLE OF lty_sel,
lt_erg TYPE STANDARD TABLE OF lty_erg,
lt_ekko TYPE gty_ekko,
ls_sel LIKE LINE OF lt_sel,
ls_erg LIKE LINE OF lt_erg,
ls_ekko LIKE LINE OF lt_ekko,
ls_entry LIKE LINE OF mt_matnr_entries.
data selection
READ TABLE mt_matnr_entries INTO ls_entry
WITH TABLE KEY matnr = iv_matnr
werks = iv_werks.
IF NOT sy-subrc IS INITIAL.
IF NOT iv_matnr IS INITIAL.
IF iv_werks NE space AND mv_585 NE 0.
ls_sel-matnr = iv_matnr. "werksbezogener Kontrakt
ls_sel-werks = iv_werks.
ls_sel-bstyp = bstyp-kont.
APPEND ls_sel TO lt_sel.
ENDIF.
IF mv_587 NE 0.
ls_sel-matnr = iv_matnr. "Zentralkontrakt
ls_sel-werks = space.
ls_sel-bstyp = bstyp-kont.
APPEND ls_sel TO lt_sel.
ENDIF.
IF iv_werks NE space AND mv_586 NE 0.
ls_sel-matnr = iv_matnr. "Lieferplan
ls_sel-werks = iv_werks.
ls_sel-bstyp = bstyp-lfpl.
APPEND ls_sel TO lt_sel.
ENDIF.
ENDIF.
IF NOT lt_sel IS INITIAL.
SELECT bstyp werks ebeln FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE lt_erg
FOR ALL ENTRIES IN lt_sel
WHERE matnr EQ lt_sel-matnr
AND werks EQ lt_sel-werks
AND bstyp EQ lt_sel-bstyp
AND loekz EQ space
AND elikz EQ space
GROUP BY bstyp werks ebeln.
IF NOT lt_erg IS INITIAL.
SELECT * FROM ekko INTO TABLE lt_ekko
FOR ALL ENTRIES IN lt_erg
WHERE ebeln = lt_erg-ebeln.
LOOP AT lt_ekko INTO ls_ekko.
READ TABLE lt_erg INTO ls_erg WITH KEY ebeln = ls_ekko-ebeln.
IF ls_erg-werks IS INITIAL.
ls_ekko-bstyp = 'Z'.
MODIFY lt_ekko FROM ls_ekko.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
CREATE OBJECT ls_entry-docs EXPORTING it_ekko = lt_ekko.
ls_entry-matnr = iv_matnr.
ls_entry-werks = iv_werks.
INSERT ls_entry INTO TABLE mt_matnr_entries.
ENDIF.
checks
IF mv_585 NE 0.
IF ls_entry-docs->test( iv_kind = bstyp-kont
iv_date = iv_date ) EQ mmpur_yes.
MESSAGE w585 INTO gl_dummy.
mmpur_message_enaco ' ' '06' '585' '' '' '' ''.
ENDIF.
ENDIF.
IF mv_586 NE 0.
IF ls_entry-docs->test( iv_kind = bstyp-lfpl
iv_date = iv_date ) EQ mmpur_yes.
MESSAGE w586 INTO gl_dummy.
mmpur_message_enaco ' ' '06' '586' '' '' '' ''.
ENDIF.
ENDIF.
IF mv_587 NE 0.
IF ls_entry-docs->test( iv_kind = 'Z'
iv_date = iv_date ) EQ mmpur_yes.
MESSAGE w587 INTO gl_dummy.
mmpur_message_enaco ' ' '06' '587' '' '' '' ''.
ENDIF.
ENDIF.
ENDMETHOD. "execute_matnr
METHOD execute_matkl.
TYPES: BEGIN OF lty_sel,
matkl LIKE ekpo-matkl,
werks LIKE ekpo-werks,
bstyp LIKE ekpo-bstyp,
END OF lty_sel,
BEGIN OF lty_erg,
werks LIKE ekpo-werks,
bstyp LIKE ekko-bstyp,
ebeln LIKE ekko-ebeln,
END OF lty_erg.
DATA: lt_sel TYPE STANDARD TABLE OF lty_sel,
lt_erg TYPE STANDARD TABLE OF lty_erg,
lt_ekko TYPE gty_ekko,
ls_sel LIKE LINE OF lt_sel,
ls_erg LIKE LINE OF lt_erg,
ls_ekko LIKE LINE OF lt_ekko,
ls_entry LIKE LINE OF mt_matkl_entries.
data selection
READ TABLE mt_matkl_entries INTO ls_entry
WITH TABLE KEY matkl = iv_matkl
werks = iv_werks.
IF NOT sy-subrc IS INITIAL.
IF NOT iv_matkl IS INITIAL.
IF iv_werks NE space AND mv_330 NE 0.
ls_sel-matkl = iv_matkl. "werksbezogener Kontrakt
ls_sel-werks = iv_werks.
ls_sel-bstyp = bstyp-kont.
APPEND ls_sel TO lt_sel.
ENDIF.
IF mv_332 NE 0.
ls_sel-matkl = iv_matkl. "Zentralkontrakt
ls_sel-werks = space.
ls_sel-bstyp = bstyp-kont.
APPEND ls_sel TO lt_sel.
ENDIF.
IF iv_werks NE space AND mv_331 NE 0.
ls_sel-matkl = iv_matkl. "Lieferplan
ls_sel-werks = iv_werks.
ls_sel-bstyp = bstyp-lfpl.
APPEND ls_sel TO lt_sel.
ENDIF.
ENDIF.
IF NOT lt_sel IS INITIAL.
SELECT bstyp werks ebeln FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE lt_erg
FOR ALL ENTRIES IN lt_sel
WHERE matnr EQ space
AND matkl EQ lt_sel-matkl
AND werks EQ lt_sel-werks
AND bstyp EQ lt_sel-bstyp
AND loekz EQ space
AND elikz EQ space
GROUP BY bstyp werks ebeln.
IF NOT lt_erg IS INITIAL.
SELECT * FROM ekko INTO TABLE lt_ekko
FOR ALL ENTRIES IN lt_erg
WHERE ebeln = lt_erg-ebeln.
LOOP AT lt_ekko INTO ls_ekko.
READ TABLE lt_erg INTO ls_erg WITH KEY ebeln = ls_ekko-ebeln.
IF ls_erg-werks IS INITIAL.
ls_ekko-bstyp = 'Z'.
MODIFY lt_ekko FROM ls_ekko.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
CREATE OBJECT ls_entry-docs EXPORTING it_ekko = lt_ekko.
ls_entry-matkl = iv_matkl.
ls_entry-werks = iv_werks.
INSERT ls_entry INTO TABLE mt_matkl_entries.
ENDIF.
checks
IF mv_330 NE 0.
IF ls_entry-docs->test( iv_kind = bstyp-kont
iv_date = iv_date ) EQ mmpur_yes.
MESSAGE w330(me) INTO gl_dummy.
mmpur_message_enaco ' ' 'ME' '330' '' '' '' ''.
ENDIF.
ENDIF.
IF mv_331 NE 0.
IF ls_entry-docs->test( iv_kind = bstyp-lfpl
iv_date = iv_date ) EQ mmpur_yes.
MESSAGE w331(me) INTO gl_dummy.
mmpur_message_enaco ' ' 'ME' '331' '' '' '' ''.
ENDIF.
ENDIF.
IF mv_332 NE 0.
IF ls_entry-docs->test( iv_kind = 'Z'
iv_date = iv_date ) EQ mmpur_yes.
MESSAGE w332(me) INTO gl_dummy.
mmpur_message_enaco ' ' 'ME' '332' '' '' '' ''.
ENDIF.
ENDIF.
ENDMETHOD. "execute_matkl
ENDCLASS. "lcl_oa IMPLEMENTATION
*----
*
CLASS lcl_docs IMPLEMENTATION
*----
*
CLASS lcl_docs IMPLEMENTATION.
METHOD constructor.
DATA: ls_doc LIKE LINE OF mt_docs,
ls_ekko LIKE LINE OF it_ekko.
LOOP AT it_ekko INTO ls_ekko.
ls_doc-kind = ls_ekko-bstyp.
ls_doc-ebeln = ls_ekko-ebeln.
ls_doc-kdatb = ls_ekko-kdatb.
ls_doc-kdate = ls_ekko-kdate.
INSERT ls_doc INTO TABLE mt_docs.
ENDLOOP.
ENDMETHOD. "constructor
METHOD test.
DATA: ls_doc LIKE LINE OF mt_docs.
READ TABLE mt_docs WITH TABLE KEY kind = iv_kind
TRANSPORTING NO FIELDS.
CHECK sy-subrc IS INITIAL.
LOOP AT mt_docs INTO ls_doc FROM sy-tabix.
IF ls_doc-kind NE iv_kind. EXIT. ENDIF.
IF ls_doc-kdate >= iv_date AND
ls_doc-kdatb <= iv_date.
rv_found = mmpur_yes.
EXIT.
ENDIF.
ENDLOOP.
ENDMETHOD. "test
ENDCLASS. "lcl_docs DEFINITION
*----
*
FORM VERTRAG_NACHLESEN *
*----
*
........ *
*----
*
FORM vertrag_nachlesen.
*-- in Orderbuch ist gar kein Vertrag vorhanden -
-
*
*--- Suchen eines Vertrages ---> Meldung, wenn einer da -
-
*-- nicht, wenn nur Menge und Termin geändert wurden
CHECK ( comim-oldat IS INITIAL AND comim-olmng IS INITIAL )
OR comim-bstyp EQ bstyp-banf "590450
OR comim-fcall EQ cva_en.
IF comim-fcall EQ cva_en.
IF comim-matnr NE space.
mmpur_metafield mmmfd_matnr.
lcl_oa=>instance->execute_matnr( iv_matnr = comim-matnr
iv_werks = comim-werks
iv_date = comim-nedat ).
ELSE.
mmpur_metafield mmmfd_mat_grp.
lcl_oa=>instance->execute_matkl( iv_matkl = comim-matkl
iv_werks = comim-werks
iv_date = comim-nedat ).
ENDIF.
EXIT.
ENDIF.
IF comim-matnr NE space.
mmpur_metafield mmmfd_matnr.
PERFORM w566_check.
PERFORM vertrag_ekpo_select_mit_mat.
PERFORM vertrag_message_mit_mat.
ELSE.
mmpur_metafield mmmfd_mat_grp.
PERFORM ww566_check.
PERFORM vertrag_ekpo_select_ohne_mat.
PERFORM vertrag_message_ohne_mat.
ENDIF.
ENDFORM. "VERTRAG_NACHLESEN
THANKS
MRUTYUN
07-20-2006 1:31 PM
Hi MRUTYUN,
thanks for your answer, I've rewarded points to you. Could you just let me know the support package level you're on? I wonder because the code is exactly the same as we have in our system (SP 51). But this include was changed by the support packagesand I don't know where because you can't see any version for SP changes.
Regards
Nicola