Standardpreisliste in Wareneingang (Bestandstransaktionen)

Hallo
Ich habe das Problem, dass in den Buchungsmasken für Bestandstransaktionen initial immer die Preisliste "Letzter Einkaufspreis" angezogen wird.
Im Rahmen des Workflows ist es aber gewünscht, dass die Wareneingänge mit anderen Preisen gebucht werden, ohne dass der Mitarbeiter daran denken muss die Preisliste nochmals umzuschalten.
Leider habe ich im System (SBO 8.81) keine Einstellmöglichkeit für eine abweichende Standardpreisliste gefunden. Auch der Versuch das Problem mittels formatierter Suche zu lösen führte nicht zum Erfolg, da ich kein passendes Feld finde, dass mir auch beim Öffnen des Belegs sicher eine Change- Event liefert um die Abfrage auszulösen.
Vielleicht hat hier doch noch jemand eine Idee, wie das Problem zu lösen ist.
MfG
Christian Gey

Hallo
Danke erstmal für die Antwort. Auf die Idee mit der TransctionNotification war ich auch schon gekommen. Leider existiert dann doch die Anforderung ab und an mal einen Wareneingang mit abweichendender Preislistre buchen zu wollen. Insofern kann ich abweichende Preislisten nicht komplett unterdrücken.

