Multiple Internal tables in separate result sets in ALV report
Hi All
I need to create a program to display the 3 different Internal Tables in different boxes using ALV
For example, say i am having the values in my internal table say ITAB1, ITAB2 & ITAB3 if you call the "REUSE_ALV_LIST_DISPLAY" by passing the "ITAB1" it will show you the output in 1 box,
but we can't then display the ITAB2 and ITAB3 data.
so i want to confirm 3 separate internal tables are displayed in separate boxes using ALV.
Is it possible in ALV ?
Hi Amol Sonaikar
<b>1</b>.
Displaying different ITABs one by one using ALV called BLOCKED ALV reports.
<b>2</b>.
For this we use 3 FMs
<b>REUSE_ALV_BLOCK_LIST_INIT
REUSE_ALV_BLOCK_LIST_APPEND
REUSE_ALV_BLOCK_LIST_APPEND</b>
<b>3</b>.
Have a look at this Example .
Just create and Execute .It displays 2 outputs.
If u want display another one call REUSE_ALV_BLOCK_LIST_APPEND FM and pass ur ITAB .
REPORT zvenkat_head1.
DATA: BEGIN OF i_mard OCCURS 0,
werks TYPE mard-werks,
lgort TYPE mard-lgort,
matnr TYPE mard-matnr,
insme TYPE mard-insme,
einme TYPE mard-einme,
speme TYPE mard-speme,
END OF i_mard.
DATA: BEGIN OF i_makt OCCURS 0,
matnr TYPE makt-matnr,
maktx TYPE makt-maktx,
maktg TYPE makt-maktg,
END OF i_makt.
*& ALV Variables
TYPE-POOLS :slis.
DATA :i_field TYPE slis_t_fieldcat_alv,
w_field LIKE LINE OF i_field,
w_layout TYPE slis_layout_alv,
i_events TYPE slis_t_event,
w_events LIKE LINE OF i_events.
DATA :i_field1 TYPE slis_t_fieldcat_alv,
w_field1 LIKE LINE OF i_field1,
w_layout1 TYPE slis_layout_alv,
i_events1 TYPE slis_t_event,
w_events1 LIKE LINE OF i_events1.
*& START-OF-SELECTION
START-OF-SELECTION.
PERFORM get_data_from_database .
*& END-OF-SELECTION
END-OF-SELECTION.
PERFORM build_fieldcatalog.
PERFORM build_events.
PERFORM display_data.
*& Form build_fieldcatalog
FORM build_fieldcatalog .
CLEAR :
w_field,
i_field[].
CLEAR :
w_field1,
i_field1[].
Fieldcatalog 1
w_field-fieldname = 'WERKS' .
w_field-tabname = 'I_MARD'.
w_field-seltext_m = 'Plant'.
APPEND w_field TO i_field.
CLEAR w_field.
w_field-fieldname = 'LGORT' .
w_field-tabname = 'I_MARD'.
w_field-seltext_m = 'S.Location'.
APPEND w_field TO i_field.
CLEAR w_field.
w_field-fieldname = 'MATNR'.
w_field-tabname = 'I_MARD'.
w_field-seltext_m = 'Mat No'.
APPEND w_field TO i_field.
CLEAR w_field.
w_field-fieldname = 'INSME' .
w_field-do_sum = 'X'.
w_field-tabname = 'I_MARD'.
w_field-seltext_m = 'quality Stock'.
APPEND w_field TO i_field.
CLEAR w_field.
w_field-fieldname = 'EINME'.
w_field-do_sum = 'X'.
w_field-tabname = 'I_MARD'.
w_field-seltext_m = 'Total Stock'.
APPEND w_field TO i_field.
CLEAR w_field.
w_field-fieldname = 'SPEME'.
w_field-do_sum = 'X'.
w_field-tabname = 'I_MARD'.
w_field-seltext_m = 'Blocked stock'.
APPEND w_field TO i_field.
CLEAR w_field.
Fieldcatalog 2
w_field1-fieldname = 'MATNR'.
w_field1-tabname = 'I_MAKT'.
w_field1-seltext_m = 'MATNR'.
APPEND w_field1 TO i_field1.
CLEAR w_field1.
w_field1-fieldname = 'MAKTX'.
w_field1-tabname = 'I_MAKT'.
w_field1-seltext_m = 'MAKTX'.
APPEND w_field1 TO i_field1.
CLEAR w_field1.
w_field1-fieldname = 'MAKTG'.
w_field1-tabname = 'I_MAKT'.
w_field1-seltext_m = 'MAKTG'.
APPEND w_field1 TO i_field1.
CLEAR w_field1.
ENDFORM. " build_fieldcatalog
*& Form build_events
FORM build_events .
CLEAR:
w_events,
i_events[],
w_events1,
i_events1[].
w_events-name = 'TOP_OF_PAGE' .
w_events-form = 'TOP_OF_PAGE' .
APPEND w_events TO i_events.
CLEAR w_events.
w_events1-name = 'TOP_OF_PAGE' .
w_events1-form = 'TOP_OF_PAGE' .
APPEND w_events1 TO i_events1.
CLEAR w_events1.
ENDFORM. " build_events
*& Form display_data
FORM display_data .
DATA :program LIKE sy-repid VALUE sy-repid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = program
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
IT_EXCLUDING =
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = w_layout
it_fieldcat = i_field
i_tabname = 'I_MARD'
it_events = i_events
IT_SORT =
I_TEXT = ' '
TABLES
t_outtab = i_mard
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 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 FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = w_layout
it_fieldcat = i_field1
i_tabname = 'I_MAKT'
it_events = i_events1
IT_SORT =
I_TEXT = ' '
TABLES
t_outtab = i_makt
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 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 FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
IS_PRINT =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
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. " display_data
*& Form get_data_from_database
text
FORM get_data_from_database .
SELECT werks lgort matnr insme einme speme
FROM mard
INTO CORRESPONDING FIELDS OF TABLE i_mard
UP TO 20 ROWS
WHERE werks = 'WF01'.
SELECT matnr
maktx
maktg
FROM makt
INTO TABLE i_makt
UP TO 20 ROWS.
ENDFORM. " get_data_from_database
*& Form top_of_page
text
FORM top_of_page.
DATA: inc_colnum TYPE i.
ULINE .
inc_colnum = sy-linsz - 60.
WRITE: / 'Report: ', sy-repid(18).
WRITE AT 30(inc_colnum) sy-title CENTERED.
inc_colnum = sy-linsz - 20.
WRITE: AT inc_colnum 'Page: ', (11) sy-pagno RIGHT-JUSTIFIED.
WRITE: / 'Client: ', sy-mandt.
inc_colnum = sy-linsz - 20.
WRITE: AT inc_colnum 'Date: ', sy-datum.
WRITE: / 'User : ', sy-uname.
inc_colnum = sy-linsz - 60.
WRITE AT 30(inc_colnum) 'Blocked ALV' CENTERED.
inc_colnum = sy-linsz - 20.
WRITE: AT inc_colnum 'Time: ', (10) sy-uzeit RIGHT-JUSTIFIED.
ULINE .
ENDFORM. "top_of_page
I think that example will solve ur problem.
<b>Thanks,
Venkat.O</b>
Similar Messages
-
Collect data from a dynamic XML file into multiple internal tables
I need to convert the XML file into multiple internal tables. I tried many links and posts in SDN but still was facing difficulty in achieving this. Can some one tell me where I am going wrong.
My XML file is of the following type.It is very complex and the dynamice.
The following tags occur more than once in the XML file. The "I" and "L" tags and its child tags can occur ones or more than once for each XML file and it is not constant. i.e in one file they can occur 1 time and in another they can occur 100 times.
"I" and "L" are child tags of <C>
<I>
<J>10</J>
<K>EN</K>
</I>
<L>
<J>20</J>
<N>BB</N>
</L>
Tags <C> and <F> occur only ones for each XML file. <C> is the child tag of "A" and "F" is the child tag of <C>.
I need to collect <D>, <E> in one internal table ITAB.
I need to collect <G>, <H> in one internal table JTAB.
I need to collect <J>, <K> in one internal table KTAB.
I need to collect <J>, <N> in one internal table PTAB.
Below is the complete XML file.
?xml version="1.0" encoding="iso-8859-1" ?>
<A>
<B/>
<C>
<D>RED</D>
<E>999</E>
<F>
<G>TRACK</G>
<H>PACK</H>
</F>
<I>
<J>10</J>
<K>EN</K>
</I>
<I>
<J>20</J>
<K>TN</K>
</I>
<I>
<J>30</J>
<K>KN</K>
</I>
<L>
<J>10</J>
<N>AA</N>
</L>
<L>
<J>20</J>
<N>BB</N>
</L>
<L>
<J>30</J>
<N>CC</N>
</L>
</C>
</A>
With the help of SDN I am able to gather the values of <D> <E> in one internal table.
Now if I need to gather
<G>, <H> in one internal table JTAB.
<J>, <K> in one internal table KTAB.
<J>, <N> in one internal table PTAB.
I am unable to do. I am following XSLT transformation method. If some one has some suggestions. Please help.
Here is my ABAP program
TYPE-POOLS abap.
CONSTANTS gs_file TYPE string VALUE 'C:\TEMP\ABCD.xml'.
* This is the structure for the data from the XML file
TYPES: BEGIN OF ITAB,
D(10) TYPE C,
E(10) TYPE C,
END OF ITAB.
* Table for the XML content
DATA: gt_itab TYPE STANDARD TABLE OF char2048.
* Table and work ares for the data from the XML file
DATA: gt_ITAB TYPE STANDARD TABLE OF ts_ITAB,
gs_ITAB TYPE ts_ITAB.
* Result table that contains references
* of the internal tables to be filled
DATA: gt_result_xml TYPE abap_trans_resbind_tab,
gs_result_xml TYPE abap_trans_resbind.
* For error handling
DATA: gs_rif_ex TYPE REF TO cx_root,
gs_var_text TYPE string.
* Get the XML file from your client
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = gs_file
CHANGING
data_tab = gt_itab1
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "IITAB".
GET REFERENCE OF gt_shipment INTO gs_result_xml-value.
gs_result_xml-name = 'IITAB'.
APPEND gs_result_xml TO gt_result_xml.
* Perform the XSLT stylesheet
TRY.
CALL TRANSFORMATION zxslt
SOURCE XML gt_itab1
RESULT (gt_result_xml).
CATCH cx_root INTO gs_rif_ex.
gs_var_text = gs_rif_ex->get_text( ).
MESSAGE gs_var_text TYPE 'E'.
ENDTRY.
* Now let's see what we got from the file
LOOP AT gt_ITAB INTO gs_ITAB.
WRITE: / 'D:', gs_ITAB-D.
WRITE: / 'E :', gs_ITAB-E.
ENDLOOP.
Transformation
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<IITAB>
<xsl:apply-templates select="//C"/>
</IITAB>
</asx:values>
</asx:abap>
</xsl:template>
<item>
<D>
<xsl:value-of select="D"/>
</D>
<E>
<xsl:value-of select="E"/>
</E>
</item>
</xsl:template>
</xsl:transform>
Now the above pgm and transformation work well and I am able to extract data into the ITAB. Now what changes should I make in transformation and in pgm to collect
<G>, <H> in one internal table JTAB.
<J>, <K> in one internal table KTAB.
<J>, <N> in one internal table PTAB.
Please help..i am really tring hard to figure this out. I am found lot of threads addressing this issue but not my problem.
Kindly help.
Regards,
VSHi Rammohan,
Thanks for the effort!
But I don't need to use GUI upload because my functionality does not require to fetch data from presentation server.
Moreover, the split command advised by you contains separate fields...f1, f2, f3... and I cannot use it because I have 164 fields. I will have to split into 164 fields and assign the values back to 164 fields in the work area/header line.
Moreover I have about 10 such work areas. so the effort would be ten times the above effort! I want to avoid this! Please help!
I would be very grateful if you could provide an alternative solution.
Thanks once again,
Best Regards,
Vinod.V -
Split a string into multiple internal tables
Hi all,
I need to split a string based internal table into multiple internal tables based on some sub strings in that string based internal table...
High priority help me out...
eg...
a | jhkhjk | kljdskj |lkjdlj |
b | kjhdkjh | kldjkj |
c | jndojkok |
d |
this data which is in the application server file is brought into a internal table as a text. Now i need to send 'a' to one internal table, 'b' to one internal table, so on... help me
<Priority downgraded>
Edited by: Suhas Saha on Oct 12, 2011 12:24 PMHi pradeep,
eg...
a | jhkhjk | kljdskj |lkjdlj |
b | kjhdkjh | kldjkj |
c | jndojkok |
d |
As per your statement "Now i need to send 'a' to one internal table, 'b' to one internal table"
Do you want only a to one internal table and b to one internal table
OR
Do you want the whole row of the internal table i mean
a | jhkhjk | kljdskj |lkjdlj | to 1 internal table
Having the case of an internal table which is of type string,
1) Loop through the internal table. LOOP AT lt_tab INTO lwa_tab.
2) Ge the work area contents and get the first char wa_tab-string+0(1)
3) FIELD-SYMBOLS: <t_itab> TYPE ANY TABLE.
w_tabname = p_table.
CREATE DATA w_dref TYPE TABLE OF (w_tabname).
ASSIGN w_dref->* TO <t_itab>.
Follow the link
http://www.sap-img.com/ab030.htm
http://www.sapdev.co.uk/tips/dynamic-structure.htm
and then based on the sy-tabix values you will get that many number of internal table
<FS> = wa_tab-string+0(1)
append <FS>
OR
USE SPLIT statement at the relevant seperator
revert for further clarification
Thanks
Sri
Edited by: SRIKANTH P on Oct 12, 2011 12:36 PM -
OBIEE Answers does not display the result set of a report query
Hi,
We have a pivot table type of report in Oracle Business Intelligence Enterprise Edition v.10.1.3.3.2 Answers that has the following characteristics:
3 Pages
3 Sections , 4 Columns
18363 Rows in the result set
As per the NQQuery.log, the query for this report executes successfully resulting in 18363 rows. However, nothing comes up in the display on Answers. Moreover, no error is reported. The instanceconfig.xml file has the following setting:
<PivotView>
<CubeMaxRecords>30000</CubeMaxRecords>
<CubeMaxPopulatedCells>300000</CubeMaxPopulatedCells>
</PivotView>
Even with these settings, Answers just returns a blank page - nothing is displayed in the name of the result set of the report query. Has anyone encountered this problem scenario before?
Any help is much appreciated.
Thanks,
PiyushHi Fiston / Pradeep,
Thanks for your inputs. A few points to note:
-> I am actually not getting any error message in answers or the NQQuery log. Moreover I am not getting any errors related to "query governor limit exceeding in cube generation" also.
-> I have other pivot table type of reports in the same repository that work fine. In fact the report which has this issue even works sometimes - what actually is happening is that if I alter the number of sections from 3 to 4, then the result set changes from 14755 Rows to 18363 Rows and as per the NQQuery.log in both cases the query completes successfully. However, when the result set has 14755 rows, I get to see the output in Answers; however when the result set is 18636 rows, the Answers screen just goes blank and does not show any output or error. This makes me believe that there is some parameter in instanceconfig or the NQSconfig file - I have tried a lot of changes but nothing works !
Any help is much appreciated.
Best Regards,
Piyush -
How to return the result set of multiple select statements as one result set?
Hi All,
I have multiple select statements in my stored procedure that I want to return as one result set
for instance
select id from tableA
union
select name from table b
but union will not work because the result sets datatypes are not identical so how to go about this ?
ThanksYou have to CAST or CONVERT (or implicitly convert) the columns to the same datatype. You must find a datatype that both columns can be converted to without error. In your example I'm guessing id is an int and name is a varchar or nvarchar.
Since you didn't convert the datatypes, SQL will use its data precedence rules and attempt to convert name to an int. If any row contains a row that has a value in name that cannot be converted to an int, you will get an error. The solution is
to force SQL to convert the int to varchar. So you want something like
select cast(id as varchar(12)) from tableA
union
select name from tableb
If the datatypes are something other that int or varchar, you must find a compatable datatype and then convert one (or both) of the columns to that datatype.
Tom -
Creating XML transformation using multiple internal tables
<b>Hi everyone,</b><br />
<br />
<b>I'm trying to transforme 3 internal tables (from customer master data) into a single XML document.</b><br />
<p />
DATA: BEGIN OF wtab OCCURS 0 ,<br />
kunnr LIKE kna1-kunnr, "Customer ID<br />
ktokd LIKE kna1-ktokd, <br />
land1 LIKE kna1-land1, <br />
name1 LIKE kna1-name1, <br />
ort01 LIKE kna1-ort01, <br />
pstlz LIKE kna1-pstlz, <br />
spras_iso LIKE kna1-spras, <br />
smtp_addr LIKE adr6-smtp_addr, <br />
stras LIKE kna1-stras, <br />
END OF wtab.<br />
<br />
DATA: BEGIN OF wtab_o OCCURS 0 ,<br />
kunnr LIKE knvv-kunnr, "Customer ID<br />
vkorg LIKE knvv-vkorg, "Sales organisation<br />
waers LIKE knvv-waers, <br />
END OF wtab_o.<br />
<br />
DATA: BEGIN OF wtab_p OCCURS 0 ,<br />
kunnr LIKE knvp-kunnr, "Customer ID<br />
vkorg LIKE knvp-vkorg, "Sales organisation<br />
parvw LIKE knvp-parvw, <br />
kunn2 LIKE knvp-kunnr,<br />
END OF wtab_p.<br />
<p />
<b>The internal tables are related to each other as follows:*</b><br />
<br />
wtab-kunnr = wtab_o-kunnr<br />
<br />
AND<br />
<br />
wtab_o-vkorg = wtab_p-vkorg<br />
wtab_o-kunnr = wtab_p-kunnr<br />
<br />
<b>I couldn't figure out how to declare this relationship when calling the transformation. Is it possible?</b><br />
<p />
ABAP<br />
<br />
<br />
REFRESH : gt_source_itab.<br />
CLEAR : g_rxml.<br />
<br />
GET REFERENCE OF wtab INTO gs_source_wa-value.<br />
gs_source_wa-name = 'DEBMAS04'.<br />
APPEND gs_source_wa TO gt_source_itab.<br />
<br />
GET REFERENCE OF wtab_o INTO gs_source_wa-value.<br />
gs_source_wa-name = 'E1KNVVM'.<br />
APPEND gs_source_wa TO gt_source_itab.<br />
<br />
GET REFERENCE OF wtab_p INTO gs_source_wa-value.<br />
gs_source_wa-name = 'E1KNVPM'.<br />
APPEND gs_source_wa TO gt_source_itab.<br />
<br />
TRY.<br />
CALL TRANSFORMATION Z_XSLT_CLIENT<br />
SOURCE (gt_source_itab)<br />
RESULT XML g_rxml<br />
OPTIONS xml_header = 'without_encoding'.<br />
CATCH cx_root INTO gs_rif_ex.<br />
<br />
gs_var_text = gs_rif_ex->get_text( ).<br />
MESSAGE gs_var_text TYPE 'E'.<br />
ENDTRY.<br />
<br />
<br />
Transformation Z_XSLT_CLIENT:<br />
<br />
<br />
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl"><br />
<xsl:output indent="yes" encoding="UTF-16" method="xml" version="1.0"/><br />
<xsl:strip-space elements="*"/><br />
<xsl:template match="/"><br />
<DEBMAS04><br />
<xsl:apply-templates select="//DEBMAS04/item"/><br />
</DEBMAS04><br />
</xsl:template><br />
<xsl:template match="DEBMAS04/item"><br />
<IDOC><br />
<xsl:attribute name="BEGIN">1</xsl:attribute><br />
<E1KNA1M><br />
<xsl:attribute name="SEGMENT">1</xsl:attribute><br />
<KUNNR><br />
<xsl:value-of select="KUNNR"/><br />
</KUNNR><br />
<KTOKD><br />
<xsl:value-of select="KTOKD"/><br />
</KTOKD><br />
<LAND1><br />
<xsl:value-of select="LAND1"/><br />
</LAND1><br />
<NAME1><br />
<xsl:value-of select="NAME1"/><br />
</NAME1><br />
<ORT01><br />
<xsl:value-of select="ORT01"/><br />
</ORT01><br />
<PSTLZ><br />
<xsl:value-of select="PSTLZ"/><br />
</PSTLZ><br />
<SPRAS_ISO><br />
<xsl:value-of select="SPRAS_ISO"/><br />
</SPRAS_ISO><br />
<SMTP_ADDR><br />
<xsl:value-of select="SMTP_ADDR"/><br />
</SMTP_ADDR><br />
<STRAS><br />
<xsl:value-of select="STRAS"/><br />
</STRAS><br />
<xsl:apply-templates select="//E1KNVVM/item"/><br />
</E1KNA1M><br />
</IDOC><br />
</xsl:template><br />
<xsl:template match="E1KNVVM/item"><br />
<E1KNVVM><br />
<xsl:attribute name="SEGMENT">1</xsl:attribute><br />
<VKORG><br />
<xsl:value-of select="VKORG"/><br />
</VKORG><br />
<WAERS><br />
<xsl:value-of select="WAERS"/><br />
</WAERS><br />
<xsl:apply-templates select="//E1KNVPM/item"/><br />
</E1KNVVM><br />
</xsl:template><br />
<xsl:template match="E1KNVPM/item"><br />
<E1KNVPM><br />
<xsl:attribute name="SEGMENT">1</xsl:attribute><br />
<PARVW><br />
<xsl:value-of select="PARVW"/><br />
</PARVW><br />
<KUNN2><br />
<xsl:value-of select="KUNN2"/><br />
</KUNN2><br />
</E1KNVPM><br />
</xsl:template><br />
</xsl:transform><br />
<br />
<b>The way the call transformation is now, for each line in table wtab (DEBMAS04) I'm getting all the lines in table wtab_o (E1KNVVM) and table wtab_p (E1KNVPM)</b><br />
<p />
<br />
Thank you for your help,<br />
<br />
Giselle<br />
<p />Hi Giselle,
I think it's possible (using xsl:if for instance), but an easier way is to nest your internal tables declarations (wtab_o inside wtab, kunnr becomes useless, and wtab_p inside wtab_o), and use the SAP standard "ID" transformation (no need for a custom XSL transformation). You'll get a slightly different result, but I don't think you want something very sophisticated.
Sandra -
Internal table for the result area
hey
where do the result area data stored in after the search? is it in internal table??. If so is there any possibility of finding the internal table?
thanks in advanceHi Shailaja,
You can check as pointed by Vijay, which is at the Framework Level.
For Application Level (specific to your PCUI Appl), the QEURY method of your class (assigned to Search Area screen) returns the list of found object keys (based on the search query) to the READ method. The READ method now queries the backend, for the supplied object keys and stores all the result data in export parameter ET_SCREEN_SRTUCTURE.
Now the Framework with the help of One Order Interaction Layer, pumps the data to the Data Context Layer as pointed by Vijay.
So in order to do any data massaging, you can do it at internal table et_screen_structure.
But whatever changes you do in et_screen_structure, will not be commited to backend, without touching the MODIFY method.
Thanks
Harsh -
Exporting Multiple Internal table data to Single Excel file.
Hello Expert,
I want to export more than one internal table data from Web Dynpro Application to single Excel file but in such a way that
each table's data to be get exported to different tabs in (Multiple sheets) that single excel file.
So help me in this matter.
Thank You.
Varun
Moderator message: wrong forum, please post again in "Web Dynpro ABAP".
Edited by: Thomas Zloch on Oct 29, 2010 1:39 PMEach table having different sheet in same CSV file .
A CSV file is a flat file and don't have "Sheets"; you would have to Export to an Excel file, which supports several Sheets in one file.
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Tables listed in Result set field selction tab against Standard Data Objects in MDO configuration
On what basis are the tables gettting filled in the Result set field selction tab against Standard Data Objects in MDO configuration.
Only the handler class is specified before it gets filled.
Vivek.
Tags edited by: Michael ApplebyHi Vivek,
I would also recommend providing the version of the product either in the body of your discussion or in the tags (or both, preferred). If you are installing it on SMP 2.3 or some other platform, please add that as well. I have updated your tags and assigned the correct Category. Since there are so many different technologies in SAP for Mobile, tags and Categories help the helpers find your post and help you find a solution.
Thanks, Mike -
Moving the data from multiple internal tables into a single one
Hello everyone,
I am creating a classical report which uses the following tables.
tables : ekko, ekpo, mara, makt,lfa1.
my input parameter is
Select-options Purchase Order number
Following fields are getting used.
Doc no EKKO-EBELN
Material EKPO-MATNR
Item number EKPO-EBELP
Quantity EKPO-MENGE
Material Group MARA-MATKL
Vendor EKKO-LIFNR
Old Material code MARA-BISMT
Material Desc. MAKT-MAKTX
Vendor name LFA1-NAME1
Now i need to do the following task.
1 Select record from EKKO Using document number.
2 Select record from EKPO using EKKO record using Document no as key.
3 Find out Old Material code of each and every material from Material master.
4 Find out Material description for each and every material from MAKT.
5 Sort record on Vendor, Purchase Order number and Material.
I have defined seperate internal tables for these operation.
Once i have fetched records into these individual internal tables from the corresponding DB tables i need to move these values into a new internal tables which has all the above fields mentioned
I need to move these values into a new internal table because to display the values on the report.
Any idea for the above ? Plz help with a sample example or some relevant.
Regards,
Ranjith NambiarHi
1 Select record from EKKO Using document number.
2 Select record from EKPO using EKKO record using Document no as key.
Use inner join and retrive data into one internal table.for Ex ITAB1
3 Find out Old Material code of each and every material from Material master.
Use ITAB1 with for allentries in MARA table to get the onl materil number populate in to one table.
4 Find out Material description for each and every material from MAKT.
Get the Material desc with the same manner as above,
5 Sort record on Vendor, Purchase Order number and Material.
now sort the ITAB1 as you req.
now Loop on the ITAB1.
and read above 2 tables for old matnr and matner deac and append into another table as you want.
Hope this will help.
Regards,
Hiren Patel -
Multiple internal table display
Hi All,
I have query regarding the internal tables,
Is it possible to display more than one internal table in ABAP List view
one beneath another......in the same page.....?
thanks in advance.....Hi,
Yes, in classical do like this
loop at itab.
write:/
endloop.
loop at itab1.
write:/
endloop.
and in alv refer this code.
*& Form sub_alv_display *
This form displays the output using REUSE_ALV_GRID_DISPLAY *
function module *
FORM sub_alv_display .
*--Local Variables
DATA : lv_index LIKE sy-tabix.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid.
wa_layout1-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout1
it_fieldcat = it_fieldcat[]
i_tabname = 'it_final'
it_events = it_events
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
LOOP AT it_fieldcat INTO wa_fieldcat.
lv_index = sy-tabix.
IF wa_fieldcat-fieldname = 'ERDAT'.
wa_fieldcat-fieldname = 'TITLE'.
wa_fieldcat-seltext_m = text-026.
wa_fieldcat-outputlen = 10.
ENDIF.
MODIFY it_fieldcat FROM wa_fieldcat INDEX lv_index TRANSPORTING
fieldname seltext_m outputlen.
CLEAR : wa_fieldcat.
ENDLOOP.
wa_layout2-no_colhead = 'X'.
wa_layout2-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout2
it_fieldcat = it_fieldcat[]
i_tabname = 'it_total'
it_events = it_event1
TABLES
t_outtab = it_total
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
wa_layout3-no_colhead = 'X'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout3
it_fieldcat = it_fieldcat2[]
i_tabname = 'it_ship'
it_events = it_event2
TABLES
t_outtab = it_ship
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
IF NOT it_final IS INITIAL OR
NOT it_total IS INITIAL OR
NOT it_ship IS INITIAL.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXCEPTIONS
program_error = 1
OTHERS = 2.
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.
ENDFORM. "sub_alv_display
Regards,
Prashant -
Possible to join multiple internal tables ?
Is it possible to join internal tables like this:
itab1:
fields are matnr f1 f2
itab2:
fields are matnr f3 f4
itab3:
fields are matnr f5 f6
required final-itab:
fields are - matnr f1 f2 f3 f4 f5 f6
(which are joined by matnr)
Thanks.Ok, then we need to take all three ITABs and get all of the MATNRs into another internal table, then loop at this internal table and read the records for ITAB1, ITAB2, and ITAB3.
data: begin of imatnr occurs 0,
matnr type mara-matnr,
end of imatnr.
loop at itab1.
imatnr-matnr = itab1-matnr.
collect imatnr.
endloop.
loop at itab2.
imatnr-matnr = itab2-matnr.
collect imatnr.
endloop.
loop at itab3.
imatnr-matnr = itab3-matnr.
collect imatnr.
endloop.
Loop at imatnr.
clear final_itab.
final_itab-matnr = imatnr-matnr.
clear itab1.
read table itab1 with key matnr = imatnr-matnr.
if sy-subrc = 0.
final_itab-f1 = itab1-f1.
final_itab-f2 = itab1-f2.
endif.
clear itab2.
read table itab2 with key matnr = imatnr-matnr.
if sy-subrc = 0.
final_itab-f3 = itab2-f3.
final_itab-f4 = itab2-f4.
endif.
clear itab3.
read table itab3 with key matnr = imatnr-matnr.
if sy-subrc = 0.
final_itab-f5 = itab3-f5.
final_itab-f6 = itab3-f6.
endif.
append final_itab.
endloop.
REgards,
Rich Heilman -
Displaying an internal table with raw data in an ALV
Hi Experts,
Can you please help me out I'm retrieving an ABAP Report List which i submitted to memory, I'm using the function module LIST_FROM_MEMORY to retrieve the list from memory and storing it in an internal table. The problem is i'm struggling to display the List using an ALV coz the internal table contains raw data. Your help wil be much appreciated.My ASCII internal table is empty. Below I have included a code sample of what I want to do.
Type-pools slis.
DATA: MTAB_REPORT_LIST LIKE ABAPLIST OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF MTAB_REPORT_ASCII OCCURS 0,
LINE(255) TYPE C,
END OF MTAB_REPORT_ASCII.
START-OF-SELECTION.
*-- Submit a report. This one is the chart of accounts
SUBMIT ZPRINTREPORT
EXPORTING LIST TO MEMORY " Save list in memory
AND RETURN. " Return control to this program
END-OF-SELECTION.
*-- Get the list from memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = MTAB_REPORT_LIST
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
if sy-subrc <> 0.
write / 'unable 2 retrieve list from memory'.
else.
"REFRESH MTAB_REPORT_ASCII.
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listasci = MTAB_REPORT_ASCII " list converted to ASCII
listobject = MTAB_REPORT_LIST
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
if sy-subrc = 1.
write 'list ASCII list empty'.
else.
WRITE: MTAB_REPORT_ASCII, ' ff'.
" perform build_alv tables MTAB_REPORT_LIST.
endif.
endif.
"CALL FUNCTION 'WRITE_LIST'
" TABLES
" LISTOBJECT = MTAB_REPORT_LIST
" EXCEPTIONS
" EMPTY_LIST = 1
" OTHERS = 2.
FORM build_alv tables MTAB_REPORT_ASCII.
ALV required data objects.
"DATA: w_title TYPE lvc_title,
" w_comm TYPE slis_formname,
" w_status TYPE slis_formname,
" x_layout TYPE slis_layout_alv,
" t_event TYPE slis_t_event,
" t_fieldcat TYPE slis_t_fieldcat_alv,
" t_sort TYPE slis_t_sortinfo_alv.
data int_fcat type SLIS_T_FIELDCAT_ALV.
Layout
x_layout-zebra = 'X'.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'MTAB_REPORT_ASCII'
I_INCLNAME = sy-repid
CHANGING
CT_FIELDCAT = int_fcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
IT_FIELDCAT = int_fcat
I_SAVE = 'A'
TABLES
T_OUTTAB = MTAB_REPORT_ASCII
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
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. -
How to move multiple decision tables values into results data object
Hi Carsten and other experts,
I am building a BRF+ function and have a question, I would probably try to give an example to better explain the issue.
1. Function Signature
Context elements: C1, C2, C3
2. Ruleset has two decision tables DT1 and DT2.
DT1 take C1, C2, C3 as inputs to provide C4 and C5.
DT2 takes C5 takes as inputs to provide C6.
What should be results data object for function to get C4,C5 and C6 as Function Output parameters?
I have tried different combination of structures and table and couldn't figure out how it behaves.
Thank you
KrisThe function gets a result structure with components C4, C5, C6.
In a ruleset assigned to the function you have a rules that calls the two decision tables DT1/2.
Create a structure for DT1 with C4 and C5 as components. Make the structure the result of your decision table.
DT2 has C6 as a result. -
Creation of View from Mutiple Tables (Union of result sets)
Hi,
I have started working on Information Steward very recently and Im working on creating some profiling rules in Data Insight.
I’m working on bringing data in two tables together to apply some common rules, I have tried view option but I’m not sure how to create the views as below without joins.
View should have common columns from Table1 and Table2 so I can perform below rules.
Check uniqueness of primary key column across both the tables. Like Id – Unique in view below
Combination of two different columns should be unique in both the tables. Like First name + Last Name Unique in view
I would like to create a view which is can be done using Aggregator in Information PC and Merger in BODS.
Permenent Employee
Id
First Name
Last Name
Age
salary
6
Sachin
Tendulkar
41
2000
7
Ajay
Jadeja
43
2000
9
Rahul
Dravid
40
2000
Contracting Employee
Id
First Name
Last Name
Age
salary
1
Sourav
Ganguly
41
2000
2
Ajith
Agarkar
38
2000
3
Anil
Kumble
43
2000
View
Id
First Name
Last Name
Age
salary
1
Sourav
Ganguly
41
2000
2
Ajith
Agarkar
38
2000
3
Anil
Kumble
43
2000
6
Sachin
Tendulkar
41
2000
7
Ajay
Jadeja
43
2000
9
Rahul
Dravid
40
2000
Please let me know you thoughts on how this can be achieved in SAP ISThis is not possible in IS. You'll have to create a view at db level. Or merge all data into one table, using DS as you say.
Maybe you are looking for
-
Sharing Music on Different Computer at Home
Okay, so my main computer, the one that had the purchased songs and had list of the song I purchased.. when I plug my iPod into the computer, the iPod icon won't show up in the iTunes, instead, it opened to a new window. So I uninstall to reinstall i
-
Streaming youtube video from my macbook to Apple TV?
Hello ... Can I stream youtube video from my macbook pro (OS X 10.9.2) to Apple TV? with same HD quality, similar to iPad and iPhone. The built-in AirPlay feature is not satisfactory and gives poor video quality. There might be some kind of plugins
-
Any IDOC in CRM available to exchange delivery data through EDI
Hi CRM guyz, Is there any IDOC available post the delivery data with third party from CRM. <b>FYI</b> We are using CRM 5.0. Communication is through EDI signals. Order status(like delivery etc) is flows to CRM from from R/3 Thank you, Pavan Pagolu
-
Regarding special characters in XSLT
hi , i am working on XSLT, as we know that XSLT does not support special characters we need to handle them. can anyone provide me with the entire list of characters that XSLT does not support. I had searched in google but could only find a few. thank
-
Machine and OS: 2007 white plastic iMac with 20" screen and 2 GHz Intel Core Duo, running OSX 10.6.8. The problem: The screen dims itself for no known reason. It is especially noticeable when waking from sleep: for the first second or two after wakin