cancel
Showing results for 
Search instead for 
Did you mean: 

how to get report on the basis of selection of 2 values select in BSP

konchada_saikrishna
Active Participant
0 Kudos
65

Hi All

Friends i am unable to pass on 2 values from one page (select page) and according to the selected values i am calling one function module to get one report.

I think there is some problem in the event handler page below is the code please help me:

LAYOUT CODE:


<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>

<htmlb:content design="design2003">
  <htmlb:page title = " KEY VALUE REPORT">
    <br>
    <br>

                  <u><htmlb:textView     text     =   "HINDUSTAN ZINC LTD."
                        design     =    "HEADER1"></htmlb:textView>
    </u>


        <htmlb:gridLayout width  = "100%"
                      height     = "50%"
                      rowSize    = "6"
                      columnSize = "25"
                      cellSpacing= "5"
                      cellPadding= "2">

       <htmlb:gridLayoutCell columnIndex        = "8"
                            width               = "100%"
                            rowIndex            = "5"
                            horizontalAlignment = "left"
                            verticalAlignment   = "middle" >


    <htmlb:form>

      <htmlb:textView     text          = "Plant"
                          design        = "HEADER1"></htmlb:textView>
                      
          
       <htmlb:dropdownListBox    id          = "<zplant>" selection="key_green" >
        <htmlb:listBoxItem      key         = "key_red"   value = "2010"></htmlb:listBoxItem>
        <htmlb:listBoxItem      key         = "key_green" value = "2010"></htmlb:listBoxItem>
        <htmlb:listBoxItem      key         = "key_blue"  value = "2010"></htmlb:listBoxItem>
        <htmlb:listBoxItem      key         = "key_black" value = "2010"></htmlb:listBoxItem>
      </htmlb:dropdownListBox>

    <br>
    <br>

      <htmlb:textView     text          = "Financial Year"
                          design        = "HEADER1"></htmlb:textView>
         
       <htmlb:dropdownListBox    id          = "<zfoy>" selection="key_green" >
        <htmlb:listBoxItem      key         = "key_red"   value = "2007"></htmlb:listBoxItem>
        <htmlb:listBoxItem      key         = "key_green" value = "2007"></htmlb:listBoxItem>
        <htmlb:listBoxItem      key         = "key_blue"  value = "2007"></htmlb:listBoxItem>
        <htmlb:listBoxItem      key         = "key_black" value = "2007"></htmlb:listBoxItem>
      </htmlb:dropdownListBox>
    <br>
   <br>
   <br>    
<htmlb:button id = "button1"
                      
                      text = "Press to see report"
                      onClick = "MyButtonClick"></htmlb:button>
    </htmlb:form>
          </htmlb:gridLayoutCell>
    </htmlb:gridLayout>

  </htmlb:page>
</htmlb:content>

 
OnInputInitialization:

CLASS CL_HTMLB_MANAGER DEFINITION LOAD.


data: event type ref to cl_htmlb_event,
      plant type I,
      foy type d.
    IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
        event = CL_HTMLB_MANAGER=>GET_EVENT( runtime->server->request ).

     IF event->name = 'button1' AND event->event_type = 'click'  .
         plant = request->get_form_field('zplant').
         foy = request->get_form_field('zfoy').
         navigation->set_parameter( name = 'zplant' value = plant ).
         navigation->set_parameter( name = 'zfoy' value = foy ).

         navigation->goto_page('Report.htm').
     ENDIF.
    ENDIF.

Message was edited by:

Durairaj Athavan Raja to format the code.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sai,

If you use the following code :

    plant = request->get_form_field('zplant'). 
    foy = request->get_form_field('zfoy').

Then it means that u will have to pass the values from another page while calling your page in the url....

example...if this page is named <b>called.htm</b>, then you will have to call it as

window.open("called.htm?plant='0500'");

This is how you pass one variable....Similarly pass foy also....

Hope this helps.

<b><i>Do reward each useful answer..!</i></b>

Thanks,

Tatvagna.

Former Member
0 Kudos

Hi!

Do you set the auto-flag for zplant and zfoy on "page attributes" of report.htm?

Regards