My first post ! 🙂

First press: ‘Cred’ button for adding ‘credits’, then chose the ‘Bet’ botton for betting value, then ‘Spin’.

When you ‘win’ you can double the winning amount by pressing ‘<5’ or  ‘>=5’.

Have fun!

sly.JPG

***************************************************************************************************************************************

REPORT  zMini_SIZZLING.
TABLES SSCRFIELDS.
TYPEPOOLS: icon.
DATA: w_num TYPE i.
data: credit(4) TYPE p DECIMALS 0,
       cred2 TYPE i,
       bet TYPE p DECIMALS 0.
data: a type i,
        CASTIG TYPE P DECIMALS 0,
        castig2 TYPE p DECIMALS 0,
       B TYPE I.

DATA: FLAG, count(10) type c ,
f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,
p1(2) type c,
p2(2) type c,
player(2) type c,
ch type c,
rand(2) TYPE c.

SELECTION-SCREEN BEGIN OF BLOCK b1                          “rad1
WITH FRAME TITLE text002 .“no intervals.
PARAMETERS: Message1(10) TYPE c MODIF ID ABC,
             message(10) type c MODIF ID ABC,
             BETS(2) TYPE C MODIF ID ABC,
             wining(10) MODIF ID ABC.
SELECTION-SCREEN SKIP 1.
SELECTIONSCREEN:
BEGIN OF LINE,
   PUSHBUTTON 2(10) BUTgame1 USER-COMMAND CLIgame1 MODIF ID sc1,
   PUSHBUTTON 14(10) BUTnet1 USER-COMMAND net MODIF ID sc1,
END OF LINE,
BEGIN OF LINE,
PUSHBUTTON 2(10) BUT1 USER-COMMAND CLI1 MODIF ID sc1,
PUSHBUTTON 12(10) but22 USER-COMMAND CLI2 MODIF ID sc2,
PUSHBUTTON 22(10) BUT3 USER-COMMAND CLI3 MODIF ID sc3,
PUSHBUTTON 32(10) BUT101 USER-COMMAND CLI3 MODIF ID sc3,
PUSHBUTTON 42(10) BUT102 USER-COMMAND CLI3 MODIF ID sc3,
PUSHBUTTON 67(10) BUTdub USER-COMMAND CLI000 MODIF ID sc3,
END OF LINE,
BEGIN OF LINE,
PUSHBUTTON 2(10) BUT4 USER-COMMAND CLI4 MODIF ID sc4,
PUSHBUTTON 12(10) BUT5 USER-COMMAND CLI5 MODIF ID sc5,
PUSHBUTTON 22(10) BUT6 USER-COMMAND CLI6 MODIF ID sc6,
PUSHBUTTON 32(10) BUT121 USER-COMMAND CLI3 MODIF ID sc3,
PUSHBUTTON 42(10) BUT122 USER-COMMAND CLI3 MODIF ID sc3,
END OF LINE,
BEGIN OF LINE,
PUSHBUTTON 2(10) BUT7 USER-COMMAND CLI7 MODIF ID sc7,
PUSHBUTTON 12(10) BUT8 USER-COMMAND CLI8 MODIF ID sc8,
PUSHBUTTON 22(10) BUT9 USER-COMMAND CLI9 MODIF ID sc9,
PUSHBUTTON 32(10) BUT131 USER-COMMAND CLI3 MODIF ID sc3,
PUSHBUTTON 42(10) BUT132 USER-COMMAND CLI3 MODIF ID sc3,

END OF LINE,
BEGIN of line,

END OF line,
BEGIN OF LINE,
   PUSHBUTTON 2(37) BUT10 USER-COMMAND CLI10 MODIF ID sc3,
   PUSHBUTTON 41(5) BUT11 USER-COMMAND CLI11 MODIF ID sc9,
   PUSHBUTTON 47(5) BUT12 USER-COMMAND CLI12 MODIF ID sc9,
   PUSHBUTTON 65(5) BUTmin USER-COMMAND CLI001 MODIF ID sc3,
   PUSHBUTTON 74(5) BUTmax USER-COMMAND CLI002 MODIF ID sc9,
end of line,

BEGIN of line,

END OF line.
SELECTION-SCREEN END OF BLOCK b1.                           “rad1.

form box_disable using ch.
   LOOP AT SCREEN.
     IF screengroup1 = ch.
       screeninput = ‘0’.
       MODIFY SCREEN.
     ENDIF.
   ENDLOOP.
