Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Submit MMBE

Former Member
0 Kudos

Hello All,

I created a program ZMMBE with the same selection-screen as of standard Program RMMMBEST (MMBE Transaction ).

Now I use a Submit statement in the ZMMBE Program as follows :



*EPORT RMMMBEST NO STANDARD PAGE HEADING MESSAGE-ID M3.
*               LINE-COUNT 20 MESSAGE-ID M3.
***********************************************************************
* Anzeige der Materialbestände                                        *
***********************************************************************
*report ZMMBE.

INCLUDE rmmmbtop.
TABLES: mbewv,mvke,mlgn,mlgt.
*INCLUDE dbmsmsel.
SELECTION-SCREEN BEGIN OF BLOCK msm WITH FRAME TITLE text-001.
SELECT-OPTIONS:
  ms_matnr  FOR marav-matnr MEMORY ID mat MATCHCODE OBJECT mat1,
  ms_werks  FOR marcv-werks MEMORY ID wrk,
  ms_lgort  FOR mard-lgort  MEMORY ID lag,
  ms_charg  FOR mchb-charg  MEMORY ID cha MATCHCODE OBJECT mch1.",
*   MS_CHARG  FOR mchb-CHARG  MEMORY ID CHA,
* ch/4.6B: Wenn Bewertungsebene = Werk, dann wird BWKEY ausgeblendet
* und mit dem Inhalt von WERKS gefüllt.
*    MS_BWKEY  FOR MBEWV-BWKEY MEMORY ID BWK,
*    MS_BWTAR  FOR MBEWV-BWTAR MEMORY ID BWT,
*    MS_VKORG  FOR MVKE-VKORG  MEMORY ID VKO,
*    MS_VTWEG  FOR MVKE-VTWEG  MEMORY ID VTW,
*    MS_LGNUM  FOR MLGN-LGNUM  MEMORY ID LGN,
*    MS_LGTYP  FOR MLGT-LGTYP  MEMORY ID LGT.
SELECTION-SCREEN END OF BLOCK msm.


*--------- Design Einstiegsbild --------------------------------------*
*#JH 01.07.96 (Anfang)
*#JH Zusätzliche Kennzeichen eingeführt, um das Lesen von Sonderbest.
*#JH und offenen Beständen nur nach Bedarf durchführen zu können
*---- Teilbild "Bestandsartenselektion" -------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-087.
PARAMETERS: kzlso LIKE rmmmb-kzlso
                  DEFAULT 'X'.
PARAMETERS: kzlon LIKE rmmmb-kzlon
                  DEFAULT 'X'.
* Anmerkung: Die Kennzeichen sind standardmäßig gesetzt, um nicht bei
* bestehenden Anwendungen, die diese Parameter beim CALL TRANSACTION
* oder SUBMIT nicht versorgen, eine abweichende Anzeige gegenüber vorher
* hervorzurufen!
SELECTION-SCREEN END OF BLOCK b1.

*---- Teilbild "Listdarstellung" --------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-088.
*#JH 01.07.96 (Ende)
SELECT-OPTIONS:
*           SOBKZ FOR MSKU-SOBKZ.     "ch zu 3.0F
            sobkz FOR rmmmb-sel_sobkz.
*ELECTION-SCREEN SKIP 1.  "Entfernung war wg. GUI-Umstellung notwendig
*ARAMETERS: VERNU LIKE T136-VERNU DEFAULT DEF_VERNU OBLIGATORY,
PARAMETERS: vernu LIKE t136-vernu MEMORY ID vnr OBLIGATORY, "ch zu 3.0C
*#JH 06.08.96 P30K089911 (-> Entw.antrag 124851/1996)
*           MEINH LIKE RMMME-MEINH NO-DISPLAY, "Vorl. nur Übergabeparam.
* JH/18.11.98/4.6A (Anfang)
* Feld kann nun per SET-Parameter bei Aufruf aus anderer TA belegt
* werden
*           MEINH LIKE RMMME-MEINH,    "Jetzt auch Eingabemöglichkeit
            meinh LIKE rmmme-meinh MEMORY ID mmbe_me,
* JH/18.11.98/4.6A (Ende)
            kznul LIKE rmmmb-kznul DEFAULT x,
