Skip to content

Instantly share code, notes, and snippets.

@iespino00
Last active September 21, 2017 01:33
Show Gist options
  • Save iespino00/dee0df06aa5e95f247ba7e96e3a32945 to your computer and use it in GitHub Desktop.
Save iespino00/dee0df06aa5e95f247ba7e96e3a32945 to your computer and use it in GitHub Desktop.
*&---------------------------------------------------------------------*
*& Report Z_FORM_EMAIL
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT z_form_email.
data wa_data type ZFORM_IER.
CONSTANTS: p1 TYPE string VALUE 'Iphone',
p2 TYPE string VALUE 'Samsung',
p3 TYPE string VALUE 'Oppo',
s1 TYPE string VALUE '30H',
s2 TYPE string VALUE '15H',
s3 TYPE string VALUE '10H'.
DATA: id TYPE i,
phone type string,
suscription type string.
SELECTION-SCREEN BEGIN OF BLOCK bl0 WITH FRAME TITLE text-003.
SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME .
PARAMETERS: nombre TYPE string DEFAULT sy-uname,
position TYPE string OBLIGATORY.
SELECTION-SCREEN END OF BLOCK bl3.
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
PARAMETER : p_1 RADIOBUTTON GROUP gr1,
p_2 RADIOBUTTON GROUP gr1,
p_3 RADIOBUTTON GROUP gr1.
SELECTION-SCREEN END OF BLOCK bl1.
SELECTION-SCREEN BEGIN OF BLOCK bl2 WITH FRAME TITLE text-002.
PARAMETER : s_1 RADIOBUTTON GROUP gr2,
s_2 RADIOBUTTON GROUP gr2,
s_3 RADIOBUTTON GROUP gr2.
SELECTION-SCREEN END OF BLOCK bl2.
SELECTION-SCREEN END OF BLOCK bl0.
perform valid_checkboxes.
form valid_checkboxes.
wa_data-nombre = nombre.
wa_data-pos = position.
"Valid phone
if p_1 eq 'X'.
wa_data-phone = p1.
elseif p_2 eq 'X'.
wa_data-phone = p2.
ELSEIF p_3 eq 'X'.
wa_data-phone = p3.
ENDIF.
"Valid suscription
if s_1 eq 'X'.
wa_data-suscription = s1.
elseif s_2 eq 'X'.
wa_data-suscription = s2.
ELSEIF s_3 eq 'X'.
wa_data-suscription = s3.
ENDIF.
insert ZFORM_IER from wa_data.
"mensaje de información para saber si se insertó el registro
if sy-subrc eq 0.
"write: / 'Registro guardado en DB con éxito'.
message 'Registered Data' type 'I'.
else.
write: / 'Error ¡¡ Registered Data'.
endif.
endform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment