Quantcast
Channel: SCN : All Content - Web Dynpro ABAP
Viewing all 3667 articles
Browse latest View live

Convert the field in read-only format on selection of radio button in webdynpro

$
0
0

Hi Guys,

 

Am new to webdynpro...Wated your help...

I have a webdynpro form where there are 3 radio buttons. User will fill in information in 1 radio button.The data will flow from table to 2 and 3 radiobutton fields. However user should not be able to edit the fields on selection of 2 and 3 radio button he can only read the data.

 

Awaiting early response.

 

Regards,

Nishigandha


New Select Options Multivalue Selection - WD_SELECT_OPTIONS_20

$
0
0

How to use multi value selection in new Webdynpro ABAP Select options (WD_SELECT_OPTIONS_20):


New select options in WD ABAP has lot more features including this multi value selection, copy paste from file, new UI look and many more. This document describes how use that multiple value selection using new interface IF_WD_SELECT_OPTIONS_20.

 

Go to SE80 and create a Webdynpro component “YSELOP_MULTIVALUE”.

 

1.png

Add the new WD_SELECT_OPTIONS_20 as used component in component controller.

 

2.png

 

Go to main view and add a ViewContainerUIElement

 

3.png

 

In main window, add the select Option view “W_SELECT_OPTIONS” to the view container.

 

4.png

 

5.png

Create the used component in the Main view

6.png

 

7.png

Go to main view Attribute tab and add following attribute mentioned in below figure.

8.png

 

Create a method “SET_SELECTION” in the main view9.png

Add below lines of  code in the method “SET_SELECTION

 

method SET_SELECTION .
* Types Declaration
TYPES: BEGIN OF ty_key,
prog_name
TYPE zwdvari-prog_name,
vari_name
TYPE zwdvari-vari_name,
uname
TYPE zwdvari-uname,
END OF ty_key,

BEGIN OF ty_matnr,
MATNR
type matnr,
END OF ty_matnr.

* Table Type Declaration
TYPES tt_matnr TYPE STANDARD TABLE OF ty_matnr.

* Data Declaration
DATA:   lo_cmp_usage TYPE REF TO if_wd_component_usage,
lo_interfacecontroller
TYPE REF TO iwci_wd_select_options_20 ,
lt_tab1
TYPE wdr_so_t_values,
ls_multi
type WDR_SO_S_MULTIVALUE,
ls_global
type WDR_SO_S_GLOBAL_OPTIONS,
lt_matnr
type tt_matnr,
ls_matnr
type ty_matnr,
lo_struc
type ref to cl_abap_structdescr,
lt_mara
type STANDARD TABLE OF mara,
lt_attributes
TYPE TABLE OF wdr_so_s_attributes,
ls_attributes
TYPE wdr_so_s_attributes.

lo_struc ?= cl_abap_structdescr
=>describe_by_data( ls_matnr ).

