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

Saving the selection variant



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


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

PostPosted: Sat Nov 29, 2008 4:46 pm    Post subject: Saving the selection variant Reply with quote

Saving the selection variant during the program (saving the settings)

Selection table as a variant:
So after example in a report for mass updates an extensive selection was made to be narrowing before or after this selection process as a variant be stored for later restore them.

Code:
*Variante
DATA:
  seltab TYPE TABLE OF rsparams WITH HEADER LINE,
  g_repid LIKE sy-repid.
  d_text TYPE TABLE OF varit WITH HEADER LINE,
  d_varid LIKE varid,
  d_variant LIKE rsvar-variant.                             " 14 Char


  g_repid = sy-repid.

* Selektionstabelle einlesen
    REFRESH seltab.
    CLEAR seltab.
*   Selektionen lesen und merken
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
         EXPORTING
              curr_report     = g_repid
         TABLES
              selection_table = seltab.


    PERFORM selektionstabelle_sichern.



*---------------------------------------------------------------------*
*      Form  selektionstabelle_sichern
*---------------------------------------------------------------------*
FORM selektionstabelle_sichern.

* Variantennamen bilden
  CONCATENATE 'ZU'
    sy-datum+2(6) sy-uzeit INTO d_variant.                  " max 14

* Variantentabelle füllen
  MOVE:
    g_repid  TO d_varid-report,
    d_variant TO d_varid-variant,
    'F'       TO d_varid-transport,
    'A'       TO d_varid-environmnt,
    'X'       TO d_varid-protected,
    '1'       TO d_varid-version,
    sy-uname  TO d_varid-ename,
    sy-datum  TO d_varid-edat,
    sy-uzeit  TO d_varid-etime,
    sy-langu TO d_varid-mlangu.
*    '20' to d_varid-xflag1,
*    '00' to d_varid-xflag2.

*Beschreibungstext füllen
  MOVE: sy-langu TO d_text-langu,
        g_repid  TO d_text-report,
        d_variant TO d_text-variant.
  CONCATENATE sy-uname sy-datum sy-uzeit
    INTO d_text-vtext SEPARATED BY space.
  APPEND d_text.

* Variante anlegen.
  CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
      curr_report                     = g_repid
      curr_variant                    = d_variant
      vari_desc                       = d_varid
    TABLES
      vari_contents                   = seltab
      vari_text                       = d_text
*   VSCREENS                        =
   EXCEPTIONS
     illegal_report_or_variant       = 1
     illegal_variantname             = 2
     not_authorized                  = 3
     not_executed                    = 4
     report_not_existent             = 5
     report_not_supplied             = 6
     variant_exists                  = 7
     variant_locked                  = 8
     OTHERS                          = 9.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
ENDFORM.                    " selektionstabelle_sichern
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 -> Dialog Programming 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 can 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.