Use of FI sets instead of Z Table

By Suhas H. Sonawane Infosys Ltd.

Most of us creates a Z tables and provides a maintenance view to store values which we want use for validations or some other propose in programs.

If values are in ranges or amount of load is very low then Instead of a table we can create a FI set which holds the values and also provides simple maintenance in production.  

Steps:  

Create SET:  

Transaction GS01  

 

Want to maintain a set transaction is GS02. To view its GS03  

How to set values in program.  

2 Simple FMs G_SET_GET_ID_FROM_NAME & G_SET_FETCH needs to call in program

Table set_lines_basic of FM G_SET_FETCH returns values store in the set.  

Sample Code.  

REPORT  ztest_set.

DATA: w_setid LIKE sethier-setid,
      int_vlaues 
TYPE STANDARD TABLE OF rgsbv.

CALL FUNCTION 'G_SET_GET_ID_FROM_NAME'
  
EXPORTING
    shortname = 
'ZTEST'       "Set Name
  
IMPORTING
    new_setid = w_setid
  
EXCEPTIONS
    
OTHERS    = 1.

IF sy-subrc NE 0.
  
WRITE 'Invalid Set'.
ENDIF.

CALL FUNCTION 'G_SET_FETCH'
  
EXPORTING
    setnr           = w_setid
  
TABLES
    set_lines_basic = int_vlaues
  
EXCEPTIONS
    
OTHERS          = 1.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image