Read log into Internal table
Hi all,
I am using a transaction CJR2. At the end of this transaction I get a Log. I want to read this log into an internal table.
How will it works.
Please suggest.
Thanks
Sanket sethi.
Hi
If that an Application log then based on object you can get the log in an Internal table.
BAL_log_display.
Similar Messages
-
Error while reading excel file from application server into internal table.
Hi experts,
My requirement is to read an excel file from application server into internal table.
Hence I have created an excel file fm_test_excel.xls in desktop and uploaded to app server using CG3Z tcode (as BIN file type).
Now in my program I have used :
OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
DO.
READ DATASET v_filename INTO wa_tab.
The statement OPEN DATASET works fine but I get a dump (conversion code page error) at READ DATASET statement.
Error details:
A character set conversion is not possible.
At the conversion of a text from codepage '4110' to codepage '4103':
- a character was found that cannot be displayed in one of the two
codepages;
- or it was detected that this conversion is not supported
The running ABAP program 'Y_READ_FILE' had to be terminated as the conversion
would have produced incorrect data.
The number of characters that could not be displayed (and therefore not
be converted), is 445. If this number is 0, the second error case, as
mentioned above, has occurred.
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_CONVERSION_CODEPAGE', was not
caught and
therefore caused a runtime error.
The reason for the exception is:
Characters are always displayed in only a certain codepage. Many
codepages only define a limited set of characters. If a text from a
codepage should be converted into another codepage, and if this text
contains characters that are not defined in one of the two codepages, a
conversion error occurs.
Moreover, a conversion error can occur if one of the needed codepages
'4110' or '4103' is not known to the system.
If the conversion error occurred at read or write of screen, the file
name was '/usr/sap/read_files/fm_test_excel.xls'. (further information about
the file: "X 549 16896rw-rw----201105170908082011051707480320110517074803")
Also let me know whether this is the proper way of reading excel file from app server, if not please suggest an alternative .
Regards,
KarthikHi,
Try to use OPEN DATASET v_filename FOR INPUT IN BINARY mode encoding default. instead of OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
As I think you are uploading the file in BIN format to Application server and trying to open text file.
Regards,
Umang Mehta -
Question about reading csv file into internal table
Some one (thanks those nice guys!) in this forum have suggested me to use FM KCD_CSV_FILE_TO_INTERN_CONVERT to read csv file into internal table. However, it can be used to read a local file only.
I would like to ask how can I read a CSV file into internal table from files in application server?
I can't simply use SPLIT as there may be comma in the content. e.g.
"abc","aaa,ab",10,"bbc"
My expected output:
abc
aaa,ab
10
bbb
Thanks again for your help.Hi Gundam,
Try this code. I have made a custom parser to read the details in the record and split them accordingly. I have also tested them with your provided test cases and it work fine.
OPEN DATASET dsn FOR input IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET dsn INTO record.
PERFORM parser USING record.
ENDDO.
*DATA str(32) VALUE '"abc",10,"aaa,ab","bbc"'.
*DATA str(32) VALUE '"abc","aaa,ab",10,"bbc"'.
*DATA str(32) VALUE '"a,bc","aaaab",10,"bbc"'.
*DATA str(32) VALUE '"abc","aaa,ab",10,"b,bc"'.
*DATA str(32) VALUE '"abc","aaaab",10,"bbc"'.
FORM parser USING str.
DATA field(12).
DATA field1(12).
DATA field2(12).
DATA field3(12).
DATA field4(12).
DATA cnt TYPE i.
DATA len TYPE i.
DATA temp TYPE i.
DATA start TYPE i.
DATA quote TYPE i.
DATA rec_cnt TYPE i.
len = strlen( str ).
cnt = 0.
temp = 0.
rec_cnt = 0.
DO.
* Start at the beginning
IF start EQ 0.
"string just ENDED start new one.
start = 1.
quote = 0.
CLEAR field.
ENDIF.
IF str+cnt(1) EQ '"'. "Check for qoutes
"CHECK IF quotes is already set
IF quote = 1.
"Already quotes set
"Start new field
start = 0.
quote = 0.
CONCATENATE field '"' INTO field.
IF field IS NOT INITIAL.
rec_cnt = rec_cnt + 1.
CONDENSE field.
IF rec_cnt EQ 1.
field1 = field.
ELSEIF rec_cnt EQ 2.
field2 = field.
ELSEIF rec_cnt EQ 3.
field3 = field.
ELSEIF rec_cnt EQ 4.
field4 = field.
ENDIF.
ENDIF.
* WRITE field.
ELSE.
"This is the start of quotes
quote = 1.
ENDIF.
ENDIF.
IF str+cnt(1) EQ ','. "Check end of field
IF quote EQ 0. "This is not inside quote end of field
start = 0.
quote = 0.
CONDENSE field.
* WRITE field.
IF field IS NOT INITIAL.
rec_cnt = rec_cnt + 1.
IF rec_cnt EQ 1.
field1 = field.
ELSEIF rec_cnt EQ 2.
field2 = field.
ELSEIF rec_cnt EQ 3.
field3 = field.
ELSEIF rec_cnt EQ 4.
field4 = field.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
CONCATENATE field str+cnt(1) INTO field.
cnt = cnt + 1.
IF cnt GE len.
EXIT.
ENDIF.
ENDDO.
WRITE: field1, field2, field3, field4.
ENDFORM.
Regards,
Wenceslaus. -
Read DMS document into internal table
Hi,
I have a requirement to read DMS document in binary format into internal table.
and i want to print the data in internal table through SAP spool.
Please let me know how to handle this requirement.
Thanks
SriniHi,
Check scms pakage, FG - SCMS_CONV for conversions..
Regards
Surjit -
Read info about files in specific folder into internal table
Hi Experts
I need to have last modified date and filename information read into an internal table. I need to read in the information of all files in a specific (UNIX) folder (I do not know the name of the single files).
I really hope someone can help.
Thanks a lot
Kind regards,
TorbenHi Guys
Thanks a lot for you input.
I managed to get my program to works as follows:
REPORT ZDELETE_ARCHIVING_FILES.
*Step 1: Get the list of files in the directory into internal table :
DATA: DLIST LIKE EPSFILI OCCURS 0 WITH HEADER LINE,
DPATH LIKE EPSF-EPSDIRNAM,
MDATE LIKE SY-DATUM,
MTIME LIKE SY-UZEIT.
DATA: BEGIN OF FATTR OCCURS 0,
FILE_NAME LIKE EPSF-EPSFILNAM,
FILE_SIZE LIKE EPSF-EPSFILSIZ,
FILE_OWNER LIKE EPSF-EPSFILOWN,
FILE_MODE LIKE EPSF-EPSFILMOD,
FILE_TYPE LIKE EPSF-EPSFILTYP,
FILE_MTIME(12),
END OF FATTR.
DATA: P_PATH(50) TYPE C.
CONCATENATE '/ARCHIVE/' sy-sysid '/archive' INTO P_PATH.
* WRITE: / P_PATH.
DPATH = P_PATH.
*Get files in folder - read into internal table DLIST
*if filenames are longer than 40 characters
*then use FM SUBST_GET_FILE_LIST.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
DIR_NAME = DPATH
TABLES
DIR_LIST = DLIST
EXCEPTIONS
INVALID_EPS_SUBDIR = 1
SAPGPARAM_FAILED = 2
BUILD_DIRECTORY_FAILED = 3
NO_AUTHORIZATION = 4
READ_DIRECTORY_FAILED = 5
TOO_MANY_READ_ERRORS = 6
EMPTY_DIRECTORY_LIST = 7
OTHERS = 8.
IF SY-SUBRC EQ 0.
*Step 2: Read the file attributes into an internal table
*Read info about the files (attributes) into the internal table FATTR
*as we need info about the last time it was changed (MTIME)
LOOP AT DLIST.
CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
EXPORTING
FILE_NAME = DLIST-NAME
DIR_NAME = DPATH
IMPORTING
FILE_SIZE = FATTR-FILE_SIZE
FILE_OWNER = FATTR-FILE_OWNER
FILE_MODE = FATTR-FILE_MODE
FILE_TYPE = FATTR-FILE_TYPE
FILE_MTIME = FATTR-FILE_MTIME
EXCEPTIONS
READ_DIRECTORY_FAILED = 1
READ_ATTRIBUTES_FAILED = 2
OTHERS = 3.
IF SY-SUBRC EQ 0.
FATTR-FILE_NAME = DLIST-NAME.
APPEND FATTR.
ENDIF.
ENDLOOP.
SORT FATTR BY FILE_NAME.
DATA: time(10), date LIKE sy-datum.
DATA: months TYPE i.
DATA: e_file TYPE string.
LOOP AT FATTR.
CLEAR: time, months, e_file.
IF FATTR-FILE_NAME(10) = 'archive_BW'.
*Convert the unix time into readable time
PERFORM p6_to_date_time_tz(rstr0400) USING FATTR-FILE_MTIME
time
date.
*Calculate the number of months between date (MTIME) and current day
*ex 31.03.2009 - 01.04.2009 = 1 month
*ex 01.02.2009 - 01.04.2009 = 2 month
CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_von = date
i_datum_bis = sy-datum
IMPORTING
e_monate = months.
CONCATENATE DPATH '/' FATTR-FILE_NAME INTO e_file.
* WRITE: / FATTR-FILE_NAME,
* FATTR-FILE_SIZE,
* date,
* time,
* sy-datum,
* months,
* e_file.
*Step 3: Delete files where months > 1
IF months > 1.
OPEN dataset e_file for output in text mode encoding default.
DELETE dataset e_file.
CLOSE dataset e_file.
ENDIF. "months > 1
ENDIF.
ENDLOOP.
ENDIF. -
Read Application server file and upload into internal table
Another help needed guys,
My file in the application server is of format
Name Marks 1 Marks 2 Marks 3............
A 10 15 20
The only thing separating the columns is space.
Actually this file was downloaded from an internal table into the app server.
Now I want to load it back into the internal table.
How do I load this into internal table so that each column goes in separate internal table field.
Currently am using cl_abap_char_utilities=>HORIZONTAL_TAB but I can get only the first column name in my field1 of the internal table.
How should I applroach this?
Points will be awarded for useful answers.
Regards
AnkitHi ankit,
i think u have uploaded the tab delimited file in the application sever.
then suppose see if u r file is in the format of name#marks1#marks2#marks3.
then in the program u do like this..
first declare one internal table with one filed.
data:
c_hextab(1) TYPE x VALUE '09'.
data:
begin of t_data occurs 0,
line(256) type c,
endof t_data.
and declare one more intternal table
data:
begin of t_itab occurs 0,
name(15) type c,
marks1(4) type c,
marks2(4) type c,
marks3(4) type c,
endof t_itab.
then
open the file with
OPEN DATASET p_file FOR INPUT IN TEXT MODE.
then between do and endo do like this..
DO.
clear t_data.
READ DATASET p_file INTO t_data.
if sy-subrc ne 0.
exit.
else.
split t_data at c_hextab
into t_itab-name
t_itab-marks1
t_itab-marks2
t_itab-marks3.
append t_itab.
endif.
enddo.
i think it will be helpful to u
Please let me know wht type of file has been uploaded into application server.(tab deleimted, comma separated or something else).
Regards,
Sunil Kumar Mutyala. -
Read local folder, return filenames into internal table
Assume I have 3 files in c:\abc folder:
a1.xls
a2.xls
a6.xls
Is there a fm or code sample to pass in folder name (ie c:\abc) and returns a1.xls, a2.xls and a6.xls into internal table?Use Class CL_GUI_FRONTEND_SERVICES Method DIRECTORY_LIST_FILES to get list of file in a folder . FILE_TABLE will give the table with list of files
data: begin of itab ,
file(26) type c,
end of itab.
data: tab type table of itab.
data : cnt type i.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
EXPORTING
DIRECTORY = 'C:\temp'
* FILTER = '*.*'
* FILES_ONLY =
* DIRECTORIES_ONLY =
CHANGING
FILE_TABLE = tab
COUNT = cnt
* EXCEPTIONS
* CNTL_ERROR = 1
* DIRECTORY_LIST_FILES_FAILED = 2
* WRONG_PARAMETER = 3
* ERROR_NO_GUI = 4
* NOT_SUPPORTED_BY_GUI = 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. -
How to merge All text fiels into 1 text file to read into internal table
Hi dudes,
I have 3 text files in workstation. I need to everytime download these files in my internal table .
But it takes long processing time .ie everytime it opens file read and close.
Do u suggest for better performance for this? Like how i can meage all txt files in 1 txt file and then read once ito internal table.
Hope i m clear to explain u my requirement.
Gain PointsIt actually depends on your requirement(a standard answer from any SAP guy).
Coming back to the question at hand:
a) Can we merge these files ? My question to you :
i) Are you downloading these to your presentation server from application server using WS_DOWNLOAD(I am using 4.5B) or CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD ?
ii) What holds you back ?
b) How do we parse multiple files contained in a single file ?
Keep a delimiter which is unique only for file endings. That should do the trick.
Regards,
Subramanian V. -
Issue with uploading XML file from application server into internal table
i Need to fetch the XML file from the application server and place into internal table and i am getting error message while using the functional module SMUM_XML_PARSE and the error message is "line 1 col 1-unexpected symbol; expected '<', '</', entity reference, character data, CDATA section, processing instruction or comment" and could you please let me know how to resolve this issue?
TYPES: BEGIN OF T_XML,
raw(2000) TYPE C,
END OF T_XML.
DATA:GW_XML_TAB TYPE T_XML.
DATA: GI_XML_TAB TYPE TABLE OF T_XML INITIAL SIZE 0.
DATA:GI_STR TYPE STRING.
data: GV_XML_STRING TYPE XSTRING.
DATA: GI_XML_DATA TYPE TABLE OF SMUM_XMLTB INITIAL SIZE 0.
data:GI_RETURN TYPE STANDARD TABLE OF BAPIRET2.
OPEN DATASET LV_FILE1 FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC NE 0.
MESSAGE 'File does not exist' TYPE 'E'.
ELSE.
DO.
* Transfer the contents from the file to the work area of the internal table
READ DATASET LV_FILE1 INTO GW_XML_TAB.
IF SY-SUBRC EQ 0.
CONDENSE GW_XML_TAB.
* Append the contents of the work area to the internal table
APPEND GW_XML_TAB TO GI_XML_TAB.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
* Close the file after reading the data
CLOSE DATASET LV_FILE1.
IF NOT GI_XML_TAB IS INITIAL.
CONCATENATE LINES OF GI_XML_TAB INTO GI_STR SEPARATED BY SPACE.
ENDIF.
* The function module is used to convert string to xstring
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
TEXT = GI_STR
IMPORTING
BUFFER = GV_XML_STRING
EXCEPTIONS
FAILED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE 'Error in the XML file' TYPE 'E'.
ENDIF.
ENDIF.
IF GV_SUBRC = 0.
* Convert XML to internal table
CALL FUNCTION 'SMUM_XML_PARSE'
EXPORTING
XML_INPUT = GV_XML_STRING
TABLES
XML_TABLE = GI_XML_DATA
RETURN = GI_RETURN.
ENDIF.
READ TABLE GI_RETURN TRANSPORTING NO FIELDS WITH KEY TYPE = 'E'.
IF SY-SUBRC EQ 0.
MESSAGE 'Error converting the input XML file' TYPE 'E'.
ELSE.
DELETE GI_XML_DATA WHERE TYPE <> 'V'.
REFRESH GI_RETURN.
ENDIF.Could you please tel me why the first 8 lines were removed, till <Soap:Body and also added the line <?xml version="1.0" encoding="UTF-8"?> in the beggining .
Becuase there will be lot of XML files will be coming from the Vendor daily and that should be uploaded in the application server and should update in the SAP tables based on the data in the XML file.
what information i need to give to vendor that do not add the first 8 lines in the XML file and add the line in the beggining <?xml version="1.0" encoding="UTF-8"?> ??????
Is there any other way we can do with out removing the lines? -
How to get data of tabulated text file into internal table
hi all,
i want to get data from tabulated text file(notepad) into internal table. i searched in SCN and got lot of post regarding how to convert excel file into internal table but i didnt get posts regarding text file.
thanks
SAchintry:
DATA: BEGIN OF tabulator,
x(1) TYPE x VALUE '09',
END OF tabulator.
READ DATASET file INTO wa.
split wa at tabulator into table itab.
A. -
Function module to get data into internal table from Excel file sheets
Hi,
I have to upload customers from excel file.
we are donloading customer data excel file sheets.
Customer data in 1 sheet, tax data the other sheet of same excel file, Customer master-Credit data in other sheet of same excel file.
so i have 3-4 sheet in one excel file.
now my requirement is to get the data from excel file into internal table.
is there any function module.
Thanks & RegardsI am sending you the idea with an example how you can upload data from an EXCEL file into an internal table. I am not sure if you can take data from different sheet in the same EXCEL file. I think that this is not possible (try it )
Upload the data into an internal table, like the way that I am describing in the above:
DATA: L_MAX_COL_NB TYPE I.
DATA: l_file_name LIKE RLGRAP-FILENAME.
Just to be sure that is the correct type for the FM.
l_file_name = P_FILE_NAME.
L_MAX_COL_NB = 58. "Maximum nb of colums that the FM can read.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = l_file_name
I_BEGIN_COL = 1
I_BEGIN_ROW = 2
I_END_COL = L_MAX_COL_NB
I_END_ROW = 9999
TABLES
INTERN = PT_EXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
ENDIF.
Now you should upload the data into your own itab. The Function Module will return to you all the an itab
from all fields and columns. Define the structure of the uploading file into SE11 - Data Dictionary. Then read the fieldcatalog of this structure. In the code that I am sending to you, I am insearting an empty line into the internal table and then I am assigning this line into a corresponding field-symbol. Then I am able to change the working area - so and the line of the itab. Propably you could you the statement APPEND INITIAL LINE TO (your_table_name) ASSIGNING <your_field_symbol>, but the example was written in an old SAP version.
FIELD-SYMBOLS:
<F_REC> LIKE WA_UPLOAD_FILE, "working are of the uploading file
<F_FIELD> TYPE ANY.
DATA: COLUMN_INT TYPE I,
C_FIELDNAME(30) TYPE C.
PERFORM GET_FIELDCATOLG TABLES FIELDCAT
USING 'ZECO_CHARALAMBOUS_FILE'.
LOOP AT PT_EXCEL.
AT NEW ROW.
ASSIGN WA_UPLOAD_FILE TO <F_REC>.
ENDAT.
COLUMN_INT = PT_EXCEL-COL.
READ TABLE FIELDCAT INTO WA_FIELDCAT INDEX COLUMN_INT.
CONCATENATE '<F_REC>-' WA_FIELDCAT-FIELDNAME INTO C_FIELDNAME.
ASSIGN (C_FIELDNAME) TO <F_FIELD>.
<F_FIELD> = PT_EXCEL-VALUE.
AT END OF ROW.
APPEND WA_UPLOAD_FILE TO GT_UPLOAD_FILE.
CLEAR WA_UPLOAD_FILE.
ENDAT.
ENDLOOP.
With Regards
George
Edited by: giorgos michaelaris on Mar 4, 2010 3:44 PM -
Read statement in internal table.
PLease help me to figure out what a read statement does???
Please show me through examples how a read statements selects data from a table ,,,puts into internal table & finally we are able to read it through work area????
thanx... <REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Mar 10, 2008 7:27 PMHey saswat ,
just wanted to give a simplified example of ur query , if not understood please ask
REPORT Z_PRGM_TRY_READ NO STANDARD PAGE HEADING.
TABLES : MARA , MARD.
SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.
TYPES : BEGIN OF LT_MARA ,
MATNR LIKE MARA-MATNR ,
ERSDA LIKE MARA-ERSDA ,
MBRSH LIKE MARA-MBRSH ,
END OF LT_MARA .
DATA : TT_MARA TYPE STANDARD TABLE OF LT_MARA INITIAL SIZE 0 ,
WA_MARA TYPE LT_MARA .
TYPES : BEGIN OF LT_MARD ,
MATNR LIKE MARD-MATNR ,
WERKS LIKE MARD-WERKS ,
LGORT LIKE MARD-LGORT ,
PSTAT LIKE MARD-PSTAT ,
END OF LT_MARD.
DATA : TT_MARD TYPE STANDARD TABLE OF LT_MARD INITIAL SIZE 0 ,
WA_MARD TYPE LT_MARD.
TYPES : BEGIN OF LT_FINAL ,
MATNR LIKE MARA-MATNR ,
ERSDA LIKE MARA-ERSDA ,
MBRSH LIKE MARA-MBRSH ,
WERKS LIKE MARD-WERKS ,
LGORT LIKE MARD-LGORT ,
PSTAT LIKE MARD-PSTAT ,
END OF LT_FINAL .
DATA : TT_FINAL TYPE STANDARD TABLE OF LT_FINAL INITIAL SIZE 0 ,
WA_FINAL TYPE LT_FINAL .
SELECT MARA~MATNR
ERSDA
MBRSH
INTO CORRESPONDING FIELDS OF TABLE TT_MARA FROM MARA WHERE MARA~MATNR IN S_MATNR .
SELECT MARD~MATNR
WERKS
LGORT
PSTAT
INTO CORRESPONDING FIELDS OF TABLE TT_MARD FROM MARD
FOR ALL ENTRIES IN TT_MARA
WHERE MATNR = TT_MARA-MATNR.
LOOP AT TT_MARA INTO WA_MARA.
READ TABLE TT_MARD INTO WA_MARD WITH KEY MATNR = WA_MARA-MATNR .
IF SY-SUBRC = 0.
WA_FINAL-MATNR = WA_MARA-MATNR .
WA_FINAL-ERSDA = WA_MARA-ERSDA.
WA_FINAL-MBRSH = WA_MARA-MBRSH.
WA_FINAL-WERKS = WA_MARD-WERKS.
WA_FINAL-LGORT = WA_MARD-LGORT.
WA_FINAL-PSTAT = WA_MARD-PSTAT.
APPEND WA_FINAL TO TT_FINAL.
CLEAR WA_FINAL.
ENDIF.
ENDLOOP.
LOOP AT TT_FINAL INTO WA_FINAL.
WRITE : / WA_FINAL-MATNR , WA_FINAL-ERSDA , WA_FINAL-MBRSH , WA_FINAL-WERKS ,
WA_FINAL-LGORT , WA_FINAL-PSTAT.
ENDLOOP. -
Hi Experts,
I am new comer to ABAP, have some very important task to be done, need help from all of you. I have a program which displays the results(inform about the infocubes). I want to insert the output of this prgm into an internal table, I am looking lot into the documentation, but so far not much help and i am not able to execute it. And one more task, I want to join this internal table and one database table and get the result, my question is , Is it possible to join this internal table and database table based on some common field.
Any help will be of grt help
Thanks,
Hem.Hi,
For joining internal table with database table,you need to write the logic as below.
This is the pseudo code.
select * from database into table itab2 where condition.
loop at itab1 into wa1.
move-corresponding wa1 to wa3.
loop at itab2 into wa2 where field = wa1-field.
move-corresponding wa2 to wa3.
endloop.
append wa3 to itab3.
endloop.
1. select the required data from database table into internal table.
2. loop the first internal table which you already have.
3. Based on the key fields in these two internal tables[database],place the condition in READ or LOOP statement for the second internal table inside the loop of the first internal table.
4. If there are more records in second internal table for a single record in first internal table,then use LOOP the second internal table within the first internal table.Otherwise, read the second internal table within the first internal table.
5.Then move the corresponding fields from both the internal tables inside the loop to third internal table.Append the record to the third internal table.
Hope it helps.
Regards,
J.Jayanthi -
Collect message into internal table
Hi,
does any one knows how BAPIs or CALL TRANSACTIONs collect messages into internal table.
My problem is that some BI with CALL TRANSACTION doesn't collect right message into return table and I would like to collect this last message after CALL TRANSACTION and therefore be sure that everything went OK.....
thx
mariohi
good
check this
Call Transaction p_trans using ZBDC_Table
Mode p_mode
Update p_update
Messages into p_messages.
Move sy-subrc to w__subrc.
Scan the messages in YDCRAISES to see if we need to
change the message class.
Loop at p_messages.
Select single msgtyp
into w__msgtp
from zdcraise
where tcode = p_messages-tcode and
msgid = p_messages-msgid and
msgnr = p_messages-msgnr.
If sy-subrc = 0.
Move w__msgtp to p_messages-msgtyp.
Modify p_messages.
EndIf.
EndLoop.
Dump the message table ?
If w__ydcset-dumpmsg = True.
thanks
mrutyun^ -
READ CHECKBOX FROM INTERNAL TABLE
can anyone tell me how to read in an internal table whether checkbox are marked or not....
i m finding difficulty in identifiyng my checkboxes as marked or not....dynamically....
Thanks in Advance.......
KARTIKEYHi,
are u using ALV LIST or GRID?
Find the sample code.
TYPES:
BEGIN OF ty_output,
chk TYPE c,
number TYPE i,
name(20) TYPE c,
END OF ty_output.
DATA: gt_output TYPE STANDARD TABLE OF ty_output,
gs_output TYPE ty_output.
<<populate the internal table>>
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
I_STRUCTURE_NAME =
is_layout = wa_layout
it_fieldcat = it_fieldcatalog
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
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 =
TABLES
t_outtab = gt_output
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
*& Form USER_COMMAND
FORM user_command USING p_ucomm TYPE sy-ucomm
p_selfld TYPE slis_selfield.
CASE p_ucomm.
WHEN 'HELLO'.
loop at gt_output into gs_output where chk = 'X'.
< <ur code>>
endloop.
ENDCASE.
ENDFORM.
Note: HELLO is a button in the PF status,
Regards,
Niyaz
Maybe you are looking for
-
Is anyone having problems with apple mail since upgrading to Yosemite?
MacBook Pro 15", mid 2012 running Yosemite 10.10.1 - ever since upgrading to Yosemite, I have a problem with Apple Mail which is that the from address persists on my screen after I close the email. I have to quit mail and sometimes even restart to g
-
My ios 6 album is still hidden on my facebook account.
I already access the private settings to allow my photos to my facebook account, But still i cant see my ios6 photo album just like before. What will I do? I tried to restart the location and privacy settings but still the ios6 album didnt work. What
-
Open a doxc word document on a Mac OS 10.6.8
How can I open a Microsoft Word .docx document on my Mac with an older verision of Word?
-
Already had some photos imported from my camera (Canon T4i) in iphoto, I seem to have lost (?) 110 photos from yesterday. The folder they were in is not showing them anymore. Photo stream doesn't help bring them back, in fact dropping them into a new
-
Hi, my AuthenticationFilter will not be invoked if a session-timeout occurs. I thougt this ist the place to redirect to the login-page agein or a timeout-page? That's my code: <filter> <filter-name>MyFacesExtensionsFilter</filter-name> <filter-class>