Resume application using BSP Application

By Srividya

Resume Application using BSP:

Create a BSP application as “Zres_app” in transaction SE80 and create 3 pages(Page with flow logic) for the created  BSP application as follows 

Page with flow Logic:

First.htm, Second.htm, Third.htm 

Scenario:

User can fill their details in ‘first.htm’ and he/she has 3 options Save (or) Submit (or) Display their details via button event. 

First.htm:

<%@page language="abap"%>

*For Reset Button
<script type="text/javascript">

function formReset()

{

var x=document.getElementById("myForm").reset();

alert ('Are You sure want to Reset ur details');

}

</script>


<%@ extension name="htmlb" prefix="htmlb" %>

   <htmlb:content id="res" design="classic+design2002+design2003">

   <htmlb:page title="Resume Application">
   <htmlb:form>
   <htmlb:group title = "Enter Your Resume Details"
                width = "550px" >
   <htmlb:groupBody>
   <htmlb:gridLayout id      = "myGridLayout1"
                     columnSize = "2"
                     rowSize    = "7" >
     <htmlb:gridLayoutCell rowIndex    = "1"
                           columnIndex = "1">
      <htmlb:textView text   = "Name"
                      design = "EMPHASIZED" />
       </htmlb:gridLayoutCell>
       <htmlb:gridLayoutCell rowIndex    = "1"
                             columnIndex = "2" >
        <htmlb:inputField id       = "i_name"
                          type     = "string"
                          size     = "10"
                          value    = "<%= i_name %>" />
       </htmlb:gridLayoutCell>
       <br/>
       <htmlb:gridLayoutCell rowIndex    = "2"
                           columnIndex = "1">
      <htmlb:textView text   = "Age"
                      design = "EMPHASIZED" />
       </htmlb:gridLayoutCell>
       <htmlb:gridLayoutCell rowIndex    = "2"
                             columnIndex = "2" >
        <htmlb:inputField id       = "i_age"
                          type     = "string"
                          size     = "2"
                          value    = "<%= i_age %>" />
       </htmlb:gridLayoutCell>
       <br/> <br/>
       <htmlb:gridLayoutCell rowIndex    = "3"
                             columnIndex = "1" >
       <htmlb:textView design="EMPHASIZED"
                       text="Sex"/>
       </htmlb:gridLayoutCell>
       <htmlb:gridLayoutCell rowIndex    = "3"
                             columnIndex = "2" >

       <htmlb:radioButtonGroup id="gro" selection="<%= selection1 %>">
       <htmlb:radioButton id="Male"
                      text="Male"
                      onClick="myClick">  
       </htmlb:radioButton>
       <htmlb:radioButton id="Female"
                      text="Female"
                      onClick="myClick">
      </htmlb:radioButton>
      </htmlb:radioButtonGroup>
      </htmlb:gridLayoutCell>
      <br/><br/>
      <htmlb:gridLayoutCell rowIndex    = "4"
                             columnIndex = "1" >
        <htmlb:textView text   = "Address"
                        design = "EMPHASIZED" />
         </htmlb:gridLayoutCell>
        <htmlb:gridLayoutCell rowIndex    = "4"
                              columnIndex = "2" >
         <htmlb:textEdit id   = "address"
                         cols = "30"
                         rows = "4"
                         text = "<%= i_address %>" />
         </htmlb:gridLayoutCell>
         <br/><br/>
          <htmlb:gridLayoutCell rowIndex    = "5"
                               columnIndex = "1" >
         <htmlb:textView text   = "Qualification"
                         design = "EMPHASIZED" />
         </htmlb:gridLayoutCell>
         <htmlb:gridLayoutCell rowIndex    = "5"
                               columnIndex = "2" >
         <htmlb:dropdownListBox id  = "ListBox1"
                                onSelect = "ListBox1Event"
                                selection = "<%= selection2 %>"
                                >
        <htmlb:listBoxItem  key   = "B.Com" value = "B.Com" />
        <htmlb:listBoxItem  key   = "BCA"  value = "BCA"  />
        <htmlb:listBoxItem  key   = "B.E"  value = "B.E"  />
        <htmlb:listBoxItem  key   = "MCA"  value = "MCA"  />
        <htmlb:listBoxItem  key   = "MBA"  value = "MBA"  />
        </htmlb:dropdownListBox>
        </htmlb:gridLayoutCell>
        <br/><br/>
         <htmlb:gridLayoutCell rowIndex    = "6"
                              columnIndex = "1" >
        <htmlb:textView text   = "My Strengths"
                        design = "EMPHASIZED" />
        </htmlb:gridLayoutCell>

        <htmlb:gridLayoutCell rowIndex    = "6"
                              columnIndex = "2" >
        <htmlb:checkbox id            = "SelfConfidence"
                      text          = "Self Confidence"
                      checked       = "<%=i_check %>"/>
         <br/>
         <htmlb:checkbox id            = "HardWorker"
                      text          = "HardWorker"
                      checked       = "<%=i_check %>" />
          <br/>
         <htmlb:checkbox id            = "CreativitySense"
                      text          = "Creativity Sense"
                      checked       = "<%=i_check %>" />
          <br/>
          <htmlb:checkbox id            = "FlexibletoSurroundings"
                      text          = "Flexible to Surroundings"
                      checked       = "<%=i_check %>" />
          </htmlb:gridLayoutCell>
          <br/> <br/>


        <htmlb:gridLayoutCell rowIndex    = "7"
                              columnIndex = "1" >
        <htmlb:textView text   = "Extra Activities"
                        design = "EMPHASIZED" />
        </htmlb:gridLayoutCell>
        <htmlb:gridLayoutCell rowIndex    = "7"
                              columnIndex = "2" >
        <htmlb:textEdit id   = "ea"
                         cols = "30"
                         rows = "4"
                         text = "<%= i_act %>"/>
        </htmlb:gridLayoutCell>
         <br/> <br/>
         </htmlb:gridLayout>


         <htmlb:button id="btn_submit"
                       text    = "Submit Ur Details"
                       onClick = "myDetail" />
         <htmlb:button id="btn_save"
                       text    = "Save Ur Details"
                       onClick = "mysave"
                       onClientClick="alert('Ur details are updated!')" />
         <htmlb:button id="btn_display"
                       text    = "Display Details"
                       onClick = "myDetails" />

    </htmlb:groupBody>
   </htmlb:group>
   </htmlb:form>
   </htmlb:page>

   </htmlb:content>

Types:

TYPES: table_res type ZRES_TT. 

Page attributes:

c_text	TYPE	STRING
itab	TYPE	ZRES_TT
i_act	TYPE	CHAR40
i_address	TYPE	CHAR40
i_age	TYPE	NUMC2
i_check	TYPE	STRING
i_name	TYPE	CHAR40
i_qualify	TYPE	CHAR5
i_sex	TYPE	CHAR6
selection1	TYPE	STRING
selection2	TYPE	STRING
wa	TYPE	ZRES

Event Handler(OninputProcessing):

DATA: iname type ref to cl_htmlb_inputfield,
      iage type ref to cl_htmlb_inputfield,
      isex type ref to cl_htmlb_radiobutton,
      event type ref to cl_htmlb_event.
DATA: irb type ref to cl_htmlb_radiobuttongroup.
DATA: radio type ref to cl_htmlb_event_radiobutton.
DATA: adr type ref to cl_htmlb_textedit.
DATA: qualify type ref to cl_htmlb_dropdownlistbox,
       data1 type char5.
DATA: act type ref to cl_htmlb_textedit.

DATA: checkbox TYPE REF TO CL_HTMLB_CHECKBOX,
      c_text type string.

event ?= cl_htmlb_manager=>get_event( runtime->server->request ).


***********************
irb ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                  name = 'radiobuttongroup'
                                  id   = 'gro' ).
if irb is not initial.
  selection1 = irb->selection.
endif.

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

if event->name = 'radioButton' and event->event_type = 'click'.
  radio ?= event.
  if radio->id = 'Male'.
 isex ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                     id = 'Male'
                                     name = 'radiobuttonfield' ).
    i_sex = me->selection1.
  else.
 isex ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                     id = 'female'
                                     name = 'radiobuttonfield' ).
    i_sex = me->selection1.
  endif.
endif.

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

adr ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                   name = 'textedit'
                                   id = 'address' ).
i_address = adr->text.

******************
event ?= cl_htmlb_manager=>get_event( runtime->server->request ).

qualify ?= cl_htmlb_manager=>get_data(

               request =runtime->server->request
                     name = 'dropdownListBox'
                     id = 'ListBox1' ).
if qualify is not initial.
selection2 = qualify->selection.
endif.
i_qualify = me->selection2.

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

act ?= cl_htmlb_manager=>get_data(

            request = runtime->server->request
                  name = 'textedit'
                  id = 'ea' ).
i_act = act->text.

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

if event->id = 'btn_submit'.
iname ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                     id = 'i_name'
                                     name = 'inputfield' ).
 iage ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                    id = 'i_age'
                                    name = 'inputfield' ).
 event = cl_htmlb_manager=>get_event( runtime->server->request ).
 if event->name = 'checkBox' and event->event_type = 'click'.

 case event->id .
 when 'SelfConfidence'.
 checkbox ?= cl_htmlb_manager=>get_data(

                request = runtime->server->request
                      name    = 'checkbox'
                      id = 'SelfConfidence' ).
   when 'HardWorker'.
   checkbox ?= cl_htmlb_manager=>get_data(

                request   = runtime->server->request
                      name      = 'checkbox'
                      id   = 'HardWorker' ).
   when 'CreativitySense'.
     checkbox ?= cl_htmlb_manager=>get_data(

                request  = runtime->server->request
                      name  = 'checkbox'
                      id = 'CreativitySense' ).
   when 'FlexibletoSurroundings'.
        checkbox ?= cl_htmlb_manager=>get_data(

                 request  = runtime->server->request
                       name    = 'checkbox'
                       id = 'FlexibletoSurroundings' ).
 endcase.
 endif.

IF checkbox IS NOT INITIAL.
  i_check = checkbox->checked.
  if i_check = 'X'.
  c_text = checkbox->id.
  endif.
ENDIF.

  i_name = iname->value.
  i_age = iage->value.
  i_sex = me->selection1.
  i_qualify = me->selection2.
*  i_check = me->i_check   .
  navigation->set_parameter( name = 'i_name' value = me->i_name ).
  navigation->set_parameter( name = 'i_age' value = me->i_age ).
  navigation->set_parameter( name = 'i_sex' value = me->i_sex ).
  navigation->set_parameter( name = 'i_address' value = me->i_address ).
  navigation->set_parameter( name = 'i_qualify' value = me->i_qualify ).
  navigation->set_parameter( name = 'i_act' value = me->i_act ).
  navigation->set_parameter( name = 'c_text' value = c_text ).
   navigation->goto_page( 'second.htm' ).
endif.

if event->id = 'btn_save'.
if itab is initial.
*loop at itab into wa.
move i_name to wa-name.
wa-age = me->i_age.
wa-sex = me->selection1.
wa-address = me->i_address.
wa-qualify = me->selection2. "i_qualify.
wa-act = me->i_act.
append wa to itab.
modify zres from table itab.
commit work.
*endloop.
endif.
endif.

if event->id = 'btn_display'.
  navigation->goto_page( 'third.htm' ).
 endif.

Click here to continue...

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