Internal table - WRITING ON SCREEN with position
Hi I want to write a report with an internal table .
But the internal table should not be seen at the left corner of the screen as it usually is. but it should be displayed at the column that I specify.
My display is
Itab.
A1
A2
A3
A4
I want
Itab
__________________A1
__________________A2
__________________A3
__________________A4
Hi,
If you want to display the output in desired location. You should use the below code :
write :/18 itab-fieldname,40 itab-fieldname, etc....
Thanks,
Sriram Ponna.
Similar Messages
-
Display 2 different structured internal tables in single screen using ALV
Hi,
I have two internal tables. Both has different structures. My requirement is to display both the internal tables in single screen using ALV Grid but NOT using OO ALV Grid display.
Is there any way of spliting the Final ALV display screen into two with two different headers and details as shown below.
Header1 for internal table 1
Data of internal table 1
Header1 for internal table 2
Data of internal table 2
Can anyone suggest a better way to display this.
Regards,
Senthilhi
first think i can say ALV GRID means only for OO ALV it is not possible to display two I.T. data in singr report screen.
better to use of the fm: REUSE_ALV_BLOCK_LIST_DISPLAY
so that u can display both I.T. data in separate report list under single screen
Check the example programs:
BALVBT01 Testprogram ALV: Block list
BCALV_TEST_BLOCK_LIST Program BCALV_TEST_BLOCK_LIST
Regards,
deepak -
Upload data from Internal table to text file with '~' separator
can anyone help me to download data from internal table to flat file with '' separator. GUI_DOWNLOAD is not working in my case ....like for '' separator
Here it is
REPORT zkb_test1.
TYPE-POOLS: truxs.
DATA: i_scarr TYPE TABLE OF scarr,
i_conv_data TYPE truxs_t_text_data.
SELECT * FROM scarr INTO TABLE i_scarr.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = '~'
TABLES
i_tab_sap_data = i_scarr
CHANGING
i_tab_converted_data = i_conv_data
EXCEPTIONS
conversion_failed = 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.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = 'C:\Test1.txt'
filetype = 'ASC'
CHANGING
data_tab = i_conv_data
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Regards
Kathirvel -
Internal table in Excel output with Header and Total
Hi All,
I have a selection-screen of a report where there is option to specify the path of a file to be stored in local PC. This Report gives output in ALV format which displays header and total of columns.
Now, the requirement is, when the user specifies a path for the file in selection screen it should download in the specified location with header and total row into an excel format.
The issue is, I have the internal table with data without total and header row and the total is getting displayed in the screen through ALV feature. I am not sure, how to give the same output in downloaded excel with header row and total as it is displayed on screen.
Please let me know, if you have any suggestions.
Thanks & Regards,
Anshumita.try using TOP OF PAGE event and write the number of records in the header part.
hope this will help. -
Upload data from Excel to internal table without using Screen
Hi,
My reqirment is to read the excel input data and then upload it to internal table for further proceeing but without using selection input screen. I mean can I mention the fixed file name and the path in the function module iself for the input file.1.First create one internal table as u have created ur EXCEL file.
e.g: if ur EXCEL file contains 3 fields col1 col2 and col3.
data: begin of wa,
col1(10),
col2(10),
col3(10),
end of wa,
itab like standard table of wa.
data: filename type string 'C:\FOLDER\DATA.XLS'
If u dont want to use the screen, then pass the file name directly to the GUI_UPLOAD FM.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = filename
FILETYPE = '.XLS'
tables
data_tab = itab
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
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
This will serve ur puspose.
loop at itab into wa.
write: / wa-col1,wa-col2,wa-col3.
endloop.
Thanks & Regards
Santhosh -
Need to display Internal table records on screen without using table contro
Hi Experts,
I have a requirement to display internal table on screen which is having three columns (Material no, Serial No and quantity).
But I can't use table control as it is not supported by hand held devices.
They are going to use this transaction on hand held devices.
Thanks In advance.
GauravYou should be able to use the good old STEP LOOP processing for this... create your three fields in the row then convert them to a STEP-LOOP.
You can look up in the help how to work with STEP-LOOPs if you are not familiar with it. It was the way to manage table-like information before the age of table controls -
How to export internal table and pass the internal table to another screen?
Hi,
I have a sql SELECT statement that select data from table into internal table. I would like to export out the internal table and pass to another screen and display the data in ALV list. How to export it out? I try but the error given was " The type of "OUT_SELECT_ITAB" cannot be converted to the type of "itab_result".
Another question is, how to pass the internal table that i export out from the function module to another screen?
Here is the code
==============================================================
FUNCTION ZNEW_SELECT_ZSTUD00.
""Local Interface:
*" IMPORTING
*" REFERENCE(IN_SELECT_YEAR) TYPE ZSTUD00-EYEAR
*" EXPORTING
*" REFERENCE(OUT_RESULT) TYPE CHAR9
*" REFERENCE(OUT_SELECT_ITAB) TYPE ZSTUD00
*& Global Declarations
DATA: itab TYPE ZSTUD00,
itab_result TYPE TABLE OF ZSTUD00.
*& Processing Blocks called by the Runtime Environment
itab-eyear = IN_SELECT_YEAR.
SELECT *
FROM ZSTUD00
INTO TABLE itab_result
WHERE eyear = IN_SELECT_YEAR.
IF sy-subrc = 0.
out_result = 'Success'.
OUT_SELECT_ITAB = itab_result.
ELSE.
out_result = 'Fail'.
ENDIF.
ENDFUNCTION.
===============================================================
Please advise. Thanks
Regards,
RaydenHi Nagaraj,
I try to change it in Tables tab page but it state that TABLES parameters are obsolete. when i "Enter". I try to "Enter" again. it seem to be ok but it stil give me the same error.
================================================================
FUNCTION ZNEW_SELECT_ZSTUD00.
""Local Interface:
*" IMPORTING
*" REFERENCE(IN_SELECT_YEAR) TYPE ZSTUD00-EYEAR
*" EXPORTING
*" REFERENCE(OUT_RESULT) TYPE CHAR9
*" TABLES
*" OUT_SELECT_ITAB STRUCTURE ZSTUD00
*& Global Declarations
DATA: itab TYPE ZSTUD00,
itab_result TYPE TABLE OF ZSTUD00.
*& Processing Blocks called by the Runtime Environment
itab-eyear = IN_SELECT_YEAR.
SELECT *
FROM ZSTUD00
INTO TABLE itab_result
WHERE eyear = IN_SELECT_YEAR.
IF sy-subrc = 0.
out_result = 'Success'.
OUT_SELECT_ITAB = itab_result.
ELSE.
out_result = 'Fail'.
ENDIF.
ENDFUNCTION.
===============================================================
regards,
Rayden -
Passing values to an internal table and use it with the table painter
Hi,
I have seen this topic here before but the answers didn't help me. Maybe I,m doing something wrong.
The problem is that I defined the following structure on the |Types| tab of the |Global Definitions| section:
TYPES: BEGIN OF DETAILS,
EBELP TYPE EKPO-EBELP,
BSMNG TYPE EBAN-BSMNG,
LFDAT TYPE RM06P-LFDAT,
END OF DETAILS.
Then defined the following definition on the |Global Data| section:
WA_DETAILS TYPE STANDARD TABLE OF DETAILS WITH HEADER LINE
The problem is that when I try to assign a value to one of the fields in the program code like this:
LOOP AT WA_EKPO.
WA_DETAILS-EBELP = WA_EKPO-EBELP.
WA_DETAILS-EMATN = WA_EKPO-EMATN.
MODIFY WA_DETAILS.
ENDLOOP.
gives me the following error:
"WA_DETAILS" is not an internal table -the "OCCURS n" specification is missing.
Then if I add the "OCCURS 10" to the definition of the Global Data the error "OCCURS 10" is not expected.
How can I define, assign values and use as a parameter an internal table defined with types for use it with the table painter?Hi,
if it is one record in wa_details. you can directly write as follows..
REPORT ZCR_TEST1 .
TYPES: BEGIN OF details,
ebelp TYPE ekpo-ebelp,
bsmng TYPE eban-bsmng,
lfdat TYPE rm06p-lfdat,
ematn TYPE ekpo-ematn,
END OF details.
DATA: wa_details TYPE STANDARD TABLE OF details WITH HEADER LINE,
wa_ekpo TYPE STANDARD TABLE OF details WITH HEADER LINE.
wa_details-ebelp = '1'.
append wa_details.
wa_ekpo-ebelp = '3'.
append wa_ekpo.
LOOP AT wa_ekpo.
wa_ekpo-ebelp = wa_details-ebelp.
wa_ekpo-ematn = wa_details-ematn.
modify wa_ekpo.
endloop.
Normally it wont be one record, so u need to put <b>read statement with key</b> in LOOP and ENDLOOP.
Regards,
Sriram -
About finding internal tables to manage screen changes
Dear experts,
I am working to enhance ME51 ME52 in order to allow storing of some customer fields in
screen 111 using MEREQ001.
How can i know which internal table i should use in order to define the screen fields in screen painter
ex in Name what i will give as <internaltable>-<fieldname>.How can i know in which structure data is going.
Regards,
Aditya SharmaTry this :
1-Re: enhancements MEREQ001 in purchase requisition
2-http://sap.niraj.tripod.com/id63.html
Regards
Neha -
To show data from internal table on selection Screen
HI,
please solve my problem.
i am taking the LIFNR from MSEG in one internal table
AND LIFNR FROM MY ZTABLE in other internal table
after this READ the table and take the data in
LIFNER2
my condition is:
{READ TABLE it_mseg WITH KEY mblnr = it_mkpf-mblnr.
i_DATA-lifnr = it_mseg-lifnr.
Read table it_ZTMM_LOG_REQ_HDR with key repid = it_ztmm_reporting-repid.
i_data-lifnr1 = it_ZTMM_LOG_REQ_HDR-lifnr.
if i_data-lifnr = ' ' .
i_data-lifnr2 = i_data-lifnr1.
else.
i_data-lifnr2 = i_data-lifnr.
endif.}
the LIFNR3 is in my final table
the lifnr3 field i have to show on selection sceen
the it_mseg is not my 1st selection condition.
Regards,
Pankaj VashistaPankaj,
It is always better to have even the MJHAR in the where/read with key clause as there is a possibility of same material doc number getting repeated in two fiscal years.
K.Kiran. -
To send an Internal Table Content as email with type 'XLS'
Hi,
I have an Internal Table with 1000 records and would like to send them as an email with type as EXCEL.
Please share your experience.
Thank You,
Tk.
Moderator Message: Please (re)search before posting your question.
Edited by: Suhas Saha on Nov 11, 2011 10:44 AMHi,
Please check below link. This will give you many examples to do that.
[http://www.google.com.au/search?q=site%3Asap.comsendexcelasattachment&ie=utf-8&oe=utf-8]
Thanks.
Ravi -
Download internal table as text file with comma separation
hi all
I wanted text file separated by comma. I used the CSV function module, but the result is separeted by semicolon,instead i need comma.
Kindly suggest some solution.
Thanks
Subhause this fm to convert to csv file
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ','
TABLES
I_TAB_SAP_DATA = ITAB_FINAL
CHANGING
I_TAB_CONVERTED_DATA = ITAB_OUTPUT
EXCEPTIONS
CONVERSION_FAILED = 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.
itab_output is of type ITAB_OUTPUT TYPE TRUXS_T_TEXT_DATA,
and then download using gui_download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = W_FILENAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = ITAB_OUTPUT
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22. -
Error when displaying a field on Screen with Table Control
Hi,
It is going to 'Dump' when I am trying to display data on the screen with the help of Table Control. From the dump, What I have observed is , there is a field 'ZTSV_FSRDATA-ANZFEHLER'. If this field has negative value, then it is going to 'Dump' saying that the length is not enough. If it has a positive value then it is working fine. But the type of the field in the Internal table & on the screen are same.
Please help me to resolve this error.
I am posting here the Dump message also:
A conversion error occurred while the program was trying todisplay data on the screen.
The ABAP output field and the screen field may not have the same format.
Some field types require more characters on the screen thanin the ABAP program. For example, a date field on a screen needstwo characters more than it would in the program. When attempting to display the date on the screen, an error will occur that triggers the error message.
Thanks,
Sreenivas Reddy Maddi.Hi Sreenivas,
Refer this thread:
how to display negative values in a screen field of a screen
Re: negative values not allowed
Regards,
Sampath -
Dynamic Internal Table with Dynamic Fields
Hi all,
My scenario is fairly simple----
--> End user clicks a button on screen and he gets the list of HR tables.
--> Then selects a table and list of all the fields for that table gets displayed.
--> He/she selects the fields they want data to be retrieved for.
So, the requirement is, the dynamic internal table should get created with the fields selected.
The select statement should only retrieve fields which were selected by the end user
and from the table selected by the end user.
I believe the fields selected by end user can be passed by a variable of type string.
something like this---
select (fields)
from (p_table) " Table selected by end user
into dynamic internal table. " should contain columns selected by end user"
Appreciate your inputs and guidance.
Warm regards,
Hari KiranTYPE-POOLS :ABAP.
Parameters P_TAB TYPE DDOBJNAME.
DATA : GO_LINE_TYPE TYPE REF TO CL_ABAP_STRUCTDESCR,
GO_TABLE_DESC TYPE REF TO CL_ABAP_TABLEDESCR,
GS_COMPONENTS TYPE ABAP_COMPONENTDESCR,
GT_COMPONENTS TYPE ABAP_COMPONENT_TAB,
GR_TAB TYPE REF TO DATA,
GT_FIELDS TYPE TABLE OF DFIES WITH HEADER LINE.
FIELD-SYMBOLS: <GT_TABLE> TYPE TABLE,
<GS_TABLE> TYPE ANY,
<GV_VALUE> TYPE ANY.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
TABNAME = P_TAB
* FIELDNAME = ' '
* LANGU = SY-LANGU
* LFIELDNAME = ' '
* ALL_TYPES = ' '
* GROUP_NAMES = ' '
* UCLEN =
* IMPORTING
* X030L_WA =
* DDOBJTYPE =
* DFIES_WA =
* LINES_DESCR =
TABLES
DFIES_TAB = GT_FIELDS
* FIXED_VALUES =
EXCEPTIONS
NOT_FOUND = 1
INTERNAL_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.
LOOP AT GT_FIELDS.
CLEAR GS_COMPONENTS.
GS_COMPONENTS-NAME = GT_FIELDS-FIELDNAME.
GS_COMPONENTS-TYPE ?= CL_ABAP_STRUCTDESCR=>DESCRIBE_BY_NAME( GT_FIELDS-ROLLNAME ).
APPEND GS_COMPONENTS TO GT_COMPONENTS.
ENDLOOP.
GO_LINE_TYPE = CL_ABAP_STRUCTDESCR=>CREATE( GT_COMPONENTS ).
GO_TABLE_DESC = CL_ABAP_TABLEDESCR=>CREATE( GO_LINE_TYPE ).
CREATE DATA: GR_TAB TYPE HANDLE GO_TABLE_DESC.
ASSIGN: GR_TAB->* TO <GT_TABLE>.
SELECT * FROM (P_TAB) APPENDING CORRESPONDING FIELDS OF TABLE <GT_TABLE>.
LOOP AT <GT_TABLE> ASSIGNING <GS_TABLE>.
NEW-LINE.
DO.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE <GS_TABLE> TO <GV_VALUE>.
IF SY-SUBRC NE '0'.
EXIT.
ENDIF.
WRITE : <GV_VALUE>.
ENDDO.
ENDLOOP. -
Performance with internal tables
Hi everybody,
I'm having trouble with the performance of a report.
The reports selects data out of many different tables and merges them together in one extraction file. (I would really like it to be executable in dialog task, because I don't want to write the file on the application sever)
I've done what I could using runtime analysis to improve performance of the db accesses. Now 97% of runtime is consumed by abap.
I'm using several internal tables which will have many entries, and at the moment I'm using nested loops to gather the information out of the internal tables into one extraction file. (Reading the internal tables with key is not always possible, I do this whenever possible)
I've tried to use loop... assigning <fs> instead of loop... into, but it doesn't really help too much.
Any other suggestions?
Thank you for your help, regards, Kathrin!Hi,
Some of these might be able to help for improving the performance.
1. Read table with key using binary search.
2. While comparing two internal tables, user Kernal
method. Eg: If I_TAB1[] = I_TAB2[]. Enfif.
3. Instead of appending records within loop/endloop,
use 'Append lines of'.
4. When populate different internal tables, try to create
with key field which will make a big difference while
accessing the data.
5. Sort the internal tables.
6. Use Case/Endcase in place of If/Endif.
7. While making values negative, use 0 - <field>, in
place of <field> * -1.
8. If the field structures are similar in two internal
tables, for appending records use I_TAB2[] = I_TAB1[].
9. After the complete usage of internal tables, release
the resources using FREE/FREFRESH <internal table>.
10. For data extraction, use field by field selection
from database.
11. Try to avoid using 'ALL ENTRIES'. If using and make
sure that the ref.internal table have entries.
12. Try using Inner Join using Foriegn key fields.
13. To get sum or count use Aggregate functions.
14. Try to use Views if need appropriately.
Hope this helps.
Gopakumar
Maybe you are looking for
-
Printing a document created in FB60
Hello, i need to print a form which corresponds to the bill created in FB60. How can i do this. thx
-
Blackberry world connection error
Good afternoon I am trying to access blackberry world but get the error 'an error has occurred and blackberry world must close. Try waiting a few minutes and then re-open Blackberry world'. I have seen several recommendations to turn off wifi but I a
-
Intercompany with Risk management
Hi SAP Prof, These is an issue with intercompany with multiple line items and each line item belongs to different company code... I have created intercompany sales order with multiple items(Each item belong to different Ccode) and i ha
-
Dear All, When the sales posting(invoice,returns etc) is triggered later in SAP PI/XI it is successful. Once it reached ECC system the idoc's are successfull but the delivery is not created. Please find attached images for your reference. It is basic
-
TS4407 The problem is that iPhoto quits as well.
System prefs quits after opening the screensaver pane. The solution according to Apple is to open iPhoto and move stuff in the events window, The problem I have is that iPhoto quits as well. Appears that the Finder is not working right