cancel
Showing results for 
Search instead for 
Did you mean: 

how to populate the field after execution of the application

Former Member
0 Kudos

Hello gurus,

I am creating one application and need your help. on my webdynpro screen I have few fields, out of these user will enter some and one field I want to populate when user hit enters. My application is to create a sales order, user will enter the details and hit create button that will create the sales order. Now what I want is when the sales order is created on the same screen the sales order number should also be displayed in the field : VBELN. Can you please tell me how can I get this.

Thank

Rajeev

Accepted Solutions (1)

Accepted Solutions (1)

i827647
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rajeev, if I understand you want show in a field that was created the VBELN after execute BAPI, well I assume that this field is binding with context document->Att_VBELN. You can use the code below.

 
    DATA lo_nd_document TYPE REF TO if_wd_context_node.

    DATA lo_el_document TYPE REF TO if_wd_context_element.
    DATA ls_document TYPE wd_this->element_document.
    DATA lv_att_vbeln TYPE wd_this->element_document-att_vbeln.

    lo_nd_document = wd_context->get_child_node( name = wd_this->wdctx_document ).
    lo_el_document = lo_nd_document->get_element( ).

    IF lo_el_document IS INITIAL.
    ENDIF.

   lv_att_vbeln = <<RETURNED VBELN FROM BAPI>>.

    lo_el_document->set_attribute(
      name =  `ATT_VBELN`
      value = lv_att_vbeln ).

Regards,

Edson Thomaz

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Rajiv,

Context and attributes are data storage part of the webdynpro and the ui elements are bound to it.

So if you want a ui element(input field) to have data in it, you need to save the value to the attribute which is bind to that input field.

And Since you want this on click of buttton or enter, you need to use the method bound to that action.

Some suggestions : I hope you have disabled that particular input field as it is read only. You may want to use a message to highlight the creation of the sales order, it could be difficult for the end user to realize any change in the screen or you could set the focus to the input field.

Regards

Anurag Chopra

Former Member
0 Kudos

Any suggestion.