scripturi ABAP

Monday, April 18, 2005

ZPOPUP_TO_GET_ONE_VALUE

concatenate 'Prg. a mai fost rulat de' zcorectii_nc-uname ' '
' la ' zcorectii_nc-datum into fraza.
if sy-batch is initial.

*daca a mai fost rulat--------------
call function 'ZPOPUP_TO_GET_ONE_VALUE'
exporting
textline1 =
fraza
textline2 =
'Daca nu sinteti sigur RENUNTATI'
textline3 = 'Introduceti parola de acces !'
titel = 'Info'
valuelength = '10'
importing
* ANSWER =
value1 = value.
* EXCEPTIONS
* TITEL_TOO_LONG = 1
* OTHERS = 2
if not value is initial.
if value <> sy-uname+0(3).
message e999(zbc) with 'Parola incorecta'.
ELSE.
PERFORM rulare_ulterioara.
ENDIF.
else.
message e999(zbc) with 'Parola incorecta'.
endif.
else.
PERFORM rulare_ulterioara.
endif.




Unde zpopup_to_get_one_value este definit ca :

FUNCTION ZPOPUP_TO_GET_ONE_VALUE.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(TEXTLINE1)
*" VALUE(TEXTLINE2) DEFAULT SPACE
*" VALUE(TEXTLINE3) DEFAULT SPACE
*" VALUE(TITEL)
*" VALUE(VALUELENGTH)
*" EXPORTING
*" VALUE(ANSWER)
*" VALUE(VALUE1) LIKE SPOP-VARVALUE1
*" EXCEPTIONS
*" TITEL_TOO_LONG
*"----------------------------------------------------------------------
* CALL FUNCTION 'STRING_CENTER'
* EXPORTING STRING = TITEL
* IMPORTING CSTRING = SPOP-TITEL
* EXCEPTIONS TOO_SMALL 1.
* IF SY-SUBRC = 1.
* RAISE TITEL_TOO_LONG.
* ENDIF.
ANSWER = 'J'.
MOVE TITEL TO GL_TITEL.
SPOP-TEXTLINE1 = TEXTLINE1.
SPOP-TEXTLINE2 = TEXTLINE2.
SPOP-TEXTLINE3 = TEXTLINE3.
V_LENGTH = VALUELENGTH.
CLEAR SPOP-VARVALUE1.
CALL SCREEN 100 STARTING AT 25 6
ENDING AT 61 12.
VALUE1 = SPOP-VARVALUE1.
ANSWER = ANTWORT.
ENDFUNCTION.

0 Comments:

Post a Comment

<< Home