Adding new rows after displaying subtotals in an ALV report by using OOABAP
Dear All,
I am creating an ALV report, displaying subtotals and total by using Classes. I have used classes CL_SALV_AGGREGATIONS (Method : add_aggregation) and CL_SALV_AGGREGATIONS (Method : add_sort) for sorting and doing subtotals.
Output of my report as follows :- (I have used * for displaying spaces between fields)
Materia*******Quantity**SerialNo*Equipment**Value***WBS Element
ISM-DBSVR****1********12363****31872565***2165***Q-0040358945.001010
ISM-DBSVR****1********12364****31872566***2165***Q-0040358945.001010
**************************************Subtotal***********4330
-> If the value of "Quantity" is greater than 1 then the value of subtotal for the field "Value" is to be divided by the Quantity for that line item and needs to be displayed Quantity, SerialNo, Value details information after subtotal .
-> Basically I need to add few more rows for displaying above additional information in the ALV grid after displaying subtotal .
Q: Do we have any methods for change the layout for the above requirement.
I Appreciate your early response.
Thank you.
RajaSekhar.
Hi,
For such type of requirement you need to use ALV hierchical table.
You can have your main table in master table.
For quantity greater than 1 you need to move the data into a seperate internal table....this internal table will have material as the key between the main table and the second table.
*... §2 create an ALV hierseq table
try.
cl_salv_hierseq_table=>factory(
exporting
t_binding_level1_level2 = lt_binding
importing
r_hierseq = gr_hierseq
changing
t_table_level1 = gt_master
t_table_level2 = gt_slave ).
catch cx_salv_data_error cx_salv_not_found.
endtry.
you can display both the tables together with the subtotals also.
please refer to program SALV_DEMO_HIERSEQ_SIMPLE to see how to display the hierarchical display.
Plr reward points if found helpful.
Regards,
Mayank
Similar Messages
-
EDIT method doesn't work after adding new row
I would like to start editing after adding new row into TableView.
I copied example from Oracle website: [Using JavaFX UI Controls - 13 Table View|http://docs.oracle.com/javafx/2/ui_controls/table-view.htm#CJAGDAHE]. Then I put additional button for adding new row and define action for the button.
final Button addButton = new Button("Add");
addButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent arg0) {
Person p = new Person("", "", "");
table.getItems().add(p);
table.getSelectionModel().select(p);
table.edit(table.getSelectionModel().getSelectedIndex(), table.getColumns().get(2));
});In result I can see selected new row but the table doesn't start edditing in the third column.
I have similar method for editing existing rows and it works properly.
final Button editButton = new Button("Edit");
editButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent arg0) {
table.edit(table.getSelectionModel().getSelectedIndex(), table.getColumns().get(2));
});Could you help me what I do wrong?Try wrapping the setCaretPosition(...) method in a SwingUtilities.invokeLater(...)
caret=outputArea.getDocument().getText(0,outputArea.getDocument().getLength()).length();Should be:
caret = outputArea.getDocument().getLength(); -
How to insert the new row after current row in RowIterator - Steve Muench
Hi,
Our client wants the new row to be added after current row on the front end instead of before current row.
we were using "new JUActionBinding(this,iterBinding,JUActionBinding.ACTION_CREATE_INSERT_ROW);" this code inserts the new row after current row.
I tried a lot to insert the new row after current row. Used new JUActionBinding(this,iterBinding,JUActionBinding.ACTION_LAST to move the cursor to last row in rowiterator and the used .ACTION_CREATE_INSERT_ROW but this thing inserts the new row as the second last row.
Could somebody plesae help ?
Message was edited by:
user556161I am using JDeveloper 9.0.4.2.0 (Build 1459)
-
Adding new rows at run time in alv oops
HI ALL,
I have a created an editable alv report in oops. Now i have to add a new row having similar values as the previous row at run time when a custom button is clicked in the output and after entering some values in the new row and pressing the database must be updated and also the internal table at run time itself.
for example let us suppose i have the following row in the alv output.
MATNR DESCRIPTION NAME DATE
001 TEST MATRIKS 10092001
NOW if we click the custom button added on the alv toolbar, it should a new row at the run time similar to previous row as shown below
MATNR DESCRIPTION NAME DATE
001 TEST MATRIKS 10092001
001 TEST MATRIKS 10092001 -> NEW ROW.
can we do it in alv oops? pls let me know the soln or any helpful links
thanks
johnHi John,
I dont think, you can find any method for that,
one way what I can suggest is
Get the selected row index.
Insert the blank row in your internal table at this index
Refresh the container.
Hope this will help.
Thanks,
Anmol. -
How to refresh the grid so that default values come on adding new row.
Hi Experts,
In alv grid while adding new row, i want some 2-3 column values to come by default from already existing row in grid.
i am getting new row in internal table with 2-3 default values and rest columns blank on adding new row in alv grid
but the entire row is coming blank, not able to get the default values in new row
how can i refresh the grid so that default values come on adding new row.
thanksHi Surabhi,
Use this in Interactive section even if you are doing simple ALV.
DATA:
lv_ref_grid TYPE REF TO cl_gui_alv_grid.
CLEAR : gv_tcode.
*-- to ensure that only new processed data is displayed
IF lv_ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lv_ref_grid.
ENDIF.
IF NOT lv_ref_grid IS INITIAL.
CALL METHOD lv_ref_grid->check_changed_data.
ENDIF.
THis will solve your problem.
Regards,
Vijay -
Can iOS Numbers copy formulas when adding new rows?
iOS Numbers table add row is not copying previous cell formulas. Is this supported or not?
I have a table with lots of columns and all of them have formulas. When I click at the lower left of the table to add a row, none of the new cells have the formulas. I have to manually go through every column and copy the formulas to the new row.
This is not very practical if you're planning to use Numbers on the go with an iPad. In my case, I have to quickly get a new row ready as needed. I was hoping there is a preference setting somewhere like "copy formulas when adding new row".I had the same issue with the added twist that I wanted to reference the created cells in formulas in other sheets. This is what works for me:
I use a form to enter data. The referenced sheet is set up like this:
1 Name Date ServPayment SalesPayment Total
2 Week1 =sum (ServPayment,SalesPayment)
3 =sum (ServPayment,SalesPayment)
4 TotWeek1 =sum (Total2,Total3)
"Total" sums the 2 Payments, TotWeek1 sums the totals.
In the entry form I never add data to the empty line. In this example, I would start at "Week1" and tap the "+" to add a new form. This creates the line in the referenced sheet with my formulas. As I continue, I always start at the last entry I have made and tap "+".
When I create a line that does not have the formula on either side, I do not get the formula.
Hope this helps. -
Null Pointer Exception When Adding New Row on Table
Hello JheadStart Team
I have used detail group with table layout , when I am clicking on AddRow button on detail table , I encounter NulllPointer Exception . I have traced the code and fount that in JhsCollectionModel when adding new row following
condition occurs :
DCIteratorBinding ib = getRangeBinding().getIteratorBinding();
int rangeSize = ib.getRangeSize();
int rowsInRange = ib.getAllRowsInRange().length;
because getAllRowsInRange is Null then the error raise.
My JheadStart ver is 10.1.3.3.85 .
Detail Group with table layout setting is :
Use Table range=true
Show New Row at top=true
New Rows:empty
Show Add New Row Button :true
RegardsGiven the build you are using, I assume you are an Oracle employee.
Is this correct? if so, please post your question to the [email protected] mailing list.
Steven Davelaar,
JHeadstart team. -
CRM PCUI (Imp): Adding new fields & Webpage display in ODC1
Hi Gurus,
Plz help in these PCUI related configurations:
<b>Query 1</b>.
PCUI: Adding custom created field in a new TAB (BSP Iview)
Steps Done
a. Custom field defined in an object (say Opportunity)
b. An event created.
c. A Group Tab Page created
d. A Field group created and a new field name added to the field group (What structure need to be added to this field group?)
e. Entry made in Application Layout for an application i.e. event / position / screen element / tab page / structure . (Again what structure to be added?)
To handle this new field & tab, plz advice
1. What needs to be entered in the screen structure? Do we need to create this structure?
2. The required the model access class defined for the screen structure.
3. Any changes required in the controllers
<u><i>(Where is the linking between custom field defined in the opportunity object and the new field entry made in the filed group)</i></u>
<b>Query 2.</b>
Calling a webpage in a tab (ODC1, Detail area)
Opening a webpage in an iview can be done easily by reating a URL iview.
If the requirement is to open a web page in ODC1, than what are the steps required for the same?
e.g. On clicking a user defined tab the webpage should open in the detail area 1.
<b>Query 3.</b>
We have extended an object (say field addition in opportunity header) through EEWB
Will the added filed be available in PCUI screen also?
Regards,
SAURABHHello SAURABH,
welcome to the SDN Community. Please do not crosspost:
<a href="https://forums.sdn.sap.com/thread.jspa?threadID=66550&messageID=707519">CRM PCUI (Imp): Adding new fields & Webpage display in ODC1</a>.
Regards
Gregor -
How to display two lables in alv report
Is there any chance to display two lables in alv report
for example..
AMOUNT
Rs | Ps
|
like that this for an example.
thanks,
JBHai Babu
Go through the following Code
using Classes & Methods
try with the following Code( Just copy the code & try with in SE38 Tcode & Execute it that all)
REPORT ZALV_SALES_HEADER_DETAIL MESSAGE-ID Z50650(MSG) .
TABLES
TABLES: VBAK . "SALES DOCUMENT HEADER
DATA OBJECTS DECLARATION
DATA: IT_VBAK TYPE STANDARD TABLE OF ZVBAK_STRUC,
IT_VBAP TYPE STANDARD TABLE OF ZVBAP_STRUC,
GS_LAYOUT TYPE LVC_S_LAYO,
GS1_LAYOUT TYPE LVC_S_LAYO,
GRID TYPE REF TO CL_GUI_ALV_GRID,
CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
VBAK_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
VBAP_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
WA_VBAK LIKE LINE OF IT_VBAK,
WA_VBAP LIKE LINE OF IT_VBAP,
SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
TOP_OF_PAGE_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
GRID_VBAP TYPE REF TO CL_GUI_ALV_GRID,
TOP_PAGE TYPE REF TO CL_DD_DOCUMENT,
FLAG(1).
*"EVENT RECIEVER CLASS DEFINITION
CLASS LCL_EVENT_RECIEVER DEFINITION DEFERRED.
DATA: OBJ_EVENT TYPE REF TO LCL_EVENT_RECIEVER.
SELECTION-SCREEN
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
PARAMETERS: P_VBTYP LIKE VBAK-VBTYP DEFAULT 'C'.
SELECTION-SCREEN: END OF BLOCK B1.
CLASS DEFINITION AND DECLARATIONS
CLASS LCL_EVENT_RECIEVER DEFINITION.
PUBLIC SECTION.
EVENTS:DOUBLE_CLICK,
TOP_OF_PAGE.
METHODS:HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW .
METHODS: HANDLE_TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID.
ENDCLASS. "LCL_EVENT_RECIEVER DEFINITION
CLASS LCL_EVENT_RECIEVER IMPLEMENTATION
CLASS LCL_EVENT_RECIEVER IMPLEMENTATION.
METHOD: HANDLE_DOUBLE_CLICK.
READ TABLE IT_VBAK INDEX E_ROW-INDEX INTO WA_VBAK.
PERFORM FETCH_ITEM_DETAILS USING WA_VBAK.
PERFORM ALV_GRID.
ENDMETHOD. "HANDLE_DOUBLE_CLICK
METHOD: HANDLE_TOP_OF_PAGE.
CALL METHOD TOP_PAGE->ADD_TEXT
EXPORTING
TEXT = 'SALES HEADER & ITEM DETAILS'.
CALL METHOD TOP_PAGE->DISPLAY_DOCUMENT
EXPORTING
PARENT = TOP_OF_PAGE_CONTAINER.
ENDMETHOD. "HANDLER_TOP_OF_PAGE
ENDCLASS. "LCL_EVENT_RECIEVER IMPLEMENTATION
AT SELECTION-SCREEN
AT SELECTION-SCREEN.
IF S_VBELN IS NOT INITIAL.
SELECT COUNT(*)
FROM VBAK
WHERE VBELN IN S_VBELN.
IF SY-DBCNT = 0.
MESSAGE E000 WITH 'NO TABLE ENTRIES FOUND FOR LOW KEY SPECIFIED'.
ENDIF.
ENDIF.
START-OF-SELECTION.
START-OF-SELECTION.
PERFORM FETCH_SALES_HEADER_RECORD.
PERFORM CREATE_CALL. "CREATION OF OBJECTS & CALLING METHODS
END-OF-SELECTION.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Form FETCH_SALES_HEADER_RECORD
text
--> p1 text
<-- p2 text
FORM FETCH_SALES_HEADER_RECORD .
SELECT
VBELN
AUDAT
VBTYP
AUART
AUGRU
NETWR
WAERK
FROM VBAK
INTO CORRESPONDING FIELDS OF TABLE IT_VBAK
WHERE VBELN IN S_VBELN
AND VBTYP = P_VBTYP.
ENDFORM. " FETCH_SALES_HEADER_RECORD
*& Form CREATE_CALL
text
--> p1 text
<-- p2 text
FORM CREATE_CALL .
IF CUSTOM_CONTAINER IS INITIAL.
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
PARENT =
CONTAINER_NAME = 'CUSTOM_CONTAINER'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT SPLITTER
EXPORTING
TOP = 5
PARENT = CUSTOM_CONTAINER
ROWS = 3
COLUMNS = 1
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 1
COLUMN = 1
RECEIVING
CONTAINER = TOP_OF_PAGE_CONTAINER.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
CONTAINER = VBAK_CONTAINER.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 3
COLUMN = 1
RECEIVING
CONTAINER = VBAP_CONTAINER.
CREATE OBJECT GRID
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = VBAK_CONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
GS_LAYOUT-GRID_TITLE = 'SALES HEADER DETAILS.'(100).
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'ZVBAK_STRUC'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = GS_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_VBAK
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CREATE OBJECT OBJ_EVENT .
SET HANDLER OBJ_EVENT->HANDLE_DOUBLE_CLICK FOR GRID.
SET HANDLER OBJ_EVENT->HANDLE_TOP_OF_PAGE FOR GRID.
CREATE OBJECT TOP_PAGE
EXPORTING
STYLE = 'ALV_GRID'
CALL METHOD TOP_PAGE->INITIALIZE_DOCUMENT.
CALL METHOD GRID->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = TOP_PAGE.
CALL SCREEN 100.
ENDFORM. " CREATE_CALL
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form FETCH_ITEM_DETAILS
text
--> p1 text
<-- p2 text
FORM FETCH_ITEM_DETAILS USING WA_VBAK TYPE ZVBAK_STRUC .
SELECT
VBELN
POSNR
MATNR
MATWA
PMATN
CHARG
FROM VBAP
INTO TABLE IT_VBAP
WHERE VBELN = WA_VBAK-VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'NO RECORDS FOUND FOR SPECIFIED KEY'.
ENDIF.
ENDFORM. " FETCH_ITEM_DETAILS
*& Module STATUS_0200 OUTPUT
text
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0200 OUTPUT
*& Module USER_COMMAND_0200 INPUT
text
MODULE USER_COMMAND_0200 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Form alv_grid
text
--> p1 text
<-- p2 text
FORM ALV_GRID .
IF FLAG = ''.
FLAG = 'X'.
CREATE OBJECT GRID_VBAP
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = VBAP_CONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
GS1_LAYOUT-GRID_TITLE = 'SALES ITEM DETAILS.'(100).
CALL METHOD GRID_VBAP->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'ZVBAP_STRUC'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = GS1_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_VBAP
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " alv_grid
Thansk & regards
Sreenivasulu P -
Displaying special characters in ALV report.
Hi Experts,
Can we display special characters in ALV reports? Special characters such as tick mark.(Like in character map(Font Bookshelf Symbol 7) of windows ).
I tried with icons in ALV report, I was able to display tick icon in the ALV report, but when we export the report in to a excel, the icons comes in as Hexadecimal code.
Can any we display special characters like tick in ALV report or display the icons in excel aswell?
I will be gratefull for the <urgency reduced by moderator> response.
Regards,
Sharath.
Edited by: Thomas Zloch on May 10, 2011 10:26 AMSharath,
I think it is possible to do so.
Please check this link.
http://www.sapfans.com/forums/viewtopic.php?f=13&t=322569
Thanks,
Guru. -
How to refresh after delete the records in ALV report ?
Hi Friends,
How to refresh after delete the records in ALV report.
I am deleting records in ALV report .
After successful delete the screen should refresh.
u201C Deleted records should not appear in the screen u201C.
Please guide me.
Regards,
SubashHi subhash,
FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
WHEN 'BACK'.
Refresh the internal table from the ALV grid
PERFORM update_alv_tab.
ENDFORM. "user_command
FORM update_alv_tab .
DATA : e_grid TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = e_grid.
CALL METHOD e_grid->check_changed_data.
"update_alv_tab
CALL METHOD e_grid->refresh_table_display.
ENDFORM. " UPDATE_ALV_TAB
Then see in Debug mode is it updating or not..
Please confirm .
And please paste the code if you can.
Regards. -
How to display the fields in ALV Output without using Field catalog?
How to display the fields in ALV Output without using Field catalog?
Could you pls tell me the coding?
Akshitha.Hi,
u mean without building field catalog. is it? I that case, we can use the FM REUSE_ALV_FIELDCATALOG_MERGE.
data: itab type table of mara.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = itab
CHANGING
ct_fieldcat = lt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
*Pass that field catalog into the fillowing FM
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_grid_title = 'REPORTING'
is_layout = gt_layout
it_fieldcat = lt_fieldcat[]
tables
t_outtab = itab. -
Problem in display of text in ALV report
Dear experts,
I am working on a MM Report in which I need to display Material Basic data text maintained in MM01,02 Tcodes through ALV report.
I have declared a string type variable for the Basic data text in the Final Internal Table.
For reading the Standard text I am using Read_Text FM, from which I am looping the Text internal table and concatenating it into
String variable.
What I notice is all the content beyond 255 chars is not getting displayed, Even when the ALV report is downloaded to Excel file.
Can you suggest some approach to over come this issue.
Regards,
MurthyHi,
Use the below code
Data : lt_content TYPE TABLE OF tline,
lw_content TYPE tline.
Data : lt_text Type Table of solisti1,
lw_text TYPE solisti1.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = lv_id
language = tdspras
name = lv_name
object = lv_object
archive_handle = 0
local_cat = ' '
TABLES
lines = lt_content
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
loop at lt_content into lw_content.
lw_text-line = lw_content-tdline.
APPEND lw_text TO lt_text.
CLEAR: lw_content, lw_text.
endloop.
Now your whole text is in "lt_text".
Regards,
Avish Mittal -
Displaying data on an ALV report
Hi Abaper's
I have data that is stored in an internal table and I want to display it in an ALV report, How can I achieve this?
Thanx in advance
ThandieHi,
Try to run the following code you will find the Ans.
TABLES : ekpo.
TYPE-POOLS : slis.
TYPES : BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
matnr TYPE ekpo-matnr,
werks TYPE ekpo-werks,
menge TYPE ekpo-menge,
END OF t_ekpo.
*VARIABLES
DATA : check(1),
rep_id TYPE sy-repid.
*INTERNAL TABLE TYPE OF ZEKPO
DATA : it_ekpo TYPE STANDARD TABLE OF t_ekpo WITH HEADER LINE.
*FIELD CATALOG
DATA : it_field TYPE slis_t_fieldcat_alv,
wa_field TYPE slis_fieldcat_alv.
*SORTING
DATA : it_sort TYPE slis_t_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv.
INITIALIZATION.
check = 'X'.
rep_id = sy-repid.
START-OF-SELECTION.
SELECT ebeln
ebelp
matnr
werks
menge
FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE it_ekpo.
* FIELD CATALOG
wa_field-fieldname = 'EBELN'.
wa_field-tabname = 'IT_TAB'.
wa_field-outputlen = 10.
wa_field-seltext_l = 'PO #'.
APPEND wa_field TO it_field.
CLEAR wa_field.
wa_field-fieldname = 'EBELP'.
wa_field-tabname = 'IT_TAB'.
wa_field-outputlen = 10.
wa_field-seltext_l = 'Line Item'.
APPEND wa_field TO it_field.
CLEAR wa_field.
wa_field-fieldname = 'MATNR'.
wa_field-tabname = 'IT_TAB'.
wa_field-outputlen = 15.
wa_field-seltext_l = 'Material'.
APPEND wa_field TO it_field.
CLEAR wa_field.
wa_field-fieldname = 'WERKS'.
wa_field-tabname = 'IT_TAB'.
wa_field-outputlen = 6.
wa_field-seltext_l = 'Plant'.
APPEND wa_field TO it_field.
CLEAR wa_field.
wa_field-fieldname = 'MENGE'.
wa_field-tabname = 'IT_TAB'.
wa_field-outputlen = 10.
wa_field-seltext_l = 'Qty.'.
* wa_field-outputlen = 17.
* wa_field-edit = 'X'.
wa_field-do_sum = check.
APPEND wa_field TO it_field.
CLEAR wa_field.
* SORT W.R.T. PURCHASE ORDER NUMBER
wa_sort-spos = 1.
wa_sort-fieldname = 'EBELN'.
wa_sort-tabname = 'IT_EKPO'.
wa_sort-up = check.
wa_sort-subtot = check.
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
* DISPLAY RECORDS IN ALV GRID
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = rep_id
it_fieldcat = it_field
it_sort = it_sort
TABLES
t_outtab = it_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
Kind Regards,
Faisal -
Dear all,
I press right-click on Journal Entry and select "Cancel" function.
SAP B1 creates a new journal entry with inverted rows registration.
Now, I added a new button in this form.
When I press the button, I need to add a new empty row in the matrix.
I use this command:
oJEMatrix.AddRow()
I also used this command:
oJEMatrix.AddRow(1, 1)
but what I obtain is a new row with the same values of the first row (it seems a duplication of the first row).
The new row-index (first left column) in the matrix has the value "1" as the first original row.
How can I add a new empty row in this matrix and refresh the matrix to update the index of each row?
Best regards
EmanueleI found the error:
I was trying to set Credit > 0 and Debit > 0 on the same row.
But now I have a nother issue with matrix.
See image below...
After populating the matrix, the rows index are incorrect. How can refresh the matrix to recalculate the correct row number in the first column?
Best regards
Emanuele
Maybe you are looking for
-
How to get the values in a single row without using union
Hi, I have a table with the following structure and data empid address phoneno emailid 1001 xyz 1001 1234234 1001 [email protected] 1002 23434 1002 [email protected] 10
-
PDFs and Word Files open on iMac but not Macbook Pro
I own an iMac and a MacBook Pro. Recently, I've been having an issue with some PDFs and Word files that have been emailed to me from different contacts. All open-and can be seen using Quick Look-on the iMac. However, on the MacBook Pro it's a differe
-
Rollover images question + site deffinition tool
Hi, I took a course in Dreamweave but unfortunately lost my notes. I am making a gallery site for myself and would like to have roll over images where one rolls over a thumbnail at the bottom of the page and a larger image in the middle changes to t
-
Safari crashes when I try opening the bookmark tab (iPad 3, iOS 5.1.1)
Hello, I was trying to sync my bookmarks from computer to iPad, and suddenly I couldn't open the bookmarks tab on my iPad any more. Safari just closes right away. I tried erasing all the history and rebooting, but it didn't work. Thanks for your help
-
how do I sync my SkyDrive pro with the SkyDrive that is already on my computer? I do not know where to start