endform. “box_disable

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.
IF SCREENGROUP1 = ‘ABC’.
SCREENINPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

   if f1 = 1.
     perform box_disable using ‘SC1’.
   endif.
   if f2 = 1.
     perform box_disable using ‘SC2’.
   endif.
   if f3 = 1.
     perform box_disable using ‘SC3’.
   endif.
   if f4 = 1.
     perform box_disable using ‘SC4’.
   endif.
   if f5 = 1.
     perform box_disable using ‘SC5’.
   endif.
   if f6 = 1.
     perform box_disable using ‘SC6’.
   endif.
   if f7 = 1.
     perform box_disable using ‘SC7’.
   endif.
   if f8 = 1.
     perform box_disable using ‘SC8’.
   endif.
   if f9 = 1.
     perform box_disable using ‘SC9’.
   endif.

AT SELECTION-SCREEN .

   CASE SSCRFIELDS.
     when ‘CLIGAME1’.
       “SUBMIT Z_TEST_XO_1  VIA SELECTION-SCREEN AND RETURN.
CALL TRANSACTION ‘ZF_GAME_2’ .
       when ‘NET’.
       SUBMIT ZF_HTML1  VIA SELECTION-SCREEN AND RETURN.

     when ‘CLI000’.
       DATA: BROWSER_TYPE       LIKE TOLEAPP VALUE ‘INTERNETEXPLORER.APPLICATION’,

       LV_HELP_MODE        TYPE CHAR1,

       LV_WINDOW_NAME      TYPE SYDATAR.

CALL FUNCTION ‘GET_WEBGUI_HELP_MODE’

      IMPORTING

           HELP_MODE = LV_HELP_MODE.

IF LV_HELP_MODE = ‘X’.

   LV_WINDOW_NAME = ‘SAPNet’.

ELSE.

   LV_WINDOW_NAME = SPACE.

ENDIF.

     CALL FUNCTION ‘CALL_BROWSER’

      EXPORTING

           URL                    = http://www.youtube.com/watch?v=6dja9wIHPJo&feature=player_embedded#t=59s

           BROWSER_TYPE           = BROWSER_TYPE

           WINDOW_NAME            = LV_WINDOW_NAME

      EXCEPTIONS

           FRONTEND_NOT_SUPPORTED = 1

           FRONTEND_ERROR         = 2

           PROG_NOT_FOUND         = 3

           NO_BATCH               = 4

           UNSPECIFIED_ERROR      = 5

           OTHERS                 = 6.

IF SYSUBRC NE 0.

   WRITE:/ ‘Browser not called.’.