* AS/26.01.99/4.6A (-> Entw.antrag 0002569135)
* Bei gesetztem Flag werden die Nachkommast. gemaess Cust. aufbereitet
* Anmerkung: Das Kennzeichen ist standardmäßig nicht gesetzt, um nicht
* bei bestehenden Anwendungen, die diese Parameter beim CALL TRANSACTION
* oder SUBMIT nicht versorgen, eine abweichende Anzeige gegenüber vorher
* hervorzurufen!
            kzngc LIKE rmmmb-kzngc DEFAULT space.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN COMMENT /1(30) text-025 FOR FIELD kzbuk.
*ELECTION-SCREEN COMMENT /1(30) TEXT-026 FOR FIELD KZWER.  "s.o.
PARAMETERS: kzbuk LIKE rmmmb-kzbuk DEFAULT x,
            kzwer LIKE rmmmb-kzwer DEFAULT x,
            kzlgo LIKE rmmmb-kzlgo DEFAULT x,
            kzcha LIKE rmmmb-kzcha DEFAULT x,
            kzson LIKE rmmmb-kzson DEFAULT x.
*#JH 01.07.96 (Anfang)
SELECTION-SCREEN END OF BLOCK b2.
*#JH 01.07.96 (Ende)

* JH/3.1H/KPr1089617 (Anfang)
* Neuer dunkler Parameter, der angibt, ob der Report aus dem
* Bereichsmenü heraus gestartet wurde. SY-CALLD kann für diesen
* Zweck nur bedingt benutzt werden, weil das Kennzeichen umgesetzt
* wird, wenn sich der Report selbst aufruft.
PARAMETERS: p_mcall(1) TYPE c NO-DISPLAY.
* JH/3.1H/KPr1089617 (Ende)

*#JH 24.10.96 3.0F (-> Entw.antrag 124851/1996, IntPr 237231) (Anfang)
AT SELECTION-SCREEN ON VALUE-REQUEST FOR meinh.
*----- Eigene F4-Hilfe zur Anzeige der zu einem Material definierten
*----- Mengeneinheiten
  PERFORM f4_hilfe_zul_meinh.
*#JH 24.10.96 3.0F (-> Entw.antrag 124851/1996, IntPr 237231) (Ende)

* JH/10.02.98/4.0B/KPr100038308 (Anfang)
INITIALIZATION.
* Das Lesen der Chargenebene wurde vorverlegt (s. unten)!
  PERFORM chargenebene_ermitteln.
* JH/10.02.98/4.0B/KPr100038308 (Ende)

* note 548777
  PERFORM restrict_select_options_matnr.

*------ Modifikation des Einstiegsbildes ------------------
AT SELECTION-SCREEN OUTPUT.
* note 548777
*  LOOP AT SCREEN.
*    IF SCREEN-NAME = '%_MS_MATNR-PUSH' OR
*       SCREEN-NAME = '%_MS_MATNR-MORE' OR
*       SCREEN-NAME = 'MS_MATNR-HIGH'   OR               "CH/07.02.1995
*       SCREEN-NAME = '%_MS_MATNR_%_APP_%-VALU_PUSH'.    "CH/14.03.1995
*      SCREEN-ACTIVE = '0'.
*      MODIFY SCREEN.
*    ENDIF.
*  ENDLOOP.
* Evtl wird vom aufrufenden Programm eine Anzeigeversion mitgegeben
* IF NOT SY-CALLD IS INITIAL.                      "ch zu 3.0C
  IF vernu IS INITIAL.                             "note 428395
    GET PARAMETER ID vnr FIELD vernu.
  ENDIF.                                           "note 428395
*   SET PARAMETER ID VNR FIELD DEF_VERNU.          "ch zu 3.0C
* ENDIF.                                           "ch zu 3.0C
  SELECT * FROM t136 WHERE vernu = vernu.          "note 486104
    EXIT.
  ENDSELECT.
  IF sy-subrc NE 0.                                "note 486104
*  if vernu is initial.   "kann passieren nach 'Neue Selektion'
    vernu = def_vernu.
  ENDIF.

  IF meinh IS INITIAL.                             "note 428395
    GET PARAMETER ID 'MMBE_ME' FIELD meinh.  "JH/18.11.98/4.6A
  ENDIF.                                           "note 428395

* note 610162
  CLEAR ms_matnr.
  READ TABLE ms_matnr.
  IF sy-subrc NE 0.
    GET PARAMETER ID 'MAT' FIELD ms_matnr-low.
    REFRESH ms_matnr.
    MOVE 'I' TO ms_matnr-sign.
    MOVE 'EQ' TO ms_matnr-option.
    APPEND ms_matnr.
  ENDIF.