lo_cmp_usage
wd_this->wd_cpuse_selop( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage
->create_component( ).
ENDIF.

lo_interfacecontroller
=   wd_this->wd_cpifc_selop( ).
ls_global
-NO_MULTI_PASTE = ''.

wd_this
->lv_handler = lo_interfacecontroller->init_select_options(
global_options
ls_global                  " wdr_so_s_global_options
).

*-- Add Attributes to Selection Screen --*
ls_attributes
-attribute  = 'VBELN'.
ls_attributes
-attr_type  = if_wd_select_options_20=>e_attribute_types-id.
ls_attributes
-text       = 'Sales Document'.
ls_attributes
-dataelement = 'VBELN_VA'.

APPEND ls_attributes TO lt_attributes.

clear ls_attributes.

ls_multi
-STRUCTURE = lo_struc.
ls_multi
-MAX_ROWS = 6.
ls_multi
-DIRECT_EDITABLE = ''.

ls_attributes
-attribute  = 'MATNR'.
ls_attributes
-attr_type  = if_wd_select_options_20=>e_attribute_types-multi_value.
ls_attributes
-text       = 'Material'.
ls_attributes
-RTTI_TYPE = cl_abap_elemdescr=>GET_C( 18 ).
ls_attributes
-MULTI_VALUE = ls_multi.

APPEND ls_attributes TO lt_attributes.

wd_this
->lv_handler->add_attributes( EXPORTING attributes = lt_attributes ).

endmethod.

 

Call the SET_SELECTION method from WDDOINIT.

10.png

Next step, create new view and a new Window for multiple value selection popup.

11.png

 

12.png

Embed the view to the Window.

14.png

Create a node ND_MULTI in component controller and an attribute MATNR of type STRING_TABLE as shown below.  This node will hold multiple values on the popup entered by the user.

15.png

Map the new node to both Views.

 

25.png

On the popup view, create a textEdit UI element and bind that to the matnr attribute of the node.

16.png

 

17.png

Now, go to main View and create an event handler on_multi for event ON_EDIT_MULTI_VALUE of used component WD_SELECT_OPTIONS_20.

18.png

 

19.png

 

Copy below lines of code in the method ON_MULTI

 

method ON_MULTI .

DATA lo_window_manager TYPE REF TO if_wd_window_manager.
DATA lo_api_component  TYPE REF TO if_wd_component.
DATA lo_window         TYPE REF TO if_wd_window.
DATA lt_buttons        TYPE wdr_popup_button_list.
DATA ls_canc_action    TYPE wdr_popup_button_action.
DATA: l_api   TYPE REF TO if_wd_view_controller.
DATA: ls_button TYPE wdr_popup_button_definition.
DATA: ls_action TYPE wdr_popup_button_action.

wd_this
->m_attribute = attribute.
wd_this
->m_index     = row_index.
wd_this
->m_value     = value.

l_api
= wd_this->wd_get_api( ).

lo_api_component          
= wd_comp_controller->wd_get_api( ).
lo_window_manager         
= lo_api_component->get_window_manager( ).

lt_buttons                
= lo_window_manager->get_buttons_ok(
default_button         
= if_wd_window=>co_button_ok
).

ls_action
-action_name = 'CLOSE'.
ls_button
-button = 6.
ls_button
-action = ls_action.
ls_button
-is_enabled = 'X'.

APPEND ls_button TO lt_buttons.
lo_window                 
= lo_window_manager->create_and_open_popup(
window_name         
= 'W_MULTIVALUE'
title                = 'Set Multiple Values'
message_type        
= if_wd_window=>co_msg_type_none
message_display_mode
= if_wd_window=>co_msg_display_mode_selected
buttons             
= lt_buttons
cancel_action       
= ls_canc_action
).

wd_this
->l_window = lo_window.
lo_window
->subscribe_to_button_event(
button           
= 4
button_text      
= 'Ok’
tooltip          
= 'Click yes to Exit'
action_name      
= 'OK'
action_view      
= l_api
).

lo_window
->subscribe_to_button_event(
button           
= 6
button_text      
= 'Close'
tooltip          
= 'Click to Cancel'
action_name      
= 'CLOSE'
action_view      
= l_api
).

endmethod.

 

  In next step, create to action “OK” and “Close” in the Action tab of main View.

 

21.png

Write below lines of code in ONACTIONCLOSE and ONACTIONOK methods.

 

method ONACTIONCLOSE .
wd_this
->L_WINDOW->close( ).
endmethod.

 

method ONACTIONOK .

DATA: lo_nd_nd_multi TYPE REF TO if_wd_context_node,
lo_el_nd_multi
TYPE REF TO if_wd_context_element,
ls_nd_multi
TYPE wd_this->Element_nd_multi,
lt_matnr
TYPE wd_this->Element_nd_multi-matnr,
ls_matnr
type string,
l_attrbute
TYPE wdr_so_attribute.

lo_nd_nd_multi
= wd_context->get_child_node( name = wd_this->wdctx_nd_multi ).
* get element via lead selection
lo_el_nd_multi
= lo_nd_nd_multi->get_element( ).

* get single attribute - String table
lo_el_nd_multi
->get_attribute(
EXPORTING
name
`MATNR`
IMPORTING
value = lt_matnr ).    " String Table

l_attrbute
= wd_this->m_attribute." Get the attribute name

CALL METHOD wd_this->lv_handler->set_input_per_row
EXPORTING
attribute               
= l_attrbute
row_index               
= wd_this->m_index
multi_value             
= wd_this->m_value
multi_value_string_table
= lt_matnr.

wd_this
->L_WINDOW->close( ).

endmethod.

 

Now our component is ready. Create a WD Application and test it.

 

Test:

22.png

 

23.png

 

24.png

Webdynpro performance issue for check box selection in ALV list

$
0
0

Hi Guys,

 

In the ALV list I have the check box option. By default in some of the ALV rows the checkbox option is disabled and for some of the rows it is enabled for user selection.

 

But the current problem is when the user marks or unmarks the checkbox option it is taking atleast 2 to 3 secs for the checkbox to be selected or deselected.

 

Please share me any valuable suggestions as to how to improve the performance for the above scenario.

 

Any thoughts wuld be of great help.

Enhancing Standard Webdynpro POWL component

$
0
0

Dear Expert's,

 

I have a requirement to enhance Standard Webdynpro component EAMS_WDC_JOB, which makes use of POWL component. My requirement is to change few description's and remove couple of standard button's as highlighted below. I went through some link's, but not getting an appropriate solution. Can someone help me to solve the issue ?

 

 

Thanks and Regards,

Gaurav.

my concern is I am able to download the data in CSV file format in webdynpro but first column is getting blank

$
0
0

Hi Friends ,

 

In my current project we are suppose to download the data from internal table to CSV file format excel(xls and xlsx are not allowed).

 

my concern is I am able to download the data but first column is getting blank .

 

for your information i am adding the sample code .

 

 

  data : str type string,

            xstr type xstring.

  do 3 TIMES.
  CONCATENATE str  'singh2' 'singh2' cl_abap_char_utilities=>newline    INTO str  SEPARATED BY  ','.
  ENDDO.

 

      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
      text  = str
     
    IMPORTING
      buffer = xstr.

  CALL METHOD cl_wd_runtime_services=>attach_file_to_response
    EXPORTING
      i_filename      = 'Dashboard.csv'
      i_content      = xstr
      i_mime_type    = 'TEXT/CSV'
      i_in_new_window = abap_false
      i_inplace      = abap_false.

 

my concern is i am able to download in CSV file but first column is gertting blank.

 

 

output
--------------------------

col1  col2     col3      col4

       singh2   singh2

       singh2   singh2

       singh2   singh2

 

expexcted output

--------------------------

 

col1       col2     col3      col4

singh2   singh2

singh2   singh2

singh2   singh2

 

output should start from column 1 but it is starting from column 2 leaving column1 blank.

 

 

kindly let me know if nay solution is there

 

Thanks,

Harish Singh.

POP up in webdynpro

$
0
0


Hello Expert,

 

i have a requirement where i want to call pop up once user click on SAVE button created by us and depending on action we proceed further.The problem is we are calling a method in custom class(Not assistance class) once user click on SAVE button.

 

So in that class method if we call POP_UP_TO_CONFIRM,it is giving dump.

 

please suggest.

Thanks

Mahesh

how to reduce text field length in webdynpro

$
0
0

Hi team,

 

how to reduce text field length to 150 char in webdynpro.

screen1.jpg

Enable ALV Cell Action on POWL

$
0
0

Hi Experts,

 

I've created a custom Web Dynpro that contains a custom POWL.

 

I need to handle the action on the POWL when the user click on a drop-down field in the POWL.

 

I manage to find that you have to create a configuration for the custom Web Dynpro (that contains the POWL) under the POWL_UI_COMP component and then you set the enableAlvCellAction parameter under the confData section in the configuration. This works like a dream and the  POWL_ALV_CELL_ACTION action now gets triggered in the handle_action method of the POWL Feeder class.

 

I know placed my new configuration in an iView and Portal role, so it can be assigned to the a portal user.

 

When I now access the custom POWL with the portal user, the POWL_ALV_CELL_ACTION action in the feeder class is no longer triggered.

 

Does anyone know why this is happening or what I'm doing wrong?

 

Your assistance would be greatly appreciated.

 

Regards,

Andrew


Checking required fields: delete duplicate messages

$
0
0

Hello, colleagues!

 

I've got a WDA view containing several obligatory fields. I need to highlight the fields which are empty and display an error message during the input check.

 

I use this method:

 

  cl_wd_dynamic_tool=>check_mandatory_attr_on_view(

     EXPORTING view_controller  = wd_this->wd_get_api( )

                          display_messages = abap_true

     IMPORTING messages = lt_msg ).

 

The emplty fields are highlighted, but I've got several identical error messages. The number of messages is equal to the number of highlighted fields.

I can't set the parameter display_messages to false because in this case the fields won't be highlighted.

 

Is there any way to highlight N fields and display only 1 message?


Thanks in advance!

Problem with WD_SELECT_OPTIONS_20 and MultiValue Paste and Internet Explorer 11

$
0
0

Hi All

 

We have created a WebDynpro Component, using the Interface Controller Component WD_SELECT_OPTIONS_20 to have select-options functionality available in WebDynpro.


One of the most used features in our company is the Multivalue-Paste, where you can select your values (e.g. in excel) copy them into the windows clipboard and paste them into WebDynpro select-option field (just click into the SO-field and do Ctrl+C)

WD_SELECT_OPTIONS_20 automatically creates 1 single selection-line for each entry in the clipboard.

With this functionality our product managers copy their articles and paste it into our WebDynpro application to do further processing with them.

 

This is standard functionality that comes with WD_SELECT_OPTIONS_20 and is there right away (as soon as you do not disable it in the global options of the SO).

 

All this worked perfectly well with Internet Explorer 9 and 10.

Recently our IT has "forced" a browser upgrade to IE11, where this feature does not work anymore.

When you now paste more than 1 entry into the selection-field, the WDA hangs and freezes.

You can still create more than 1 lines per SO-field by clicking on the + sign at the end of the field and add 1 entry after the other (meaning you can manually do what the multi-paste did automatically), but that is not feasable for 100s of articles.

 

I have tried to set almost everything in IE11 (enable everthing in the IE options), I have set compatibility mode in IE11, nothing helped.

I have tried different browsers (Firefox, Opera, Chrome), and - Surprise - it worked with Chrome, and only with Chrome.

 

But unfortunately Chrome is not allowed here in our company, so this is not the solution.

 

Did anyone encounter a simliar problem, or knows any hint or workaround to this problem ?

Any comments are highly appreciated.

 

Thanks

Harald

Issue while dowloading the contends to CSV file in webdynpro

$
0
0


Hi Frnds ,

 

In my scenario iam uploading CSV file trough file upload Ui elemenrt in sap webdynpro

 

FYI,

 

cotents in the file are

 

PlantSales OrganizationDistribution Channelcolor
2000100010red,yellow,green
1000100010

 

 

and i am using the below code to read the contends in the file

 

*data source is attribute  the trough which i have binded my data to file uplod ui element

 

  wd_context->get_attribute(    EXPORTING      name `DATASOURCE`    IMPORTING      value = l_xstring ).


  CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
    EXPORTING
      in_xstring = l_xstring
    IMPORTING
      out_string = l_string.

 

in debugging i found the data in the below format in i_string.

 

Plant,Sales Organization,Distribution Channel,color##2000,1000,10,"red,yellow,green"##1000,1000,10,##

 

 

my concern is if in case in debugging if i chnage the conted to

 

werks,Sales Organization,Distribution Channel,color##2000,1000,10,"red,yellow,green"##1000,1000,10,##

 

i have just chnaged plant to werks in debugging

 

     CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
      text   = l_string

    IMPORTING
      buffer = xstr.

 

   CALL METHOD cl_wd_runtime_services=>attach_file_to_response
    EXPORTING
      i_filename      = 'Dashboard.csv'
      i_content       = xstr
      i_mime_type     = 'TEXT/CSV'
      i_in_new_window = abap_false
      i_inplace       = abap_false.

 

when i am dowloding it is showing output as

 

werksSales OrganizationDistribution Channelcolor##2000100010red,yellow,green##1000100010##

 

 

if i am not chnaging any thingh in debugging on the field l_string

 

then it is giving out as \

 

PlantSales OrganizationDistribution Channelcolor
2000100010red,yellow,green
1000100010

 

 

kindly let me know what was the reason

 

 

Is that we should not edit any thingh

 

 

Thanks,

Harish.

 

 

 

 

 

 

Raise Error Message in webdynpro

$
0
0

Hi Experts,

 

when i raise an Error Message , using    lo_message_manager->report_attribute_error_message ...its not allowing me to do any action further...

 

I have attached the screen shot for reference ...

 

I have written the code in "WDDOBEFOREACTION" method...

 

senario :

 

If the value is greater 8 hours, i need to through Error message individually...dates which is populating in header is dynamic one ...

 

Can u suggest an idea on it ..

 

code used :

 

   *        CALL METHOD lo_message_manager->report_attribute_error_message
*          EXPORTING
*            message_text              = l_string
*            element                   = lo_el_timesheet
*            attribute_name            = 'DATE1'
*            cancel_navigation         = abap_true
*            ENABLE_MESSAGE_NAVIGATION = abap_true .
*P_1.JPG

 

Regards,

KArthik S

enable wda ALV print pdf: node "SAP List Viewer (ALV)" not available in spro

$
0
0

hi all,

we are trying to use the standard print version pdf of WDA alv.

checked the blog: Webdynpro ABAP ALV  Print Version(PDF)

 

currently in my server it is giving the error as:

Print version System Failure: timeout during allocate / CPIC-CALL: 'ThSAPCMRCV', communication rc: CM_PRODUCT_SPECIFIC_ERROR (cmRc=20), taskhandler rc: C_TIM

s1.jpg

checked the notes:

 

1413938 - WD ABAP ALV - creating print version

1630587 - WD ABAP ALV: IMG paths for Customizing Settings

 

we are in 7.4, but the node SAP List Viewer (ALV) mentioned in 1630587 is not avaible in our system.


SAP_BASIS 7.40

  + SAP Customizing Implementation Guide

    + SAP NetWeaver

      + UI Technologies

        + SAP List Viewer (ALV)


in our system, the node is appearing as:

s2.jpg

 

our sap version is:

s3.jpg

also checked the blog Please Run it Simpler before it Drives us Mad... we could not find.

 

what are the steps we need to follow, to enable print version pdf for standard alv in WDA.

 

 

 

thanks,

Madhu_1980.

HIDE SECONDS OF INPUT FIELDS TIMES

$
0
0

Hi to all, could you help me?

 

I have an input field which refers to domain TIMES, but my customer asked me to hide seconds, since i must change the domain in a lot of contexts and structures and tables there is a better way to hide the seconds in web dynpro not changing the input field domain?

Dump after selecting Travel and Expense tab in ESS

$
0
0

Hello Experts;

I have a user getting a dump after selecting the Travel and Expense tab in ESS.

User has same issue when logged in to ESS on different computers

Not aware of any other users with same issue

 

Category: ABAP Programming Error

Runtime Errors: OBJECTS_OBJREF_NOT_ASSIGNED

Except: CX_SY_REF_IS_INITIAL

ABAP Program: CL_POWL_UI_HELPER=============CP

Application Component: BC-MUS-POW

Short Text: Access using a 'ZERO' object reference is not possible.

 

Information on where terminated: The termination occurred in ABAP program "CL_POWL_UI_HELPER=============CP",in "RENDER_DELTA_TABSTRIP". The main program was "SAPMHTTP"

 

In the source code, the termination point is in line 235 of (Include) program "CL_POWL_UI_HELPER=============CM00D". The termination is due to exception "CX_SY_REF_IS_INITIAL" occurring in procedure "RENDER_DELTA_TABSTRIP" "(METHOD)". This exception was not handled locally or declared in the RAISING clause in the procedure's signature however. The procedure is in program "CL_POWL_UI_HELPER=============CP". The source code begins in line 1 of (include) program "CL_POWL_UI_HELPER=============CM00D".

 

Line 234 code: CONCATENATE l_caption l_tooltip l_type_text INTO l_tooltip SEPARATED BY space.

>>>Line 235 code: lr_caption = lr_tab->get_header( ).

Line 236 code: lr_caption->set_text( l_caption ).

Line 237 code: IF mr_model->check_new_ui_enabled( ) IS INITIAL.

Line 238 code: lr_caption->set_tooltip( l_tooltip ).

Line 239 code: ENDIF.


Office Control with Word Documents: Add pages / Merge two documents

$
0
0

Hello,

 

we are trying to work with an Web Dynpro ABAP application that handles Word documents.

 

We have two Word documents and we want to add the second one as a new page to the first Word document. Is this possible somehow?

 

Thanks for any hints in advance,

André

Programmatically sort the personal value list

$
0
0

Hi,

 

I have a view where I have one input field for customer(KUNNR) and I have assigned one custom search help in the corresponding context attribute. Now when I run my WD application and press F4 to KUNNR, I can see the search help ( 3 columns, customer number, name, address respectively) with customer number is sorted by ascending order by default. Besides, when I create my personal value list out of that list, I found my personal value list is also sorted by customer number by ascending order by default. Now the user is complaining that he doesn't want the default sorting behaviour. Rather he wants the customer name should be by default sorted when he sees the personal value list.

 

So I need your advise how to control that. Also I am curious to know why SAP is by default sorting the customer number(is it because it is first field in the list? ). I didn't sort my result list when I prepared the list in search help exit. My sap abap is NW 7.31 support pack 7.

 

Thanks,

Mainak

Get the selected record from Business Graphic

$
0
0

Below Steps will help to get the selected record from Business Graph

 

1. Create an WebDynpro Component, View, Window and application

1.JPG

2. Create context node and attribute as below in View. String type for all the attribute

9.JPG

3. Create Business graph, bind the series and create on Action as below

3.JPG

4. Create Category and bind the property as below

4.JPG

5. Create Series and bind property as below

5.JPG

6. Create Text view to display selected Employee Number

6.jpg

7. Populate the code as below in WDDOINIT

7.jpg

8. Create EVENT_ID parameter in EMP Event handler

8.jpg

9. Populate the below code in EMP Event handler

9.JPG

 

Output

Before selecting on Chart

o1.JPG

After Selecting on Chart, selected part will be marked and the employee number will display below

O2.png

 

Regards,

Manikandan S

Identifying Selected employee in team calendar

$
0
0

Hi all,

 

In the team calendar, I have added a new event to handle a click on the Business Graphics.

Snap 2015-02-17 at 11.45.27.jpg

 

However, when I click on an employee and go into the debug mode, the selected employee is not the one that I clicked on.

Snap 2015-02-17 at 11.46.41.jpg

 

Appreciate if any expert is able to advice how I can pick the correct person?

 

Thanks and Regards

Wai

How to display Key and description in table field

$
0
0

Hello Experts,

 

I have a requirement where I have to show Price group field (VBKD-KONDA) in one of the table field in output with key and description in webdynpro.

 

I analyzed that description is coming in T118 customizing table and search help assigned in table as H_T188.

 

Currently only key value is coming and not its description.

 

Please advise how to fill this requirement.

 

Regards,

Shiv

Viewing all 3667 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>