ENDIF.

     WHEN ‘CLI001’.
       castig2 = wining.
       IF A = 1.
         CALL FUNCTION ‘ISB_RANDOM_CHAR’
         EXPORTING
          length = 1                  ” sy-tabix
           pattern =‘1234567890’                  
         IMPORTING
           ran_char = butDUB                
         EXCEPTIONS
           INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR
         IF BUTDUB < 5 .
           WINING = WINING * 2.
         ELSE.
           MESSAGE1 = ‘You Lost’.
           WINING = 0.
           A = 0.
         ENDIF.
       ENDIF.
     WHEN ‘CLI002’.
       IF A = 1.
         CALL FUNCTION ‘ISB_RANDOM_CHAR’
         EXPORTING
          length = 1                  ” sy-tabix
           pattern =‘1234567890’                  
         IMPORTING
           ran_char = butDUB                
         EXCEPTIONS
           INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR
         IF BUTDUB >= 5 .
           WINING = WINING * 2.
         ELSE.
           WINING = 0.
           MESSAGE1 = ‘You Lost’.
           A = 0.
         ENDIF.
       ENDIF.
     when ‘CLI11’.
       credit = credit + 500.
       MESSAGE = credit.
      ” PERFORM beting.
     when ‘CLI12’.
       “PERFORM beting.
       IF BET < 50.
         BET = BET + 10.
       ELSE.
         BET = 10.
       ENDIF.
       BETS = BET.
     when ‘CLI10’.
       IF credit < bet.
           bet = credit.
           bets = bet.
       ENDIF.
        butdub = ‘Press?!’.
       count = 1.
       credit = credit bet.
       IF wining <> 0 .
             wining = wining + bet.
       ENDIF.
       MESSAGE1 = .
       CREDIT = CREDIT + WINING.
       IF credit <= 10.
         PERFORM reset.
       else.
         MESSAGE = credit.

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but101                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but102                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but121                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR
         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but122                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but131                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but132                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but1                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but22                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but3                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but4                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but5                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but6                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but7                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION ‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but8                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         CALL FUNCTION‘ISB_RANDOM_CHAR’
           EXPORTING
            length = 1                  ” sy-tabix
             pattern =‘1234712341234’                  
           IMPORTING
             ran_char = but9                
           EXCEPTIONS
             INVALID_INPUT = 1           . ”  ISB_RANDOM_CHAR

         ” prima linie ****************
         IF but101 = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but101
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but101 = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but101
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but101 = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but101
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but101 = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but101
             EXCEPTIONS
               OTHERS = 0.
         elseif  but101 = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but101
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but1  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but1
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but1  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but1
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but1  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but1
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but1  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but1
             EXCEPTIONS
               OTHERS = 0.
         elseif  but1  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but1
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but3  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but3
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but3  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but3
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but3  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but3
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but3  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but3
             EXCEPTIONS
               OTHERS = 0.
         elseif  but3  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but3
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but102  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but102
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but102  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but102
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but102  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but102
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but102  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but102
             EXCEPTIONS
               OTHERS = 0.
         elseif  but102  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but102
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but22  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but22
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but22  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but22
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but22  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but22
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but22  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but22
             EXCEPTIONS
               OTHERS = 0.
         elseif  but22  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but22
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.
         “a doua linie ********************
         IF but121 = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but121
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but121 = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but121
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but121 = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but121
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but121 = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but121
             EXCEPTIONS
               OTHERS = 0.
         elseif  but121 = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but121
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but4  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but4
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but4  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but4
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but4  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but4
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but4  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but4
             EXCEPTIONS
               OTHERS = 0.
         elseif  but4  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but4
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but6  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but6
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but6  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but6
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but6  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but6
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but6  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but6
             EXCEPTIONS
               OTHERS = 0.
         elseif  but6  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but6
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but122  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but122
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but122  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but122
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but122  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but122
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but122  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but122
             EXCEPTIONS
               OTHERS = 0.
         elseif  but122  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but122
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but5  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
              RESULT = but5
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but5  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but5
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but5  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but5
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but5  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but5
             EXCEPTIONS
               OTHERS = 0.
         elseif  but5  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but5
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         “a doua linie ********************
         IF but131 = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but131
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but131 = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but131
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but131 = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but131
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but131 = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but131
             EXCEPTIONS
               OTHERS = 0.
         elseif  but131 = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but131
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but7  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but7
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but7  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but7
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but7  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but7
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but7  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but7
             EXCEPTIONS
               OTHERS = 0.
         elseif  but7  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but7
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but9  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but9
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but9  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but9
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but9  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but9
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but9  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but9
             EXCEPTIONS
               OTHERS = 0.
         elseif  but9  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but9
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but132  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but132
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but132  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but132
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but132  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but132
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but132  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but132
             EXCEPTIONS
               OTHERS = 0.
         elseif  but132  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but132
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         IF but8  = 1.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = icon_okay
               text   = ‘1’
               info   = ‘1’
             IMPORTING
               RESULT = but8
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but8  = 2.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_LOCKED
               text   = ‘2’
               info   = ‘2’
             IMPORTING
               RESULT = but8
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but8  = 3.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_GREEN_LIGHT
               text   = ‘3’
               info   = ‘3’
             IMPORTING
               RESULT = but8
             EXCEPTIONS
               OTHERS = 0.
         ELSEIF but8  = 4.
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_YELLOW_LIGHT
               text   = ‘4’
               info   = ‘4’
             IMPORTING
               RESULT = but8
             EXCEPTIONS
               OTHERS = 0.
         elseif  but8  = 7 .
           CALL FUNCTION ‘ICON_CREATE’
             EXPORTING
               name   = ICON_RED_LIGHT
               text   = ‘7’
               info   = ‘7’
             IMPORTING
               RESULT = but8
             EXCEPTIONS
               OTHERS = 0.
         ENDIF.

         PERFORM wining.
       ENDIF.

   ENDCASE.

