Webdynpro ALV
Hi
I have created an application through which we need to update the DB table.
How to capture the current ALV data into an Internal Table.
Regards,
Surya
most of the time people don't post the solution
Read the context node binded to the ALV .
data: lr_node type ref to if_wd_context_node.
data: lt_table type <node type>
lr_node = wd_context->get_child_node( '<node name>' ).
lr_node->GET_STATIC_ATTRIBUTES_TABLE( table = lt_table ).
Abhi
Similar Messages
-
How to code to get intermediate results in webdynpro ALV? Please help!
Hi Experts,
I got following info from help file to generate Intermediate Results(subtotal).
Can somebody help me with sample code to achieve this?
Basically I want to subtotal 'Qty' column based on 'Product' field.
By default, all values in a field are used in the calculation during aggregation. However, you
are also able to generate intermediate results. You group the data records that contain the
values for an intermediate result and display each intermediate result in its own result row.
To generate intermediate results, you have to provide certain information:
● To specify in which field the values from which the intermediate results are calculated
are located, generate an aggregation condition for the desired field. The overall result is
displayed in the result row.
● To specify which data records are contained in an intermediate result, group the data
records: You sort the ALV output by the field that includes the criterion for the
intermediate result.
● To then generate the intermediate results, calculate the intermediate results using the
field with the criterion.
● To then display the intermediate results, switch on the display of intermediate results.
You are able to make the following settings for intermediate results:
● Generate intermediate results
● Display intermediate results
● Setting levels for drilling down intermediate results
● Set the position of the result rows (see Settings for Aggregation [page 196])
● Forbid the generation of intermediate results
Prerequisites
● You have generated an aggregation object for at least one aggregatable field.
● The field with the criterion for intermediate results is not an aggregatable field, and
therefore has an alphanumeric data type.
Generate Intermediate Results
To generate intermediate results in a field that already has an aggregation condition, generate
a sort condition for the field of a column (another column) (see Sorting [page 190]).
In this sort condition, define whether intermediate results are to be generated. To do this, use
the methods of the class CL_SALV_WD_SORT_RULE.
Methods for Generating Intermediate Results
Function Method
Generate intermediate results SET_GROUP_AGGREGATION
Check whether intermediate results are displayed GET_GROUP_AGGREGATION
Display Intermediate Results
Once you have made all settings, to generate intermediate results you have to switch on the
display of these intermediate results. You use the methods of the interface class
IF_SALV_WD_FIELD_SETTINGS for this (implementing class
CL_SALV_WD_CONFIG_TABLE).
Methods for Displaying Intermediate Results
Function Method
Display intermediate results SET_GROUP_AGGR_DISPLAYED
Check whether intermediate results are displayed GET_GROUP_AGGR_DISPLAYED
I have tried a bit but it is not working. here is my code:
get field and create aggregation rule of type total
lr_field = l_value->if_salv_wd_field_settings~get_field( 'Qty' ).
lr_field->if_salv_wd_aggr~create_aggr_rule( ).
lr_aggr_rule = lr_field->if_salv_wd_aggr~get_aggr_rule( ).
lr_aggr_rule->set_aggregation_type( if_salv_wd_c_aggregation=>aggrtype_total ).
l_field = l_value->if_salv_wd_field_settings~get_field( 'PRODUCT' ).
l_sortrule = l_field->IF_SALV_WD_SORT~create_sort_rule( ).
l_sortrule~SET_GROUP_AGGREGATION( 'Y').
l_value->if_salv_wd_field_settings~SET_GROUP_AGGR_DISPLAYED( 'Y' ).
Please help
Message was edited by:
gopalkrishna baligaHi Gopalakrishna balgia,
I think i have answered in the below thread. Check it out.
How to show Subtotal in webdynpro ALV(ABAP)? Kindly help!
Regards
Rakesh -
Help,Webdynpro ALV report
Hello,
My Webdynpro ALV report display SFLIGHT all fields .
But I want to show only five fields,
how code?
CODE::
data:node_flights type ref to if_wd_context_node,
it_flights type sflight_tab1,
is_flights type sflight,
it_final type IF_MAIN=>elements_flights,
is_final type IF_MAIN=>element_flights.
select * from sflight into table it_flights up to 10 rows.
node_flights = wd_context->get_child_node( 'FLIGHTS' ).
data:l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data:l_ref_interfacecontroller type ref to iwci_salv_wd_table.
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
node_flights = wd_context->get_child_node( name = `NODE_FLIGHT` ).
fill context node
node_flights ->bind_table( it_flight ).
endmethod.
thanksHI,
There is no need to change your code.
Do one thing.
Create a node SFLIGHT and do not add dictionary structure SFLIGHT.
Then create what are the required five attributes under it.
Make sure all these five refer to the dictionary data elements.
example: If you want carrid declare dectionary structure S_CARR_ID.
Like wise.
Now finally goto component usage->ALV->INTERFACECONTROLLER in the
left side tree of web dynpro component.
Then create component usage and drag SFLIGHT node to DATA of the context.
It is one of the way.
Second way is.
Create SFLIGHT node and mention SFLIGHT as stricture and select five required attributes that you need.
Now after creation of SFLIGHT NODE just delete the structure name present in the PROPERTIES of
SFLIGHT NODE.
Now finally goto component usage->ALV->INTERFACECONTROLLER in the
left side tree of web dynpro component.
Then create component usage and drag SFLIGHT node to DATA of the context.
I hope it helped you.
Regards and Best wishes. -
Export and Import functionality in WebDynpro ALV
Hi Experts,
I have done a webdynpro alv application and it is displaying the data as i wanted. However i have a requirement to get the alv displayed data in an excel sheet( which works with the export button on alv) and update that excel sheet which will be updated back in the alv table.(for eg any import button functinality on alv)
Regards,
TashiHi,
For this you need to use file upload to upload the modified excel data back to ALV. Else why dont you make an ALV Editable.!
For upload excel refer this wiki: [Upload excel in WDA|http://wiki.sdn.sap.com/wiki/display/WDABAP/ExcelFileUploadAndDisplayDataUsingWebDynPro+ABAP]
hope this helps u.,
Thanks & regards,
Kiran. -
Dynamic report output in a webdynpro alv
Hi,
I have created a dynamic report in the R/3 system . In this report, i am creating a report program within the report and subsequently executing this dynamically created report and displaying in the ALV..
Is it possible to handle such a scenario in a webdynpro ALV. One option is to use ITS and display the report in the portal but is there some other way so that i can directly view this report in an alv grid in a view.
all help appreciated!!
regards,
PriyankHi Priyank,
This could be one of the solution:
1] Run the report in background mode (using submit statement, dn't forget to give printer as LOCL), get the spool id programatically. Use the FM's CONVERT_OTFSPOOLJOB_2_PDF or CONVERT_ABAPSPOOLJOB_2_PDF.
Which returns the ouput of table tline, convert this to xtring and bind it to xtring attribute.
In view add a interactive form and bind the xstring attribute to the Interactive form.
By following the above steps, we can display the result in the PDF in WD ABAP.
2] The report result is ALV and in most of the cases we generally do not have function modules or any other easy way to get the output.
In such cases the best approach which we follow is, to run this in background mode and generate the spool and display the ouput in PDF.
3] But if intertactive form is not present in your requirement then we need to debug the logic of the report (if no FM or class present) and get the results and display it in the View.
You can create a service which takes the parameters of the report, submits it and
transfers the result to HTML. In a view you use an IFRame which takes the URL of the service and shows the result HTML.
just additionally read this thread,
Display simple ABAPLIST
Here an IFrame is used to display HTML output of report. But as IFRame gets obsolete the Suresh's solution seems to be pretty cool.
Hope this will help you!
Cheers,
Darshna. -
How to build a fieldcatalog in webdynpro alv
Hi friends,
how to build a fieldcatalog in webdynpro alv ? can any give me with example
Thnx
Kumar Srinifieldcatalog in the sense, we can modify the alv table column names by using below code.
DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
LO_CMP_USAGE = WD_THIS->WD_CPUSE_ALV2( ).
IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
LO_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
LO_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV2( ).
DATA LO_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
LO_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
LO_VALUE->IF_SALV_WD_TABLE_SETTINGS~SET_VISIBLE_ROW_COUNT( 5 ).
for title
DATA: LR_TABLE_SETTINGS TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.
DATA: LR_HEADER TYPE REF TO CL_SALV_WD_HEADER.
LR_TABLE_SETTINGS ?= LO_VALUE.
LR_HEADER = LR_TABLE_SETTINGS->GET_HEADER( ).
LR_HEADER->SET_TEXT( 'Waiting for Travel Advance Approval ' ).
**lr_table_Settings->set_Read_only( abap_false ).
DATA L_HEADER TYPE REF TO CL_SALV_WD_COLUMN_HEADER.
DATA: LO_COLUMN1 TYPE REF TO CL_SALV_WD_COLUMN.
LO_COLUMN1 = LO_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'TRAVELID' ).
L_HEADER = LO_COLUMN1->GET_HEADER( ).
L_HEADER->SET_TEXT( 'Travel Adv ID' ).
DATA: LO_COLUMN2 TYPE REF TO CL_SALV_WD_COLUMN.
LO_COLUMN2 = LO_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PERNR' ).
L_HEADER = LO_COLUMN2->GET_HEADER( ).
L_HEADER->SET_TEXT( 'Employee Name' ).
In get_column you have to pass the attribute name
is this what you are looking?
Regards
Srinivas -
Hi ,
I have one requirement in webdynpro ALV. I have to display all po header detail in one view and when user click on any po respective item detail from item table should display .
i am facing problem in user interaction means how to handle click event in where i have to call and how its possible.Hi Abhishek,
Try to post these type of questions in WD ABAP forum.
Please check the below threads for a help on your issue.
http://help.sap.com/saphelp_erp2005/helpdata/EN/f1/177741adb7167de10000000a155106/content.htm
[ALV|https://wiki.sdn.sap.com/wiki/display/WDABAP/GettingtheRowSelectedIntheALV....andMuchMore..]
Search on supply function in SDN, you will find more links.
Thanks,
Sreekanth
Edited by: Sreekanth on Jul 24, 2009 8:30 AM -
How to make all the rows editable in webdynpro alv output
Hi,
How to make all the rows editable in webdynpro alv output.
Thanks
RaksharHi Rakshar,
Check this wiki:
http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoeditconditionallyrowofaALVtableinWebDynprofor+ABAP
Regards -
How to remove the the standard button APPEND/INSERT/DELETE in webdynpro alv
Hello,
how to remove the the standard button APPEND/INSERT/DELETE in webdynpro-abap alv
Thanks
RaksharUse this.
data lo_cmp_usage type ref to if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_alv1( ).
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
data lo_interfacecontroller type ref to iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_alv1( ).
data lo_value type ref to cl_salv_wd_config_table.
lo_value = lo_interfacecontroller->get_model(
data: lr_std type ref to if_salv_wd_std_functions.
lr_std ?= lo_value.
lr_std->set_export_allowed( abap_false ).
NOte: ALV1 is alv component name
Regards
Srinivas
Edited by: sanasrinivas on Dec 1, 2011 6:11 AM -
Disabling fields(Make the field as non-editable) in webdynpro ALV
HI All,
I have a requirement in the ABAP webdynpro where I have to disable(Make the field as non-editable) the field(or that ALV cell alone) in the ALV after the user has inputed in that field.
Is it possible, if yes, could you please give me some sample code , or links to which I can refer to.
Thanks for your help.
Regards,
Subash MHi,
Use the following approach :
1. Create an ALV and create an inputfield cell editor for the column that you want to make editable/disable.Refer this tutorial for creating an [Editable ALV|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1]
2. Now under the same node create an attribute EDITABLE type boolean and bind this to the readonly property of the input field. Include the following code while creating Input field for binding.
lr_input_field->set_read_only_fieldname( 'EDITABLE' ).
3. Now implement the onDataCheck event or OnCellAction event and pass abap_true to this attibute to make the cell readonly/disable.Refer this tutorial for [Events in ALV|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/bd28494a-0801-0010-45a3-fc359d82d3e8]
Hope this helps.
Regards,
Radhika. -
Webdynpro ALV index of rows in a separate column
Hello,
I have an ALV in webdynpro and would like to see the index of the rows in a separate column. Does anybody know if there is an option for that in ALV or how to solve this problem?
Thanks!It's useful to read CAREFULLY !
_I wrote:_
Enter the _"iWork Formulas and Functions User Guide"_ and search for COUNTIF.
_I didn't wrote_ Enter the Numbers User Guide and search for COUNTIF !!!!!!!
Yvan KOENIG (from FRANCE vendredi 31 juillet 2009 19:14:36) -
Webdynpro ALV - Adding an additional row
Hi Friends,
I want to develop an ALV report in Webdynpro ABAP as per the format mentioned in the below link. I want to have an additional row after the subtotal in ALV to show some calculation.As per the format below in the output after subtotaling the total operating revenue and total other income i would like to have an additional row to show the Total revenue(total operating revenue + total other income). Similarly after subtotaling the cost of sales, I would like to show the gross profit(total operating revenue - cost of sales) in an additional row. Please let me know whether this is possible in ALV. If so please advice me how to achieve it.
http://www.imagebanana.com/view/gpl4ynnk/report_layout.jpg
Regards
SAPTechiesHi,
I'm not sure but have you tried implementing the code you want after the total inside end of page.
There is another event called 'AFTER_LINE_OUTPUT' , try using them.
Refer the below links for understanding how to use them.
END-OF-PAGE
http://help.sap.com/saphelp_470/helpdata/en/9f/dba04f35c111d1829f0000e829fbfe/content.htm
Thanks. -
Unable to selelct a Row in ABAP Webdynpro ALV table
Hi,
I have a ALV Table in webdynpro and I need to choose a Row in that table. But the table is not allowing me to choose the row.
Row_selectable is at 'X'.
Row selection type is at 8.
Still.. the grid looks like it is in display mode..
pls helpHi
You explicitly need to make the table editable.
DATA lo_table_setings TYPE REF TO if_salv_wd_table_settings.
lo_table = lo_interfacecontroller->get_model( ).
lo_field_settings ?= lo_table.
lo_table_setings->set_cell_action_event_enabled( value = abap_true ).
lo_table_setings->set_read_only( value = abap_false ).
lo_table_setings->set_enabled( value = abap_true ).
have u written thse lines in ur code??
Regards,
Arvind -
How to provide F4 for inputfield in ABAP Webdynpro ALV
Hi Friends,
I am displaying records in Editable ALV Gridd in webdynpro.
I need to provide search help(F4) for few fields which are editable.
Please help me, how I can achieve this functionality in ALV .
Regards,
Xavier.phi Xavier.
to display the data in alv you must have binded it to some context node / attribute rite?.......now to get an input help to the fields you can first make the search help using transaction se11...after making the search help return to the web dynpro component go to the conttext tab.... click on the particular attribut where you want to have the search help....check in the property below...you will find that the " INPUT SEARCH help" is set to automatic ....set it to " dictionary search help".....and below it mention the name of search help you created....save it and activate the component again...the search help will be reflected automatically in the output.
in case of any further query regarding this kindly reply.
thanks,
sahai.s -
WebDynpro: ALV: LinktoURL depending on row
Hello all,
I need to integrate a LinkToURL UIElement to a column in an ALV. The column is AUFNR and
the link is depending on the number of the order. f.e. www.sdn.sap.com?id=<AUFNR>.
Anybody could tell me if its possible with WebDynpro for ABAP?
Thanks and regards
MarioOk, I'm in kind of a snarky mood today. I assume that even though you didn't ask how to acomplish this, you might want to know. First of all, here is the help link on how to change the cell editor in general:
http://help.sap.com/saphelp_nw70/helpdata/EN/43/2808494f49601ee10000000a422035/frameset.htm
The class that you want to use for a linkToURL is CL_SALV_WD_UIE_LINK_TO_URL. You will need to build the URL as a separate context attribute and bind to the linkToURL. -
Webdynpro ALV checkbox displays 'X'
Hello Webdynpro Champions,
I have an issue with displaying ALV output in Webdynpro.
I have a checkbox as my first column.
This checkbox is bound to a context node.
When I check this checkbox, in the ALV output I get 'X' displayed in the output. I think this is unwanted in my case and hence will like to curb it and not display that X next to my checkbox in the ALV output.
Any ideas how to disable that X from gettting displayed in the ALV output?Hello,
This one can you can solve by removing this (or smilar) method call from the place where you setup your ALV layout:
lrc_checkbox->set_text_fieldname( 'CBXCOLNAME' ).
As you probably have this call in your coding (copy&paste from different cell editor example? ), you will see column's text (autoo-mapped to content) next to your checkbox.
Best regards,
Marcin
Maybe you are looking for
-
MacBook Alum battery heating up while being charged and used
MacBook Alum battery heating up while being charged and used at the same time. Is this normal? Or is it only mine? :S
-
Printing problem with Lexmark Z43
Printing with a Lexmark Z43 printer in any application, the print will stall at approximately 35 to 45% of the printing job and not continue. Any advice would be helpful.
-
Table name input. and output i need all rows and columns using procedures
hi, question: table name input. and output i need all rows and columns by using procedures. thanks, To All
-
Change header name in Snapshot
Hi, We have a FR report which uses the report name in the header. We created a snapshot of it. I believe the snapshot uses the base report name in the header. Is it possible to change the name in the header of the snapshot? Regards, Ragav.
-
Third-party JS Libraries and XHR cross-domain requests
Hello, I am running into issues while developping a Windows Store app implementing the Jabber javascript SDK. This jquery-based SDK allows you to connect to a Cisco communication server to send/receive messages between users and share presence states