Dynamic table control creation? - dynamic

I have a task to create tableview on a GUI screen dynamically. The control must be created dynamically fo different table types, because we need to maintain different tables. I mean I need SM30 looking table maintainance screen.
Is it possible in ABAP to create tableview dynamically? Or is it possible within ALV grids only?

There isn't any alternative table view for SAP GUI. You need to use ALV to show multiple lines same time.
You can create ALV dynamically.

As a very slim trick use STC1_FULLSCREEN_TABLE_CONTROL. It makes table control just in time
CALL FUNCTION 'STC1_FULLSCREEN_TABLE_CONTROL'
EXPORTING
header = 'MyTab'
tabname = 'MARA'
no_button = 'X'
TABLES
table = lt_mara
EXCEPTIONS
no_more_tables = 1
too_many_fields = 2
nametab_not_valid = 3
handle_not_valid = 4
OTHERS = 5
.
However, I agree with the rest of commenters that ALV grid will be much better for this case.

Related

How to find table type for a data element?

I create a new function modul in abap which should return a list of the data element AGVAL.
AFAIK there are two ways now:
I use an already available table type
I create a new table type
How to do this kind of introspection? I would like to now if there is already a table type with one column, which is of type AGVAL?
you can enter your element type in TA SE11 as Data Type.
Go to display and use the Where-Used-List to search for table fields / strucure fields to find the usage of this data element.
Regards
Max
I don't know any option else but using SQL to query the ABAP dictionary directly.
For instance, this query extracts all table types having a structure whose first component has the data element SO_TEXT255 (and which is not embedded in a nested structure) :
SELECT * FROM DD40L
WHERE ROWKIND = 'S'
and ROWTYPE in (
select TABNAME from DD03L
where POSITION = 1
and ROLLNAME = 'SO_TEXT255' )
Of course, it doesn't restrict to structures with only this one component but you may adapt it a little bit.
If you do not stick purely to ABAP-way it is done via SE11 in a very simple way.
Search by table types
Choose search type as "by reference line"
That's it!

Oracle APEX: Update Table based on changes in an Interactive Grid

currently i am facing a problem on how to update a single row in an interactive grid. am trying to update the table (Interactive Grid) based on the changes the user has made. I followed the guide from APEX 5.1.
Unfortunately the rowid function didn't work.
My code:
update poc_sofortmassnahme
set BESCHREIBUNG_SOFORT = :BESCHREIBUNG_SOFORT,
BEARBEITER_SOFORT = :BEARBEITER_SOFORT,
ZIELDATUM_SOFORT = :ZIELDATUM_SOFORT,
WIRKSAMKEIT = :WIRKSAMKEIT
where rowid = :ROWID; // doesn't update the row.
Any help is appreciated.
Interactive Grid can be editable (as tabular forms used to be in previous versions), so I'd suggest you to use that functionality instead of reinventing the wheel. Because, it seems that you're trying to do your own row processing while there's no need to do that.

How to add a table data to transport request programmatically?

I have a task to add selected rows from alv grid to the transport request.
At this moment I already have:
Name of transport request
Selected rows (I put them in a table because I don't know what the type they should be if I want to put them into the transport request):
First I get indexes:
call method grid->get_selected_rows
importing
et_index_rows = lt_rows.
Second I get rows that I need and put them into a new table:
if lt_rows is not initial.
loop at lt_rows into ls_row.
read table lt_variable index ls_row into ls_variable.
append ls_variable to lt_variable_changed.
endloop.
endif.
As I understand I need to use all of this in the function TR_OBJECTS_INSERT, but unfortunately I didn't get any information that could help me to understand that I did it correctly.
What is the critical need of transporting data in runtime? It is unstable and not recommended.
Just create customizing table in Data Dictionary and insert necessary ALV grid rows to it in runtime.
Then use transport with object type R3TR-TABU to move that customizing table to another system. Do it in batches, not by pieces of 2 or 3 rows like you want.
Here is the full tutorial.
But it's a bad practice to do like this. Replicating data across the landscape in a regular manner is a BASIS task and should be done by BASIS, not by developer.
And replicating rows of business data in runtime is a horrible practice.

How to check if a field is present in a particular view or table using ABAP

I have list of 100 views for which I need to check if those views have fields A and B. If any of those 100 views uses those two fields, I need to display a message. Any existing function module will help.
Sujeet,
Function module ISB_TABLE_READ_FIELDS accepts a table or view name and returns a table of fields on the structure. If you don't have this function module, you can write your code to select entries from table DD03L, which is keyed on table name and contains all of the fields on all database table structures.
Once you have the list of fields, the code to implement the logic you want should be trivial.
I doubt there is an existing SAP Function Module to do this - I suspect you will have to write some ABAP or do some Excel manipulation.
I would expect that there is a table within SAP which defines views - I'm not sure which though.
If no-one suggests anything else I would use ST05 - "SQL Trace" to see which tables SAP reads when you call SE12 to look at the view you are interested in. You can look at the SELECT statements and see which tables it reads to get the view definition.
I just tried pressing F1 on a field in SE12 for a view to see if there was a mention of a table. The technical info made reference to a structure containing the string "DD27" - I had a look in SE16 for tables with similar names and DD27SV looks like it might help.
Have a look and see what you think - you'd need to query that table in some ABAP or extract to Excel and do equivalent manipulation there.

SSRS Report, shared layout, using different data sets

We need to create several reports but they all have the same exact layout. Rather than creating many reports, is it possible to create a single report that can conditionally be populated by different sets of data?
For example, say the report is a simple list of customer names and addresses. I would like to have a parameter that asks for a customer type. A second drop down parameter list would only show customer subtypes directly related to the parent customer type. Can a parameter drop down be filtered based upon a selection in another parameter drop down?
What other ways can I manage a single report layout but populate with different sets of data based on parameters?
is it possible to create a single report that can conditionally be
populated by different sets of data?
Yes, it is possible as long as the multiple data you use fits the structure of your report. Using parameters you can populate your report with different data.
Can a parameter drop down be filtered based upon a selection in
another parameter drop down?
Yes, A parameter can be populated based on other parameter selection. There are a lot of resources in the web that ilustrate how to achieve that functionality. Give a try and if you get stuck we are here.
What other ways can I manage a single report layout but populate with
different sets of data based on parameters?
You can select the data in your report by using multiple parameters and a single dataset. Then using SQL statements and parameters you can filter from where clause or create a flow in multiple select statements using T-SQL. Something like
IF #my_param = 1
BEGIN
select ...
END
ELSE
BEGIN
select ...
END
Let me know if this helps you.