*&———————————————————————*
*&      Form  reset
*&———————————————————————*
*       text
*———————————————————————-*
form reset.
   wait up to 2 SECONDS.
   butgame1 = ‘Jocul 2’.
   butnet1 = ‘Net’.
   credit = 100.
   BUT1 = ‘L’.
   but22 = ‘E’.
   BUT3 = ‘T’.
   BUT101 = ‘,’.
   BUT102 = ‘S’.
   BUT4 = ‘P’.
   BUT5 = ‘L’.
   BUT6 = ‘A’.
   BUT121 = ‘Y’.
   BUT122 = ‘ ‘.
   BUT7 = ‘ ‘.
   BUT8 = ‘ ‘.
   BUT9 = ‘ ‘.
   BUT131 = ‘ ‘.
   BUT132 = ‘ ‘.
   CALL FUNCTION ‘ICON_CREATE’
     EXPORTING
       name   = icon_okay
       text   = ‘Spin/Colect’
       info   = ‘Click to Continue’
     IMPORTING
       RESULT = but10
     EXCEPTIONS
       OTHERS = 0.
   but11 = ‘Cred’.

   but12 = ‘Bet’.
   f1 = ‘ ‘.
   f2 =‘ ‘.
   f3 = ‘ ‘.
   f4 =‘ ‘.
   f5 = ‘ ‘.
   f6 =‘ ‘.
   f7 = ‘ ‘.
   f8 =‘ ‘.
   f9 = ‘ ‘.
   Message = ‘New Game’.
** Score = ‘ ‘.
   count = 0.

endform. “reset

initialization.
   count = 0.
   butgame1 = ‘Jocul 2’.
   butnet1 = ‘Net’.
   BUT1 = p1.
   but22 = p1.
   BUT3 = p1.
   BUT4 = p1.
   BUT5 = p1.
   BUT6 = p1.
   BUT7 = p1.
   BUT8 = p1.
   BUT9 = p1.
   BUT101 = p1.
   BUT102 = p1.
   BUT121 = p1.
   BUT122 = p1.
   BUT131 = p1.
   BUT132 = p1.
   but11 = ‘Cred’.
   but12 = ‘Bet’.

   CALL FUNCTION ‘ICON_CREATE’
     EXPORTING
       name   = icon_okay
       text   = ‘Spin/Colect’
       info   = ‘Click to Continue’
     IMPORTING
       RESULT = but10
     EXCEPTIONS
       OTHERS = 0.

   cALL FUNCTION ‘MOVE_CHAR_TO_NUM’
     EXPORTING
       CHR             = but11
     IMPORTING
       NUM             = credit
     EXCEPTIONS
       CONVT_NO_NUMBER = 1
       CONVT_OVERFLOW  = 2
       OTHERS          = 3.
   IF SYSUBRC <> 0.
   ENDIF.
   cALL FUNCTION ‘MOVE_CHAR_TO_NUM’
     EXPORTING
       CHR             = but12
     IMPORTING
       NUM             = bet
     EXCEPTIONS
       CONVT_NO_NUMBER = 1
       CONVT_OVERFLOW  = 2
       OTHERS          = 3.

   IF SYSUBRC <> 0.
   ENDIF.

