Skip to Content
avatar image
Former Member

Webdynpro code

Dear Expertise

I have created a login page in webdynpro.

here's the screenshots as-

Main

View

after clicking new user from main window, i should go to view window and fill the details , then that data should be save in Z-table.

Can anyone help me with this?

Regards

varun

mainpage.PNG (19.0 kB)
view.PNG (3.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • Best Answer
    Sep 16, 2014 at 07:45 AM

    Hello,

    If I understand it correctly, you need the steps how to do that:

    For the button 'New user' create a action. In this action you need to 'fire to a plug'(call the view). In this view you got the input fields that are connected to a node in the context.

    After the user fill up the data in the input fields, for the button 'Submit' create a new action in which you read the context node to get the data from the view , and this data you will update your database table.

    Have fun,

    Hancila

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello

      i have created a node which has 3 attributes.

      i have use code wizard and my code is as-

      method ONACTIONSAVE .
      DATA lo_nd_node1 TYPE REF TO if_wd_context_node.

      DATA lo_el_node1 TYPE REF TO if_wd_context_element.
      DATA ls_node1 TYPE wd_this->Element_node1.

      * navigate from <CONTEXT> to <NODE1> via lead selection
      lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).

      * @TODO handle non existant child
      * IF lo_nd_node1 IS INITIAL.
      * ENDIF.

      * get element via lead selection
      lo_el_node1 = lo_nd_node1->get_element( ).
      * alternative access via index
      * lo_el_node1 = lo_nd_node1->get_element( index = 1 ).
      * @TODO handle not set lead selection
      IF lo_el_node1 IS INITIAL.
      ENDIF.

      * get all declared attributes
      lo_el_node1->get_static_attributes(
      IMPORTING
      static_attributes = ls_node1 ).



      Data wa type z-table.

      wa-userid = lv_userid.

      wa-paswd = lv_passwd.

      wa-name - lv_name.

      update z-table from wa.

      commit work.





      ENDMETHOD.


      Can you check what should be next to update or save the values in Z-table


      Regards

      varun

  • Sep 16, 2014 at 07:39 AM

    Hi Varun,

    I think i already replied to you in previous thread which due to some reasons is not there anymore

    what did you do with previous thread?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Aarif Baig

      Hi

      I have that fields

      Problem is where to add this particular code in my Code which i have used from code wizard.

      Can you check my code which i have pasted in above reply.

      Regards

      varun

  • Sep 16, 2014 at 08:20 AM

    Hi Varun,

    I don't see is it a good idea to have to store user credentials in a z-table, which can be accessed by anyone, and can login 😊, if you need to store passwords, are you considering the encryption?

    What are you trying to achieve from this?

    ...................

    Regarding your approach of development

    ...................

    Why are you creating separate context nodes for each fields viz, user id, password?

    • Instead, create one node - REG_USER with attributes NAME, USER_ID, PASSWORD, C_PASSWORD etc.
    • Read the static attributes of node at once and use it for further processing

    data lo_node type ref to if_wd_context_node.

    data ls_user_reg type wd_this->element_REG_USER

    lo_node->GET_STATIC_ATTRIBUTES( receiving static_attributes = ls_user_reg )

    • Now create a temp work area of type z-table

    data ls_zdata type z_user_data.

    move-corresponding ls_user_reg to ls_zdata.

    modify Z_USER_DATA from ls_zdata.

    Regards,

    Rama

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Aarif Baig

      Hi

      Now further i have to see that whenever I fill login and password it should open another page or window displaying simple

      Login name or watever we have filled.

      and if login and password doesn/t match , it should not able to login.

      Help.

      Regards

      varun

  • avatar image
    Former Member
    Sep 16, 2014 at 07:02 AM

    Hi Varun,

    Are these two windows or views ?

    If they are views, what you can do is create the nodes accordingly in component controller and read them in both the view.

    For navigating between views you can make use of inbound and outbound plugs.


    Regards,

    Aakash

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi

      Both are views .

      I have created the nodes and attributes as you can see from the above posted screenshots.

      Problem is with how to read the values and set them or save them in particular Z-table.

      Regards

      varun

  • avatar image
    Former Member
    Sep 16, 2014 at 07:15 AM

    hi,

    create on action even for submit button.u can check subit button properties and give the action name(event name).inside submit action method write the code(use the code wizard to read the values from the input field) and update the ztable.

    Best regards,

    Noufal P

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      it based on your requirement..you can read node as structure..or each attribute of a node and assing it to work area field one by one and finally update your ztable

      best regards,

      Noufal p

  • avatar image
    Former Member
    Oct 04, 2014 at 09:19 AM

    Hi

    What is a neccessary set when user is valid?

    Thank you

    Add comment
    10|10000 characters needed characters exceeded