Dynamic Lenght of Table in VC
Hi,
Is it possible to make the length of the tables displayed in the VC dynamic as it can be done in webdynpro.?
Also how advisable is it to use VC application as a substitute for a webdynrpo application from point of view of stability and scaling?
Regards,
Aamod.
Hi Aamod,
If you are looking for stability and scaling, then i suggest you go for web dynpro.
And here are two threads for you, very nicely explained in each of the threads the differences between Visual Composer and Web dynpro. The first one is awesome:
When to use Visual Composer
Bye
Ankur
Do reward points if it helps!!
Similar Messages
-
Uploading data from excel file to a dynamically created internal table
Hi,
I have a requirement where i have to upload data from an excel file into a database table. I would be able to determine the structure of the table only at runtime based on the user input.. so i have created an internal table dynamically.
Could you please tell me if its possible to upload data from an excel file to the dynamically created internal table using any function modules?
I thought of doing this by declaring a generic internal table of one field and then uploading the *.csv file into it and then splitting it based on "," and then assigning it to the field symbol referencing the internal table.. but my file length exceeds 132 characters and i'm only able to get data of lenght 132 char's in my internal table ( generic one).
Could anyone please show me a way around this.
Thanks in advance,
HarshaSure, check this out.
report zrich_0002.
type-pools: slis.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: it_fldcat type lvc_t_fcat,
wa_it_fldcat type lvc_s_fcat.
type-pools : abap.
data: new_table type ref to data,
new_line type ref to data.
data: iflat type table of string.
data: xflat type string.
data: irec type table of string with header line.
data: tabix type sy-tabix.
data: file type string.
selection-screen begin of block b1 with frame title text .
parameters: p_file type rlgrap-filename default 'c:Test.csv'.
parameters: p_flds type i.
selection-screen end of block b1.
start-of-selection.
* Add X number of fields to the dynamic itab cataelog
do p_flds times.
clear wa_it_fldcat.
wa_it_fldcat-fieldname = sy-index.
wa_it_fldcat-datatype = 'C'.
wa_it_fldcat-inttype = 'C'.
wa_it_fldcat-intlen = 10.
append wa_it_fldcat to it_fldcat .
enddo.
* Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_fldcat
importing
ep_table = new_table.
assign new_table->* to <dyn_table>.
* Create dynamic work area and assign to FS
create data new_line like line of <dyn_table>.
assign new_line->* to <dyn_wa>.
file = p_file.
call method cl_gui_frontend_services=>gui_upload
exporting
filename = file
changing
data_tab = iflat
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.
loop at iflat into xflat.
clear irec. refresh irec.
split xflat at ',' into table irec.
loop at irec.
tabix = sy-tabix.
assign component tabix of structure <dyn_wa> to <dyn_field>.
<dyn_field> = irec.
endloop.
append <dyn_wa> to <dyn_table>.
endloop.
* Write out data from table.
loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index of structure <dyn_wa> to <dyn_field>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
Regards,
Rich Heilman -
How to dynamically update the Table?
Hi All,
Hope somebody will help me out ot resolve my issue.
In my application, about 10 analog channels data coming in. Out of which two parameter needs to get updated dynamically on the table. (For each Rpm between 500-1000, in steps of 50, have to capture Pressure points & show it on the table.)
I seen there is one method called table method available which helps to set the value of a particular cell specified by corresponding row and column index.
I tried this. In row 0, col 0 & col 1 it put what value I specified by using that table method. when it goes to row 1, col 0 & col 1 also got updated but vanishing the above put row 0, col 0 & col 1 values. so at any point of time, I am able to see only the current row values.
Hope there should be some dynamic refreshing method available or else I dont know how to handle this situation. Pls. clarify.
Thanks,
KousyHi,
Thanks.
But I am not able to update dynamically.
I just done slight changes to your update.vi. Just run Update_1.vi and after update
button is pressed, change the row, col index to see the update. please note
it is not able to update if matrix exceeds 3x4. i.e set row index=3
col index=0; new cell value = 10. it is not updating.. it might because of initialization
of 3x4 matrix values at the start.. ot the way I am trying out is bad?
By using Table method itself I got the solution what I want. I have attached that vi too.
just check out and reply if any flaw..
Thanks,
Kousy
Attachments:
update_1.vi 94 KB
Table Update.vi 96 KB -
How can i dynamically update a table in my program?
Hi there!
I would like to know if anyone can assist me with advice on how to dynamically update
a table within my program, with new values from the database?
Thanking You all.Add rows to its model.
Kind regards,
Levi -
Dynamically changing internal table in 'gui_download'
Hi Experts,
i have to download 4 internal tables, each with different structures, to the presentation server using 'gui_download', based on which radio-button is selected in the selection screen. I am hoping to use a single 'form' and 4 'perform' calls. how can I dynamically change the tables in the 'gui_download' function modules.
plz help.....................Hi ,
Build the field catalog dynamically based on the internal table structure based on the radio button selected.Use the dynamic internal table generated from the filedcatalog and use in GUI_DOWNLOAD.
See the below code:
*& Report ZRAJESH02
REPORT zrajesh02.
Dynamic internal table
TYPE-POOLS: slis.
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa>.
DATA: alv_fldcat TYPE slis_t_fieldcat_alv,
it_fldcat TYPE lvc_t_fcat.
DATA: lv_monate TYPE f,
lv_months TYPE i,
lv_date TYPE sy-datum,
p_check1 type n value '1'.
lv_date = sy-datum + 360.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_check TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = lv_date
i_datum_von = sy-datum
i_kz_incl_bis = ' '
IMPORTING
e_monate = lv_monate.
lv_months = lv_monate.
PERFORM f_fcat USING 'AUFNR' 'CHAR' '12'.
PERFORM f_fcat USING 'POSNR' 'CHAR' '06'.
while p_check1 LE p_check.
PERFORM f_fcat USING p_check1 'CHAR' '1'.
p_check1 = p_check1 + 1.
endwhile.
PERFORM build_dyn_itab.
LOOP AT <dyn_table> INTO <dyn_wa>.
WRITE:/ <dyn_wa>.
ENDLOOP.
FORM f_fcat USING fieldname dattyp length.
DATA:wa_it_fldcat TYPE lvc_s_fcat.
CLEAR wa_it_fldcat.
wa_it_fldcat-fieldname = fieldname.
wa_it_fldcat-datatype = dattyp.
wa_it_fldcat-intlen = length.
APPEND wa_it_fldcat TO it_fldcat .
ENDFORM. "f_fcat
*& Form build_dyn_itab
text
FORM build_dyn_itab.
DATA: new_table TYPE REF TO data,
new_line TYPE REF TO data.
wa_it_fldcat TYPE lvc_s_fcat.
CLEAR wa_it_fldcat.
wa_it_fldcat-fieldname = 'AUFNR'.
wa_it_fldcat-datatype = 'CHAR'.
wa_it_fldcat-intlen = 12.
APPEND wa_it_fldcat TO it_fldcat .
CLEAR wa_it_fldcat.
wa_it_fldcat-fieldname = 'POSNR'.
wa_it_fldcat-datatype = 'CHAR'.
wa_it_fldcat-intlen = 6.
APPEND wa_it_fldcat TO it_fldcat .
Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fldcat
IMPORTING
ep_table = new_table.
ASSIGN new_table->* TO <dyn_table>.
Create dynamic work area and assign to FS
CREATE DATA new_line LIKE LINE OF <dyn_table>.
ASSIGN new_line->* TO <dyn_wa>.
ENDFORM. "build_dyn_itab
Thanks,
Rajesh. -
How to change the images dynamically in a table.
Hai,
How to change the images dynamically in a table based on the condition in webdynpro abap.
Edited by: Ravi.Seela on Oct 13, 2011 2:17 PMThis has been much discussed earlier. Do search posts.
For your scenario i would do the following.
inside your node which is binded to the table, i create a new node image with cardinality 1 ..1 and a attribute called path of type string.
create a supply function for the node image .
Supply method now has a Element (Parent element ) and node.
Based on your record in element, set the right image source to path attribute and bind the node.
This will make sure that the framework calls the image supply function for every row in a table. -
How to create the Dynamic UI element table in web dynpro in abap
Hi All,
Does anybody have reference note or teach me how to create dynamic UI element table in web dynpro in abap ?
Regards,
LukeHI LukeWong ,
for creating any UI dynamically you shoul use their runtime class that always start with cl_wd_* ui element name*
so for the Table UI element the runtime class is CL_WD_TABLE
now reffer the below code for creating the Table UI dynamically
METHOD wddomodifyview.
DATA lr_table TYPE REF TO cl_wd_table.
DATA lr_flow_data TYPE REF TO cl_wd_flow_data.
DATA lr_container TYPE REF TO cl_wd_uielement_container.
DATA lr_column_name TYPE REF TO cl_wd_table_column.
DATA lr_text_view TYPE REF TO cl_wd_text_view.
DATA lr_table_header TYPE REF TO cl_wd_caption.
DATA lr_column_name_header TYPE REF TO cl_wd_caption.
IF first_time EQ abap_true.
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_table = cl_wd_table=>new_table(
id = 'TBL_TABLE'
bind_data_source = 'TABLE'
design = cl_wd_table=>e_design-alternating
visible_row_count = 3
lr_flow_data = cl_wd_flow_data=>new_flow_data( element =
lr_table ).
lr_container->add_child( lr_table ).
lr_column_name = cl_wd_table_column=>new_table_column(
id = 'TBL_EXAMPLE_NAME'
lr_table_header ?= cl_wd_caption=>new_caption( text = 'Table UI elem
ent - example').
lr_table->add_column( the_column = lr_column_name ).
lr_table->set_header( lr_table_header ).
lr_text_view = cl_wd_text_view=>new_text_view(
id = 'TXV_NAME'
bind_text = 'TABLE.NAME'
lr_column_name_header ?= cl_wd_caption=>new_caption( text = 'Name').
lr_column_name->set_table_cell_editor( the_table_cell_editor = lr_text_view).
lr_column_name->set_header( lr_column_name_header ).
ENDIF.
ENDMETHOD.
Regards
Chinnaiya P
Edited by: chinnaiya pandiyan on Sep 17, 2010 12:01 PM -
Dynamic headers in table control
Hi,
How to create dynamic headers in table control headers?
I have to replace the header labels with internally computed headers.
I have created input fields for headers..
Regards,
KrutikaHi Krutika,
Try this out,
Populate an internal tabel with all the dates and day in it and also populate the column position in it.
say you have populated all this in an internal table it_date----fields in the internal table
1. date
2. day
3. spot1 -
column name of the table control(spot1 represents the column position)
then do this ,
LOOP AT it_date INTO wa_date.
LOOP AT SCREEN .
*WHERE screen-name = wa_date-spot.
CASE wa_date-spot.
WHEN 'SPOTS1'.
spots1 = wa_date-dd.
WHEN 'SPOTS2'.
spots2 = wa_date-dd.
WHEN 'SPOTS3'.
spots3 = wa_date-dd.
WHEN 'SPOTS4'.
spots4 = wa_date-dd.
WHEN 'SPOTS5'.
spots5 = wa_date-dd.
WHEN 'SPOTS6'.
spots6 = wa_date-dd.
WHEN 'SPOTS7'.
spots7 = wa_date-dd.
WHEN 'SPOTS8'.
spots8 = wa_date-dd.
WHEN 'SPOTS9'.
spots9 = wa_date-dd.
WHEN 'SPOTS10'.
spots10 = wa_date-dd.
WHEN 'SPOTS11'.
spots11 = wa_date-dd.
WHEN 'SPOTS12'.
spots12 = wa_date-dd.
WHEN 'SPOTS13'.
spots13 = wa_date-dd.
WHEN 'SPOTS14'.
spots14 = wa_date-dd.
WHEN 'SPOTS15'.
spots15 = wa_date-dd.
WHEN 'SPOTS16'.
spots16 = wa_date-dd.
WHEN 'SPOTS17'.
spots17 = wa_date-dd.
WHEN 'SPOTS18'.
spots18 = wa_date-dd.
WHEN 'SPOTS19'.
spots19 = wa_date-dd.
WHEN 'SPOTS20'.
spots20 = wa_date-dd.
WHEN 'SPOTS21'.
spots21 = wa_date-dd.
WHEN 'SPOTS22'.
spots22 = wa_date-dd.
WHEN 'SPOTS23'.
spots23 = wa_date-dd.
WHEN 'SPOTS24'.
spots24 = wa_date-dd.
WHEN 'SPOTS25'.
spots25 = wa_date-dd.
WHEN 'SPOTS26'.
spots26 = wa_date-dd.
WHEN 'SPOTS27'.
spots27 = wa_date-dd.
WHEN 'SPOTS28'.
spots28 = wa_date-dd.
WHEN 'SPOTS29'.
spots29 = wa_date-dd.
WHEN 'SPOTS30'.
spots30 = wa_date-dd.
WHEN 'SPOTS31'.
spots31 = wa_date-dd.
ENDCASE.
Hope this helps you,
Regards,
Abhijit G. Borkar -
Dynamic extending of table control in bdc
hi frnds
I want an example of dynamic extension of table control i.e
for example:In xk01 there is table control with bank details.
i have to upload upto 10 bank details of a record. I have searched in forum.I got the hint of 'p+' but i cant understand that.so please send me sample code
Thanks
RaghavHai,
Chech this sample code.
Check the below link.
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
THis is example to upload the Bank details of the Vendor which has the TC.
REPORT zprataptable2
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA : BEGIN OF itab OCCURS 0,
i1 TYPE i,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
anred LIKE lfa1-anred,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
END OF itab.
DATA : BEGIN OF jtab OCCURS 0,
j1 TYPE i,
banks LIKE lfbk-banks,
bankl LIKE lfbk-bankl,
bankn LIKE lfbk-bankn,
END OF jtab.
DATA : cnt(4) TYPE n.
DATA : fdt(20) TYPE c.
DATA : c TYPE i.
INCLUDE bdcrecx1.
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\first1.txt'
filetype = 'DAT'
TABLES
data_tab = itab.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\second.txt'
filetype = 'DAT'
TABLES
data_tab = jtab.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02K-LIFNR'
itab-lifnr.
PERFORM bdc_field USING 'RF02K-BUKRS'
itab-bukrs.
PERFORM bdc_field USING 'RF02K-EKORG'
itab-ekorg.
PERFORM bdc_field USING 'RF02K-KTOKK'
itab-ktokk.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-LAND1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFA1-ANRED'
itab-anred.
PERFORM bdc_field USING 'LFA1-NAME1'
itab-name1.
PERFORM bdc_field USING 'LFA1-SORTL'
itab-sortl.
PERFORM bdc_field USING 'LFA1-LAND1'
itab-land1.
PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-KUNNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
cnt = 0.
LOOP AT jtab WHERE j1 = itab-i1.
cnt = cnt + 1.
CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-banks.
CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankl.
CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankn.
IF cnt = 5.
cnt = 0.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-FDGRV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFB1-AKONT'
itab-akont.
PERFORM bdc_field USING 'LFB1-FDGRV'
itab-fdgrv.
PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-ZTERM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB5-MAHNA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFM1-WAERS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFM1-WAERS'
itab-waers.
PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_transaction USING 'XK01'.
ENDLOOP.
PERFORM close_group.
Header file:
1 63190 0001 0001 0001 mr bal188 b in 31000 a1 inr
2 63191 0001 0001 0001 mr bal189 b in 31000 a1 inr
TC file:
1 in sb 11000
1 in sb 12000
1 in sb 13000
1 in sb 14000
1 in sb 15000
1 in sb 16000
1 in sb 17000
1 in sb 18000
1 in sb 19000
1 in sb 20000
1 in sb 21000
1 in sb 22000
2 in sb 21000
2 in sb 22000
REPORT zmm_pr_upload_mat
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_pr OCCURS 0,
Header Screen
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
lpein(001), " Category of Del Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
Item Details
matnr(018), " Material No
menge(017), " Quantity
badat(010),
frgdt(010),
preis(014), " Valuation Price
waers(005), " Currency
peinh(005),
wepos(001),
repos(001),
sakto(010), " GL Account
kostl(010), " Cost Center
bnfpo(005),
END OF i_pr.
Internal Table for header Data
DATA: BEGIN OF it_header OCCURS 0,
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
END OF it_header.
Internal Table for Item Data
DATA: BEGIN OF it_item OCCURS 0,
sno(3), " SNo
matnr(018), " Material No
menge(017), " Quantity
preis(014), " Valuation Price
sakto(010), " GL Account
kostl(010), " Cost Center
END OF it_item.
Data Variables & Constants
CONSTANTS : c_x VALUE 'X'. " Flag
DATA : v_l(2), " Counter
v_rowno(5), " Row No
v_2(2), " Counter
v_rows LIKE sy-srows, " Rows in TC
v_field(45). " String
Parameters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_pr
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT i_pr BY sno.
LOOP AT i_pr.
MOVE-CORRESPONDING i_pr TO it_item.
APPEND it_item.
CLEAR it_item.
AT END OF sno.
READ TABLE i_pr INDEX sy-tabix.
MOVE-CORRESPONDING i_pr TO it_header.
APPEND it_header.
CLEAR it_header.
ENDAT.
ENDLOOP.
SORT it_header BY sno.
SORT it_item BY sno.
v_rows = sy-srows - 6.
Upload the Data from Internal Table
LOOP AT it_header.
Header Data
PERFORM bdc_dynpro USING 'SAPMM06B' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-BEDNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-BSART'
it_header-bsart.
PERFORM bdc_field USING 'RM06B-EPSTP'
it_header-epstp.
PERFORM bdc_field USING 'EBAN-KNTTP'
it_header-knttp.
PERFORM bdc_field USING 'RM06B-EEIND'
it_header-eeind.
PERFORM bdc_field USING 'RM06B-LPEIN'
it_header-lpein.
PERFORM bdc_field USING 'EBAN-WERKS'
it_header-werks.
PERFORM bdc_field USING 'EBAN-LGORT'
it_header-lgort.
PERFORM bdc_field USING 'EBAN-EKGRP'
it_header-ekgrp.
PERFORM bdc_field USING 'EBAN-MATKL'
it_header-matkl.
PERFORM bdc_field USING 'EBAN-BEDNR'
it_header-bednr.
PERFORM bdc_field USING 'EBAN-AFNAM'
it_header-afnam.
Item Details
v_l = 0.
To add no. of rows
v_2 = 0 .
As the screen is showing 13 rows defaulted to 130
v_rowno = 130 .
LOOP AT it_item WHERE sno = it_header-sno.
v_l = v_l + 1.
IF v_l = 14 .
IF v_2 = 12 .
v_2 = 12 .
v_l = 2 .
From second time onwards it is displaying 12 rows only
v_rowno = v_rowno + 120 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ELSE.
V_2 initialized to 12 for second screen purpose
v_2 = 12 .
v_l = 2 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno .
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.
ENDIF.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CLEAR v_field.
CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-matnr.
CLEAR v_field.
CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-menge.
PERFORM bdc_dynpro USING 'SAPMM06B' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-PREIS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-PREIS'
it_item-preis.
PERFORM bdc_dynpro USING 'SAPMM06B' '0505'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBKN-SAKTO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'EBKN-SAKTO'
it_item-sakto.
Cost Center
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_CURSOR'
'COBL-KOSTL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'COBL-KOSTL'
it_item-kostl.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
Call The Transaction
PERFORM bdc_transaction USING 'ME51'.
ENDLOOP.
Close the BDC Session
PERFORM close_group.
with regards.
sowjanya.b. -
Hi All,
I am using Oracle 8i. I have created a dynamic PL/SQL table in my procedure. Now i need to select rows and sort the data in that PL/SQL table. How do i do it? I
I appreciate any help on this.
Thanks,
VijiSQL> select count(1) from emp;
COUNT(1)
14
SQL> create or replace type emp_row is OBJECT
2 (
3 EMPNO NUMBER(4),
4 ENAME VARCHAR2(10),
5 JOB VARCHAR2(9),
6 MGR NUMBER(4),
7 HIREDATE DATE,
8 SAL NUMBER(7,2),
9 COMM NUMBER(7,2),
10 DEPTNO NUMBER(2)
11* )
SQL> /
Type created.
SQL> set serveroutput on
SQL> declare type emp_table is table of emp_row index by binary_integer;
2 plsql_tab emp_table;
3 rec_num number;
4 begin
5 select emp_row(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO)
6 BULK COLLECT into plsql_tab
7 from scott.emp;
8 select count(1) into rec_num
9 from scott.emp;
10 DBMS_OUTPUT.PUT_LINE(rec_num||' records in SCOTT.EMP');
11 DBMS_OUTPUT.PUT_LINE(plsql_tab.count||' records in plsql_table');
12 end;
13 /
14 records in SCOTT.EMP
14 records in plsql_table
PL/SQL procedure successfully completed. -
Hi
Is it possible to create a dynamic selection of tables in the 'from' clause.
Thanks in advanceHi,
Thanks for the reply.
I have two tables. Currently in our existing production system we have two different procedures for example say, P1 and P2. These procedures have the same logic except that the data is retrieved from two different tables.
I felt that if there is a possibility to select data from the tables dynamically then i could just use one common procedure and pass the tables as parameters to that.
To make it more clear, please see the following.
I have two tables , say T1, T2.
I have two procedures P1, P2 in one package.
P1 procedure
Procedure P1 is
cnt number := 0;
Begin
select count(*) into cnt from T1;
if cnt = 0 then
IF GVAR.T1_RecordNbr <= '1' -- GVAR is Global Variable package
THEN
IF NAME_IN('T1.col_name') IS NULL
THEN
display_msg('Error');
END IF;
end if;
end if;
end;
[\pre]
P2 procedure
[pre]
Procedure P2 is
cnt number := 0;
Begin
select count(*) into cnt from T2;
if cnt = 0 then
IF GVAR.T2_RecordNbr <= '1'
THEN
IF NAME_IN('T2.col_name') IS NULL
THEN
display_msg('Error');
END IF;
end if;
end if;
end;
[\pre]
Now I want to write only one procedure and just change the table names dynamically. Could you please suggest. -
Populating values in dynamically generated internal table
Hi,
We can generate internal tables dynamically and also populate them with values from database.But is there any way to populate the dynamically generated internal table(has 2-3 selected fields) with values from another internal table(has all fields required by the program) being populated within the same program?
Thanks & Regards,
SavithaHi
Dynamic internal table is internal table that we create on the fly with flexible column numbers.
For sample code, please look at this code tutorial. Hopefully it can help you
Check this link:
http://www.****************/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm
Reward points if useful
Regards
Anji -
Appending column to an dynamically created internal table
Hi folks,
i have an dynamically created internal table <dyn_tab> which is based on a parameter p_table ( containing the table name ). now i want to add one more column to this <dyn_tab> table where i can store further information in. how can i do that ?
i appreciate your help!Hi,
Please check this sample program.
type-pools : abap.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: dy_table type ref to data,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
selection-screen begin of block b1 with frame.
parameters: p_table(30) type c default 'T001'.
selection-screen end of block b1.
start-of-selection.
perform get_structure.
perform create_dynamic_itab.
form get_structure.
data : idetails type abap_compdescr_tab,
xdetails type abap_compdescr.
data : ref_table_des type ref to cl_abap_structdescr.
* Get the structure of the table.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_table_des->components[].
loop at idetails into xdetails.
clear xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
append xfc to ifc.
endloop.
*Add your new field(s) into table ifc here.
endform.
form create_dynamic_itab.
* Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = ifc
importing
ep_table = dy_table.
assign dy_table->* to <dyn_table>.
* Create dynamic work area and assign to FS
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
endform.
Regards,
Ferry Lianto -
Dynamically sourcing a table from 2 tables in obiee 11g
Hello,
I am a rookie trying to learn OBIEE and I really need your help in creating rpd from the Oracle_Bi_Sample_app.
It has 2 tables Time_mth and Time_day.
How can I source those 2 tables dynamically into one table as a single logical table in the physical layer itself?
Also it is suggested to create that table in physical layer itself right? And should it exist as a separate table / view or ALias?
Please help.
Thanks
SaiHow can I source those 2 tables dynamically into one table as a single logical table in the physical layer itself?
You have to do it in BMM layer by adding these two as LTS to one Logical table..
Also it is suggested to create that table in physical layer itself right? And should it exist as a separate table / view or ALias?
Best way is to import the physical tables once and create as many Alias tables as much depends on your Requirement.. -
Dynamic Filter a Table using BI
Hi All
I need to be able to dynamically filter a table, VC can not do this, but is it possible to do it using BI?
Jarrod WilliamsHi,
Using the Filter info-actor, it is not possible to use it dynamically.
But as previously said, you can use the result of query as an input variable for the next query.
JH
Maybe you are looking for
-
Database structure documentation tool
I have been asked to include the database structure of our application in the help. It doesn't look as though there is a tool within RH that will do this but I thought it was worth asking in case it's hidden away somewhere. If not, there are plenty o
-
Close blackberry browser session
Hi, We have a WD Java application for blackberry thats being launched from within the extended notification email. Once the user approves / rejects from within the application we want to provide them with a close or exit link which would close the br
-
Changing the IDOC control header.... again!
Hi. In the EDI_DC40, I would like to populate the ARCKEY field, but know it is not possible, since it's overwritten with the Message GUID (even though the "Apply Control Record Values from Payload" is checked). Are there anyway to force this field to
-
Time differences between ical and iphone
When syncing ical to iphone i have a time difference of 9 hours. (dates on the iphone are always 9 hours earlier) No matter on which device the entry was made. Time zone is set to Berlin, Germany on my iphone as well as on my G5. Same thing is happen
-
Intermediate time in calculation field in BAM11g
I have two field in my data object receivedtime and endtime.Is there any way to get intermediate time in calculation field?