*&———————————————————————*
*&      Form  wining
*&———————————————————————*
*       text
*———————————————————————-*
form wining.

   a = 0.
   CASTIG = 0.
   B = 0.
   if but1 = but22 and but1 = but3 .
     IF but1 = but101.
       IF BUT1 = BUT102.
         IF BUT1 = ‘@0A\Q7@ 7’ .
           CASTIG = 5 * ( CASTIG + 5 * BET ).
           B = 1.
         ELSE.
           CASTIG = 5 * ( CASTIG + 2 * BET ).
           B = 1.
         ENDIF.
       ENDIF.
       IF B = 0 AND BUT1 = ‘@0A\Q7@ 7’ .
         CASTIG = 3 * ( CASTIG + 5 * BET ).
         B = 1.
       ELSEIF B = 0 AND BUT1 <> ‘@0A\Q7@ 7’ .
         CASTIG = 3 * ( CASTIG + 2 * BET ).
         B = 1.
       ENDIF.
     ENDIF.
     IF B = 0 AND BUT1 = ‘@0A\Q7@ 7’ .
       CASTIG = ( CASTIG + 5 * BET ).
       B = 1.
     ELSEIF B = 0 AND BUT1 <> ‘@0A\Q7@ 7’ .
       CASTIG = ( CASTIG + 2 * BET ).
       B = 1.
     ENDIF.
     A = 1.
   ENDIF“PRIMA LINIE

   B = 0.
   if but4 = but5 and but4 = but6.
     IF but4 = but121.
       IF BUT4 = BUT122.
         IF BUT4 = ‘@0A\Q7@ 7’ .
           CASTIG = 5 * ( CASTIG + 5 * BET ).
           B = 1.
         ELSE.
           CASTIG = 5 * ( CASTIG + 2 * BET ).
           B = 1.
         ENDIF.
       ENDIF.
       IF B = 0 AND BUT4 = ‘@0A\Q7@ 7’ .
         CASTIG = 3 * ( CASTIG + 5 * BET ).
         B = 1.
       ELSEIF B = 0 AND BUT4 <> ‘@0A\Q7@ 7’ .
         CASTIG = 3 * ( CASTIG + 2 * BET ).
         B = 1.
       ENDIF.
     ENDIF.
     IF B = 0 AND BUT4 = ‘@0A\Q7@ 7’ .
       CASTIG = ( CASTIG + 5 * BET ).
       B = 1.
     ELSEIF B = 0 AND BUT4 <> ‘@0A\Q7@ 7’ .
       CASTIG = ( CASTIG + 2 * BET ).
       B = 1.
     ENDIF.
     A = 1.
   ENDIF. “LINIE MIJLOC

   B = 0.
   if but7 = but8 and but7 = but9.
     IF but7 = but131.
       IF BUT7 = BUT132.
         IF BUT7 = ‘@0A\Q7@ 7’ .
           CASTIG = 5 * ( CASTIG + 5 * BET ).
           B = 1.
         ELSE.
           CASTIG = 5 * ( CASTIG + 2 * BET ).
           B = 1.
         ENDIF.
       ENDIF.
       IF B = 0 AND BUT7 = ‘@0A\Q7@ 7’ .
         CASTIG = 3 * ( CASTIG + 5 * BET ).
         B = 1.
       ELSEIF B = 0 AND BUT7 <> ‘@0A\Q7@ 7’ .
         CASTIG = 3 * ( CASTIG + 2 * BET ).
         B = 1.
       ENDIF.
     ENDIF.
     IF B = 0 AND BUT7 = ‘@0A\Q7@ 7’ .
       CASTIG = ( CASTIG + 5 * BET ).
       B = 1.
     ELSEIF B = 0 AND BUT7 <> ‘@0A\Q7@ 7’ .
       CASTIG = ( CASTIG + 2 * BET ).
       B = 1.
     ENDIF.
     A = 1.
   ENDIF.                                                    “LINIE 3

   B = 0.
   if but7 = but5 and but7 = but3.
     IF but7 = but121.
       IF BUT7 = BUT132.
         IF BUT7 = ‘@0A\Q7@ 7’ .
           CASTIG = 5 * ( CASTIG + 5 * BET ).
           B = 1.
         ELSE.
           CASTIG = 5 * ( CASTIG + 2 * BET ).
           B = 1.
         ENDIF.
       ENDIF.
       IF B = 0 AND BUT7 = ‘@0A\Q7@ 7’ .
         CASTIG = 3 * ( CASTIG + 5 * BET ).
         B = 1.
       ELSEIF B = 0 AND BUT7 <> ‘@0A\Q7@ 7’ .
         CASTIG = 3 * ( CASTIG + 2 * BET ).
         B = 1.
       ENDIF.
     ENDIF.
     IF B = 0 AND BUT7 = ‘@0A\Q7@ 7’ .
       CASTIG = ( CASTIG + 5 * BET ).
       B = 1.
     ELSEIF B = 0 AND BUT7 <> ‘@0A\Q7@ 7’ .
       CASTIG = ( CASTIG + 2 * BET ).
       B = 1.
     ENDIF.
     A = 1.
   ENDIF.                                                    “DIAG 2

   B = 0.
   if but1 = but5 and but1 = but9.                           “DIAG 1
     IF but1 = but121.
       IF BUT1 = BUT102.
         IF BUT1 = ‘@0A\Q7@ 7’ .
           CASTIG = 5 * ( CASTIG + 5 * BET ).
           B = 1.
         ELSE.
           CASTIG = 5 * ( CASTIG + 2 * BET ).
           B = 1.
         ENDIF.
       ENDIF.
       IF B = 0 AND BUT1 = ‘@0A\Q7@ 7’ .
         CASTIG = 3 * ( CASTIG + 5 * BET ).
         B = 1.
       ELSEIF B = 0 AND BUT1 <> ‘@0A\Q7@ 7’ .
         CASTIG = 3 * ( CASTIG + 2 * BET ).
         B = 1.
       ENDIF.
     ENDIF.
     IF B = 0 AND BUT1 = ‘@0A\Q7@ 7’ .
       CASTIG = ( CASTIG + 5 * BET ).
       B = 1.
     ELSEIF B = 0 AND BUT1 <> ‘@0A\Q7@ 7’ .
       CASTIG = ( CASTIG + 2 * BET ).
       B = 1.
     ENDIF.
     A = 1.
   ENDIF.                                                    “LINIE 3

   IF a = 1.
     MESSAGE1 = ‘You win ‘.
      butdub = ‘Double?!’.
   else.
     MESSAGE1 = .
   ENDIF.
   WINING = CASTIG.
   BUTMIN = ‘<5’.
   BUTMAX = ‘>=5’.

