cancel
Showing results for 
Search instead for 
Did you mean: 

Accepting User Input using BSP and storing it in a table in backend.

Former Member
0 Kudos

Hello Gurus,

Scenario is to accept User Input using BSP and save it into a table in backend (SAP-BW) there by using that table to load data into a Cube (in SAP-BW). The data stored in the BW Cubes will then be used in the reports.

Now I dnt know anything about BSP and how I can use it to take User Input and save it in a table.

Any help would be greatly appreciated and of course be given appropriate marks.

Regards

Rohit

Accepted Solutions (1)

Accepted Solutions (1)

sreemsft
Contributor
0 Kudos

Hi Rohit,

Yes. Raja is correct. First try to learn how to create BSP applications, then you can do these things very easily.

If you need a simple example with code. I am providing below.

I designed a simple BSP application to update a <i>ZTABLE</i> which has two fields using <i>PAGE WITH FLOW LOGIC</i>.

Here is the code.

<u>First.htm</u>


<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
  <htmlb:page title="first page " >
    <htmlb:form>
      <htmlb:textView text   = "First Field"
                      design = "STANDARD" />
      <htmlb:inputField id="field1" />
      <br>
      <htmlb:textView text   = "Second Field"
                      design = "STANDARD" />
      <htmlb:inputField id="field2" />
      <htmlb:button id      = "submitButton"
                    text    = "Press Me"
                    onClick = "myClickHandler" />
    </htmlb:form>
  </htmlb:page>
</htmlb:content>

<u>OnInputProcessing</u>


* event handler for checking and processing user input and
* for defining navigation

CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
DATA: EVENT TYPE REF TO CL_HTMLB_EVENT.

DATA : BEGIN OF WA,
       MATNR TYPE MARA-MATNR,
       ERSDA TYPE MARA-ERSDA,
       END OF WA.

EVENT ?= CL_HTMLB_MANAGER=>GET_EVENT( RUNTIME->SERVER->REQUEST ).

IF EVENT->ID = 'submitButton' AND EVENT->EVENT_TYPE = 'click'.

  DATA: DATA TYPE REF TO CL_HTMLB_INPUTFIELD.
  DATA: DATA1 TYPE REF TO CL_HTMLB_INPUTFIELD.
  DATA ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = RUNTIME->SERVER->REQUEST
                                         NAME     = 'inputField'
                                         ID       = 'field1'
                                      ).
  IF DATA IS NOT INITIAL.
    WA-MATNR = DATA->VALUE.
  ENDIF.

  DATA1 ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = RUNTIME->SERVER->REQUEST
                                         NAME     = 'inputField'
                                         ID       = 'field2'
                                      ).
  IF DATA1 IS NOT INITIAL.
    WA-ERSDA = DATA1->VALUE.
  ENDIF.

  INSERT INTO ZTEMP_BSP CLIENT SPECIFIED VALUES WA. " ZTEMP_BSP  is my Z table
ENDIF.

Above code will give you an idea of how to update a table.

Thanks,

Sreekanth

<i>* Do not forget to reward each helpful answer.</i>

Former Member
0 Kudos

Hi

This code came up with exception..<b>type "MARA" is unknown</b>

Should i need to declare it somewhere?

<i>Points will be rewarded</i>

Thanks

Answers (2)

Answers (2)

sreemsft
Contributor
0 Kudos

Rohit,

Can you close the post if your issues is solved?

Thanks,

Sreekanth

athavanraja
Active Contributor
0 Kudos

<i>Now I dnt know anything about BSP</i>

since you are fresh to BSP i would suggest you to go thru the tutorial in the following link. if you have problem in understanding thesame do get back to us.

http://help.sap.com/saphelp_nw04/helpdata/en/c8/101c3a1cf1c54be10000000a114084/frameset.htm

also check out the tutorial BSP applications in your system

tutorial_1

tutorial_2

tutorial_3

Regards

Raja