SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Status excludes



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> PP
View previous topic :: View next topic  
Author Message
vga
Мастер
Мастер


Age: 195
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Sat Nov 29, 2008 4:12 pm    Post subject: Status excludes Reply with quote

For example, when processing Manufacturing orders exclude certain status to be able to customize the following code.

On the selection screen, the status in the 'clear' will be selected.

Code:
DATA:
  h_fehler,
  help_system LIKE tj02t-txt04,
  help_status LIKE jest-stat.
DATA: fufi     TYPE c.

SELECT-OPTIONS: s_syste FOR  help_system NO INTERVALS,
                s_systh FOR  help_status NO-DISPLAY.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_syste-low.
  DATA: stsma     LIKE atj49-stsma.
  DATA: f4_cstate LIKE atj49-cstate.
  PERFORM value_state(saplcoss) USING    stsma
                                CHANGING f4_cstate s_syste-low.



INITIALIZATION.
* auszuschließende Status vorbelegen
  s_syste-sign   = 'E'.
  s_syste-option = 'EQ'.
  s_syste-low    = 'TABG'.
  APPEND s_syste.
  s_syste-low    = 'GLFT'.
  APPEND s_syste.

 

START-OF-SELECTION.

* Prüfen der Selektionseingaben
  PERFORM selektionen_pruefen.
  IF h_fehler = 'X'.
    EXIT.
  ENDIF. " h_fehler = 'X'

 

* Daten anreichern
  LOOP AT ifauf INTO wa_ifauf. " iauf enthält die Fertigungsaufträge
    my_tabix = sy-tabix.
    CLEAR fufi.
    PERFORM status_check.
    IF fufi = 'A'.
*     Status soll ausgeschlossen werden
      DELETE ifauf INDEX my_tabix.
      CONTINUE.
    ENDIF.
  ENDLOOP. " AT ifauf INTO wa_ifauf

 


*&---------------------------------------------------------------------*
*&      Form  SELEKTIONEN_PRUEFEN
*&---------------------------------------------------------------------*
FORM selektionen_pruefen .
* Status prüfen
  LOOP AT s_syste.
    IF NOT s_syste-high IS INITIAL.
      MESSAGE i000(z_uo) WITH
        'Eingabe von Intervallen für Status nicht zulässig.'(e02).
      h_fehler = 'X'.
      EXIT.
    ENDIF. " not s_syste-high is initial
    IF s_syste-option NE 'EQ'.
      MESSAGE i000(z_uo) WITH
        'Status nur als gleich oder ungleich eingeben.'(e03).
      h_fehler = 'X'.
      EXIT.
    ENDIF. " s_syste-option ne 'EQ'
    CLEAR s_systh.
    MOVE-CORRESPONDING s_syste TO s_systh.
    PERFORM system_state_check(ppio_entry)
      USING 'X'  CHANGING s_syste-low s_systh-low.
    IF s_syste-low IS INITIAL.
      MESSAGE i000(z_uo) WITH
        'Status'(e04) s_syste-low 'nicht zulässig.'(e05).
      h_fehler = 'X'.
      EXIT.
    ELSE. " s_syste-low is initial
*     jawohl, diesen Status gibt es
      APPEND s_systh.
    ENDIF. " s_syste-low is initial
  ENDLOOP. " at s_syste
ENDFORM.                    " SELEKTIONEN_PRUEFEN


*&---------------------------------------------------------------------*
*&      Form  STATUS_CHECK
*&---------------------------------------------------------------------*
FORM status_check .
*   Aus- bzw. Einschluss verschiedener Status laut Selektionsbildschirm
  LOOP AT s_systh.
    IF s_systh-sign = 'E'.
*     Status soll ausgeschlossen sein
      CALL FUNCTION 'STATUS_CHECK'
        EXPORTING
*       BYPASS_BUFFER           = ' '
          client                  = sy-mandt
          objnr                   = wa_ifauf-objnr
          status                  = s_systh-low
       EXCEPTIONS
         object_not_found        = 1
         status_not_active       = 2
         OTHERS                  = 3.
      IF sy-subrc EQ 0. " CALL FUNCTION 'STATUS_CHECK'
*     Status ist vorhanden
        fufi = 'A'.
        EXIT. " erster Treffer zählt
      ENDIF. " sy-subrc ne 0. " CALL FUNCTION 'STATUS_CHECK'
    ENDIF. " s_systh-sign = 'I'
  ENDLOOP. " at s_systh
ENDFORM.                    " STATUS_CHECK
Back to top
View user's profile Send private message Blog Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> PP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.