*----- Prüfen der Eingaben ----------------------------------------
AT SELECTION-SCREEN.
*---- Prüfen der Anzeigeversion --------------------------------------
  SELECT * FROM t001w WHERE werks IN ms_werks.              "ch zu 3.0D
    EXIT.                                                   "
  ENDSELECT.                                                "
  IF sy-subrc > 0.                     "->KPr 30121
    MESSAGE e102 WITH ms_werks-low.                         "
  ENDIF.                                                    "

  SELECT * FROM t136
         WHERE vernu = vernu.
    EXIT.
  ENDSELECT.
  IF sy-subrc NE 0.
    table = 'T136 '.
    SET PARAMETER ID 'TAB' FIELD table.
    MESSAGE e404 WITH vernu.
  ELSE.
    rmmmb-vernu = t136-vernu.
  ENDIF.
* --- Ermitteln KZ_NUR_WERKSOND  ---------------------------------------
  PERFORM sobkz_einlesen.
* --- Selektionsebenen auswerten  --------------------------------------
  PERFORM selektionsebenen.
*// JH 11.09.96 KPr1192975
* --- SPA/GPA für Lagerort und Charge übernehmen bei Aufruf aus -
* --- anderer Anwendung
* IF NOT SY-CALLD IS INITIAL.
*   PERFORM GPA_LGORT_CHARGE.
* ENDIF.
  IF sscrfields-ucomm EQ 'ONLI' OR                          "SW/8.10.98
      sscrfields-ucomm EQ 'PRIN'.
    PERFORM read_kzwso.                "ALRK014884 SW
    IF NOT kzwso IS INITIAL.           "Begin P40K053180 SW
      IF NOT ms_charg[] IS INITIAL.
        ms_charg_save[] = ms_charg[].
        CLEAR ms_charg.
        REFRESH ms_charg[].
      ENDIF.
      IF NOT ms_werks[] IS INITIAL.
        ms_werks_save[] = ms_werks[].
*        CLEAR MS_WERKS.                                    "note_737504
*        REFRESH MS_WERKS.
      ENDIF.
      IF NOT ms_lgort[] IS INITIAL.
        ms_lgort_save[] = ms_lgort[].
*        CLEAR MS_LGORT.                                    "note_737504
*        REFRESH MS_LGORT.
      ENDIF.
    ENDIF.                             "End P40K053180 SW
  ENDIF.



START-OF-SELECTION.

  SUBMIT rmmmbest   AND RETURN "via selection-screen
  WITH  ms_matnr  IN ms_matnr
  WITH  ms_werks  IN ms_werks
  WITH  ms_lgort  IN ms_lgort
  WITH  ms_charg  IN ms_charg
  WITH  kzlso     EQ kzlso
  WITH  kzlon     EQ kzlon
  WITH  sobkz     EQ sobkz
  WITH  vernu     EQ vernu
  WITH  meinh     EQ meinh
  WITH  kznul     EQ kznul
  WITH  kzngc     EQ kzngc
  WITH  kzbuk     EQ kzbuk
  WITH  kzwer     EQ kzwer
  WITH  kzlgo     EQ kzlgo
  WITH  kzcha     EQ kzcha
  WITH  kzson     EQ kzson.


END-OF-SELECTION.
*-----------------------------------------------------------------------
* Formroutinen für die Listerstellung
*-----------------------------------------------------------------------

*eject
  INCLUDE rmmmbefg .                   "Allgemeine Form-Routinen
*eject
  INCLUDE rmmmbefa .      "Spez. Routinen für Grund- und Aufrißliste
*eject
  INCLUDE rmmmbefe .                   "Spez. Routinen für Einzelliste
*eject
  INCLUDE rmmmbefl .                   "Verschieben der Grundliste
*eject
  INCLUDE rmmmbefm .      "Lesen und merken der Bestandsdaten
*eject
  INCLUDE rmmmbeff .                   "FCode-Handling
*eject
  INCLUDE rmmmbmur .      "Mengenumrechnung auf Charge     "ALRK014884 SW
*eject
  INCLUDE rmmmpbo1 .                   "PBO-Module
*eject
  INCLUDE menuretn.                    "Standardroutine zum Beenden"SW/8.10.98

Everything is ok . But when I execute this Program by entering some input values to the SSCRN the result comes.