endform. “check_x_win
*&———————————————————————*
*&      Form  BETING
*&———————————————————————*
*       text
*———————————————————————-*
*  –>  p1        text
*  <–  p2        text
*———————————————————————-*
FORM BETING .

DATA: it_vbscript LIKE STANDARD TABLE OF soli WITH HEADER LINE,
       v_vbsfile LIKE rlgrapfilename.

*———————————————————————–
*  This code creates the vbScript to play sound ringin.wav
*———————————————————————–
APPEND: ‘strSoundFile = “C:\WINDOWS\Media\notify.wav”‘ TO it_vbscript,
         ‘Set objShell = CreateObject(“Wscript.Shell”)’ TO it_vbscript,
         ‘strCommand = “sndrec32 /play /close ” & chr(34) & strSoundFile & chr(34)’ TO it_vbscript,
         ‘objShell.Run strCommand, 0, True’ TO it_vbscript.

*———————————————————————–
*  Generated Script file must be downloaded into the TEMP folder of
*  the Windows environment
*———————————————————————–
CALL FUNCTION ‘WS_QUERY’
   EXPORTING
     environment    = ‘TEMP’
     query          = ‘EN’
   IMPORTING
     return         = v_vbsfile
   EXCEPTIONS
     inv_query      = 1
     no_batch       = 2
     frontend_error = 3
     OTHERS         = 4.

IF sysubrc <> 0.

   MESSAGE ID symsgid TYPE symsgty NUMBER symsgno WITH symsgv1 symsgv2 symsgv3 symsgv4.

ELSE.

   CONCATENATE v_vbsfile ‘\my_script.vbs’ INTO v_vbsfile.

*———————————————————————–
*   Script file is downloaded
*———————————————————————–
   CALL FUNCTION ‘WS_DOWNLOAD’
     EXPORTING
       filename            = v_vbsfile
       filetype            = ‘DAT’
       mode                = ‘S’
     TABLES
       data_tab            = it_vbscript
     EXCEPTIONS
       file_open_error     = 1
       file_write_error    = 2
       invalid_filesize    = 3
       invalid_table_width = 4
       invalid_type        = 5
       no_batch            = 6
       unknown_error       = 7
       OTHERS              = 8.

   IF sysubrc <> 0.

     MESSAGE ID symsgid TYPE symsgty NUMBER symsgno WITH symsgv1 symsgv2 symsgv3 symsgv4.

   ELSE.

*———————————————————————–
*  The Script file is executed
*———————————————————————–
     CALL FUNCTION ‘WS_EXECUTE’
       EXPORTING
         commandline    = v_vbsfile
         program        = ‘WSCRIPT.EXE’
       EXCEPTIONS
         frontend_error = 1
         no_batch       = 2
         prog_not_found = 3
         illegal_option = 4
         OTHERS         = 5.

     IF sysubrc <> 0.

       MESSAGE ID symsgid TYPE symsgty NUMBER symsgno WITH symsgv1 symsgv2 symsgv3 symsgv4.

     ENDIF.

   ENDIF.

ENDIF.

ENDFORM.                    ” BETING

********************************************************************************************************************************************************************

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Eric Peterson

    Hi Zavate,

    Congrats on your first post!  It’s always cool to see people write games with ABAP.  It’s a fun break from work topics on here.

    I have a tip for this blog post.  Why don’t you put the code as a .txt attachment to this blog so readers don’t have to do so much scrolling?  Then you could write more of a description on the rules of the game.  Right now, they are somewhat unclear.  I don’t know if it’s a slot machine or craps table or blackjack or something else.

    Happy Blogging,

    Eric

    (0) 

Leave a Reply