Smartform loop into internal table problem
hello experts,
i am doing an example given in **************** regarding smartforms. I am getting problem which doing the smartforms . please help me.
http://****************/Tutorials/Smartforms/SFMain.htm
in that i am doing the program
Working with loop.
I have done exactly as the screen shots in the program.
Now in the main window i created a loop.
in that loop i am not getting the option internal table.
But it is showing as operand . It is in the data tab of the loop.
I searched the all the tabs in the loop but did not find the option internal table.
so then i ticked the operand and i did as speified in the screen shots.
it_tab into fs_tab
Then i created a text and then placed &fs_tab-vbeln& etc.
then i executed the smartform now in the output i am not getting the sales order number , item etc.
The output is showing like
&fs_tab-vbeln& &fs_tab-posnr& etc.
please guide me how to get the internal table option in the loop. And also tell me how to rectify this problem
thanks for all the replies.
I will give all at the time of closing my thread.
Hi Sravanthi -> in loop node i am not getting the internal table insted of that i am getting operand in the data tab.
This is my main problem.I dont why operand is comming there.
my version is 4.7e
Hi Karthik and swati -> i simply hard coded the statements in the text as shown in the example.
Now i will try with the add field.
But please tell me why i am not getting internal table option in loop.
Similar Messages
-
Bdc upload file data into internal table problem with gui_upload fm
Hello experts,
my coding is like this ..
data : begin of itab occurs 0 .
field1 like mara-matnr,
field2......
etc,
end of itab.
data: file1 type string.
parameter :file like rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
mask = space
field_name = 'FILE'
CHANGING
file_name = file.
START-OF-SELECTION.
FILE1 = FILE . "HERE I AM PASSING INTO STRING
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = FILE1
FILETYPE = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = itab. " here the data is not populating from the file , it is giving the error like speified table not found.
HERE i am getting the message like "specified table name not recgonised" . the data is not populating into the itab from the file.
file structure is same as the internal table.
I stored the file as .txt( ie in notepad).
my file is like this..
10000 200 323 sunndarrr.......
i had a problem with this bdc , i am getting like "specified table name not recgonised" in the fm gui_upload while debugging.
when i am using the ws_upload it is working fine.
please guide me where i have done the mistake.
thank you so much for all the replies.Hi,
Have a look on the following code.
TABLES: kna1.
DATA: BEGIN OF itab1 OCCURS 0,
str(255),
END OF itab1.
DATA: itab2 TYPE kna1 OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'D:\ABAP EVE\ffile1.txt'
filetype = 'ASC'
TABLES
data_tab = itab1
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
OTHERS = 11.
IF sy-subrc <> 0.
WRITE:/ 'sorry'.
ELSE.
LOOP AT itab1.
SPLIT itab1-str AT ',' INTO itab2-kunnr itab2-name1.
APPEND itab2.
ENDLOOP.
IF sy-subrc = 0.
LOOP AT itab2.
WRITE:/ itab2-kunnr,itab2-name1.
INSERT INTO kna1 VALUES itab2.
ENDLOOP.
IF sy-subrc = 0.
WRITE:/ 'inserted'.
ELSE.
WRITE:/ 'not inserted'.
ENDIF.
ELSE.
WRITE:/ 'fail'.
ENDIF.
ENDIF.
Flat file:
10001,Sadney
10003,Yogesh
20005,Madan
1.U need to define internal table with one field of max size
2.upload the flat file data into that internal table
3.split that internal table data into another internal table(having fields)
<REMOVED BY MODERATOR>
thanks,
Chandu
Edited by: Alvaro Tejada Galindo on Apr 30, 2008 12:17 PM -
Problem to upload the data into internal table record length more than 6000
Hi all
I stuck with this problem from past 3 days. I have to upload the data from excel sheet. iam making it tab delimited and trying to upload from gui_upload. but in the structure of file, we have, one field of 4000 characters, and other fields of 255 characters.
how can i upload this into internal table . From excel sheet or from tab delimeted or any other format? or any special function module is there? while iam doing this its truncating the datat 255 characters and not uploading the other fields also...
can any one of you help me out. ASAP
thnks in advancefrom one of the forum iam just pasting code which it is used in lsmw, try the same logic in ur code hope it can work.
you have to create multiple lines with do...enddo loop., like this:
(assuming excel_long_text-text is 924 characters long, 7 lines X 132 char)
__GLOBAL_DATA__
data: offset type i,
text_132(132) type c.
__BEGIN_OF_RECORD__ Before Using Conversion Rules
Rule : Default Settings Modified
Code: /sapdmc/ltxtl = init_/sapdmc/ltxtl.
CLEAR offset.
DO 7 TIMES.
text_132 = excel_long_text-text+offset(132).
offset = offset + 132.
__END_OF_RECORD__ After Using Conversion Rules
Rule : Default Settings Modified
Code: transfer_record.
ENDDO.
also check this
COMMIT_TEXT
To load long text into SAP
READ_TEXT
To load long text into SAP -
Problem in collecting Spool data into internal table
Hi ,
i need to download spool request data into internal table,
after collecting i need to loop it and delete some records,
for this i am using Fm RSPO_RETURN_ABAP_SPOOLJOB
but getting some extra spaces and lines,unable to get right format.
please help me in this issue to prepare internal table like normal internal table with spool id.
Regards
sarathHi ,
Thanks for the reply,
My requirement is like i need to collect all the records from the spool to Internal table and
after that based on one field in the internal table i have to separate error records by deleting sucess records from that internal table(from spool),
for that i have to loop the internal table and need to count the error records, after that download to excel and mail functionalities
required for that .
so please help me in this.
Regards
sarath -
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^ -
Uploading data into internal table
hi all ,
i;m uploading the file using Function module ALSM_EXCEL_TO_INTERNAL_TABLE . problem now is when i given lower cae in excel it is not taking . when i use upper case then it is taking from excel and putting into internal table . now i need to take records from excel even it is lower case . can u pls suggest how to proceed and help . ThanksCALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = pa_f
i_begin_col = co_x " column num shd start take as 1
i_begin_row = co_y "row number shd start take based on the heading in excel sheet
i_end_col = co_n13 "end column is 13 here
i_end_row = co_50000 "endrow is 50000 here
TABLES
intern = ta_file
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc EQ 0.
LOOP AT ta_file INTO wa_file.
AT NEW row.
Clear the work area
CLEAR wa_file.
ENDAT.
Check the Columen numbers and move the file data in to work area of Task.
For Column One
IF wa_file-col = '1'.
MOVE wa_file-value TO wa_ztemp_employee-employeid.
ENDIF.
For Column Two
IF wa_file-col = '2'.
MOVE wa_file-value TO wa_ztemp_employee-employe_name.
ENDIF.
AT END OF row.
The Data Transfer from work area to Internal table
APPEND wa_ztemp_employee TO ta_ztemp_employee.
Clear the work area
CLEAR wa_ztemp_employee.
ENDAT.
ENDLOOP.
ELSE.
MESSAGE e004 DISPLAY LIKE 'I'.
try this code
u will get
Regards
Edited by: Rasheed salman on Nov 28, 2008 6:33 AM -
Char data into internal table.
Hi all,
I will get data from the FTP (.TXT file) through FTP_SERVER_TO_R3.
in chardata with separater Tab delimited.
here i took one field symbol and assigning the data into internal table.
till here every thing is ok.
My problem is one data type is 13 char, if that field is more than 13 char in the file
it is giving DUMP. (DUMP is OVERFLOW Field 999976767878.22)
TYPES : BEGIN OF X_STRING,
LINE(150) TYPE STRING,
END OF X_STRING.
data : IT_STRING TYPE STANDARD TABLE OF X_STRING,
WA_STRING TYPE X_STRING.
FIELD-SYMBOLS : <fs> TYPE ANY.
LOOP AT chardata INTO wa_chardata.
REFRESH it_string.
SPLIT wa_chardataline AT cl_abap_char_utilities=>horizontal_tab INTO TABLE it_string.
LOOP AT it_string INTO wa_string FROM 1 TO 29.
ASSIGN COMPONENT sy-tabix OF STRUCTURE wa_data TO <fs>.
<fs> = wa_string-field1.
UNASSIGN <fs>.
ENDLOOP.
APPEND wa_data TO it_data.
CLEAR wa_data.
ENDLOOP.
Please give me solution to over come this.
Regards,
SriIn Statement ASSIGN COMPONENT sy-tabix OF STRUCTURE wa_data TO <fs>.
insted of using SY-TABIX use the actual field name of the structre wa_data .
Use a RTTS Method to get all the fields of the structre WA_DATA and then loop at all the fields and then manuplate teh that which has been splitted...!
Hope it helps it will not cause any over flow..and ...( Try to condence the The splitted dat use condence addition while moveing the data to wa_data it will avoide the leading and trailing spaces.... )
Edited by: Anup Deshmukh on Jun 17, 2010 8:31 AM -
Extract the classification data into internal table
Hi all,
I having requirement to extract classification data for material number.
1) Provide the selection option for material number (MATNR).
2) Based on the material number, then extract all that data into internal table as below layout. My problem is how to retrieve the following data from different table based on the MATNR (material number).
Please provide the sample code for select the following data. Thanks.
Classification table
OBJEK (from AUSP table)
MAFID (from AUSP table)
KLART (from AUSP table)
CLASS (from KLAH table)
ATWRT (from AUSP table)
MSEHI (from CABN table)
OBTAB (check if class type=002, set it as MARA)
STDCL (from KSSK table)Hi,
if I understand, you´re trying to get information from the classification system for the material. You can use the following code:
DATA: clases LIKE TABLE OF sclass WITH HEADER LINE,
datos LIKE TABLE OF clobjdat WITH HEADER LINE.
CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
EXPORTING
class = 'DESK' "clase a buscar
classtype = '001' "tipo de la clase
features = 'X'
language = sy-langu
object = 'PM00A000C055' "Material
objecttable = 'MARA'
key_date = sy-datum
initial_charact = 'X'
change_service_clf = 'X'
TABLES
t_class = clases
t_objectdata = datos
EXCEPTIONS
no_classification = 1
no_classtypes = 2
invalid_class_type = 3
OTHERS = 4.
loop at datos.
endloop. -
Getting Issue while uploading CSV file into internal table
Hi,
CSV file Data format as below
a b c d e f
2.01E14 29-Sep-08 13:44:19 2.01E14 SELL T+1
actual values of column A is 201000000000000
and columen D is 201000000035690
I am uploading above said CSV file into internal table using
the below coding:
TYPES: BEGIN OF TY_INTERN.
INCLUDE STRUCTURE KCDE_CELLS.
TYPES: END OF TY_INTERN.
CALL FUNCTION 'KCD_CSV_FILE_TO_INTERN_CONVERT'
EXPORTING
I_FILENAME = P_FILE
I_SEPARATOR = ','
TABLES
E_INTERN = T_INTERN
EXCEPTIONS
UPLOAD_CSV = 1
UPLOAD_FILETYPE = 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.
am getting all columns data into internal table,
getting problem is columan A & D. am getting values into internal table for both; 2.01E+14. How to get actual values without modifying the csv file format.
waiting for your reply...
thanks & regards,
abhiHi Saurabh,
Thanks for your reply.
even i can't double click on those columns.
b'se the program needs be executed in background there can lot of csv file in one folder. No manual interaction on those csv files.
regards,
abhi -
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 -
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 -
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. -
Import an open office spreadsheet into internal table
hi all,
i have one requirment to import excel into sap but i dont have MS office on my system
is there any way to import an open office spreadsheet into internal table
by using ALSM_EXCEL_TO_INTERNAL_TABLE fm or any other ways.Hi,
You can use this function module 'ALSM_EXCEL_TO_INTERNAL_TABLE',
It works fine, Here is a sample code hwich I developed and working fine.
FIELD-SYMBOLS: <FS1>.
Variables
DATA: LV_BEGCOL TYPE I VALUE 1,
LV_BEGROW TYPE I VALUE 1,
LV_ENDCOL TYPE I VALUE 100,
LV_ENDROW TYPE I VALUE 32000.
DATA: LV_FILENAME LIKE RLGRAP-FILENAME.
DATA: LV_ZWLEN TYPE I,
LV_ZWLINES TYPE I.
DATA: LV_TIND(4) TYPE N.
DATA: LV_ZWFELD(30).
DATA: KZHEADER TYPE XFELD.
Internal Tables
DATA: BEGIN OF LT_INTERN OCCURS 0.
INCLUDE STRUCTURE ALSMEX_TABLINE.
DATA: END OF LT_INTERN.
DATA: BEGIN OF LT_INTERN1 OCCURS 0.
INCLUDE STRUCTURE ALSMEX_TABLINE.
DATA: END OF LT_INTERN1.
DATA: BEGIN OF LT_COL OCCURS 0,
COL LIKE ALSMEX_TABLINE-COL,
SIZE TYPE I.
DATA: END OF LT_COL.
DATA: BEGIN OF LT_FIELDNAMES OCCURS 3,
TITLE(60),
TABLE(6),
FIELD(10),
KZ(1),
END OF LT_FIELDNAMES.
No of columns
DATA: BEGIN OF LT_DATA_TAB OCCURS 0,
VALUE_0001(50),
VALUE_0002(50),
VALUE_0003(50),
VALUE_0004(50),
VALUE_0005(50),
VALUE_0006(50),
VALUE_0007(50),
VALUE_0008(50),
VALUE_0009(50),
VALUE_0010(50).
DATA: END OF LT_DATA_TAB.
Initialization
LV_FILENAME = P_UFILE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = LV_FILENAME
I_BEGIN_COL = LV_BEGCOL
I_BEGIN_ROW = LV_BEGROW
I_END_COL = LV_ENDCOL
I_END_ROW = LV_ENDROW
TABLES
INTERN = LT_INTERN
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
WRITE:/ 'Uploading Error'(019), SY-SUBRC.
ENDIF.
Arrange Data
LOOP AT LT_INTERN.
LT_INTERN1 = LT_INTERN.
CLEAR LT_INTERN1-ROW.
APPEND LT_INTERN1.
ENDLOOP.
SORT LT_INTERN1 BY COL.
LOOP AT LT_INTERN1.
AT NEW COL.
LT_COL-COL = LT_INTERN1-COL.
APPEND LT_COL.
ENDAT.
LV_ZWLEN = STRLEN( LT_INTERN1-VALUE ).
READ TABLE LT_COL WITH KEY COL = LT_INTERN1-COL.
IF SY-SUBRC EQ 0.
IF LV_ZWLEN > LT_COL-SIZE.
LT_COL-SIZE = LV_ZWLEN.
Internal Table, Current Row Index
MODIFY LT_COL INDEX SY-TABIX.
ENDIF.
ENDIF.
ENDLOOP.
DESCRIBE TABLE LT_COL LINES LV_ZWLINES.
SORT LT_INTERN BY ROW COL.
IF KZHEADER = 'X'.
LOOP AT LT_INTERN.
LT_FIELDNAMES-TITLE = LT_INTERN-VALUE.
APPEND LT_FIELDNAMES.
AT END OF ROW.
EXIT.
ENDAT.
ENDLOOP.
ELSE.
DO LV_ZWLINES TIMES.
WRITE SY-INDEX TO LT_FIELDNAMES-TITLE.
APPEND LT_FIELDNAMES.
ENDDO.
ENDIF.
SORT LT_INTERN BY ROW COL.
LOOP AT LT_INTERN.
IF KZHEADER = 'X'
AND LT_INTERN-ROW = 1.
CONTINUE.
ENDIF.
LV_TIND = LT_INTERN-COL.
CONCATENATE 'LT_DATA_TAB-VALUE_' LV_TIND INTO LV_ZWFELD.
ASSIGN (LV_ZWFELD) TO <FS1>.
<FS1> = LT_INTERN-VALUE.
AT END OF ROW.
APPEND LT_DATA_TAB.
CLEAR LT_DATA_TAB.
ENDAT.
ENDLOOP.
Thanks & Regards,
Dileep .C -
How to transfer data of RFC into Internal Table inside a WD4A program?
Hi Experts,
I have created WD4A program. This program calls RFC. The output of RFC has to populate a UI table. THe different cells of the table should have different color based on data.
I have gone through following link:
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/707fb792-c181-2d10-61bd-ce15d58b5cf1
The above link fetches data from directly from table. Then it passes the data into internal table.
If I am using RFC, then how I can insert data of RFC into a internal table in WD4A program (se80 In drop down Web Dynpro Comp / Intf)
My motto is to have table ouput whose different cells should have different color based on data.
Please help.
Regards,
Gary
Edited by: Jason Lax on Dec 28, 2011 2:52 PM (Fixed broken link)Hi Experts,
I have resolved the issue. I have created WD4A program. This WD4A program calls the RFC.
The RFC has a structure as export parameters called 'RESULT_FINAL'. I have altered the associated type of this table export parameter. I added Component 'Color' of component type 'WDUI_TABLE_CELL_DESIGN'.
In the RFC I have added some code. The code is as below:
loop at it_t1.
select pernr from pa0000 into table it_t2 where pernr = it_t1-pernr and stat2 ='3'
and begda <= sy-datum AND endda >= sy-datum.
if sy-subrc = 0.
result_final-org_unit = result_objec-objid.
result_final-pernr = it_t1-pernr.
result_final-name = it_t1-name.
result_final-color = '02'. append result_final.
endif.
endloop.
The line result_final-color = '02'.
code returns Color.
In the WD4A program, I have changed the Cell Design property of selected table coloumn to Color.
This resolved the issue.
Thanks every one for the reply.
I have added above information for other SDN users.
I am closing this thread,
Regards,
Gary -
How to join THREE different tables into internal table using one select statement .
How to join THREE different tables into internal table using one select statement .
Hi experts,
I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
Scenario:
Database tables:
SPFLI
SFLIGHT
SBOOK.
Table Fields:
SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
SEATSOCC_C SEATSMAX_F SEATSOCC_F
SBOOK - CARRID CONNID CLASS
MY INTERNAL TABLE IS IT_XX.
Your help much appreciated.
Thanks in advance.
Pawan.Hi Pawan,
please check below codes. hope it can help you.
TYPES: BEGIN OF ty_xx,
carrid TYPE spfli-carrid ,
connid TYPE spfli-connid ,
countryfr TYPE spfli-countryfr,
cityfrom TYPE spfli-cityfrom ,
countryto TYPE spfli-countryto,
cityto TYPE spfli-cityto ,
fldate TYPE sflight-fldate ,
seatsmax TYPE sflight-seatsmax ,
seatsocc TYPE sflight-seatsocc ,
seatsmax_b TYPE sflight-seatsmax_b,
seatsocc_b TYPE sflight-seatsocc_b,
seatsmax_f TYPE sflight-seatsmax_f,
seatsocc_f TYPE sflight-seatsocc_f,
class TYPE sbook-class,
END OF ty_xx,
t_xx TYPE STANDARD TABLE OF ty_xx.
DATA: it_xx TYPE t_xx.
SELECT spfli~carrid
spfli~connid
spfli~countryfr
spfli~cityfrom
spfli~countryto
spfli~cityto
sflight~fldate
sflight~seatsmax
sflight~seatsocc
sflight~seatsmax_b
sflight~seatsocc_b
sflight~seatsmax_f
sflight~seatsocc_f
sbook~class
INTO TABLE it_xx
FROM spfli INNER JOIN sflight
ON spfli~carrid = sflight~carrid
AND spfli~connid = sflight~connid
INNER JOIN sbook
ON spfli~carrid = sbook~carrid
AND spfli~connid = sbook~connid.
Thanks,
Yawa
Maybe you are looking for
-
I have problem starting OPS Center services. Ops Center is not coming online as scn/repordb is in the maintenance state. svcadm clear scn/reportdb too doesnt work. Did stop / start of agentadm, proxyadm and satadm server times, but no use. OCDoctor.s
-
XML Parsing with XSL Performance lag
Hi there I should qualify this post by saying I am fairly new to EJB's and have based the below on a Java Working with XML Tutorial I read. I have an EJB which is being developed to parse XML documents with an XSL stylesheet and return HTML for displ
-
we have the table GLPCA with 185GB (2.5 years) the technical settings are that Data class APPL1 Size category 4 we want to move Size category 4 to Size category 9 what is the impact ?? we won performace??
-
Error importing old project into Premiere Elements 11
Trying to import old project backup - that I made a couple of years ago. When importing the Project file, I get the error "The selected file cannot be linked because it's type (video) does not match the original files type (audio and video)." I try
-
EvDRE Question -- Inserting Blank Rows
Hi all, Here's a good question that we've run into a couple of different times with EvDRE: Say you are specifying a Memberset to expand on that will consist of a comma-delimited list like: bas(Accounts_Receivable), Accounts_Receivable, bas(Accounts_