How to save value in struture into internal table?
good day to everyone,
i have a prb with my coding below. i am trying to save the value tvbdpr-uecha into wa_zmas-uecha by using modify as shown below.
however, the value uecha is not successfully being transported/saved into it_zmas.
could anyone guide me?
tvbdpr - is a structure table
it_zmas - is an internal table
LOOP AT tvbdpr WHERE posnr = wa_zmas-posnr AND matnr = wa_zmas-matnr.
wa_zmas-uecha = tvbdpr-uecha.
MODIFY TABLE it_zmas FROM wa_zmas TRANSPORTING uecha.
thank you
regards,
sw
Hi,
If the internal table is already having contents and u need to modify it for the field uecha, you can try the following
LOOP AT tvbdpr WHERE posnr = wa_zmas-posnr AND matnr = wa_zmas-matnr.
wa_zmas-uecha = tvbdpr-uecha.
READ TABLE it_zmas with KEY posnr = wa_zmas-posnr matnr = wa_zmas-matnr.
if sy-subrc = 0.
it_zmas-uecha = wa_zmas-uecha.
MODIFY it_zmas index sy-index.
clear it_zmas-uecha.
endif.
ENDLOOP.
Else if the internal table is empty and you are populating the field uecha, use append
LOOP AT tvbdpr WHERE posnr = wa_zmas-posnr AND matnr = wa_zmas-matnr.
wa_zmas-uecha = tvbdpr-uecha.
it_zmas-uecha = wa_zmas-uecha.
append it_zmas.
clear it_zmas.
ENDLOOP.
Regards,
Vik
Similar Messages
-
How to store output of SQ01 into internal table.
Hello Experts
How to store output of SQ01 into internal table.
Thanks,
UmeshYou can't store the sq01 output into internal table.
Once you create the query it will generate the abap program, in that program you can see the contents.
Regards
Sasi -
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 -
Save report painter output into internal table
Hi,
i have created a report painter for vendor aging report. got output in drill down format.
i need to show the data in smartform as well. so need to save the report painter output into an internal table. can anyone please help me resolving this.
regards,
sudha.mHi Sudha
You can use sample below:
DATA: list_tab TYPE TABLE OF ABAPLIST.
SUBMIT NROWS EXPORTING LIST TO MEMORY
AND RETURN VIA SELECTION-SCREEN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = list_tab.
ENDIF.
Best regards -
How to decompose a string with ';' into Internal table
Hello all,
I need your help for find a Function module or Abap code.
I have a file with the separator is the ';'
Example of the contains of my file :
521010;16;46048,00;;*Soucet*Odmena za
524012;41;103807,00;;Zdrav.p.organizace
524012;42;;18332,00;Zdrav.p.organizace
I want a module function which can separate all the String separate by a ';' into a internal table :
for example my internal table have 5 column :
Num......|.....CC.....|............Credit....|...........Debit........|.....Label
521010....|.....16.....|......46048,00.....|...........................|.....Soucet**Odmena za
524012....|.....41.....|......103807,00...|...........................|.....Zdrav.p.organizace
524012....|.....42.....|..........................|........18332,00....|.....Zdrav.p.organizace
For read the date of my file is not a problem with ABAP Code :
DO.
CLEAR : ws_facm.
break epetrini.
READ DATASET myFile INTO test.
IF sy-subrc EQ 0.
IF ws_facm-codenreg = 'D'.
APPEND ws_facm TO wt_facm.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
Thank you for your helps.
Best regards Emilien
Edited by: Emilien P. on Mar 31, 2010 4:30 PM
Edited by: Emilien P. on Mar 31, 2010 4:34 PM
Edited by: Emilien P. on Mar 31, 2010 4:35 PM
Edited by: Emilien P. on Mar 31, 2010 4:36 PMHi,
Try whith this:
DATA: str1 TYPE string,
str2 TYPE string,
str3 TYPE string,
itab TYPE TABLE OF string,
text TYPE string.
text = `What a drag it is getting old`.
SPLIT text AT space INTO: str1 str2 str3,
TABLE itab.
Let me know if it works.
Regards,
Moh. -
How to upload the flat file records into internal table by position?
Hi
I have a flat file which has 7 records in each row and they are NOT provided with CSV or Tab demilited...
They are continous text without spaces....
but i know the fixed length of each field Eg : 1st field 7 char and seconc field 3 char and so on...
How can i upload this file into internal table by reading positions of each field...I know we can use GUI_UPLOAD and Read dataset and Open dataset...
But please let me know to read the file with the fixed postions and load into internal table...
Thanks in advance
MMHi
As per my knowledge i dont think thr is some function module or so to read with a fixed positions.
You can use the below method if you think this is the best way.
Suppose your file has
types : begin of ty_itab,
field1 type char7,
field2 type char3,
field3 type chat3,
field4 type char3,
end of ty_itab.
types : begin of ty_upload,
str type string,
end of ty_upload.
data : it_itab type standatd table of ty_itab,
it_upload type standard table ot ty_upload,
wa_itab type ty_itab,
wa_upload type ty_upload.
use gui_upload.get the data in it_upload.
here you know that u have first 16 charcters makes a first row n then next 16 charcters next row
Loop at it_upload into wa_upload.
v_len = strlen ( wa_upload ).
v_len = v_len / 16.
You get number of rows per record ,if it is decimal value make it final value if 3.9 make to 4.
do v_len times.
wa_itab = wa_upload.
By this only first 16 characters are moved and respective fields will get a value.or else u can use offset
wa_upload+0(16).
append wa_itab to it_itab.
Now shift 16 characters using shift command in wa_upload.
enddo.
endloop.
Hope this syntax help you to resolve your issue.May be something i have missed .Right now i don't have sap system to send you the full correct syntax code.
Cheers
Joginder -
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. -
How to save the form data into adobe db?
Hi All,
How to save the form data into adobe db?
I have designed one xdp file.
Through processFormSubmission(), I got the submitted form data as Document obj.
Then I have called the workflow kickoff program.
code:
InvocationRequest request = myFactory.createInvocationRequest ("myprocessname", //Specify the long-lived process name
"invoke", //Specify the operation name
params, //Specify input values (HashMap obj)
false); //Create an asynchronous request
It successfulyy started the workflow, but the submitted form data is not saved anywhere.
And also, How get the form data from tables?
Please provide the solution for the above.
Thanks in advance.
Regards,
Saravanan GYou need to create a process variable of type IN if you want to be able to pass data to your process. Then the params parameter (HashMap) contains a list of all the IN variables with their content that you want to pass to your process. They key is the name of the variable and the value the content. That way you should get it in your process.
Now LiveCycle will create a column in the database for every process variable, so the content will be saved in the database just by creating that process variable.
Jasmin -
How to transfer excel files(on ftp server) into internal table?
hello,everyone
pls tell me how to transfer excel files those on a ftp server into internal table?
ps.i know the function 'ftp_server_to_r3',it can help to transfer flat file.Hi,
I believe you want to get the data from the FTP Server to R3.
I am also sending the code. Have a look and it would help you.
First get the Password and user name and the FTP Server Path where file is stored and FTP Server Host name
FUNCTION zfi_ftp_get.
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_FILENAME) TYPE C
*" TABLES
*" T_BLOB STRUCTURE ZFI_TLM_LENGTH OPTIONAL " is a table type with a field called line of length 992
*" RETURN STRUCTURE BAPIRET2 OPTIONAL
DATA : i_password(30) TYPE c,
i_user(30) TYPE c,
i_host(30) TYPE c,
i_rfc_destination TYPE rfcdes-rfcdest,
i_length TYPE i,
i_folder_path(100) TYPE c.
DATA: lv_blob_length TYPE i.
DATA: lv_length TYPE i, "Password length
lv_key TYPE i VALUE 26101957,
lv_password(30) TYPE c,
lv_ftp_handle TYPE i,
lv_cmd(80) TYPE c.
DATA: BEGIN OF result OCCURS 0,
line(100) TYPE c,
END OF result.
TYPES: BEGIN OF ty_dummy,
line(392) TYPE c,
END OF ty_dummy.
DATA: lt_dummy TYPE TABLE OF ty_dummy,
ls_dummy LIKE LINE OF lt_dummy.
i_password = 'vnhdh'.
i_user = 'sdkgd'.
i_host = 'sbnksbg'.
i_rfc_destination = 'SAPFTP'.
i_length = '992'.
i_folder_path = '/hioj/hohjk/hh'.
lv_length = STRLEN( i_password ).
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = i_password
sourcelen = lv_length
key = lv_key
IMPORTING
destination = lv_password.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = i_user
password = lv_password
host = i_host
rfc_destination = i_rfc_destination
IMPORTING
handle = lv_ftp_handle
EXCEPTIONS
not_connected = 1
OTHERS = 2.
IF sy-subrc = 1.
return-type = 'E' .
return-message = 'FTP Connection not Successful'.
APPEND return.
ELSEIF sy-subrc = 2.
return-type = 'E' .
return-message = 'FTP Connection not Successful'.
APPEND return.
ELSEIF sy-subrc EQ 0.
return-type = 'S' .
return-message = 'FTP Connection Successful'.
APPEND return.
CONCATENATE 'cd' i_folder_path INTO lv_cmd SEPARATED BY space.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = lv_ftp_handle
command = lv_cmd
TABLES
data = result
EXCEPTIONS
command_error = 1
tcpip_error = 2.
IF sy-subrc = 1.
return-type = 'E' .
return-message = 'Command Error Occured during open of FTP Folder'.
APPEND return.
ELSEIF sy-subrc = 2.
return-type = 'E' .
return-message = 'TCIP Error Occured during open of FTP Folder'.
APPEND return.
ELSE.
REFRESH t_blob.
lv_blob_length = 992.
TRANSLATE i_filename TO LOWER CASE.
CALL FUNCTION 'FTP_SERVER_TO_R3'
EXPORTING
handle = lv_ftp_handle
fname = i_filename
IMPORTING
blob_length = lv_blob_length
TABLES
blob = lt_dummy.
t_blob[] = lt_dummy[].
ENDIF.
ENDIF.
ENDFUNCTION.
Regards
Sajid
Edited by: shaik sajid on Nov 16, 2010 7:25 AM -
How to load text data into internal table
I have a text file to load txt data into internal table. So how to read text data with validation and to load all text data into the internal table?
Say this is the text file:
IO_NAME, IO_TYPE, IO_SHTXT, IO_LONGTEXT, DATATYPE, DATA LENGTH
ZIO_TEST1, CHA, IO TEST1, IO TEST 1, CHAR, 20
ZIO_TEST2, CHA, IO TEST2, IO TEST 2, CHAR, 20
Regards,
MauHi,
U can use GUI_UPLOAD for this...
Declare an internal table like
data: begin of itab occurs 0,
string(1200),
end of itab.
check the sample code:
cange as you need
DATA: DATEI_PC TYPE STRING VALUE 'C:\MATNR.TXT'.
DATA: BEGIN OF ITAB occurs 0,
TXT(1024),
END OF ITAB.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
EXPORTING
FILENAME = DATEI_PC
FILETYPE = 'ASC'
CHANGING
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
NOT_SUPPORTED_BY_GUI = 17
ERROR_NO_GUI = 18
OTHERS = 19.
IF SY-SUBRC NE 0. WRITE: / 'Error in Uploading'. STOP. ENDIF.
WRITE: / 'UPLOAD:'.
LOOP AT ITAB. WRITE: / ITAB-TXT. ENDLOOP. -
How to convert xml file into internal table in ABAP Mapping.
Hi All,
I am trying with ABAP mapping. I have one scenario in which I'm using below xml file as a sender from my FTP server.
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MTO_ABAP_MAPPING xmlns:ns0="http://Capgemini/Mumbai/sarsingh">
<BookingCode>2KY34R</BookingCode>
- <Passenger>
<Name>SARVESH</Name>
<Address>THANE</Address>
</Passenger>
- <Passenger>
<Name>RAJESH</Name>
<Address>POWAI</Address>
</Passenger>
- <Passenger>
<Name>CARRON</Name>
<Address>JUHU</Address>
</Passenger>
- <Flight>
<Date>03/03/07</Date>
<AirlineID>UA</AirlineID>
<FlightNumber>125</FlightNumber>
<From>LAS</From>
<To>SFO</To>
</Flight>
</ns0:MTO_ABAP_MAPPING>
AT the receiver side I wnat to concatenate the NAME & ADDRESS.
I tried Robert Eijpe's weblog (/people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach)
but couldnt succeed to convert the xml file into internal table perfectly.
Can anybody help on this.
Thanks in advance!!
SarveshHi Sarvesh,
The pdf has details of ABAP mapping. The example given almost matches the xml file you want to be converted.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how to use abap-mapping in xi 3.0.pdf
Just in case you have not seen this
regards
Vijaya -
How to save each section report into different excel sheet?
Hi all
How to save each section report into different excel sheet?
I have a report in which there are 4 sections north south west east now i need to save north in excel sheet 1 , south in sheet2, west in sheet3, and east in sheet4. under each section there is list report.
Please let me know is it possible are not if possible let me no the procedure to be followed.
Thank youIf you're running XI 3.1 you might be able to solve this as follows.
1. Create four users: east, west, north, south
2. Create a profile that filters on the variable you used for the section/break
3. Publish the report
3.1 Set users created above to be the enterprise recipients
3.2 Add personalization (the profile created above)
3.3 Check the Deliver objects to each user in Destinations
(3.4 You could use %SI_OWNER% to get a nice suffix to the report name)
This should cause four reports to be created, each with its own "personalized" contents. -
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 -
How to get editable data into internal table
Hi ABAPers,
I am displaying REUSE_ALV_GRID_DISPLAY report with one editable field and i have post button in report. Once i select post button i need to get editable data to internal table which i passed to REUSE_ALV_GRID_DISPLAY.
actually i am writing below code but data is not coming to internal table.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'PF-STATUS'
i_callback_user_command = 'USER_COMMAND '
it_fieldcat = t_field[]
i_default = 'X'
TABLES
t_outtab = <fs_display1>. "t_display
FORM user_command USING g_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
g_test1 = g_ucomm.
CASE g_ucomm.
WHEN 'POST'.
READ TABLE <fs_display1> ASSIGNING <fsw_display1> INDEX 1. "Just for testing index 1
IF sy-subrc = 0.
w_display = <fsw_display1>.
APPEND w_display TO t_display.
CLEAR : w_display.
ENDIF.
PERFORM v1.
PERFORM bapi_call.
ENDCASE.
ENDFORM. "USER_COMMAND
Please help me how to get.
Regards,
Raju.Hi,
Try the following:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'PF-STATUS'
i_callback_user_command = 'USER_COMMAND '
it_fieldcat = t_field[]
i_default = 'X'
TABLES
t_outtab = <fs_display1>. "t_display
FORM user_command USING g_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
g_test1 = g_ucomm.
CASE g_ucomm.
WHEN 'POST'.
* to reflect the data changed into internal table
DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data.
ENDIF.
READ TABLE <fs_display1> ASSIGNING <fsw_display1> INDEX 1. "Just for testing index 1
IF sy-subrc = 0.
w_display = <fsw_display1>.
APPEND w_display TO t_display.
CLEAR : w_display.
ENDIF.
PERFORM v1.
PERFORM bapi_call.
ENDCASE.
ENDFORM. "USER_COMMAND
Hope it helps.
Regards,
Gilberto Li -
How to get data from maintaince view into internal table
Hi,
I want to get the all data from v_t179 (maintanence view) into intrenal table.
if i write select stmt , it is giving error.
I want all data into internal table.
regards,
AjayI think this is what you want:
TABLES: t179, t179t.
DATA: v_t179_int TYPE TABLE OF v_t179.
SELECT * FROM t179
JOIN t179t ON
t179~prodh = t179t~prodh
INTO CORRESPONDING FIELDS OF TABLE v_t179_int.
Rob
Maybe you are looking for
-
Business Folder Upgrade from 11i to R12
Hi, We are upgrading from 11.5.10.2 to R12. In the process, we have to upgrade discoverer folder also. To undergo the change, we are testing one report from 11i to R12. The report has the business folder as po_vendors in 11i, which is taking data fro
-
Getting error while importing the data using loadercli
Hello, I want to copy the data using export/ import via (loadercli). scenario: 1) I have 2 server and i want to export data from old server and import in to new MAXDB server using loadercli. I have done this once and it went fine , but now I want to
-
Dear Experts, I herewith attachedc my codings i waht to add serial number how to do that i have done something but it is giving all zero values.,.,., *& Report ZAPPRAISAL_LAG REPORT ZAPPRAISAL. *Declaration of type-pools TYPE-P
-
Time Machine--"Next backup: When Mac is plugged in"
My wife and I have identical MacBook Airs (2011) with Mavericks. For whatever reason my wife's Time Machine will not back up until it is plugged in to an electrical outlet. When I open Time Machine Preferences, it will say, "Next backup: <future t
-
I have a HP LJ5550dn that has a 13.01.00 error, Jam in tray 1.
I currently have this error continuing even on shut down and back on. I cleaned and replaced all wheels. pulled image transfer unit out and cleaned all dust in and around unit. I pulled out the fuser unit and cleaned all around it. I pulled out tray