Now when I use the back button the control is going to the selection-screen of the called program ( i.e sscrn of the standard transaction ZMMBE ) and when I press BACK again then the control is coming to the SSCRN of ZMMBE program.

I want the control to be back on the SSCRN of ZMMBE program for the first time only.

How should I acheive this ?

Regards,

Deepu.K

1 ACCEPTED SOLUTION

kostas_tsioubris
Contributor

Hi,

this happens because the fcode handles from the standard program. You can find the code in include rmmmbeff. As you can see when you press 'Back' button the program submits again the standard mmbe report.

As a workaround you can try this

data: lt_ABAPLIST like ABAPLIST occurs 0 with header line.

SUBMIT rmmmbest exporting list to memory "via selection-screen

WITH ms_matnr IN ms_matnr

WITH ms_werks IN ms_werks

WITH ms_lgort IN ms_lgort

WITH ms_charg IN ms_charg

WITH kzlso EQ kzlso

WITH kzlon EQ kzlon

WITH sobkz EQ sobkz

WITH vernu EQ vernu

WITH meinh EQ meinh

WITH kznul EQ kznul

WITH kzngc EQ kzngc

WITH kzbuk EQ kzbuk

WITH kzwer EQ kzwer

WITH kzlgo EQ kzlgo

WITH kzcha EQ kzcha

WITH kzson EQ kzson

AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = LT_ABAPLIST

EXCEPTIONS

OTHERS = 1.

CALL FUNCTION 'DISPLAY_LIST'

EXPORTING

FULLSCREEN = 'X'

  • CALLER_HANDLES_EVENTS =

  • STARTING_X = 10

  • STARTING_Y = 10

  • ENDING_X = 60

  • ENDING_Y = 20

  • IMPORTING

  • USER_COMMAND =

TABLES

LISTOBJECT = LT_ABAPLIST

EXCEPTIONS

OTHERS = 1

.

hope this helps.

Kostas

5 REPLIES 5

kostas_tsioubris
Contributor

Hi,

this happens because the fcode handles from the standard program. You can find the code in include rmmmbeff. As you can see when you press 'Back' button the program submits again the standard mmbe report.

As a workaround you can try this

data: lt_ABAPLIST like ABAPLIST occurs 0 with header line.

SUBMIT rmmmbest exporting list to memory "via selection-screen

WITH ms_matnr IN ms_matnr

WITH ms_werks IN ms_werks

WITH ms_lgort IN ms_lgort

WITH ms_charg IN ms_charg

WITH kzlso EQ kzlso

WITH kzlon EQ kzlon

WITH sobkz EQ sobkz

WITH vernu EQ vernu

WITH meinh EQ meinh

WITH kznul EQ kznul

WITH kzngc EQ kzngc

WITH kzbuk EQ kzbuk

WITH kzwer EQ kzwer

WITH kzlgo EQ kzlgo

WITH kzcha EQ kzcha

WITH kzson EQ kzson

AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = LT_ABAPLIST

EXCEPTIONS

OTHERS = 1.

CALL FUNCTION 'DISPLAY_LIST'

EXPORTING

FULLSCREEN = 'X'

  • CALLER_HANDLES_EVENTS =

  • STARTING_X = 10

  • STARTING_Y = 10

  • ENDING_X = 60

  • ENDING_Y = 20

  • IMPORTING

  • USER_COMMAND =

TABLES

LISTOBJECT = LT_ABAPLIST

EXCEPTIONS

OTHERS = 1

.

hope this helps.

Kostas

0 Kudos

Hello Kostas,

Thanks for ur code.

PS: Full points awarded.

Regards,

Deepu.K

Former Member
0 Kudos

Hello Kostas,

The output of the standard MMBE has a

detailed list also. i.e when a record is double clicked it gives a deatiled list in a pop-up.

I'm not able to get this functionality by using the previous code as mentioned by u.

DO u have any idea of how to get this ?

Regards,

Deepu.K

null

null

null

0 Kudos

submitting standard program will not solve ur problem , first u have to get the logic of MMBE then put ur own code to get all the detail.

first search for FM that gives indetail Stock data .

Regards

Prabhu

0 Kudos

Hi Deepu,

well the function display_list only displays the output without any pf-status .

The better solution is to keep the standard report untouched and make only required changes.

What do you want to do with your zmmbe report? And why you must submit the standard report and not copy the standard report logic in your z report?

Please clarify this so maybe we can use the standard report logic.

regards

Kostas