Similar Messages

  • Wareneingang gebucht, ohne Seriennummer!

    Hallo Community,
    wie kann es sein, dass plötzlich ein Wareneingang - ohne nach einer Seriennummer gefragt zu haben - gebucht wurde!? (Obwohl so eingestellt)! Es hat bisher nie Probleme gegeben!
    Sowohl im Artikelstamm als auch in der Administration ist folgendes eingepflegt:
    Managementmethode - Bei jeder Buchung
    Artikel verwalten nach - Seriennummern
    Auch das Änderungsprotokoll hat nicht weitergeholfen - es wurde NIE geändert!
    Das komische ist, dass es jetzt schon das zweite mal mit der selben Artikelnummer passiert ist!!
    Aber wiederrum wurde mit der selben Artikelnummer schon etliche male ein Beleg hinzugefügt, wo es einwandfrei geklappt hat.
    Wie kann ich mir das erklären? Business One Bug?
    Ist eine Nachbuchung möglich, aber leider ist schon verrechnet worden!?
    - Der Kunde ist auf B1 2007A SP00 PL49.
    Würde mich auf Antwort freuen.
    MfG
    Simon Wöhrle
    Edited by: Simon Wöhrle on Dec 1, 2009 5:11 PM

    Hallo Simon,
    wenn das alles so ist wie Du schreibst, ist das ganz klar ein Fall für den B1 Support. Eventuell ist die DB korrupt, muss ev. repariert werden.
    Um sicher zu gehen, würde ich den Artikel inaktiv setzen, und einen neuen benutzen.
    Gruß
    Andreas

  • How to correct internal memory issue

    This is related to the standard SAP program SAPRCKM_MR11 in which there is one include RCKM_MR11F01 which contains a select statement :
    SELECT *
         INTO CORRESPONDING FIELDS OF TABLE t_bhistory
         FROM v_ckmlgrir
         WHERE bukrs EQ p_bukrs
         AND   ebeln IN r_ebeln
         AND   ebelp IN r_ebelp
         AND   lifnr IN r_lifnr
         AND   ekorg IN r_ekorg
         AND   ekgrp IN r_ekgrp
         AND   werks IN r_werks
         AND   bedat IN r_bedat
         AND   bsart IN r_bsart
         AND   bstyp IN ht_bstyp
         AND   vgabe IN ('1', '2', '3')  "Wareneingang/Rechnung/Nachbel.
         AND   loekz_k NE 'L'            "Loeschkz. Bestellkopf
         AND   loekz_p NOT IN ('L', 'S') "Loeschkz. Bestellposition
         AND ( frgrl   EQ space          "Freigabe unvollständig
         OR    frgrl   IS NULL )
         AND ( memory  EQ space          "Bestellung noch nicht komplett
         OR    memory  IS NULL )         "falls Feld nicht initialisiert
         AND ( xwoff   EQ space          "Wertbildung offen
         OR    xwoff   IS NULL )         "falls Feld nicht initialisiert
    bei Dienstleistungsbestellungen werden mehrfach kontierte
    Bestell-Pos. gegen das WE/RE-Konto gebucht, deshalb dürfen
    mehrfach kontierte Pos. nicht generell überlesen werden.
          AND   vrtkz   EQ space          "keine Mehrfachkontierung
         AND   wepos   EQ 'X'            "Wareneingang wird erwartet
         AND   repos   EQ 'X'            "Rechnung wird erwartet
         AND   weunb   EQ space          "Wareneingang unbewertet
         AND   stapo   EQ space.         "Item is not statistical
    There is one job FMT612P which contains this standard program and the job is going to abend
    because of the select statement given above which is because of some memory issue with the internal table t_bhistory, please give us a suggestion how we can avoid the same.

    Hi,
    I am also facing the same issue. We had copied this report into a custom report and are trying to improve performance by breaking the view into separate queries on EKKO, EKPO and EKBE.
    Can someone advise the best way to deal with this view v_ckmlgrir or a best approach to break down the view into separate queries.
    Thanks
    Edited by: Shreyas Shrikant Kulkarni on Jun 29, 2009 4:56 PM

  • Facing problem in copy of standard SAP  program

    hi,,,,,,,,,,,,
           when i execute this program in production server it displays an error ....i  m    trying to find out this error but this type(error) i cudnt find plz help me .....
           i m sending the documents which i rcvd from the system after the  execution of this program.
    this program executes perfctlly in developmnt server but it creates problem in production server,,,i searched out the type kkblo_t_sortinfo in the whole program but i cud nt find it ,,,,,,,,,
    documents.....
    Runtime Errors SYNTAX_ERROR
    Date and Time 18.11.2006 12:01:19
    ShrtText
    Syntax error in program "ZVISA_RM07MLBD ".
    What happened?
    Error in ABAP application program.
    The current ABAP program "????????????????????????????????????????" had to be
    terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    In program "ZVISA_RM07MLBD ", the following syntax error occurred
    in the Include "RM07MLBD_FORM_01 " in line 1805:
    The type KKBLO_T_SORTINFO" is unknown."
    also i m sending the include program ver i m facing problem...*&----
    *&  Include           RM07MLBD_FORM_01                                 *
    correction Aug. 2005 MM                                   "n856424
    - the fields "entry time", "entry date", and "User" are   "n856424
      are not filled filled for price change documents        "n856424
    MB5B improved regarding accessibilty                      "n773673
    Improvements :                       March 2003 MM        "n599218
    - print the page numbers                                  "n599218
    - send warning M7 393 when user deletes the initial       "n599218
      display variant                                         "n599218
    - show the current activity and the progress              "n599218
    contains FORM routines without preprocessor commands and  "n547170
    no text elements                                          "n547170
    *&      Form  INITIALISIERUNG
          Vorbelegung der Anzeigevariante                                *
    form initialisierung.
      repid = sy-repid.
      variant_save = 'A'.
      clear variante.
      variante-report = repid.
    Default-Variante holen:
      def_variante = variante.
      call function 'REUSE_ALV_VARIANT_DEFAULT_GET'
           exporting
                i_save     = variant_save
           changing
                cs_variant = def_variante
           exceptions
                not_found  = 2.
      if sy-subrc = 0.
      save the initial, e.g. default variant                  "n599218
        move  def_variante-variant  to  alv_default_variant.    "n599218
        p_vari = def_variante-variant.
      endif.
    print-no_print_listinfos = 'X'.
    endform.                               " INITIALISIERUNG
    *&      Form  AKTUELLE_BESTAENDE
         Ermittlung der aktuellen eigenen Bestände,
         d.h. der bewerteten Bestände und des Retourensperrbestandes,
         auf Lagerortebene und auf Material- bzw. Chargenebene;
         folgende Sonderbestände können gesondert ausgewiesen werden:
          Lohnbearbeitung         ( Sonderbestandskennzeichen  O )
          Kundenkonsignation      (             "              V, W, M )
          Lieferantenkonsignation (             "              K )
          Projektbestand          (             "              Q )
          Kundenauftragsbestand   (             "              E )
    form aktuelle_bestaende.
    delete the range tables for the creation of table g_t_organ
      if  g_t_organ[] is initial.                               "n433765
        refresh : g_0000_ra_werks, g_0000_ra_bwkey, g_0000_ra_bukrs.
        clear   : g_0000_ra_werks, g_0000_ra_bwkey, g_0000_ra_bukrs.
      endif.
      if      bwbst = 'X'.
      select the valuated stocks
        perform                  aktuelle_bst_bwbst.
      elseif lgbst = 'X'.
      all own stock from storage locations or batches
        if xchar = ' '.
          perform                aktuelle_bst_lgbst_mard.
        elseif  xchar = 'X'.
          perform                aktuelle_bst_lgbst_xchar.
        endif.
      elseif   sbbst = 'X'.
       special stocks
        case    sobkz.
          when  'O'.
            perform              aktuelle_bst_sbbst_o.
          when  'V' or  'W'.
            perform              aktuelle_bst_sbbst_v_w.
          when  'K' or  'M'.
            perform              aktuelle_bst_sbbst_k_m.
          when  'Q'.
            perform              aktuelle_bst_sbbst_q.
          when  'E'.
            perform              aktuelle_bst_sbbst_e.
          when  others.
          Angegebener Sonderbestand nicht vorhanden.
            message s290.
            perform              anforderungsbild.
        endcase.
      endif.
    create table g_t_organ with the plants and valuation areas from
    the database selection if table g_t_organ is empty
      perform  f0000_create_table_g_t_organ
                                 using  c_no_error.
    endform.                     "aktuelle_bestaende.
    *&   AKTUELLE_BST_LGBST_MARD
    form aktuelle_bst_lgbst_mard.
    eigener Bestand auf Lagerortebene -
    ... auf Materialebene -
      select * from mard into corresponding fields of table imard
                                             where werks in g_ra_werks
                                             and   lgort in g_ra_lgort
                                             and   matnr in matnr.
      if sy-subrc ne 0.          "no records found ?
        message s289.
      Kein Material in Selektion vorhanden.
        perform                  anforderungsbild.
      endif.
    does the user has the the authority for the found entries ?
      loop at imard.
        perform    f9000_auth_plant_check
                                 using  imard-werks.
        if  g_flag_authority is initial.
          delete             imard.
        else.
          perform  f9200_collect_plant     using  imard-werks.
          perform  f9400_material_key      using  imard-matnr.
        endif.
      endloop.
      describe table imard       lines g_f_cnt_lines.
      if  g_f_cnt_lines is initial.       "no records left  ?
        message s289.
      Kein Material in Selektion vorhanden.
        perform                  anforderungsbild.
      endif.
      if not charg-low is initial or not charg-high is initial.
        clear charg.
        message w285.
      Charge wird zurückgesetzt.
      endif.
    endform.                     "aktuelle_bst_lgbst_mard
       AKTUELLE_BST_LGBST_XCHAR
    form aktuelle_bst_lgbst_xchar.
    read the stock table mchb for batches
      select * from mchb into corresponding fields of table imchb
                                 where   werks  in  g_ra_werks
                                   and   lgort  in  g_ra_lgort
                                   and   matnr  in  matnr
                                   and   charg  in  charg.
      describe table imchb       lines  g_f_cnt_lines.
      if g_f_cnt_lines is initial.         "no records found ?
        message s821 with matnr werks lgort.
      Keine Chargen zu Material & in Werk & Lagerort & vorhanden.
        perform anforderungsbild.
      endif.
    process working table with the batches
      loop at imchb.
      does the user has the the authority for the found entries ?
        perform    f9000_auth_plant_check
                                 using  imchb-werks.
        if  g_flag_authority is initial.
          delete             imchb.
        else.
          perform  f9200_collect_plant     using  imchb-werks.
          perform  f9400_material_key      using  imchb-matnr.
        endif.
      endloop.
    endform.                     "aktuelle_bst_lgbst_xchar
       AKTUELLE_BST_SBBST_O
    form aktuelle_bst_sbbst_o.
    process Special Stocks with Vendor
    Bemerkung: Im Gegensatz zu den anderen Sonderbeständen existieren
               der Lohnbearbeitungs- und Kundenkonsignationsbestand
               nur auf Werksebene.
      select * from mslb into corresponding fields of table xmslb
                                 where  werks  in  g_ra_werks
                                   and  matnr  in  matnr
                                   and  charg  in  charg
                                   and  sobkz  =   'O'.
      if sy-subrc <> 0.                     "no records found ?
         message s289.
       Kein Material in Selektion vorhanden.
         perform anforderungsbild.
      endif.
    process the found records special stock vendor
      loop at xmslb.
      check the authority
        perform  f9000_auth_plant_check
                                 using      xmslb-werks.
        if  g_flag_authority is initial.
          delete                 xmslb.
        else.
        fill range table g_0000_ra_werks if it is still empty
          perform  f9200_collect_plant     using  xmslb-werks.
          perform  f9400_material_key      using  xmslb-matnr.
        endif.
      endloop.
    error, if no records are left
      describe table xmslb       lines g_f_cnt_lines.
      if  g_f_cnt_lines is initial.
        message s289.
      Kein Material in Selektion vorhanden.
        perform anforderungsbild.
      endif.
          sort xmslb.
          loop at xmslb.
            move-corresponding xmslb to imslb.
            collect imslb.
          endloop.
          free xmslb. refresh xmslb.
          if xchar = ' '.
            loop at imslb.
              move-corresponding imslb to imslbx.
              collect imslbx.
            endloop.
            sort imslbx.
          elseif xchar = 'X'.
            loop at imslb.
              check imslb-charg is initial.
              delete imslb.
            endloop.
          endif.
    endform.                     "aktuelle_bst_sbbst_o.
       AKTUELLE_BST_SBBST_V_W
    form aktuelle_bst_sbbst_v_w.
    Sonderbestand Kundenkonsignation -
      elseif sobkz = 'V' or sobkz = 'W'.
          select * from msku into corresponding fields of table xmsku
                                             where werks in g_ra_werks
                                             and   matnr in matnr
                                             and   charg in charg
                                             and   sobkz eq sobkz.
      if sy-subrc <> 0.          "no records found
        message s289.
      Kein Material in Selektion vorhanden.
        perform anforderungsbild.
      endif.
    process Special Stocks with Customer
      loop at xmsku.
        perform  f9000_auth_plant_check    using     xmsku-werks.
        if  g_flag_authority is initial.
          delete                 xmsku.
        else.
          perform  f9200_collect_plant     using  xmsku-werks.
          perform  f9400_material_key      using  xmsku-matnr.
        endif.
      endloop.
      describe table xmsku       lines  g_f_cnt_lines.
      if g_f_cnt_lines is initial.         "no records found
        message s289.
      Kein Material in Selektion vorhanden.
        perform anforderungsbild.
      endif.
          sort xmsku.
          loop at xmsku.
            move-corresponding xmsku to imsku.
            collect imsku.
          endloop.
          free xmsku. refresh xmsku.
          if xchar = ' '.
            loop at imsku.
              move-corresponding imsku to imskux.
              collect imskux.
            endloop.
            sort imskux.
          elseif xchar = 'X'.
            loop at imsku.
              check imsku-charg is initial.
              delete imsku.
            endloop.
          endif.
          if sy-subrc ne 0.
            message s042.                             "#EC *    "n443935
          Charge ist nicht vorhanden.
            perform anforderungsbild.
          endif.
    endform.                     "aktuelle_bst_sbbst_v_w
       AKTUELLE_BST_SBBST_K_M
    form aktuelle_bst_sbbst_k_m.
    Sonderbestand Lieferantenkonsignation -
      elseif sobkz = 'K' or sobkz = 'M'.
          select * from mkol into corresponding fields of table xmkol
                                            where werks in g_ra_werks
                                            and   lgort in g_ra_lgort
                                            and   matnr in matnr
                                            and   charg in charg
                                            and   sobkz eq sobkz.
      if sy-subrc <> 0.          "no records found
        message s289.
      Kein Material in Selektion vorhanden.
        perform anforderungsbild.
      endif.
    process Special Stocks from Vendor
      loop at xmkol.
        perform  f9000_auth_plant_check    using  xmkol-werks.
        if  g_flag_authority is initial.
          delete             xmkol.
        else.
          perform  f9200_collect_plant     using  xmkol-werks.
          perform  f9400_material_key      using  xmkol-matnr.
        endif.
      endloop.
      describe table xmkol       lines  g_f_cnt_lines.
      if g_f_cnt_lines is initial.         "no records found
        message s289.
      Kein Material in Selektion vorhanden.
        perform anforderungsbild.
      endif.
          sort xmkol.
          loop at xmkol.
            move-corresponding xmkol to imkol.
            collect imkol.
          endloop.
          free xmkol. refresh xmkol.
          if xchar = ' '.
            loop at imkol.
              move-corresponding imkol to imkolx.
              collect imkolx.
            endloop.
            sort imkolx.
          elseif xchar = 'X'.
            loop at imkol.
              check imkol-charg is initial.
              delete imkol.
            endloop.
          endif.
          if sy-subrc ne 0.
            message s042.                             "#EC *    "n443935
          Charge ist nicht vorhanden.
            perform anforderungsbild.
          endif.
    endform.                     "aktuelle_bst_sbbst_k_m.
       AKTUELLE_BST_SBBST_Q
    form aktuelle_bst_sbbst_q.
    Projektbestand -
      elseif sobkz = 'Q'.
          select * from mspr into corresponding fields of table xmspr
                                             where werks in g_ra_werks
                                             and   lgort in g_ra_lgort
                                             and   matnr in matnr
                                             and   charg in charg
                                             and   sobkz eq sobkz.
      if sy-subrc <> 0.          "no record found
        message s289.
      Kein Material in Selektion vorhanden.
        perform anforderungsbild.
      endif.
    process project stock
      loop at xmspr.
        perform  f9000_auth_plant_check    using  xmspr-werks.
        if  g_flag_authority is initial.
          delete                 xmspr.
        else.
          perform  f9200_collect_plant     using  xmspr-werks.
          perform  f9400_material_key      using  xmspr-matnr.
        endif.
      endloop.
      describe table xmspr       lines  g_f_cnt_lines.
      if  g_f_cnt_lines is initial.        "no record left
        message s289.
      Kein Material in Selektion vorhanden.
        perform anforderungsbild.
      endif.
          sort xmspr.
          loop at xmspr.
            move-corresponding xmspr to imspr.
            collect imspr.
          endloop.
          free xmspr. refresh xmspr.
          if xchar = ' '.
            loop at imspr.
              move-corresponding imspr to imsprx.
              collect imsprx.
            endloop.
            sort imsprx.
          elseif xchar = 'X'.
            loop at imspr.
              check imspr-charg is initial.
              delete imspr.
            endloop.
          endif.
    endform.:                     "aktuelle_bst_sbbst_q
       AKTUELLE_BST_SBBST_E
    form aktuelle_bst_sbbst_e.
    Kundenauftragsbestand -
          select * from mska into corresponding fields of table xmska
                                             where werks in g_ra_werks
                                             and   lgort in g_ra_lgort
                                             and   matnr in matnr
                                             and   charg in charg
                                             and   sobkz eq sobkz.
      if sy-subrc <> 0.            "no records found
        message s289.
      Kein Material in Selektion vorhanden.
        perform anforderungsbild.
      endif.
    process Sales Order Stock
      loop at xmska.
        perform  f9000_auth_plant_check    using  xmska-werks.
        if  g_flag_authority is initial.
          delete                   xmska.
        else.
          perform  f9200_collect_plant     using  xmska-werks.
          perform  f9400_material_key      using  xmska-matnr.
        endif.
      endloop.
      describe table xmska       lines  g_f_cnt_lines.
      if  g_f_cnt_lines is initial.        "no records left ?
        message s289.
      Kein Material in Selektion vorhanden.
        perform anforderungsbild.
      endif.
          sort xmska.
          loop at xmska.
            move-corresponding xmska to imska.
            collect imska.
          endloop.
          free xmska. refresh xmska.
          if xchar = ' '.
            loop at imska.
              move-corresponding imska to imskax.
              collect imskax.
            endloop.
            sort imskax.
          elseif xchar = 'X'.
            loop at imska.
              check imska-charg is initial.
              delete imska.
            endloop.
          endif.
    endform.                     "aktuelle_bst_sbbst_e
    *&      Form  TABELLEN_LESEN
          Lesen der Materialkurztexte (Tabelle MAKT),                    *
          der Mengeneinheiten (Tabelle MARA) und                         *
          Mengen- und Wertfortschreibung zum Material (Tabelle T134M)    *
          (Letzteres ist zum Aussortieren der unbewerteten bzw.          *
          kontierten Warenbewegungen notwendig)                          *
    form tabellen_lesen.
      if  not g_t_mat_key[] is initial.                         "n451923
      select the material masters
        select matnr meins mtart from mara
                       into corresponding fields of table imara
                       for all entries in g_t_mat_key
                                 where  matnr  =  g_t_mat_key-matnr.
      select the short text for all materials
      take only the necessary fields                          "n451923
        select matnr maktx       from makt                      "n451923
             into corresponding fields of table g_t_makt        "n451923
                       for all entries in g_t_mat_key
                       where  matnr = g_t_mat_key-matnr
                         and  spras = sy-langu.
        sort  imara              by  matnr.                     "n451923
        sort  g_t_makt           by  matnr.                     "n451923
        free                     g_t_mat_key.
      endif.
      data: begin of k1 occurs 0,
        mtart like t134m-mtart,
      end of k1.
      refresh k1.
      loop at imara.
        k1-mtart = imara-mtart.
        collect k1.
      endloop.
      if  not k1[] is initial.                                  "n451923
        select * from t134m
               into corresponding fields of table it134m
               for all entries in k1         where mtart = k1-mtart
                                             and   bwkey in g_ra_bwkey.
      endif.                                                    "n451923
      loop at it134m.
      read table organ with key bwkey = it134m-bwkey.
        perform  f9300_read_organ
                       using     c_bwkey     it134m-bwkey.
        if sy-subrc ne 0.
          delete it134m.
        endif.
      endloop.
    To find postings with valuation string, but without relevance for
    the valuated stock, Big-G recommended this logic:
    Take lines from MSEG where for the combination BUSTW/XAUTO=XBGBB
    there is an entry in T156W with key BSX.
      select bustw xbgbb from t156w
                         into corresponding fields of table it156w
                         where vorsl = 'BSX'.
      sort it156w by bustw xbgbb.
      delete adjacent duplicates from it156w.
      delete it156w where bustw = space.
    endform.                               " TABELLEN_LESEN
    *&      Form  UNBEWERTET_WEG
          Löschen der unbewerteten Materialien aus der internen          *
          Tabelle IMBEW
    form unbewertet_weg.
      sort  it134m               by bwkey mtart.                "n451923
                                                                "n450764
    delete the materials in plants without valuation          "n450764
      loop at g_t_mbew           into  g_s_mbew.                "n450764
        read table imara                                        "n450764
                       with key matnr = g_s_mbew-matnr          "n450764
                       binary search.                           "n450764
                                                                "n450764
        read table it134m with key bwkey = g_s_mbew-bwkey       "n450764
                                   mtart = imara-mtart binary search.
        if sy-subrc ne 0.
        message ...
          delete                 g_t_mbew.                      "n450764
        else.
          if it134m-wertu = ' '.
            delete               g_t_mbew.                      "n450764
          else.                                                 "n450764
          enrich the entries with the quantity unit           "n450764
            move    imara-meins  to    g_s_mbew-meins.          "n450764
            modify  g_t_mbew     from  g_s_mbew                 "n450764
                                 transporting  meins.           "n450764
          endif.
        endif.
      endloop.
    endform.                               " UNBEWERTET_WEG
    *&      Form  FI_BELEGE_LESEN                                          *
          Lesen der Buchhaltungsbelege                                   *
    Beim Erfassen der Werte ist es notwendig, die Buchhaltungsbelege    *
    zum Material zu lesen, um abweichende Werte zwischen Wareneingang   *
    und Rechnungseingang sowie Nachbelastungen zu berücksichtigen.      *
    form fi_belege_lesen.
    Not related to note 184465, but a significant performance issue
    if ORGAN is large due to many plants/storage locations.
      data: begin of t_bwkey occurs 0,                               "184465
              bwkey like bsim-bwkey,                                 "184465
            end of t_bwkey.                                          "184465
      loop at g_t_organ          where  keytype  =  c_bwkey.
        move g_t_organ-bwkey     to  t_bwkey-bwkey.
        collect t_bwkey.                                             "184465
      endloop.                                                       "184465
      read table t_bwkey index 1.                                    "184465
      check sy-subrc = 0.                                            "184465
      select * from bsim                                        "n443935
             into corresponding fields of table g_t_bsim_lean   "n443935
               for all entries in t_bwkey   where  bwkey = t_bwkey-bwkey
                                            and    matnr in matnr
                                            and    bwtar in bwtar
                                            and    budat >= datum-low.
      loop at g_t_bsim_lean      into  g_s_bsim_lean.           "n443935
        perform  f9300_read_organ
                       using     c_bwkey  g_s_bsim_lean-bwkey.  "n443935
        if  sy-subrc is initial.
        record found : the user has the authority, go on
          move  g_s_organ-bukrs  to  g_s_bsim_lean-bukrs.       "n443935
          modify  g_t_bsim_lean  from  g_s_bsim_lean            "n443935
                                 transporting  bukrs.           "n451923
        create working table with the keys for the FI documents
          move-corresponding  g_s_bsim_lean                     "n443935
                                 to  g_t_bkpf_key.              "n443935
          append                 g_t_bkpf_key.
        else.
          delete                 g_t_bsim_lean.                 "n443935
        endif.
      endloop.
    endform.                               " FI_BELEGE_LESEN
    *&      Form  BELEGE_SORTIEREN
       Die Materialbelege werden anhand des Buchungsdatums sortiert.
       Die Materialbelege mit Buchungsdatum zwischen 'datum-high'
       und dem aktuellen Datum werden in der internen Tabelle IMSWEG
       gesammelt, während die Materialbelege mit Buchungsdatum
       zwischen 'datum-low' und 'datum-high' in der internen Tabelle
       IMSEG verbleiben.
    form belege_sortieren.
      aktdat = sy-datlo + 30.
      if not ( datum-high is initial or datum-high > aktdat ).
        loop at g_t_mseg_lean    into  g_s_mseg_lean
                                 where budat > datum-high.
          move-corresponding g_s_mseg_lean to imsweg.
          append imsweg.
          delete                 g_t_mseg_lean.
        endloop.
      endif.
      describe table imsweg lines index_2.
    endform.                               " BELEGE_SORTIEREN
    *&      Form  KONTIERT_AUSSORTIEREN
          Aussortierung der kontierten Belegpositionen,                  *
          da diese Mengen nicht bestandsrelevant sind                    *
    form kontiert_aussortieren.
    process table g_t_mseg_lean
    loop at imseg where kzvbr <> space and                         "144845
        ( kzbew = 'B' or kzbew = 'F' ).                            "144845
        read table imara with key matnr = imseg-matnr.
        read table it134m with key mtart = imara-mtart.
        if not it134m-mengu is initial and not it134m-wertu is initial.
    Die Felder 'mengu' und 'wertu' (Mengen- bzw. Wertfortschreibung)
    sind ab Release 3.0 D auch in die Tabelle MSEG aufgenommen.
    Die Einträge in der Tabelle T134M stellen nach wie vor die generelle
    Einstellung dar; auf Positionsebene sind jedoch Abänderungen möglich,
    die anhand der Einträge in der Tabelle MSEG nachverfolgt werden
    können.
          delete imseg.
        endif.
    endloop.
      data : l_f_bwkey           like  t001k-bwkey.             "n497992
      sort  it134m               by  bwkey  mtart.              "n497992
      loop at g_t_mseg_lean      into  g_s_mseg_lean
                                 where  kzvbr <> space
                                   and ( kzbew = 'B' or kzbew = 'F' ).
      get the valuation area                                  "n497992
        if  curm = '3'.                                         "n497992
        valuation level is company code                       "n497992
          if  g_s_mseg_lean-bukrs is initial.                   "n497992
          get the valuation area for this plant               "n497992
            perform  f9300_read_organ                           "n497992
                       using     c_werks   g_s_mseg_lean-werks. "n497992
                                                                "n497992
            move  g_s_organ-bwkey     to  l_f_bwkey.            "n497992
          else.                                                 "n497992
            move  g_s_mseg_lean-bukrs to  l_f_bwkey.            "n497992
          endif.                                                "n497992
        else.                                                   "n497992
        valuation level is plant                              "n497992
          move  g_s_mseg_lean-werks   to  l_f_bwkey.            "n497992
        endif.                                                  "n497992
        read table imara with key matnr = g_s_mseg_lean-matnr
                                 binary search.
        if  sy-subrc is initial.
          read table it134m      with key  bwkey = l_f_bwkey    "n497992
                                           mtart = imara-mtart  "n497992
                                 binary search.
          if  sy-subrc is initial.
            if not it134m-mengu is initial and
               not it134m-wertu is initial.
              delete              g_t_mseg_lean.
            endif.
          endif.
        else.
          delete                  g_t_mseg_lean.
        endif.
      endloop.
    endform.                               " KONTIERT_AUSSORTIEREN
    *&      Form  BELEGE_ERGAENZEN (engl. enrich documents)
    Material documents and FI documents from BSIM are merged together.
    Complications:
    - A material document can have more than one FI document.
    - There are FI documents without material documnts
    - There are material documents without FI documents
    - The document type is customizeable
    - There is no link from the materia document position to
      the FI document entry in BSIM (except URZEILE, but this
      can be filled incorrectly)
    form belege_ergaenzen.                         "Version from note 204872
    - show the current activity and the progress              "n599218
      call function 'SAPGUI_PROGRESS_INDICATOR'                 "n599218
        exporting                                               "n599218
          text = text-061.       "Reading FI documents          "n599218
    Eliminate material documents with valuation string, but without
    relevance to the valuated stock. IT156W contains all valuation
    strings with posting key BSX. XBGBB says: "I am an accrural posting".
    For more details please ask Big-G.
      loop at g_t_mseg_lean      into  g_s_mseg_lean.
      special processing for tied empties active ?            "n497992
        if  not g_cust_tied_empties is initial.                 "n497992
        look for MM documents with xauto = L and change       "n497992
        indicators                                            "n497992
          case  g_s_mseg_lean-xauto.                            "n497992
            when  'X'.                                          "n497992
            when  space.                                        "n497992
            when  others.                                       "n547170
            range table g_ra_xauto contains the special       "n547170
            indicators for the transfer movements of the      "n547170
            tied empties                                      "n547170
              if  g_s_mseg_lean-xauto in g_ra_xauto.            "n547170
                move  g_s_mseg_lean-xauto                         "n497992
                                 to  g_s_mseg_lean-retail.        "n497992
                clear              g_s_mseg_lean-xauto.           "n497992
                modify  g_t_mseg_lean    from  g_s_mseg_lean      "n497992
                                 transporting xauto retail.       "n497992
              endif.                                            "n547170
          endcase.                                              "n497992
        endif.                                                  "n497992
        read table it156w        with key
                                 bustw = g_s_mseg_lean-bustw
                                 xbgbb = g_s_mseg_lean-xauto
                                 transporting no fields
                                 binary search.
        if sy-subrc <> 0.
          delete                 g_t_mseg_lean.
        else.                                                   "n443935
        enrich the current entry with the company code        "n443935
          perform f9300_read_organ                              "n443935
                       using     c_werks  g_s_mseg_lean-werks.  "n443935
                                                                "n443935
          check : sy-subrc is initial.                          "n443935
          move  g_s_organ-bukrs  to  g_s_mseg_lean-bukrs.       "n443935
          modify  g_t_mseg_lean  from  g_s_mseg_lean            "n443935
                                 transporting  bukrs.           "n451923
        endif.
      endloop.
    For all available FI documents from BSIM, read the header data
    from BKPF to get the link to the originating material document.
      if  not g_t_bkpf_key[] is initial.
      look for the header of the matching FI documents
        sort  g_t_bkpf_key       by  bukrs belnr gjahr.
        delete adjacent duplicates from g_t_bkpf_key.
      save result from database selection into global hashed  "n856424
      table g_t_bkpf                                          "n856424
        select  *                 from bkpf                     "n856424
          into corresponding fields of table g_t_bkpf           "n856424
               for all entries in g_t_bkpf_key
                       where  bukrs = g_t_bkpf_key-bukrs
                         and  belnr = g_t_bkpf_key-belnr
                         and  gjahr = g_t_bkpf_key-gjahr.
        if  sy-subrc is initial.
        create working table l_t_keytab_m
          free                   g_t_bkpf_key.
          loop at g_t_bsim_lean  into  g_s_bsim_lean.           "n443935
          enrich the working table g_t_bsim_lean with the     "n443935
          MM doc info                                         "n443935
                                                                "n443935
          look for the matching FI document header            "n443935
            read table g_t_bkpf  assigning           "n856424
                       with key  bukrs = g_s_bsim_lean-bukrs    "n443935
                                 belnr = g_s_bsim_lean-belnr    "n443935
                                 gjahr = g_s_bsim_lean-gjahr.   "n443935
                                                                "n443935
            if  sy-subrc is initial.                            "n443935
            enrich table G_T_BSIM_LEAN with the MM doc        "n443935
            consider only FI docs created by MM docs here     "n856424
              check :

    Hi Ravi,
    possibly a service pack has been installed just in the time when you created the copy. I found
        data: lt_sort type kkblo_t_sortinfo.                    "n890109
    in the include mentioned on our system. Please check if the includes are identical in development and production server (remote-compare from editor).
    But we also have a copy of this in our system. In the copy I found type name like alv_type_sortinfo but no kkblo_t_sortinfo.
    Note KKBLO was the predecessor of ALV.
    Must have to dio something with version changed by service pack.
    Regards,
    Clemens

  • Badi ME_PROCESS_REQ_CUST Sample Code required for changing the values

    Dear Friends,
    I am new to the Badi technology. We would like to populate/change the standard field values, (Purchasing group) during Purchase Requisition creation/change.
    Method --> PROCESS_ITEM.
    I tried the following code, but system blnaks out all the field values entered during PR creation.
    Appreciate, if you could provide me some sample code which can be of help.
    Reg
    Kumar
    Sample code----
    METHOD if_ex_me_process_req_cust~process_item .
    DATA: k_mereqitem          TYPE mereq_item,
            om_data              type mereq_item,
            om_datax             type mereq_itemx,
        k_mereqitem = im_item->get_data( ).
        check im_count = 1.
        if k_mereqitem-bsart = 'ST' and
           k_mereqitem-loekz = ' '.
        om_data-pstyp = '5'. " assign default item category code
        om_data-bnfpo = k_mereqitem-bnfpo.
        om_data-WERKS = k_mereqitem-WERKS.
        om_datax-pstyp = 'X'.
        call method im_item->set_datax
             exporting im_datax = om_datax.
        call method im_item->set_data
             exporting im_data =  om_data.
        endif.
    ENDMETHOD.

    Hi Kumar,
    i have not a special solution for your case, but i use this BADI with great effort
    As my comments in example are in german lg. i explain in short words what i do:
    X) define data
    1) select data from base item
    1a) header-data
    1b) item data (easy)
    1c) accounting data
    2+3) check field values, post warning message + mostly change values + sometimes set cursor focus on field
    Have a look and give me some points if my example increased your BADI knowledge
    regards
    Jörg
    METHOD if_ex_me_process_po_cust~process_item .
    * Business-Add-Inn ME_PROCESS_PO_CUST
    * Jörg Sauterleute - 23.12.2005
    * Ablauf:
    * 1. Datenbschaffung
    * 2. Feldänderungen prüfen + Warnung ausgeben
    * 3. Feldinhalte prüfen + evtl. ändern u. Hinweis ausgeben
      DATA: ls_mepoitem TYPE mepoitem,
            ls_mepoheader TYPE mepoheader,
            ls_mepoaccounting TYPE mepoaccounting.
    * Interfacereferenz auf <if_purchase_order_mm>
      DATA: header_obj TYPE REF TO if_purchase_order_mm.
    * Interfacereferenz auf <if_purchase_order_account_mm> über Tabelle
      DATA: it_accountings TYPE purchase_order_accountings, "Tabelle
            accounting_obj TYPE purchase_order_accounting.
    * Include für Ausgabe von Meldungen
    * im BAdI ME_PROCESS_PO_CUST niemals ABAP-Statement MESSAGE verwenden!
      INCLUDE mm_messages_mac.
    * Hilfsvariablen
      DATA: h_change_mepoitem TYPE c,
            h_text TYPE string.
      IF sy-sysid = 'HLT'. break sau. ENDIF.
    * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    * 1. Datenbeschaffung
    * Kopfdaten
      header_obj = im_item->get_header( ).
      ls_mepoheader = header_obj->get_data( ).
    * Positionsdaten
      ls_mepoitem = im_item->get_data( ).
    * Kontierungsdaten (Accounting) über Tabelle it_accountings
      it_accountings = im_item->get_accountings( ).
    * ...IF eingebaut, weil sonst später Abbruch, wenn sy-subrc <> 0
      IF NOT ls_mepoitem-knttp IS INITIAL.
        LOOP AT it_accountings INTO accounting_obj.
          ls_mepoaccounting = accounting_obj-accounting->get_data( ).
        ENDLOOP.
      ENDIF.
    * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    * 2. Daten prüfen -> Warnmeldung
    * Feld Empfänger (Kontierung) prüfen -> Warnmeldung
      IF ls_mepoheader-ekorg = '1000' AND
         ls_mepoheader-bsart = 'IB'.
        IF NOT ls_mepoitem-knttp IS INITIAL.
          CASE ls_mepoheader-ekgrp.
            WHEN '500' OR '501'.
              IF NOT ls_mepoaccounting-wempf IS INITIAL.
                mmpur_metafield mmmfd_recipient.       "Warenempfänger - Cursor setzen
                mmpur_message_forced 'I' 'ME' '303' text-011 '' '' ''.
    * Warnmeldung wieder aus Protokoll entfernen.
                IF ls_mepoaccounting-wempf IS INITIAL.
                  mmpur_remove_messages_by_id ls_mepoaccounting-id.
                  mmpur_business_obj_id ls_mepoaccounting-id.
                ENDIF.
              ENDIF.
            WHEN OTHERS.
              IF ls_mepoaccounting-wempf IS INITIAL.
                mmpur_metafield mmmfd_recipient.       "Warenempfänger - Cursor setzen
                mmpur_message_forced 'W' 'ME' '303' text-010 '' '' ''.
              ENDIF.
    * Warnmeldung wieder aus Protokoll entfernen.
              IF NOT ls_mepoaccounting-wempf IS INITIAL.
                mmpur_remove_messages_by_id ls_mepoaccounting-id.
                mmpur_business_obj_id ls_mepoaccounting-id.
              ENDIF.
          ENDCASE.
        ENDIF.
      ENDIF.
    * Ende Feld Empfänger (Kontierung) prüfen -> Warnmeldung
    * Ende test
    * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    * 3. Positionsdaten prüfen/ändern -> setzen
      CLEAR: h_change_mepoitem,
             h_text.
    * Kennzeichen Wareneingang prüfen/ändern
    * Belegart 'NB' immer mit "Wareneingang" wegen Log. Rechnungsprüfung
    * Belegart 'IB' immer ohne "Wareneingang" weil Einsatz Workflow
    * (Kennzeichen 'WEPOS' setzen/nicht setzen)
      IF NOT ls_mepoitem-knttp IS INITIAL.
        CASE ls_mepoheader-bsart.
          WHEN 'NB'.
    * Prüfung ob gesetzt
    * Wenn nicht, dann setzen und Daten übergeben
    * Cursor auf Metafeld (aus Typgruppe MMMFD) für Fehlerbehandlung
            IF ls_mepoitem-wepos IS INITIAL.
              ls_mepoitem-wepos = 'X'.
              h_change_mepoitem = 'X'.
    *           im_item->set_data( EXPORTING im_data = ls_mepoitem ).
              h_text = text-001.
              mmpur_metafield mmmfd_gr_ind .       "WE-Kennzeichen - Cursor setzen
    *           message erst später ausführen!
    *           mmpur_message_forced 'I' 'ME' '303' text-001 '' '' ''.
            ENDIF.
          WHEN 'IB'.
    * Prüfung ob nicht gesetzt
    * Wenn doch, dann entfernen und Daten übergeben
    * Cursor auf Metafeld (aus Typgruppe MMMFD) für Fehlerbehandlung
            IF NOT ls_mepoitem-wepos IS INITIAL.
              ls_mepoitem-wepos = ' '.
              h_change_mepoitem = 'X'.
    *            im_item->set_data( EXPORTING im_data = ls_mepoitem ).
              h_text = text-002.
              mmpur_metafield mmmfd_gr_ind .       "WE-Kennzeichen - Cursor setzen
    *           message erst später ausführen!
    *           mmpur_message_forced 'I' 'ME' '303' text-002 '' '' ''.
            ENDIF.
        ENDCASE.
      ENDIF.
    * Ende Kennzeichen Wareneingang prüfen/ändern
    * Kennzeichen aut. WE-Abrech. (Rechnung) prüfen/ändern
    * (für autom. Gutschriftsverfahren Verpackungseinkauf)
    * Kreditordaten
      DATA: it_lfm1 TYPE TABLE OF lfm1,
            wa_lfm1 TYPE lfm1.
      IF ls_mepoheader-ekorg = '1000' AND
         ls_mepoheader-bsart = 'NB'   OR
         ls_mepoheader-bsart = 'KA'.
        IF ls_mepoitem-xersy IS INITIAL AND
           ls_mepoitem-umson IS INITIAL.                    "kostenlose Lieferung
          SELECT * FROM lfm1 INTO CORRESPONDING FIELDS OF TABLE it_lfm1
                   WHERE lifnr = ls_mepoheader-lifnr AND
                         ekorg = ls_mepoheader-ekorg.
          IF sy-subrc = 0.
            READ TABLE it_lfm1 INTO wa_lfm1 INDEX 1.
            IF wa_lfm1-xersy = 'X'.
              ls_mepoitem-xersy = 'X'.
              h_change_mepoitem = 'X'.
    *          im_item->set_data( EXPORTING im_data = ls_mepoitem ).
              h_text = text-005.
              mmpur_metafield mmmfd_ers.       " Kennz. aut.WE-Abrechnung - Cursor setzen
    *            message erst später ausführen!
    *            mmpur_message_forced 'I' 'ME' '303' text-005 '' '' ''.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    * Ende Kennzeichen aut. WE-Abrech. (Rechnung) prüfen/ändern
    * Kennzeichen WE-bezogene Rechnungsprüfung (Rechnung) prüfen/ändern
    * (für autom. Gutschriftsverfahren Verpackungseinkauf)
    * Kreditordaten bereits deklariert
    *  DATA: it_lfm1 TYPE TABLE OF lfm1,
    *        wa_lfm1 TYPE lfm1.
      IF ls_mepoitem-knttp IS INITIAL.
    * nicht anwenden bei kontierten Bestellungen
        IF ls_mepoitem-pstyp = 0.
    * nicht anwenden bei gefülltem Positionstyp (z.B. 'L' = Lohnbearbeitung, Preis 0,00 EUR)
          IF ls_mepoheader-ekorg = '1000' AND
             ls_mepoheader-bsart = 'NB'   OR
             ls_mepoheader-bsart = 'KA'.
            IF ls_mepoitem-webre IS INITIAL AND
               ls_mepoitem-umson IS INITIAL.                    "kostenlose Lieferung
              SELECT * FROM lfm1 INTO CORRESPONDING FIELDS OF TABLE it_lfm1
                       WHERE lifnr = ls_mepoheader-lifnr AND
                             ekorg = ls_mepoheader-ekorg.
              IF sy-subrc = 0.
                READ TABLE it_lfm1 INTO wa_lfm1 INDEX 1.
                IF wa_lfm1-webre = 'X'.
                  ls_mepoitem-webre = 'X'.
                  h_change_mepoitem = 'X'.
    *          im_item->set_data( EXPORTING im_data = ls_mepoitem ).
                  h_text = text-006.
                  mmpur_metafield mmmfd_gr_based_iv.   "WE-bezogene RP - Cursor setzen
    *            message erst später ausführen!
    *            mmpur_message_forced 'I' 'ME' '303' text-006 '' '' ''.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    * Ende Kennzeichen WE-bezogene Rechnungsprüfung (Rechnung) prüfen/ändern
    ** Kennzeichen Auftragsbestätigungspflicht prüfen/ändern
    ** (bisher nur Natec)
    ** Infosatzdaten (Konditionen) deklarieren
    ** Verweis of Tabelle mit Kopfzeilen immer mit TYPE TABLE OF
    *  DATA: it_ekomd TYPE TABLE OF ekomd,
    *        wa_ekomd TYPE ekomd.
    *  IF ls_mepoheader-ekorg = '1300' AND
    *     ls_mepoheader-bsart = 'NB'   .
    *    CALL FUNCTION 'ME_GET_INFORECORD_CONDITIONS'
    *      EXPORTING
    *        i_ekorg = ls_mepoheader-ekorg
    *        i_esokz = '0'                                       " '0' = NB
    *        i_infnr = ls_mepoitem-infnr
    *        i_lifnr = ls_mepoheader-lifnr
    *        i_matkl = ls_mepoitem-matkl
    *        i_matnr = ls_mepoitem-matnr
    *        i_werks = ls_mepoitem-werks
    *      TABLES
    *        tekomd  = it_ekomd.
    *    SORT it_ekomd BY datbi DESCENDING.
    *    READ TABLE it_ekomd INTO wa_ekomd INDEX 1.
    *    CASE ls_mepoheader-ekorg.
    *      WHEN '1300'.
    **     Anforderung Natec: wenn Infosatz-Kondition
    **       a)  leer o. nicht gültig  => AB setzen, wenn fehlt
    **       b)  älter       2 Monate  => AB setzen, wenn fehlt
    **       c)  nicht älter 2 Monate  => AB entfernen, wenn gesetzt
    **     Hilfsvariablen
    *        DATA: h_vgldat   TYPE sy-datum.   " Vergleichsdatum
    *        DATA: h_ergebnis TYPE c.
    **     Alter der Infosatzkondition ermitteln.
    *        CALL FUNCTION 'CCM_GO_BACK_MONTHS'
    *          EXPORTING
    *            currdate   = sy-datum
    *            backmonths = '002'
    *          IMPORTING
    *            newdate    = h_vgldat.
    *        IF wa_ekomd-datbi < sy-datum OR    " gefunden Kondition nicht gültig oder
    *           wa_ekomd-datbi IS INITIAL.      " keine Kondition gefunden
    *          h_ergebnis = 'a'.
    *        ENDIF.
    *        IF wa_ekomd-datab < h_vgldat.
    *          h_ergebnis = 'b'.
    *        ENDIF.
    *        IF wa_ekomd-datab > h_vgldat.
    *          h_ergebnis = 'c'.
    *        ENDIF.
    **       Prüfung ob nicht gesetzt
    *        IF ls_mepoitem-kzabs = ' ' AND
    *                  h_ergebnis = 'a' OR
    *                  h_ergebnis = 'b' .
    *          ls_mepoitem-kzabs = 'X'.
    *          h_change_mepoitem = 'X'.       "Merker setzen, geändert wird am Schluss
    **               im_item->set_data( EXPORTING im_data = ls_mepoitem ).
    *          h_text = text-003.
    **               message erst später ausführen!
    **               mmpur_message_forced 'I' 'ME' '303' text-004 '' '' ''.
    *        ENDIF.
    **       Prüfung ob gesetzt
    *        IF ls_mepoitem-kzabs = 'X' AND
    *           h_ergebnis        = 'c' .
    *          ls_mepoitem-kzabs = ' '.
    *          h_change_mepoitem = 'X'.       "Merker setzen, geändert wird am Schluss
    **               im_item->set_data( EXPORTING im_data = ls_mepoitem ).
    *          h_text = text-004.
    **               message erst später ausführen!
    **               mmpur_message_forced 'I' 'ME' '303' text-003 '' '' ''.
    *        ENDIF.
    *    ENDCASE.
    *  ENDIF.
    ** Ende Kennzeichen Auftragsbestätigungspflicht prüfen/ändern
    * Bestell-/Bestellpreis-Mengeneinheit prüfen/setzen
      DATA: h_txz01 TYPE mepoitem-txz01.   " Materialkurztext
      IF   ( ls_mepoheader-ekorg = '1000' OR
             ls_mepoheader-ekorg = '1500' ) AND
             ls_mepoheader-bsart = 'IB' AND
         NOT ls_mepoitem-knttp IS INITIAL.
    * Vergleichen ob eingegebene Mengeneinheit in Kurztext "avisiert"
        CONCATENATE '(' ls_mepoitem-meins ')' INTO h_txz01.
        IF ls_mepoitem-txz01 CS h_txz01.
          IF NOT ls_mepoitem-meins IS INITIAL.
            mmpur_metafield mmmfd_unit .       "Steuer-Kennz. - Cursor setzen
            mmpur_message_forced 'W' 'ME' '303' 'ME' ls_mepoitem-meins
                                                     text-031 ''.
          ENDIF.
    * sonst standarmäßig 'LE' setzen wegen Problemen bei Obligo
        ELSE.
          IF NOT ls_mepoitem-meins = 'LE'.
            ls_mepoitem-meins = 'LE'.
            ls_mepoitem-bprme = 'LE'.
            h_change_mepoitem = 'X'.
    *      im_item->set_data( EXPORTING im_data = ls_mepoitem ).
            h_text = text-030.
            mmpur_metafield mmmfd_unit .             "Steuer-Kennz. - Cursor setzen
    *      message erst später ausführen!
    *      mmpur_message_forced 'I' 'ME' '303' text-030 '' '' ''.
          ENDIF.
        ENDIF.
      ENDIF.
    * Ende Bestell-Mengeneinheit prüfen/ändern
    * Steuerkennzeichen prüfen/setzen (für EK-Gruppe 500,501)
      IF ls_mepoheader-ekorg = '5000' AND
         ls_mepoitem-matnr IS INITIAL.
        CASE ls_mepoheader-ekgrp.
          WHEN '500' OR '501'.
            IF ls_mepoitem-mwskz IS INITIAL.
              ls_mepoitem-mwskz = 'V4'.
              h_change_mepoitem = 'X'.
    *    "      im_item->set_data( EXPORTING im_data = ls_mepoitem ).
    *          h_text = text-020.
    *          mmpur_metafield mmmfd_tax_code .       "Cursor Steuer-Kennz.
    *    "      message erst später ausführen!
    *    "      mmpur_message_forced 'I' 'ME' '303' text-020 '' '' ''.
            ENDIF.
        ENDCASE.
      ENDIF.
    * Ende Steuerkennzeichen prüfen/ändern
    * zu 3.
    * zum Schluss noch die geänderten mepoitem-xxxx setzen
    * + gleiche Meldungen (I ME 303) ausgeben
      IF h_change_mepoitem = 'X'.
        im_item->set_data( EXPORTING im_data = ls_mepoitem ).
      ENDIF.
      IF NOT h_text IS INITIAL.
        mmpur_message_forced 'I' 'ME' '303' h_text '' '' ''.
      ENDIF.
    * Ende Daten prüfen/ändern -> setzen
    ENDMETHOD.                    "IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM

  • Timeout in select mseg

    Hi,
    i try this short report and get allways a runtime-error. Has anyone an idea where i can
    in MSEG faster?
    REPORT ZTEST MESSAGE-ID ZZ.
    TABLES: LFA1,   "Lieferantenstamm (allgemeiner Teil)
            LFM1,   "Lieferantenstamm Einkaufssicht
            MSEG.
    PARAMETERS:       P_MJAHR LIKE MKPF-MJAHR.
    SELECT-OPTIONS:   S_MBLNR FOR MSEG-LIFNR.
    SELECT-OPTIONS:   S_LIFNR FOR LFA1-LIFNR.
    DATA: DMBTR     LIKE          MSEG-DMBTR.
    DATA: DMBTR_SUM LIKE          MSEG-DMBTR.
    START-OF-SELECTION.
      SELECT * FROM LFA1 WHERE LIFNR IN S_LIFNR.
        SELECT SINGLE * FROM LFM1 WHERE LIFNR = LFA1-LIFNR
                                    AND EKORG = '1000'.
        CLEAR: DMBTR_SUM.
        IF SY-SUBRC = 0.
    * Nur wenn auch Einkaufssicht vorhanden
          SELECT DMBTR FROM MSEG INTO DMBTR
                             WHERE MBLNR IN S_MBLNR
                               AND MJAHR = P_MJAHR
                               AND LIFNR = LFA1-LIFNR
                               AND BWART = '101' "Wareneingang
                               AND KZBEW = 'B'.  "Bestellung.
            ADD DMBTR TO DMBTR_SUM.
          ENDSELECT.
        ENDIF.
        WRITE: LFA1-LIFNR, DMBTR_SUM.
      ENDSELECT.
    END-OF-SELECTION.
    Thanks.
    regards, Dieter
    Moderator message - Moved to the correct forum
    Edited by: Rob Burbank on May 12, 2009 9:30 AM

    Use this
    *& Report  ZSKC_SDN
    REPORT ZTEST MESSAGE-ID ZZ.
    TABLES: LFA1,   "Lieferantenstamm (allgemeiner Teil)
            LFM1,   "Lieferantenstamm Einkaufssicht
            MSEG.
    *                              D A T A
    TYPES : BEGIN OF TY_LIFNR,
              LIFNR TYPE LIFNR,
              SUM   TYPE WERTV9,
            END   OF TY_LIFNR,
            BEGIN OF TY_MSEG,
              MBLNR TYPE MBLNR,
              MJAHR TYPE MJAHR,
              ZEILE TYPE MBLPO,
              LIFNR TYPE ELIFN,
              DMBTR TYPE DMBTR,
            END   OF TY_MSEG.
    DATA :  T_LIFNR TYPE SORTED TABLE OF TY_LIFNR WITH UNIQUE KEY LIFNR,
            T_MSEG  TYPE STANDARD TABLE OF TY_MSEG.
    DATA :  IS_MSEG TYPE TY_MSEG.
    FIELD-SYMBOLS : <FS_LIFNR> TYPE TY_LIFNR.
    *                    S E L E C T I O N   S C R E E N
    PARAMETERS:       P_MJAHR LIKE MKPF-MJAHR.
    SELECT-OPTIONS:   S_MBLNR FOR MSEG-LIFNR.
    SELECT-OPTIONS:   S_LIFNR FOR LFA1-LIFNR.
    *                  S T A R T   O F   S E L E C T I O N
    START-OF-SELECTION.
    * Get the list of vendors.
      SELECT LFA1~LIFNR
      FROM   LFA1 INNER JOIN LFM1
             ON LFA1~LIFNR = LFM1~LIFNR
      INTO   TABLE T_LIFNR
      WHERE  LFA1~LIFNR IN S_LIFNR
      AND    LFM1~EKORG EQ '1000'.
      CHECK SY-SUBRC EQ 0.
    * Get Document Segment: Material.
      SELECT MBLNR MJAHR ZEILE LIFNR DMBTR
      INTO   TABLE T_MSEG
      FROM   MSEG
      WHERE  MBLNR IN S_MBLNR
      AND    MJAHR EQ P_MJAHR
      AND    BWART EQ '101'
      AND    KZBEW EQ 'B'.
      CHECK SY-SUBRC EQ 0.
      SORT T_MSEG BY LIFNR.
    * Calculate and Add.
      LOOP AT T_MSEG INTO IS_MSEG.
        READ TABLE T_LIFNR ASSIGNING <FS_LIFNR> WITH KEY LIFNR = IS_MSEG-LIFNR
                                                                 BINARY SEARCH.
        CHECK SY-SUBRC EQ 0.
        <FS_LIFNR>-SUM = <FS_LIFNR>-SUM + IS_MSEG-DMBTR.
      ENDLOOP.
    * Print output.
      LOOP AT T_LIFNR ASSIGNING <FS_LIFNR>.
        WRITE :/ <FS_LIFNR>-LIFNR, <FS_LIFNR>-SUM.
      ENDLOOP.
    Use this..This is the tuned version keeping the functionality intact. I assume u will be passing both the vendor number and the Material doc # in the selection screen.

  • Movement types corrsponds to Inbound ,Outbound and Internal transaction

    Hi,
    Can anyone tell me the list of movement types corresponding  to the Inbound,Outbound  and for Internal Transaction.
    for example:  movement type 101 corresponds to Inbound transaction.
    Thanks

    Dear Bala,
    This may help you.....
    Below you will find a short description of the standard movement types. The cancellation movement type is the movement type + 1 (cancellation for 101 = 102).
    101 Goods receipt for purchase order or order
    If the purchase order or order has not been assigned to an account, a stock type (unrestricted-use stock, stock in quality inspection, blocked stock) can be entered during goods receipt.
    If the purchase order or order has been assigned to an account, the goods receipt is not posted to the warehouse, but to consumption.
    In the case of non-valuated materials, the goods receipt is posted to the warehouse, although the purchase order has not been assigned to an account.
    Possible special stock indicators:
    o     K Goods receipt for purchase order to consignment stock
    o     O Goods receipt for purchase order to stock of material provided to vendor
    o     E GR for purchase order or order to
    o     sales order stock
    o     Q GR for purchase order or order to
    o     project stock.
    Goods receipt for subcontract order : at goods receipt, the consumption of the components is posted at the same time (see movement type 543)
    Goods receipt for
    stock transport order : at goods receipt the transported quantity is posted in the receiving plant from stock in transit into unrestricted-use stock (or stock in quality inspection, blocked stock).
    103 Goods receipt for purchase order into GR blocked stock
    The GR blocked stock is not valuated.
    You cannot receive goods into GR blocked stock for stock transport orders.
    105 Release from GR blocked stock for purchase order
    Movement type 105 has the same effects as 101.
    121 Subsequent adjustment for subcontracting
    This movement type cannot be entered manually.
    With a subsequent adjustment for a subcontract order it is possible to correct the consumption of components. In this case, the material produced by the supplier is credited with the excess consumption / under-consumption. For this reason, if there is a subsequent adjustment, an item is generated for the produced material using movement movement type 121.
    Movement type 121 does not have a reversal movement type.
    122 Return delivery to supplier or to production
    Using movement type 122, you can distinguish real return deliveries for a purchase order or order from cancellations (102).
    In the standard version, you must enter a reason for the return delivery if you are using movement type 122. In this way, evaluations of return deliveries are possible.
    The effects of movement type 122 correspond to a cancellation of movement type 101.
    123 Reversal of return delivery
    If you returned a goods receipt using movement type 122, you can reverse the return delivery using movement type 123.
    Movement type 123 has the same effects as movement type 101.
    124 Return delivery to vendor from GR blocked stock
    Using movement type 124, you can return a goods receipt to GR blocked stock (103).
    Movement type 124 has the same effects as movement type 104.
    125 Return delivery from GR blocked stock - reversal
    If you returned a goods receipt to GR blocked stock using movement type 124, you can reverse the return delivery using movement type 125.
    Movement type 125 has the same effects as movement type 103.
    131 Goods receipt for run schedule header
    This movement cannot be entered manually. It is generated automatically at notification of goods receipt for a run schedule header.
    Possible special stock indicators: E und Q
    161 Return for purchase order
    If a purchase order item is marked as a returns item, the returns to vendor are posted using movement type 161 when the goods receipt for purchase order is posted.
    Movement type 161 has the same effects as movement type 122.
    201 Goods receipt for a cost center
    The goods can only be withdrawn from unrestricted-use stock.
    Possible special stock indicators:
    o     K: Goods withdrawal from
    o     consignment stock
    o     P: Goods withdrawal from pipeline
    If you have withdrawals from consignment stock and from pipeline, payables to suppliers ensue.
    221 Goods issue for a project
    The goods can only be withdrawn from unrestricted-use stock.
    Possible special stock indicators: K, Q
    231 Goods issue for a customer order (without SD)
    You use this movement type if you want to process the delivery without SD.
    The goods can only be withdrawn from unrestricted-use stock.
    Possible special stock indicators: E, K, Q
    241 Goods issue for an asset
    The goods can only be withdrawn from unrestricted-use stock.
    Special stock indicator: K
    251 Goods issue for sales (without customer order)
    Use this movement type if you have not entered a customer order in SD. In the standard system, the movement is assigned to a cost center. kontiert.
    The goods can only be withdrawn from unrestricted-use stock.
    Possible special stock indicators: K
    261 Goods issue for an order
    This refers to all withdrawals for orders (for example, production order, maintenance order, except customer orders.
    Possible special stock indicators: E, K, P, Q, W
    The goods issue can be posted manually in Inventory Management or automatically when an order is confirmed or via an SD delivery.
    281 Goods issue for a network
    The goods can only be withdrawn from unrestricted-use stock.
    Possible special stock indicators: E, K, P, Q
    The goods issue can also be posted via an SD delivery.
    291 Goods issue for any arbitrary account assignment
    With this movement type, all account assignment fields are ready for input. You can assign the movement to an arbitrary account assignment object.
    The goods can only be withdrawn from unrestricted-use stock.
    Possible special stock indicators: E, K, P, Q
    301 Transfer posting plant to plant in one step
    The quantity is transferred from unrestricted-use stock in the issuing plant to unrestricted-use stock in the receiving plant.
    Possible special stock indicators: O, V, W
    303 Transfer posting plant to plant in two steps - removal from storage
    The quantity is transferred from unrestricted-use stock of the issuing plant to stock in transfer in the receiving plant.
    For technical reasons, you cannot carry out transfer postings from plant to plant in two steps for split-valuation materials.
    Removal from storage can be posted via an SD delivery.
    305 Transfer posting plant to plant in two steps - placement in storage
    The quantity is posted from
    stock in transfer to unrestricted-use stock in the receiving plant. The movement is not valuated.
    You can enter the goods receipt with reference to the SD delivery.
    309 Transfer posting material to material
    The quantity is posted from unrestricted-use stock of the issuing material into unrestricted-use stock in the receiving material
    Prerequisite: both materials have the same stockkeeping unit.
    Possible special stock indicators: E, O, Q, V, W
    311 Transfer posting storage location to storage location in one step
    The quantity is transferred from unrestricted-use stock of the issuing storage location to unrestricted use in the receiving storage location.
    Possible special stock indicators: E, K, M, Q
    See also 321, 343, 349, 455 for other stock types.
    313 Stock transfer storage location to storage location in two steps - removal from storage
    The quantity is transferred from unrestricted-use stock of the issuing storage location to stock in transfer in the receiving storage location.
    315 Transfer posting storage location to storage location in two steps - placement in storage
    The quantity is transferred from the
    stock in transfer to the unrestricted-use stock in the receiving storage location.
    317 Creation of a structured material from constituent components (Retail)
    A material split into its components using movement type 319 can be rejoined using movement type 317.
    Movement type 317 has the same effect as a cancellation of movement type 319.
    319 Split structured material into components (Retail)
    You can enter the splitting of a structured material manually using movement type 319.
    You can configure Customizing so that a structured material (for example, (z.B. set, prepack or display) is automatically split into its components at goods receipt. The system posts the split using movement type 319. In this process, the BOM header material is posted and each of the component stocks are increased. You can also use this function if you use the Warehouse Management System (WM).
    Example:
    A box of the structured material S contains 3 pieces of the component K1 and 4 pieces of the component K2. The following material document items result after the material is split at goods receipt:
         Qty      Unit      Material      Movement type
         1      box      S      101 +
         1      box      S      319 -
         4      piece      K1      319 +
         5      piece      K2      319 +
    321 Transfer posting stock in quality inspection - unrestricted-use stock
    The quantity is transferred from stock in quality inspection into unrestricted-use stock. Here it is possible to post the quantity to another storage location.
    This movement type is not possible for QM-managed materials since the transfer posting for these materials takes place using the usage decision.
    Possible special stock indicators: E, K, O, Q, V, W
    323 Transfer posting storage location to storage location - stock in quality inspection
    The quantity is transferred from stock in quality inspection in the issuing storage location into stock in quality inspection in the receiving storage location.
    Mögliche Sonderbestandskennzeichen: E, K, Q
    325 Transfer posting storage location to storage location - blocked stock
    The quantity is transferred from blocked stock in the issuing storage location into blocked stock in the receiving storage location.
    Possible special stock indicators: E, K, Q
    331 Withdrawal of sample from stock in quality inspection
    333 Withdrawal of sample from unrestricted-use stock
    335 Withdrawal of sample from blocked stock
    The sample is destructive, that is, the withdrawal has the same effects as scrapping.
    Possible special stock indicators: E, K, Q, V, W
    341 Change in status of a batch (available to not available)
    This goods movement is automatically created when there is a change in the status of a batch and it is also used to transfer the unrestricted-use stock into restricted-use stock.
    Possible special stock indicators: E, K, M, O, Q, V, W
    343 Transfer posting blocked stock - unrestricted-use stock
    349 Transfer posting blocked stock - stock in quality inspection
    The quantity is transferred from blocked stock to unrestricted-use stock (343) or stock in quality inspection (349).
    Here it is possible to transfer the quantity to another storage location.
    Possible special stock indicators: E, K, Q
    351 Goods issue for a stock transport order (without SD)
    The quantity is transferred from unrestricted-use stock in the issuing plant to stock in transit in the receiving plant.
    Movement type 351 is only used if the goods issue is posted without an SD delivery. A goods issue for a stock transport order with SD delivery is posted using movement type 641 or 643.
    The transfer posting is also possible for materials valuated separately.
    The goods issue for a stock transport order takes place using movement type 101.
    Possible special stock indicators: E, Q
    For special stock indicators E and Q and for purchase orders assigned to an account, ensure that the quantity is not posted to the stock in transit in the receiving plant.
    401 Transfer of sales order stock into company's own stock
    (no longer available as of Release 4.0C)
    The quantity is transferred from unrestricted-use sales order stock (non-valuated) into unrestricted-use storage location stock (valuated). For this movement, a special stock indicator is not required.
    It is possible to change the material number using this movement - if the material is managed in the company's own stock under a different material number (for example, for materials that can be configured).
    403 Transfer of consignment stock to company's own stock
    (no longer available as of Release 4.0C)
    The quantity is transferred from unrestricted-use consignment stock into unrestricted-use storage location stock and thus taken into the valuated stock. This results in a payable for vendors. For this movement, a special stock indicator is not required.
    405 Transfer of project stock to company's own stock
    (no longer available as of Release 4.0C)
    The quantity is transferred from unrestricted-use project stock to unrestricted-use storage location stock. A special stock indicator is not required for this movement.
    411 Transfer of special stocks E, K, and Q to company's own stock
    The quantity is transferred from unrestricted-use special stock E ( sales order stock ), unrestricted-use special stock K ( consignment stock) and unrestricted-use special stock Q ( project_stock ) to unrestricted-use storage location stock. The corresponding special stock indicator is required for this movement.
    If you do not use the special stock indicator, the system uses this movement type and movement type 311.
    For sales order stock, you can change the material number for this movement if you manage the material in your company's own stock under a different material number (for example, for configurable materials).
    Consignment stock is transferred to valuated stock, thus resulting in a vendor liability.
    441 Transfer posting non-tied to tied empties
    Part of the stock of an "empties" material assigned to a full product is managed in the stock type "tied empties".
    Empties stock not assigned to a full product forms part of the stock type "unrestricted-use".
    Using movement type 441, you can make a transfer posting for an empties material from the stock type "unrestricted-use" to the stock type "tied empties". Movement type 442 reverses this transaction.
    Example:
    The full product "beer" has a stock of 15 cases. Part of the empties components "bottle" and "case" is tied empties stock.
         Material      unrestricted-use      tied empties
         Beer      15      
         Bottle      240      360
         case      10      15
    451 Returns from customers (without SD)
    Using movement type 451, you post customer returns without an SD returns delivery into blocked stock returns . The blocked stock returns are not valuated.
    No special stock indicator possible.
    See also 453, 651, 653
    453 Transfer posting blocked stock returns to unrestricted-use stock
    457 Transfer posting blocked stock returns to quality inspection stock
    459 Transfer posting blocked stock returns to blocked stock
    The quantity is transferred from blocked stock returns to unrestricted-use stock (453), quality inspection stock (457) or blocked stock (459) and thereby transferred to valuated stock.
    With this movement you can transfer the quantity to another storage location at the same time.
    455 Transfer posting storage location to storage location - blocked stock returns
    The quantity is transferred from blocked stock returns of the issuing storage location to blocked stock returns of the receiving storage location.
    501 Goods receipt without purchase order - unrestricted-use stock
    503 Goods receipt without purchase order - stock in qual.inspection
    505 Goods receipt without purchase order - blocked stock
    These movement types are used for deliveries from vendors that are not based on a purchase order. Invoice verification is not possible for these goods receipts.
    Mögliche Sonderbestandskennzeichen: E, K, M, Q
    Bei einem Wareneingang zur Bestellung (101) kann der Zugang von
    Mehrwegtransportverpackung als zusätzliche Position mit 501 und Sonderbestandskennzeichen M erfaßt werden.
    511 Free-of-charge delivery from vendor
    The quantity is posted to unrestricted-use stock. If there is a material with moving average price, the moving average price is reduced accordingly.
    521 Goods receipt without order - unrestricted-use stock
    523 Goods receipt without order - stock in quality inspection
    525 Goods receipt without order - blocked stock
    The movement types are used for deliveries from production that are not based on a delivery.
    Possible special stock indicators: E, Q
    531 Goods receipt from by-product from the order
    The goods receipt of a by-product usually refers to an order, but it can be entered without a reference.
    If a component is entered with a negative quantity in the order, a reservation item is created with 531 (instead of 261). The receipt of a by-product can be entered when the component for the order is withdrawn from stock or it can be entered as another type of goods receipt.
    Possible special stock indicator: E, Q
    See also: 545 and 581
    541 Transfer posting unrestricted-use stock - stock of material provided to vendor
    WIth the movement type you provide the subcontractor with the components required for subcontract orders . The quantity is posted into unrestricted-use stock of material provided to vendor.
    If there is a goods receipt for a subcontract order (101), the consumption of components is posted from this stock.
    Special stock indicator cannot be used.
    The transfer posting can be posted via an SD delivery.
    543 Consumption from stock of material provided to vendor
    This movement cannot be entered manually.
    The consumption of components for a subcontract order is posted using goods receipt for purchase order (101). It can be corrected by means of a subsequent adjustment.
    Possible special stock indicators: E, Q.
    For the special stock indicators E and Q, you must ensure that the quantity is not removed from the stock of material provided to vendor, but from the unrestricted-use sales order or project stock.
    545 Goods receipt from by-product from subcontracting
    If a component is entered with a negative quantity for the subcontract order, the receipt of the by-product is posted during goods receipt for purchase order or during the subsequent adjustment.
    Possible special stock indicators: E, Q
    For special stock indicators E and Q, you must ensure that the quantity is not posted to the stock of material provided to vendor, but to the unrestricted-use sales order or project stock.
    551 Scrapping from unrestricted-use stock
    553 Scrapping from stock in quality inspection
    555 Scrapping from blocked stock
    Possible special stock indicators: E, K, Q
    561 Initial entry of stock - unrestricted-use stock
    563 Initial entry of stock - quality inspection
    564 Initial entry of stock - blocked stock
    During initial entry of stock balances, you enter the physical warehouse stock frigures or the book inventory from your old system into the SAP System for productive operation. This data entry usually takes place by means of batch input.
    Possible special stock indicators: E, K, M, O, Q, V, W (565: only E, K, Q)
    571 Goods receipt for assembly order to unrestricted-use
    573 Goods receipt for assembly order to quality inspection
    575 Goods receipt for assembly order to blocked stock
    This movement cannot be entered in Inventory Management, but only in repetitive manufacturing using the function "Goods receipt for sales order".
    Possible special stock indicators: E, K, Q
    581 Goods receipt of a by-product from the network
    The goods receipt of a by-product usually refers to a network , but can be entered without reference.
    If a component is entered with a negative quantity in the network, a reservation is created with 581 (instead of 261). The receipt of a by-product can be entered during the withdrawal for the network or as another type of goods receipt.
    Possible special stock indicators: E, Q
    601 Goods issue for delivery (SD)
    This movement cannot be entered manually. It is created automatically in SD using the function "Goods issue for delivery".
    The quantity is taken from unrestricted-use stock.
    Possible special stock indicators: E, K, Q
    621 Transfer posting unrestricted-use - returnable packaging (SD)
    This movement is generated by SD.
    The quantity is transferred from unrestricted-use stock to the returnable packaging stock at customer .
    623 Goods issue from returnable packaging stock at customer(SD)
    This movement is generated by SD.
    This quantity is withdrawn from unrestricted-use returnable packaging stock at the customer.
    631 Transfer posting unrestricted use - customer consignment stock (SD)
    This movement is generated by SD.
    The quantity is transferred from unrestricted-use stock to consignment stock at customer.
    633 Goods issue from customer consignment (SD)
    This movement is generated by SD.
    The quantity is withdrawn from unrestricted-use consignment stock at the customer.
    641 Goods issue for a stock transport order (SD)
    This movement is generated by SD.
    The quantity is transferred using an SD delivery from unrestricted-use stock of the issuing plant to stock in transit of the receiving plant.
    The goods receipt for the
    stock transport order takes place using movement type 101 and can, if required, refer to the purchase order or to the delivery.
    Possible special stock indicators: E, Q
    For the special stock indicators E and Q and for purchase orders assigned to an account, you must ensure that the quantity is not posted to the stock in transit of the receiving plant.
    See also: 351, 643
    643 Goods issue for a cross-company stock transport order (SD)
    This movement is generated by SD.
    It is used only for cross-company stock transport orders with SD billing and invoice. The quantity is withdrawn from the unrestricted-use stock of the issuing plant. No stock in transit is created here. In the second step, the goods receipt must be entered.
    Siehe auch: 351, 641
    645 Goods issue for a cross-company stock transport order in one step
    (SD)
    This movement is generated by SD.
    Unlike movement type 643, when a goods issue is posted using movement type 645, a goods receipt line is generated automatically.
    647 Goods issue for a stock transport order in one step (SD)
    This movement is generated by SD.
    Unlike movement type 641, when a goods issue is posted using movement type 647, a goods receipt line (101) is generated automatically.
    651 Returns from customer (SD)
    This movement is generated by SD.
    Using movement type 651, you post returns from a customer with the SD returns delivery to blocked stock returns . The blocked stock returns are not valuated.
    Special stock indicators not possible.
    See also: 451, 453, 653
    653 Returns from customer (SD) to unrestricted-use stock
    655 Returns from customer (SD) to stock in quality inspection
    657 Returns from customer (SD) to blocked stock
    These movements are generated by SD.
    With these movement types you post returns from the customer with SD returns delivery directly to the valuated stock.
    Possible special stock indicator: E
    See also: 451, 453, 651
    661 Returns to vendor via SD delivery
    As with movement type 502, a return delivery to the vendor is entered without reference to the purchase order, but the goods issue is posted via an SD delivery.
    671 Returns for stock transport order via SD delivery
    If a purchase order item is marked as a returns item, when a goods receipt for a stock transport order (101) is posted, the return is posted to stock in transit using movement type 161. When the return arrives, the issuing plant posts the goods receipt for the return using movement type 671. Movement type 671 (like movement types 352 and 642) reduces the receiving plant's stock in transit and increases the the issuing plant's unrestricted-use stock.
    701 through 708: Inventory differences in MM
    These movements are generated automatically during inventory difference posting in Inventory Management.
    711 through 718: Inventory differences in MM-WM
    These movements are generated when you post the inventory differences from Warehouse Management to Inventory Management.
    721 - Sales value receipt - not affecting margins (Retail)
    The movement is generated automatically when the sales price of a value-only material is changed (total sales price revaluation on the posting date).
    731 - Sales value receipt - affecting margins (Retail)
    The movement is generated automatically when the sales price of a value-only material is changed (partial sales price revaluation on the posting date).
    Regards
    Ravi

  • Die Top10 der meist gestellten Fragen und Antworten (FAQ) März 2009

    Verehrte Mitglieder der SAP Business One Community,
    Wir werden Ihnen in regelmäßigen Abständen die zehn meist gefragtesten Fragen zusammen mit den Antworten zur Verfügung stellen.
    Die Top10 von März:
    1. Wie kann das Buchunsdatum einer wiederkehrenden Buchung geändert werden?
    Ein Lösungsvorschlag ist zu finden auf:
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=72123074
    2. Wie geht man mit folgender Meldung um: "Steuerstatus zusammengefasste GP ist nicht erlaubt, wurde nicht geladen und verhindert die Ausführung von Excel" / "Tax status of summary BP is not permitted, has not been loaded and  prohibits MS Excel from running"
    Ein Lösungsvorschlag ist zu finden auf:
    https://wiki.sdn.sap.com/wiki/display/B1/Howcanthiserrormessagebedealtwith-TaxstatusofsummaryBPisnotpermitted
    3. Wie kann man Journalbuchungen unter Verwendung verschiedener Währungen eingeben?
    Ein Lösungsvorschlag ist zu finden auf:
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=23101590
    4. Wie kann man ein obligatorisches Profit Center einrichten?
    Ein Lösungsvorschlag ist zu finden auf:
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=23101602
    5. Fragen zur erstmaligen Aktivierung eines Genehmigungsverfahrens
    Ein Lösungsvorschlag ist zu finden auf:
    https://wiki.sdn.sap.com/wiki/display/B1/Questionsonactivatingapprovalsforinitialuse
    6. Was bedeuted ""Fester Wechselkurs"" in einer Journalbuchung bzw einem voererfaßten Beleg?
    Ein Lösungsvorschlag ist zu finden auf:
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=21694122
    7. Welche Bedeutung hat die Nummer in einer Bestellung im rechten Bereich neben der Dokumentnummer?
    Ein Lösungsvorschlag ist zu finden auf:
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=23101610
    8. Sind die rechteckigen Klammern um den Feldnamen im Abfragegenerator notwendig?
    Ein Lösungsvorschlag ist zu finden auf:
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=23101633
    9. Wo kann die Steuernummer der Mutterfirma in einer Tochterfirma definiert werden?
    Ein Lösungsvorschlag ist zu finden auf:
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=72123076
    10. Warum hat ein FIFO Artikel keine Kosten, nachdem er in ein Warenhaus zurückgebucht wurde in welchem er vorher nicht vorhanden war?
    Ein Lösungsvorschlag ist zu finden auf:
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=23101631

    6. Eine Firma hat verschiedene Dauerbuchungen für bestimmte Tage festgelegt. Da diese allerdings am Wochenende geschlossen hat, kann es sein dass diese auf ein Wochenende fallen. Wie kann man diese dann automatisch auf den darauffolgende Montag ändern?
    Die Lösung ist in Hinweis 1114120 beschrieben.                         
    7. Eine Muttergesellschaft hat mehrere Tochtergesellschaften. Jede Tochtergesellschaft hat ihre eigene Steuernummer. Allerdings muss die Steuernummer der Muttergesellschaft auch für die Tochtergesellschaft hinterlegt sein. Wie mache ich das?
    Die Lösung ist auf https://www.sdn.sap.com/irj/scn/wiki?path=/pages/viewpage.action&pageid=23101637 beschrieben
    8. Kann man eine Standardpreisliste in den Artikelstammdaten definieren?
    Die Lösung ist auf Seite https://www.sdn.sap.com/irj/scn/wiki?path=/pages/viewpage.action&pageid=23593860 beschrieben.
    9. Fehlermeldung:   'Steuerstatus zusammengefasste GP' ist nicht erlaubt. Geschäftspartner - GP Zusammenfassung 'GPcode Message 3502-8' ('Tax status of summary BP' is not permitted. Business Partner - BP Summary 'BPcode Message 3502-8') wird empfangen, wenn versucht wird einen Geschäftspartner zu den Masterdaten hinzuzufügen.
    Die Lösung ist auf Seite https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=23101727 beschrieben.
    10 - Wie kann ich eine 100%ige Steuerrechnung erstellen?
    Die Lösung ist auf Seite https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=23101734 beschrieben.

  • Code of /SMB40/FM06P

    Hi,
    there is someone could post me the code of the program /SMB40/FM06P (print program for best-practice smartforms Request Order) ?
    I have lost the source of the code during the upgrade from ECC 5.0 to ECC 6.0.
    (the version of the ECC 5.0).
    Thanks
    Fred.

    Hi Frederic Girod,
    Here i'm sending the code for program /SMB40/FM06P.
    Subroutine pool /SMB40/FM06P
      Smart Form Print Program                              *
    *Data
    INCLUDE /SMB40/FM06TOP.
    Subroutines for the Print Program
    INCLUDE /SMB40/FM06PE02.
    program /smb40/fm06p message-id me.
    type-pools:   addi, meein,
                  mmpur.
    tables: nast,                          "Messages
            *nast,                         "Messages
            tnapr,                         "Programs & Forms
            itcpo,                         "Communicationarea for Spool
            arc_params,                    "Archive parameters
            toa_dara,                      "Archive parameters
            addr_key.                      "Adressnumber for ADDRESS
    type-pools szadr.
    tables : varposr,
             rwerter,
             mtxh.
    data  umbruch type i value 4.
    data  headerflag.
    data  begin of vartab occurs 15.
            include structure varposr.
    data  end   of vartab.
    data  tabn type i.
    data  taba type i.
    data  ebelph like ekpo-ebelp.
    data  bis type i.
    data  xmax type i.
    data  tab like varposr-yzeile.
    data  diff type i.
    data  ldat_sam like eket-eindt.
    data: s, v type i.
    data: sampr like pekpov-netpr, varpr like pekpov-netpr.
    Struktur zur Variantenbildung
    data: begin of wertetab occurs 30.
            include structure rwerter.
    data: atzhl like econf_out-atzhl,
          end of wertetab.
    Interne Tabelle fuer Konditionen
    data: begin of kond occurs 30.
            include structure komvd.
    data: end of kond.
    Hilfsfelder
    data:
          merknamex(15) type c,            "Merkmalname x-Achse
          merknamey(15) type c,            "Merkmalname y-Achse
          merknrx like rwerter-nr,         "Int. Merkmal x-Achse
          merknry like rwerter-nr,         "Int. Merkmal y-Achse
          i type i value 1,
          nr like cawn-atinn.
    data: inserterror(1),sum type i,menge type i,gsumh type i, xmaxh type i.
    data: gsumv type i.
    Matrixflag
    data: m_flag value 'x'.
    *- Tabellen -
    tables: cpkme,
            ekvkp,
            ekko,
            pekko,
            rm06p,
            ekpo,
            pekpo,
            pekpov,
            pekpos,
            eket,
            ekek,
            ekes,
            ekeh,
            ekkn,
            ekpa,
            ekbe,
            eine, *eine,
            lfa1,
            likp,
           *lfa1,
            kna1,
            komk,
            komp,
            komvd,
            ekomd,
            econf_out,
            thead, *thead,
            sadr,
            mdpa,
            mdpm,
            mkpf,
            tinct,
            ttxit,
            tmsi2,
            tq05,
            tq05t,
            t001,
            t001w,
            t006, *t006,
            t006a, *t006a,
            t024,
            t024e,
            t027a,
            t027b,
            t052,
            t161n,
            t163d,
            t166a,
            t165p,
            t166c,
            t166k,
            t166p,
            t166t,
            t166u,
            t165m,
            t165a,
            tmamt,
           *mara,                          "HTN 4.0C
            mara,
            marc,
            mt06e,
            makt,
            vbak,
            vbkd,
           *vbkd,
            vbap.
    tables: drad,
            drat.
    tables: addr1_sel,
            addr1_val.
    tables: v_htnm, rampl,tmppf.           "HTN-Abwicklung
    tables: stxh.              "schnellerer Zugriff auf Texte Dienstleistung
    tables: t161.              "Abgebotskennzeichen für Dienstleistung
    *- INTERNE TABELLEN -
    *- Tabelle der Positionen -
    data: begin of xekpo occurs 10.
            include structure ekpo.
    data:     bsmng like ekes-menge,
          end of xekpo.
    *- Key für xekpo -
    data: begin of xekpokey,
             mandt like ekpo-mandt,
             ebeln like ekpo-ebeln,
             ebelp like ekpo-ebelp,
          end of xekpokey.
    *- Tabelle der Einteilungen -
    data: begin of xeket occurs 10.
            include structure eket.
    data:     fzete like pekpo-wemng,
          end of xeket.
    *- Tabelle der Einteilungen temporär -
    data: begin of teket occurs 10.
            include structure beket.
    data: end of teket.
    data: begin of zeket.
            include structure eket.
    data:  end of zeket.
    *- Tabelle der Positionszusatzdaten -
    data: begin of xpekpo occurs 10.
            include structure pekpo.
    data: end of xpekpo.
    *- Tabelle der Positionszusatzdaten -
    data: begin of xpekpov occurs 10.
            include structure pekpov.
    data: end of xpekpov.
    *- Tabelle der Zahlungbedingungen----
    data: begin of zbtxt occurs 5,
             line(50),
          end of zbtxt.
    *- Tabelle der Merkmalsausprägungen -
    data: begin of tconf_out occurs 50.
            include structure econf_out.
    data: end of tconf_out.
    *- Tabelle der Konditionen -
    data: begin of tkomv occurs 50.
            include structure komv.
    data: end of tkomv.
    data: begin of tkomk occurs 1.
            include structure komk.
    data: end of tkomk.
    data: begin of tkomvd occurs 50.       "Belegkonditionen
            include structure komvd.
    data: end of tkomvd.
    data: begin of tekomd occurs 50.       "Stammkonditionen
            include structure ekomd.
    data: end of tekomd.
    *- Tabelle der Bestellentwicklung -
    data: begin of xekbe occurs 10.
            include structure ekbe.
    data: end of xekbe.
    *- Tabelle der Bezugsnebenkosten -
    data: begin of xekbz occurs 10.
            include structure ekbz.
    data: end of xekbz.
    *- Tabelle der WE/RE-Zuordnung -
    data: begin of xekbez occurs 10.
            include structure ekbez.
    data: end of xekbez.
    *- Tabelle der Positionssummen der Bestellentwicklung -
    data: begin of tekbes occurs 10.
            include structure ekbes.
    data: end of tekbes.
    *- Tabelle der Bezugsnebenkosten der Bestandsführung -
    data: begin of xekbnk occurs 10.
            include structure ekbnk.
    data: end of xekbnk.
    - Tabelle für Kopieren Positionstexte (hier wegen Infobestelltext) ---
    data: begin of xt165p occurs 10.
            include structure t165p.
    data: end of xt165p.
    *- Tabelle der Kopftexte -
    data: begin of xt166k occurs 10.
            include structure t166k.
    data: end of xt166k.
    *- Tabelle der Positionstexte -
    data: begin of xt166p occurs 10.
            include structure t166p.
    data: end of xt166p.
    *- Tabelle der Anahngstexte -
    data: begin of xt166a occurs 10.
            include structure t166a.
    data: end of xt166a.
    *- Tabelle der Textheader -
    data: begin of xthead occurs 10.
            include structure thead.
    data: end of xthead.
    data: begin of xtheadkey,
             tdobject like thead-tdobject,
             tdname like thead-tdname,
             tdid like thead-tdid,
          end of xtheadkey.
    data: begin of qm_text_key occurs 5,
             tdobject like thead-tdobject,
             tdname like thead-tdname,
             tdid like thead-tdid,
             tdtext like ttxit-tdtext,
          end of qm_text_key.
    *- Tabelle der Nachrichten alt/neu -
    data: begin of xnast occurs 10.
            include structure nast.
    data: end of xnast.
    data: begin of ynast occurs 10.
            include structure nast.
    data: end of ynast.
    *------ Struktur zur Übergabe der Adressdaten -
    data:    begin of addr_fields.
            include structure sadrfields.
    data:    end of addr_fields.
    *------ Struktur zur Übergabe der Adressreferenz -
    data:    begin of addr_reference.
            include structure addr_ref.
    data:    end of addr_reference.
    *------ Tabelle zur Übergabe der Fehler -
    data:    begin of error_table occurs 10.
            include structure addr_error.
    data:    end of error_table.
    *------ Tabelle zur Übergabe der Adressgruppen -
    data:    begin of addr_groups occurs 3.
            include structure adagroups.
    data:    end of addr_groups.
    *- Tabelle der Aenderungsbescheibungen -
    data: begin of xaend occurs 10,
             ebelp like ekpo-ebelp,
             zekkn like ekkn-zekkn,
             etenr like eket-etenr,
             ctxnr like t166c-ctxnr,
             rounr like t166c-rounr,
             insert,
             flag_adrnr,
          end of xaend.
    data: begin of xaendkey,
             ebelp like ekpo-ebelp,
             zekkn like ekkn-zekkn,
             etenr like eket-etenr,
             ctxnr like t166c-ctxnr,
             rounr like t166c-rounr,
             insert,
             flag_adrnr,
          end of xaendkey.
    *- Tabelle der Textänderungen -
    data: begin of xaetx occurs 10,
             ebelp like ekpo-ebelp,
             textart like cdshw-textart,
             chngind like cdshw-chngind,
          end of xaetx.
    *- Tabelle der geänderten Adressen -
    data: begin of xadrnr occurs 5,
             adrnr like sadr-adrnr,
             tname like cdshw-tabname,
             fname like cdshw-fname,
          end of xadrnr.
    *- Tabelle der gerade bearbeiteten aktive Komponenten -
    data begin of mdpmx occurs 10.
            include structure mdpm.
    data end of mdpmx.
    *- Tabelle der gerade bearbeiteten Sekundärbedarfe -
    data begin of mdsbx occurs 10.
            include structure mdsb.
    data end of mdsbx.
    *- Struktur des Archivobjekts -
    data: begin of xobjid,
            objky  like nast-objky,
            arcnr  like nast-optarcnr,
          end of xobjid.
    Struktur für zugehörigen Sammelartikel
    data: begin of sekpo.
            include structure ekpo.
    data:   first_varpos,
          end of sekpo.
    *- Struktur für Ausgabeergebnis zB Spoolauftragsnummer -
    data: begin of result.
            include structure itcpp.
    data: end of result.
    *- Struktur für Internet NAST -
    data: begin of intnast.
            include structure snast.
    data: end of intnast.
    *- HTN-Abwicklung
    data: begin of htnmat occurs 0.
            include structure v_htnm.
    data:  revlv like rampl-revlv,
          end of htnmat.
    data  htnamp like rampl  occurs 0 with header line.
    *- Hilfsfelder -
    data: hadrnr(8),                       "Key TSADR
          elementn(30),                    "Name des Elements
          save_el(30),                     "Rettfeld für Element
          retco like sy-subrc,             "Returncode Druck
          insert,                          "Kz. neue Position
          h-ind like sy-tabix,             "Hilfsfeld Index
          h-ind1 like sy-tabix,            "Hilfsfeld Index
          f1 type f,                       "Rechenfeld
          h-menge like ekpo-menge,         "Hilfsfeld Mengenumrechnung
          h-meng1 like ekpo-menge,         "Hilfsfeld Mengenumrechnung
          h-meng2 like ekpo-menge,         "Hilfsfeld Mengenumrechnung
          ab-menge like ekes-menge,        "Hilfsfeld bestätigte Menge
          kzbzg like konp-kzbzg,           "Staffeln vorhanden?
          hdatum like eket-eindt,          "Hilfsfeld Datum
          hmahnz like ekpo-mahnz,          "Hilfsfeld Mahnung
          addressnum like ekpo-adrn2,      "Hilfsfeld Adressnummer
          tablines like sy-tabix,          "Zähler Tabelleneinträge
          entries  like sy-tfill,          "Zähler Tabelleneinträge
          hstap,                           "statistische Position
          hsamm,                           "Positionen mit Sammelartikel
          hloep,                           "Gelöschte Positionen im Spiel
          hkpos,                           "Kondition zu löschen
          kopfkond,                        "Kopfkonditionen vorhanden
          no_zero_line,                    "keine Nullzeilen
          xdrflg like t166p-drflg,         "Hilfsfeld Textdruck
          xprotect,                        "Kz. protect erfolgt
          archiv_object like toa_dara-ar_object, "für opt. Archivierung
          textflag,                        "Kz. druckrel. Positionstexte
          flag,                            "allgemeines Kennzeichen
          spoolid(10),                     "Spoolidnummer
          xprogram like sy-repid,          "Programm
          lvs_recipient like swotobjid,    "Internet
          lvs_sender like swotobjid,       "Internet
          timeflag,                        "Kz. Uhrzeit bei mind. 1 Eint.
          h_vbeln like vbak-vbeln,
          h_vbelp like vbap-posnr.
    *- Drucksteuerung -
    data: aendernsrv.
    data: xdruvo.                          "Druckvorgang
    data: neu  value '1',                  "Neudruck
          aend value '2',                  "Änderungsdruck
          mahn value '3',                  "Mahnung
          absa value '4',                  "Absage
          lpet value '5',                  "Lieferplaneinteilung
          lpma value '6',                  "Mahnung Lieferplaneinteilung
          aufb value '7',                  "Auftragsbestätigung
          lpae value '8',                  "Änderung Lieferplaneinteilung
          lphe value '9',                  "Historisierte Einteilungen
          preisdruck,                      "Kz. Gesamtpreis drucken
          kontrakt_preis,                  "Kz. Kontraktpreise drucken
          we   value 'E'.                  "Wareneingangswert
    *- Hilfsfelder Lieferplaneinteilung -
    data:
          xlpet,                           "Lieferplaneinteilung
          xfz,                             "Fortschrittszahlendarstellung
          xoffen,                          "offene WE-Menge
          xlmahn,                          "Lieferplaneinteilungsmahnung
          fzflag,                          "KZ. Abstimmdatum erreicht
          xnoaend,                         "keine Änderungsbelege da  LPET
          xetdrk,                        "Druckrelevante Positionen da LPET
          xetefz like eket-menge,          "Einteilungsfortschrittszahl
          xwemfz like eket-menge,          "Lieferfortschrittszahl
          xabruf like ekek-abruf,          "Alter Abruf
          p_abart like ekek-abart.         "Abrufart
    *data: sum-euro-price like komk-fkwrt.                       "302203
    data: sum-euro-price like komk-fkwrt_euro.                  "302203
    data: euro-price like ekpo-effwr.
    *- Hilfsfelder für Ausgabemedium -
    data: xdialog,                         "Kz. POP-UP
          xscreen,                         "Kz. Probeausgabe
          xformular like tnapr-fonam,      "Formular
          xdevice(10).                     "Ausgabemedium
    *- Hilfsfelder für QM -
    data: qv_text_i like tq09t-kurztext,   "Bezeichnung Qualitätsvereinb.
          tl_text_i like tq09t-kurztext,   "Bezeichnung Technische Lieferb.
          zg_kz.                           "Zeugnis erforderlich
    *- Hilfsfelder für Änderungsbeleg -
    data: objectid              like cdhdr-objectid,
          tcode                 like cdhdr-tcode,
          planned_change_number like cdhdr-planchngnr,
          utime                 like cdhdr-utime,
          udate                 like cdhdr-udate,
          username              like cdhdr-username,
          cdoc_planned_or_real  like cdhdr-change_ind,
          cdoc_upd_object       like cdhdr-change_ind value 'U',
          cdoc_no_change_pointers like cdhdr-change_ind.
    *- Common-Part für Änderungsbeleg -
    *include zzfm06lccd.
    data:    begin of common part fm06lccd.
    *------- Tabelle der Änderunsbelegzeilen (temporär) -
    data: begin of edit occurs 50.             "Änderungsbelegzeilen temp.
            include structure cdshw.
    data: end of edit.
    data: begin of editd occurs 50.             "Änderungsbelegzeilen temp.
            include structure cdshw.            "für Dienstleistungen
    data: end of editd.
    *------- Tabelle der Änderunsbelegzeilen (Ausgabeform) -
    data: begin of ausg occurs 50.             "Änderungsbelegzeilen
            include structure cdshw.
    data:   changenr like cdhdr-changenr,
            udate    like cdhdr-udate,
            utime    like cdhdr-utime,
          end of ausg.
    *------- Tabelle der Änderunsbelegköpfe -
    data: begin of icdhdr occurs 50.           "Änderungbelegköpfe
            include structure cdhdr.
    data: end of icdhdr.
    *------- Key Tabelle der Änderunsbelegköpfe -
    data: begin of hkey,                       "Key für ICDHDR
            mandt like cdhdr-mandant,
            objcl like cdhdr-objectclas,
            objid like cdhdr-objectid,
            chang like cdhdr-changenr,
          end of hkey.
    *------- Key der geänderten Tabelle für Ausgabe -
    data: begin of ekkey,                    "Tabellenkeyausgabe
            ebeln like ekko-ebeln,
            ebelp like ekpo-ebelp,
            zekkn like ekkn-zekkn,
            etenr like eket-etenr,
            abruf like ekek-abruf,
            ekorg like ekpa-ekorg,           "Änderungsbelege Partner
            ltsnr like ekpa-ltsnr,           "Änderungsbelege Partner
            werks like ekpa-werks,           "Änderungsbelege Partner
            parvw like ekpa-parvw,           "Änderungsbelege Partner
            parza like ekpa-parza,           "Änderungsbelege Partner
            consnumber like adr2-consnumber, "Änderungsbelege Adressen
            comm_type  like adrt-comm_type,  "Änderungsbelege Adressen
          end of ekkey.
    data:    end of common part.
    *- Direktwerte -
             Direktwerte                                                 *
    *------- Werte zu Trtyp und Aktyp:
    constants:  hin value 'H',             "Hinzufuegen
                ver value 'V',             "Veraendern
                anz value 'A',             "Anzeigen
                erw value 'E'.             "Bestellerweiterung
    constants:
    BSTYP
      bstyp-info value 'I',
      bstyp-ordr value 'W',
      bstyp-banf value 'B',
      bstyp-best value 'F',
      bstyp-anfr value 'A',
      bstyp-kont value 'K',
      bstyp-lfpl value 'L',
      bstyp-lerf value 'Q',
    BSAKZ
      bsakz-norm value ' ',
      bsakz-tran value 'T',
      bsakz-rahm value 'R',
    BSAKZ-BEIS VALUE 'B',  "not used
    BSAKZ-KONS VALUE 'K',  "not used
    BSAKZ-LOHN VALUE 'L', "not used
    BSAKZ-STRE VALUE 'S', "not used
    BSAKZ-MENG VALUE 'M', "not used
    BSAKZ-WERT VALUE 'W', "not used
    PSTYP
      pstyp-lagm value '0',
      pstyp-blnk value '1',
      pstyp-kons value '2',
      pstyp-lohn value '3',
      pstyp-munb value '4',
      pstyp-stre value '5',
      pstyp-text value '6',
      pstyp-umlg value '7',
      pstyp-wagr value '8',
      pstyp-dien value '9',
    Kzvbr
      kzvbr-anla value 'A',
      kzvbr-unbe value 'U',
      kzvbr-verb value 'V',
      kzvbr-einz value 'E',
      kzvbr-proj value 'P',
    ESOKZ
      esokz-pipe value 'P',
      esokz-lohn value '3',
      esokz-konsi value '2',               "konsi
      esokz-charg value '1',               "sc-jp
      esokz-norm value '0'.
    constants:
    Handling von Unterpositionsdaten
           sihan-nix  value ' ',           "keine eigenen Daten
           sihan-anz  value '1', "Daten aus Hauptposition kopiert, nicht änd
           sihan-kop  value '2', "Daten aus Hauptposition kopiert, aber ände
           sihan-eig  value '3'. "eigene Daten (nicht aus Hauptposition kopi
    Unterpositionstypen
    constants:
      uptyp-hpo value ' ',                 "Hauptposition
      uptyp-var value '1',                 "Variante
      uptyp-nri value '2',           "Naturalrabatt Inklusive (=Dreingabe)
      uptyp-ler value '3',                 "Leergut
      uptyp-nre value '4',           "Naturalrabatt Exklusive (=Draufgabe)
      uptyp-lot value '5',                 "Lot Position
      uptyp-dis value '6',                 "Display Position
      uptyp-vks value '7',                 "VK-Set Position
      uptyp-mpn value '8',                 "Austauschposition (A&D)
      uptyp-sls value '9',           "Vorkommisionierungsposition (retail)
      uptyp-div value 'X'.           "HP hat UP's mit verschiedenen Typen
    Artikeltypen
    constants:
      attyp-sam(2) value '01',             "Sammelartikel
      attyp-var(2) value '02',             "Variante
      attyp-we1(2) value '20',             "Wertartikel
      attyp-we2(2) value '21',             "Wertartikel
      attyp-we3(2) value '22',             "Wertartikel
      attyp-vks(2) value '10',             "VK-Set
      attyp-lot(2) value '11',             "Lot-Artikel
      attyp-dis(2) value '12'.             "Display
    Konfigurationsherkunft
    constants:
      kzkfg-fre value ' ',                 "Konfiguration sonst woher
      kzkfg-kan value '1',                 "noch nicht konfiguriert
      kzkfg-eig value '2'.                 "Eigene Konfiguration
    constants:
      c_ja   type c value 'X',
      c_nein type c value ' '.
    Vorgangsart, welche Anwendung den Fkt-Baustein aufruft
    constants:
      cva_ab(1) value 'B',     "Automatische bestellung (aus banfen)
      cva_we(1) value 'C',                 "Wareneingang
      cva_bu(1) value 'D',     "Übernahme bestellungen aus fremdsystem
      cva_au(1) value 'E',                 "Aufteiler
      cva_kb(1) value 'F',                 "Kanban
      cva_fa(1) value 'G',                 "Filialauftrag
      cva_dr(1) value 'H',                                      "DRP
      cva_en(1) value '9',                 "Enjoy
      cva_ap(1) value '1',                                      "APO
      cva_ed(1) value 'T'.     "EDI-Eingang Auftragsbestätigung Update Preis
    Status des Einkaufsbeleges (EKKO-STATU)
    constants:
      cks_ag(1) value 'A',                 "Angebot vorhanden für Anfrage
      cks_ab(1) value 'B',     "Automatische Bestellung (aus Banfen) ME59
      cks_we(1) value 'C',                 "Bestellung aus Wareneingang
      cks_bu(1) value 'D',                 "Bestellung aus Datenübernahme
      cks_au(1) value 'E',     "Bestellung aus Aufteiler (IS-Retail)
      cks_kb(1) value 'F',                 "Bestellung aus Kanban
      cks_fa(1) value 'G',     "Bestellung aus Filialauftrag (IS-Retail)
      cks_dr(1) value 'H',                 "Bestellung aus DRP
      cks_ba(1) value 'I',                 "Bestellung aus BAPI
      cks_al(1) value 'J',                 "Bestellung aus ALE-Szenario
      cks_sb(1) value 'S',                 "Sammelbestellung (IS-Retail)
      cks_ap(1) value '1',                                      "APO
      cks_en(1) value '9',                 "Enjoy Bestellung
      cks_fb(1) value 'X'.                 "Bestellung aus Funktionsbaustein
    Vorgang aus T160
    constants:
      vorga-angb(2) value 'AG',   "Angebot zur Anfrage    ME47, ME48
      vorga-lpet(2) value 'LE',   "Lieferplaneinteilung   ME38, ME39
      vorga-frge(2) value 'EF',   "Einkaufsbelegfreigabe  ME28, ME35, ME45
      vorga-frgb(2) value 'BF',   "Banffreigabe           ME54, ME55
      vorga-bgen(2) value 'BB',            "Best. Lief.unbekannt   ME25
      vorga-anha(2) value 'FT',   "Textanhang             ME24, ME26,...
      vorga-banf(2) value 'B ',   "Banf                   ME51, ME52, ME53
      vorga-anfr(2) value 'A ',   "Anfrage                ME41, ME42, ME43
      vorga-best(2) value 'F ',   "Bestellung             ME21, ME22, ME23
      vorga-kont(2) value 'K ',   "Kontrakt               ME31, ME32, ME33
      vorga-lfpl(2) value 'L ',   "Lieferplan             ME31, ME32, ME33
      vorga-mahn(2) value 'MA',            "Liefermahnung          ME91
      vorga-aufb(2) value 'AB'.            "Bestätigungsmahnung    ME92
    Felder für Feldauswahl (früher FMMEXCOM)
    data:       endmaske(210) type c,
                kmaske(140) type c,
                auswahl0 type brefn,
                auswahl1 type brefn,
                auswahl2 type brefn,
                auswahl3 type brefn,
                auswahl4 type brefn,
                auswahl5 type brefn,
                auswahl6 type brefn.
    Sonderbestandskennzeichen
    constants:
      sobkz-kdein value 'E',               "Kundeneinzel
      sobkz-prein value 'Q',               "Projekteinzel
      sobkz-lohnb value 'O'.               "Lohnbearbeiterbeistell
    Min-/Maxwerte für Datenelemente
    constants:
    offener Rechnungseingangswert / Feldlänge: 13 / Dezimalstellen: 2
      c_max_orewr       like rm06a-orewr   value '99999999999.99',
      c_max_orewr_f     type f             value '99999999999.99',
      c_max_orewr_x(15) type c             value '**************',
      c_max_proz_p(3)   type p decimals 2  value '999.99',          "@80545
      c_max_proz_x(6)   type c             value '******',          "@80545
      c_max_menge       like ekpo-menge  value '9999999999.999',    "@83886
      c_max_menge_f     type f           value '9999999999.999',    "@83886
      c_max_netwr       like ekpo-netwr  value '99999999999.99',    "@83886
      c_max_netwr_f     type f           value '99999999999.99'.    "@83886
    Distribution Indicator Account assignment
    constants:
      c_dist_ind-single   value ' ',       "no multiple = single
      c_dist_ind-quantity value '1',       "quantity distribution
      c_dist_ind-percent  value '2'.       "percentag
    Datendefinitionen für Dienstleistungen
    tables: eslh,
            esll,
            ml_esll,
            rm11p.
    data  begin of gliederung occurs 50.
            include structure ml_esll.
    data  end   of gliederung.
    data  begin of leistung occurs 50.
            include structure ml_esll.
    data  end   of leistung.
    data  return.
    *- interne Tabelle für Abrufköpfe -
    data: begin of xekek          occurs 20.
            include structure iekek.
    data: end of xekek.
    *- interne Tabelle für Abrufköpfe alt----
    data: begin of pekek          occurs 20.
            include structure iekek.
    data: end of pekek.
    *- interne Tabelle für Abrufeinteilungen -
    data: begin of xekeh          occurs 20.
            include structure iekeh.
    data: end of xekeh.
    *- interne Tabelle für Abrufeinteilungen -
    data: begin of tekeh          occurs 20.
            include structure iekeh.
    data: end of tekeh.
    *- Zusatztabelle Abruf nicht vorhanden XEKPO----
    data: begin of xekpoabr occurs 20,
             mandt like ekpo-mandt,
             ebeln like ekpo-ebeln,
             ebelp like ekpo-ebelp,
          end of xekpoabr.
    *-- Daten Hinweis 39234 -
    *- Hilfstabelle Einteilungen -
    data: begin of heket occurs 10.
            include structure eket.
    data:       tflag like sy-calld,
          end of heket.
    *- Key für HEKET -
    data: begin of heketkey,
             mandt like eket-mandt,
             ebeln like eket-ebeln,
             ebelp like eket-ebelp,
             etenr like eket-etenr,
          end of heketkey.
    data: h_subrc like sy-subrc,
          h_tabix like sy-tabix,
          h_field like cdshw-f_old,
          h_eindt like rvdat-extdatum.
    data  z type i.
    Defintionen für Formeln
    type-pools msfo.
    data: variablen type msfo_tab_variablen with header line.
    data: formel type msfo_formel.
    Definition für Rechnungsplan
    data: tfpltdr like fpltdr occurs 0 with header line.
    data: fpltdr like fpltdr.
    Definiton Defaultschema für Dienstleistung
    constants: default_kalsm like t683-kalsm value 'MS0000',
               default_kalsm_stamm like t683-kalsm value 'MS0001'.
    data: bstyp like ekko-bstyp,
          bsart like ekko-bsart.
    data dkomk like komk.
    Defintion für Wartungsplan
    tables: rmipm.
    data: mpos_tab like mpos occurs 0 with header line,
          zykl_tab like mmpt occurs 0 with header line.
    data: print_schedule.
    data: begin of d_tkomvd occurs 50.
            include structure komvd.
    data: end of d_tkomvd.
    data: begin of d_tkomv occurs 50.
            include structure komv.
    data: end of d_tkomv.
    Definition Drucktabellen blockweises Lesen
    data: leistung_thead like stxh occurs 1 with header line.
    data: gliederung_thead like stxh occurs 1 with header line. "HS
    data: begin of thead_key,
            mandt    like sy-mandt,
            tdobject like stxh-tdobject,
            tdname   like stxh-tdname,
            tdid     like stxh-tdid,
            tdspras  like stxh-tdspras.
    data: end of thead_key.
    ranges: r1_tdname for stxh-tdname,
            r2_tdname for stxh-tdname.
    data: begin of doktab occurs 0.
            include structure drad.
    data  dktxt like drat-dktxt.
    data: end of doktab.
    Additionals Tabelle (CvB/4.0c)
    data: l_addis_in_orders type line of addi_buying_print_itab
                                            occurs 0 with header line.
    Die Additionals-Strukturen müssen bekannt sein
    tables: wtad_buying_print_addi, wtad_buying_print_extra_text.
    data: ls_print_data_to_read type lbbil_print_data_to_read.
    data: ls_bil_invoice type lbbil_invoice.
    data: lf_fm_name            type rs38l_fnam.
    data: ls_control_param      type ssfctrlop.
    data: ls_composer_param     type ssfcompop.
    data: ls_recipient          type swotobjid.
    data: ls_sender             type swotobjid.
    data: lf_formname           type tdsfname.
    data: ls_addr_key           like addr_key,
          dunwitheket           type xfeld.
    data: l_zekko                  like ekko,
          l_xpekko                 like pekko,
          l_xekpo                like table of ekpo,
          l_wa_xekpo             like ekpo.
    data: l_xekpa like ekpa occurs 0,
          l_wa_xekpa like ekpa.
    data: l_xpekpo  like pekpo occurs 0,
          l_wa_xpekpo like pekpo,
          l_xeket   like table of eket with header line,
          l_xekkn  like table of ekkn with header line,
          l_xekek  like table of ekek with header line,
          l_xekeh   like table of ekeh with header line,
          l_xkomk like table of komk with header line,
          l_xtkomv  type komv occurs 0,
          l_wa_xtkomv type komv.
    data   ls_ssfcompop  type     ssfcompop.
    *&  Include           /SMB40/FM06PE02
    *&      Form  GET_PLANT_ADDRESS
    FORM get_plant_address USING    p_werks LIKE t001w-werks
                           CHANGING p_adrnr
                                    p_sadr  LIKE sadr.
    parameter P_ADRNR without type since there are several address
    fields with different domains
      DATA: l_ekko LIKE ekko,
            l_address LIKE addr1_val.
      CHECK NOT p_werks IS INITIAL.
      l_ekko-reswk = p_werks.
      l_ekko-bsakz = 'T'.
      CALL FUNCTION 'MM_ADDRESS_GET'
        EXPORTING
          i_ekko    = l_ekko
        IMPORTING
          e_address = l_address
          e_sadr    = p_sadr.
      p_adrnr = l_address-addrnumber.
    ENDFORM.                    " GET_PLANT_ADDRESS
    *&      Form  GET_CUSTOMER_ADDRESS
    FORM get_customer_address USING    p_kunnr LIKE ekpo-kunnr
                              CHANGING p_adrnr.
    parameter P_ADRNR without type since there are several address
    fields with different domains
      DATA: l_adrnr LIKE kna1-adrnr.
      CHECK NOT p_kunnr IS INITIAL.
      SELECT SINGLE adrnr FROM  kna1 INTO (l_adrnr)
             WHERE  kunnr  = p_kunnr.
      IF sy-subrc EQ 0.
        p_adrnr = l_adrnr.
      ELSE.
        CLEAR p_adrnr.
      ENDIF.
    ENDFORM.                    " GET_CUSTOMER_ADDRESS
    *&      Form  GET_VENDOR_ADDRESS
    FORM get_vendor_address USING    p_emlif LIKE lfa1-lifnr
                            CHANGING p_adrnr.
    parameter P_ADRNR without type since there are several address
    fields with different domains
      DATA: l_lfa1 LIKE lfa1.
      CHECK NOT p_emlif IS INITIAL.
      CALL FUNCTION 'VENDOR_MASTER_DATA_SELECT_00'
        EXPORTING
          i_lfa1_lifnr     = p_emlif
          i_data           = 'X'
          i_partner        = ' '
        IMPORTING
          a_lfa1           = l_lfa1
        EXCEPTIONS
          vendor_not_found = 1.
      IF sy-subrc EQ 0.
        p_adrnr = l_lfa1-adrnr.
      ELSE.
        CLEAR p_adrnr.
      ENDIF.
    ENDFORM.                               " GET_VENDOR_ADDRESS
    *&      Form  get_addr_key
          text
         -->P_CS_BIL_INVOICE_HD_ADR  text
         <--P_CS_ADDR_KEY  text
    FORM get_addr_key
         USING    l_xekko LIKE ekko
         CHANGING l_addr_key.
      DATA: l_lfa1 LIKE lfa1.
      IF l_xekko-lifnr NE space.
        CALL FUNCTION 'MM_ADDRESS_GET'
          EXPORTING
            i_ekko = l_xekko
          IMPORTING
            e_sadr = sadr
          EXCEPTIONS
            OTHERS = 1.
        MOVE-CORRESPONDING sadr TO l_lfa1.
        IF sy-subrc = 0.
          MOVE l_lfa1-adrnr TO ls_addr_key.
        ENDIF.
      ENDIF.
    ENDFORM.                               " get_addr_key
    *&      Form  protocol_update_I
          text
    -->  p1        text
    <--  p2        text
    FORM protocol_update_i.
      CHECK xscreen = space.
      CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
        EXPORTING
          msg_arbgb = syst-msgid
          msg_nr    = syst-msgno
          msg_ty    = syst-msgty
          msg_v1    = syst-msgv1
          msg_v2    = syst-msgv2
          msg_v3    = syst-msgv3
          msg_v4    = syst-msgv4
        EXCEPTIONS
          OTHERS    = 1.
    ENDFORM.                               " protocol_update_I
    *&      Form  add_smfrm_prot
          text
    -->  p1        text
    <--  p2        text
    FORM add_smfrm_prot.
      DATA: lt_errortab             TYPE tsferror.
      DATA: lf_msgnr                TYPE sy-msgno.
      DATA:  l_s_log          TYPE bal_s_log,
             p_loghandle      TYPE balloghndl,
           l_s_msg          TYPE bal_s_msg.
      FIELD-SYMBOLS:   TYPE LINE OF tsferror.
    get smart form protocoll
      CALL FUNCTION 'SSF_READ_ERRORS'
        IMPORTING
          errortab = lt_errortab.
      SORT lt_errortab.
    delete adjacent duplicates from lt_errortab comparing errnumber.
    add smartform protocoll to nast protocoll
      LOOP AT lt_errortab ASSIGNING -msgv4
          EXCEPTIONS
            OTHERS    = 1.
      ENDLOOP.
    open the application log
      l_s_log-extnumber    = sy-uname.
      CALL FUNCTION 'BAL_LOG_CREATE'
        EXPORTING
          i_s_log      = l_s_log
        IMPORTING
          e_log_handle = p_loghandle
        EXCEPTIONS
          OTHERS       = 1.
      IF sy-subrc  0.
        ENDIF.
      ENDLOOP.
    Function module to display error logs during
    smart form processing
    Notice , the function 'BAL_DSP_LOG_DISPLAY' can
    not be used when you using output dispatch time
    4 (Send immediately), so the statement is comment
    out by default.
    You can enable the function call statement
    if your form can not be output and you want to
    see the error log. Set output dispatch time to 3
    before save your order, then print or preview the
    output.
      DATA lv_debug.
      IF NOT lv_debug IS INITIAL.
        CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'.
      ENDIF.
    ENDFORM.                               " add_smfrm_prot
    *&      Form  ENTRY_NEU
          text
         -->ENT_RETCO  text
         -->ENT_SCREEN text
    FORM entry_neu USING ent_retco ent_screen.
      DATA: l_druvo LIKE t166k-druvo.
      DATA: ls_xfz  TYPE char1.
      xscreen = ent_screen.
      CLEAR ent_retco.
      IF nast-aende EQ space.
        l_druvo = '1'.
      ELSE.
        l_druvo = '2'.
      ENDIF.
    *>>> Start of Insertion >>> OSS 754573 (Liu Ke)
      IF xscreen EQ 'X' AND ( nast-tdarmod EQ '2' OR nast-tdarmod EQ '3').
        nast-tdarmod = '1'.
      ENDIF.
    *<<< End of Insertion <<<
      PERFORM processing_po USING nast ls_xfz
                         CHANGING ent_retco ent_screen l_druvo.
    ENDFORM.                    "entry_neu

  • Automatic UD and Automatic Stock Posting

    Step 1 QS51
    For Plant 1000, for 04 inspection type, I have created Z04GPF as selected set for taking UD
    On double clicking the Selected set codes I wll reach the following screen
    As per my requirement, I have maintained the setting for Automatic stock posting to Unrestricted Stock from Quality Inspection.
    Step 2 ; QA16
    Now My requirement is that I want to take Automatic UD and subsequently Automatics Stock Posting should takes place from quality stock to Unrestricted stock.
    On QA16 screen I have inputted the following parameters to select the lots of the same production order and same batch material.as shown below
    Sir, I am facing Problem at the area shown below on QA16 screen
    Here I want to input the UD selected set maintained for plant 1000 (In specific as Accepted A ). But on selecting F4 at the field shown above I am getting the below popup window
    This is the UD for SAP Standard Plant (01 GR WARENEINGANG)
    Also I am unable to see 04 inspection type
    The same problem is coming when I am selecting F4 on the field UD code
    Dear Sir, Please suggest me whether and Where I was wrong
    razvee.shaik

    hi,
    even i am asked to use qa41 for sheduling the job but whenever i schedule job and try qa16 for the ud and posting i recieve an error i.e (No batch input data for screen SAPLIPW1 0200)
    do u faced the same error / if u have a solution to batch job, tell me about it. i am having a relavent problem ..
    Regards,
    Sameer Jalal

  • Wareneingangslager ohne Belege

    Hallo,
    folgende Problematik. Wir haben täglich Wareneingänge. In SAP werden die aber erst eingebucht, nachdem die
    WE Prüfung durch die QS abgeschlossen ist. Je nachdem (bin ja in China) kommt es vor, dass die Teile zu
    100% angenommen werden, oder sortiert werden müssen, oder das ganze Los an den Lieferanten zurück
    geht. Teilweise habe ich einen Warenwert bis zu 500K Euro für Wochen im Nichts stehen und keine Übersicht
    darüber.
    Im Prinzip bräuchte ich ein Wareneingangslager, welches keine Belege verursacht, keine Kosten auf der
    Buchaltungsseite. Wo der Lagerist den Wareneingang einbucht und nach erfolgreicher Kontrolle auf die
    Bestellung buchen kann. Falls das Los zurück geht, einfach ausbuchen.
    Im Prinzip könnte ich denen auch sagen eine Exceldatei zu führen, aber das erscheint mir nicht so elegant.
    Weitere Lösung wäre eventuell eine eigene kleine Software zu schreiben, die auf die SAP Artikel / Lieferanten
    Daten zugreifen kann....
    Wie läuft das bei Euch ?
    Bin für jeden Rat dankbar.

    Und was passiert mit der eigentlichen Bestellung. Solange die Teile nicht OK sind, solle kein Wareneingang auf
    die Bestellung gebucht werden. Habe ich die Teile einmal manuell in ein Lager gebucht, wie bekomme ich dann
    einen Wareneingang auf die Bestellung. Sind die Teile nicht OK, muss eine Retoure angelegt werden.
    Leider kommt es vor, dass ein Los mehrmals zurückgeht, oder Teile davon. Oder der Lieferant seine
    Leute zum sortieren sendet. Oder Teile tauscht.....
    Das Grundproblem beginnt schon am Anfang mit der Menge. Der Lagerist zählt nicht, sondern prüft
    die Menge nur anhand des Lieferscheines und der Kartons, Tüten, etc. Gezählt wird erst, wenn
    die WE Prüfung erfolgreich war. Da Qualitätsprobleme (in China) normal sind, möchte ich das auch
    so belassen und die Leute nicht damit beschäftigen Mengen von Losen zu prüfen, die eh nicht
    angenommen werden. Die genaue Menge ist für mich auch an dieser Stelle zweitrangig.
    Denke die beste Lösung ist das "ausserhalb" von SAP zu machen und einfach eine WE Liste zu führen.
    Edited by: Laowai on Feb 10, 2012 10:00 AM

  • DATEV-Export mit Steuerkennzeichen '40'

    Kennt jemand hier im Forum die Ursache, warum das Steuerkennzeichen '40' beim DATEV-Export mitgegeben wird?
    Unsere Vermutung: es hängt mit dem Konto Wareneingang innergem. Erwerb bzw. Umsatz EU-steuerfreie innergem. Lieferungen zusammen. Kann das sein, dass solche Konstellationen dieses Steuerkennzeichen hervorrufen? Oder sind es andere Ursachen? Kann dieses Steuerkennzeichen unterdrückt werden - wenn ja, wie?
    Bin für jeden Hinweis dankbar.
    Gabriela Berger

    Hallo,
    Es liegt an den Buchungen mit E1. Du kannst das Steuerkennzeichen unterdrücken, wenn du beim dem betroffenen Konto die Automatik raus nimmst (Finanzwesen > Kontenplan > Benuterdefinierte Felder > Feld "BD: Is Automatic Yes/No).
    Ich hoffe das war hilfreich.
    Gruß
    Lars Barkow

  • Abfrage für Seriennummern

    Hallo zusammen,
    vielleicht hat jemand sowas schon mal gemacht.
    Ich würde gerne eine Abfrage schreiben die mir in einem Feld die nächst höhere Seriennummer schreibt.
    So zum Beispiel wenn ich einen Wareneingang über einen Seriennummer geführten Artikel verbuchen will.
    Dann muss ich ja immer die Seriennummer eingeben.
    Jemand eine Idee wie man sowas umsetzen könnte und auf welches Feld ich dann am besten die Abfrage setze?
    Viele Grüße
    Indira

    Hallo Indira,
    da fragst du aber nach ganz schönen "basics".
    Nein, die Abfrage wäre nur für Chargennummern, da die Tabelle OIBT angesprochen wird (hier werden die Chargennummern gespeichert). Die Tabelle für Seriennummern wäre die OSRI. In dieser Tabelle werden die Seriennummern PRO Artikel abgelegt. Nun kommt es bei der zu erstellende Abfrage darauf an, ob Du Nummernkreise PRO ARTIKEL verwenden möchtest, oder die Seriennummern über ALLE Artikel einfach hochzählen möchtest. Im 2. Fall wäre die Abfrage recht einfach (analog zu meinem ersten Beispiel):
    SELECT MAX(IntrSerial)+1 from OSRI
    Funktioniert allerdings nur, wenn die Seriennummer numerisch ist.
    Speichern kannst Du die Abfrage wo Du möchtest. Als FMS (Formatierte Suche) einstellen ist recht einfach: Auf dem Feld Seriennummer ALT-SHIFT-F2 drücken, und den Dialog ausfüllen.
    hdh (hoffe das hilft)
    Andreas

  • Artikel finden, die noch nie bebucht wurden

    Hallo,
    ich suche derzeit eine Abfrage, die mir als Ergebnis alle Artikel zeigt, die weder per
    Wareneingang OIGN - IGN1
    Wareneingang OPDN - PDN1
    Warenausgang OIGE - IGE1
    Umlagerung OWTR - WTR1
    noch per
    Lieferung ODLN - DLN1
    bebucht wurden.
    Bei diesen Artikeln sollte der Lagerbestand sowieso NULL sein.
    Ich habe das mit der OITM.ItemCode und den jeweiligen POSI-Tabellen (IGN1, PDN1...)
    als FULL JOIN versucht... aber das hat nicht funktioniert.
    Quasi die Artikel, wo ein Klick auf "Bestandbuchungsliste" zu keinem Ergebnis führt.
    Hat jemand eine Idee, wie das gehen könnte. Es würde der Datenpflege dienen, um Leichen zu finden, die noch nie verwendet wurden.
    Vielen Dank für Eure Wissenswerte.
    Gruß
    Markus

    Hallo Markus,
    es gibt verschiedene Wege nach Rom. Da ich ein wenig Zeit habe.... hier ein paar Ansätze:
    1. Einzelne Tabellen abfragen (mühselig):
    select itemcode, itemname from oitm where
    itemcode not in (select isnull(itemcode,'') from ign1) and
    itemcode not in (select isnull(itemcode,'') from pdn1) and
    itemcode not in (select isnull(itemcode,'') from ige1)
    und so weiter...
    2. Tabelle ADOC (ADO1) bemühen. In dieser Tabelle werden alle Dokumente archiviert (und historisiert)
    select itemcode, itemname from oitm where itemcode not in (select isnull(itemcode,'') from ado1)
    3. Bestandsbuchungsprotokoll ist auch ne Möglichkeit. Diese stehen in der Tabelle OINM
    select itemcode, itemname from oitm where itemcode not in (select isnull(itemcode,'') from oinm)
    hdh (hoffe das hilft)
    Andreas
    PS1: Das "isnull" ist notwendig, da in Servicebelegen der ItemCode NULL ist - und NULL kann man nicht vergleichen....
    PS2: Ich mache gerade updates... da war ein wenig Zeit

  • Artikel-Anfangsbestände maschinell einlesen

    Hallo zusammen,
    kennt ihr eine Möglichkeit Artikel-Anfangsbestände maschinell einzulesen - über Excel bzw. über DTW Vorlage?
    Danke und Gruß
    Milan

    Hi Milan,
    Grundsätzlich ist von einem maschinellen Import eher abzuraten.
    Bei ein paar Kunden haben wir es dennoch gelöst.
    Wir haben am Anfang (SAP B1 noch ohne Bestände) einfach über die DTW einen manuellen Wareneingang mit den jeweiligen Artikelmengen importiert.
    Somit hast du automatisch einen Anfangsbestand.
    Ich hoffe ich konnte dir weiter helfen.
    Bastian

Maybe you are looking for

  • Error while starting the weblogic server

    hi all i got the below error while trying to start the weblogic server on windows machine (win2k3-sp1). please suggest me the best way to overcome from this problem. thanks in anticipation. "FATAL ERROR: Exception from System.loadLibrary(smjavaagenta

  • Mail stationery in Lion

    I had a letter that I wanted to save for future reuse and followed the instructions to save it as Stationery.  It was done in Pages and it was saved as Stationery in Mail.  I just went to reuse it = opened new message, found the email template and cl

  • Please contact itunes support to complete this transaction how can i fix it

    please contact itunes support to complete this transaction ,how can i fix it?.i try to purchase some app but it said that

  • VF02 - Error FI011

    We recently installed Stack 27 on our PE client and are now receiving an Error FI011 in TCode VF02.  The Error is received once a Billing Document is Released to Accounting.  I have searched the OSS Notes and am unable to find anything.  We do have a

  • Finder window is not proportioned correctly

    We just updated to Adobe Acrobat DC and it looks like the Finder window is not proportioned correctly.   There is the large grey space that cannot be reduced. If the window is scaled down then you lose the files on the top while the gray space remain