Skip to Content
author's profile photo Former Member
Former Member

F4 help in input field in BSP

Hi,

i am doing search help about F4 using BSP. I have opend popup window(2nd page) after clicking help icon but i could not get F4 values in frist page.

can anybody tell me about it!!

After click ok button not show position value in frist page.

Add a comment
10|10000 characters needed characters exceeded

Related questions

12 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2009 at 06:52 AM

    Hi Rahul.

    Please find the complete code below its working fine.

    First Page:-

    <s cript>
    function transf(fval)
    {
    document.get Element ById("mod").val ue = fval;
    }
    function getmodule()
    {
    document.open('Help.htm','modulelist' ,"height = 550 width = 400 left = 200 right = 400 status = no");
    }
    </s cript>
    
          <htmlb:inputField id          = "mod"
                            showHelp    = "X"
                            value       = "<%= w_mod %>"
                            onValueHelp = "getmodule()" />
    

    F4 - HELP PAGE

    <s cript type="text/java script">
    function get Data()
    {
    opener.transf("<%= w_mod %>");
    window.close();
    return true;
    }
    </scr ipt>
    <htmlb:content design="design2003" >
      <htmlb:page title="F4 help page " >
        <htmlb:form>
          <htmlb:textView text   = "Hello World!"
                          design = "EMPHASIZED" />
          <br>
          <htmlb:tableView id             = "table"
                           selectionMode  = "SINGLESELECT"
                           keyColumn = "CARRID"
                           on RowSelection = "rowSelection"
                           table          = "<%= t_scarr %>" >
            <htmlb:tableViewColumn title               = "<b>CARRID</b>"
                                   horizontalAlignment = "right"
                                   columnName          = "CARRID" >
            </htmlb:tableViewColumn>
          </htmlb:tableView>
          <br>
          <htmlb:button text          = "Press Me"
                        id            = "ok"
                        on Clien tClick = "get Data()" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    

    ON REQUEST:-

    select Carrid from Scarr into CORRESPONDING FIELDS OF TABLE t_scarr.

    ONINPUTPROCESSING:-

    DATA: event TYPE REF TO cl_htmlb_event.
    event = cl_htmlb_manager=>get_event( runtime->server->request ).
    
    IF event IS NOT INITIAL.
    
    
    IF event->id = 'table'.
        DATA: tv TYPE REF TO cl_htmlb_tableview.
        tv ?= cl_htmlb_manager=>get_data(
        request = runtime->server->request
        name = 'tableView'
        id = 'table' ).
    
    
        IF tv IS NOT INITIAL.
          DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
          tv_data = tv->data.
          w_mod = tv_data->row_key. "( row_key )
        ENDIF.
    ENDIF.
    ENDIF.

    Let me know if you have any concern....hope i will help you..

    Thanks

    Kalyan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2009 at 03:55 AM

    Hi,

    It is possible with javscripts,here is a sample code:

    it is a javascript, Mention the script type is a java script ont he top of the mainpage and help page in layout and also close the script,

    First page Layout:

    function transf(fval)
    {
    document.getElementById("<<input-field-ID>>").value = fval;
    }
    function getmodule()
    {
    document.open('<<Help-Page>>','modulelist' ,"height = 550 width = 400 left = 200 right = 400 status = no");
    }
    
    
     <htmlb:inputField id          = "mod"
                                show Help    = "X"
                                value       = "<%= w_mod %>"
                                onValueHelp = "getmodule()" />

    First page On Input Processing Code:

    Data:
     w_inputfield TYPE REF TO cl_htmlb_inputfield,
      w_obj TYPE REF TO object,
    
    w_mod type string.
    
    CALL METHOD cl_htmlb_manager=>get_data
              EXPORTING
                request = runtime->server->request
                name    = 'inputfield'
                id      = 'mod'
              RECEIVING
                data    = w_obj.
            w_inputfield ?= w_obj.
            w_mod = w_inputfield->value.

    Help page layout code:

    function getData()
    {
    opener.transf("<%= w_mod %>"); (W_mod is avalue passing from help page to main page)
    window.close();
    return true;
    }

    For more please refer to this [F4help|http://wiki.sdn.sap.com/wiki/x/lwOmB ]

    Hope this solves the issue,Let me know if any queries.

    Regards,

    Rajani

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2009 at 05:03 AM

    Hello Rahul.

    Please find the F4 help wiki

    [F4 Help|http://wiki.sdn.sap.com/wiki/x/lwOmB ]

    Hope this is clear.if you still have any problem please paste the code r send a mail

    Thanks

    kalyan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2009 at 05:24 AM

    Thanks Rajani for the suggestions.

    I have done all the changes.. But its not working..

    W_POSCODE value not pass help page to main page.

    Can u say where i m wrong below the code.

    Main page

            function transf(fval)
            {
          document.getElementById("POSCODE").value = fval;
            }
            function getposition()
            {
            document.open("Position_details.htm","modulelist","width=680,height=370,left=170,top=300 status=no");
             }
            
    
              <htmlb:inputField id          = "POSCODE"
                                value       = "<%= W_POSCODE %>"
                                showHelp    = "X"
                                onValueHelp = "getposition()"
                                width       = "150" />

    Help page

                        function getdata()
                        {
                      opener.transf("<%= W_POSCODE %>");
                      window.close();
                      return true;
                        }
    
    
    *Oninputprocessing:-*
     DATA: EVENT TYPE REF TO CL_HTMLB_EVENT.
      EVENT = CL_HTMLB_MANAGER=>GET_EVENT( RUNTIME->SERVER->REQUEST ).
    
      IF EVENT IS NOT INITIAL.
    
        IF EVENT->ID = 'OK' AND EVENT->EVENT_TYPE = 'click'.
          DATA: TV TYPE REF TO CL_HTMLB_TABLEVIEW.
          TV ?= CL_HTMLB_MANAGER=>GET_DATA(
                                  REQUEST      = RUNTIME->SERVER->REQUEST
                                  NAME         = 'tableView'
                                  ID           = 'TABLE1' ).
    
          IF TV IS NOT INITIAL.
            DATA: TV_DATA TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
            TV_DATA = TV->DATA.
            W_POSCODE = TV_DATA->SELECTEDROWKEY.
          ENDIF.
        ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      change code in help page

      DATA: EVENT TYPE REF TO CL_HTMLB_EVENT.

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

      IF EVENT IS NOT INITIAL.

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

      DATA: TV TYPE REF TO CL_HTMLB_TABLEVIEW.

      TV ?= CL_HTMLB_MANAGER=>GET_DATA(

      REQUEST = RUNTIME->SERVER->REQUEST

      NAME = 'tableView'

      ID = 'TABLE1' ).

      IF TV IS NOT INITIAL.

      DATA: TV_DATA TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.

      TV_DATA = TV->DATA.

      W_POSCODE = TV_DATA->row_key. "( row_key )

      ENDIF.

      END

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2009 at 05:33 AM

    Hi kalyan,

    Yes is checked and also checked auto in page atribute.

    Thanks & Regards

    Rahul

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2009 at 05:40 AM

    Hi Rahul,

    Before writing the script, just mention < sc ript type = < text / java sc ript>(mention type in " " and close it as </ scr ipt>

    here is a sample code:

    sc ript type = < text / java sc ript>
    function transf(fval)
            {
          document.getElementById("POSCODE").value = fval;
            }
            function getposition()
            {
            document.open("Position_details.htm","modulelist","width=680,height=370,left=170,top=300 status=no");
             }
            
    
     </sc ript>

    Help page:

    sc ript type = < text / java sc ript>
      function getdata()
                        {
                      opener.transf("<%= W_POSCODE %>");
                      window.close();
                      return true;
                        }
     </sc ript>

    in two pages(Main oage and help page)

    Watch this thread which is of same issue [F4help|F4- using BSP;

    Hope this solves the issue,Let me know if any queries.

    Regards,

    Rajani

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2009 at 06:06 AM

    Hi rajani,

    I have allready defined function in script

    <s-cript language="JavaS-cript" type="text/javas-cript"> <--- remove the "-" in script.

    function transf(fval)

    {

    document.getElementById("POSCODE").value = fval;

    }

    function getposition()

    {

    document.open("Position_details.htm","modulelist","width=680,height=370,left=170,top=300 status=no");

    }

    </s-cript>

    Thanks & Regards

    Rahul

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Rahul,

      <s-cript type="text / javas cript "><--- remove the spaces with in " " and "-" in script
      function transf(fval)
      {
      document.getElementById("POSCODE").value = fval;
      }
      function getposition()
      {
      document.open("Position_details.htm","modulelist","width=680,height=370,left=170,top=300 status=no");
      }
      < /s cript>(remove the spaces )

      Check with the above code, Iam unable to paste the exact code due to some internal problem.

      Let me know if the issue was solved or you are facing any problem.I will send the code through mail

      Hope this helps you.

      Regards,

      Rajani

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2009 at 06:19 AM

    Hi Sreesudha,

    Thanks for reply.

    I have change the code W_POSCODE = TV_DATA->SELECTEDROWKEY to W_POSCODE = TV_DATA->row_key. when i cheking in debuging mode TV_DATA->row_key not facing selecting value when i m selected tableview row but TV_DATA->SELECTEDROWKEY are facing. Anywaz i am changing ur code wise but is the same porblem W_POSCODE value not passed help page to main page.

    I thing i m wrong in help page

    <s-cript language="JavaS-cript" type="text/javas-cript"> -


    remove - in s-cript

    function getdata()

    {

    opener.transf("<%= W_POSCODE %>");

    window.close();

    return true;

    }

    </s-cript>

    what do u mean by opener.transf?

    Thanks & Regards

    Rahul

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2009 at 07:23 AM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2009 at 09:14 AM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.