Passing dynamic table to function module
Hi all,
actully i have to pass dynamic internal table from function module.
for that i use syntax
move <dyn_table> to data_tab.
but now my question is that in fm parameters what is the type spec & associated type for data_tab in fm parameters.
regards,
anuj
Hi
Good
Here is a simple example of passing an internal table "itab" to a function module "REUSE_ALV_LIST_DISPALY".
It displays the internal table data into a list format.
data : itab like ztest213 occurs 0 with header line.
tables : ztest213 .
select * from ztest213 into table itab.
loop at itab.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
i_structure_name = 'ztest213'
IS_LAYOUT =
IT_FIELDCAT =
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
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = itab
exceptions
program_error = 1
others = 2
if sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endloop.
Thanks
mrutyun^
Similar Messages
-
Dynamic Table Selection function module
Dear Friends,
We have got critical requirement on Custom BAPI function module :
we have to pass one field name of table and table name : Eg (Matnr and MARC).
we have to get table contents w.r.t field name of table and table : Has to display MARC based on Matnr.
(It is something like we display table contents in SE11 and SE16, Our requirement is to get the data by giving random field name of table and table name ).
My View : Imports Tab of F.M of is static
Tables Tab of F.M could be dynamic....if so how to achieve or any other approach?
Note : Eg1 : Matnr and MARA (Input to F.M) -
> Get MARA contents (Table from F.M)
Eg2 : Matnr and MARC (Input to F.M) -
> Get MARC contents (Table from F.M)
Eg3 : Lifnr and LFA1 (Input to F.M) -
> Get LFA1 contents (Table from F.M)
Eg1 : Ebeln and EKKO (Input to F.M) -
> Get EKKO contents (Table from F.M)
Awaiting for positive and quick views.
Regards
SekharDear Sarcevic,
I have created zfunction module with imports and tables.
I'm able to manage import parameters as dynamical, but tables declaration gives fuzzy.
How do we make tables tab declaration in function module as dynamic? any other views?
Regards
Sekhar -
Structure of Dynamic Table in Function Module
Hi,
I'm trying to find a way to get as OUTPUT a dynamic Table from a Function Module.
I declared a table called T_DATA without a type.
And this table should have a dynamic table back.
The problem that I get the data back but, I only found a data without any field-elements.
The data is there but there's no structure, no table.
Is there any way that I can send the Data in a proper structure?Hi
Try using the following code
type-pools:slis.
data:it_fcat type lvc_t_fcat,
wa_fcat type lvc_s_fcat,
itab type ref to data.
data:it_fcat1 type slis_t_fieldcat_alv,
wa_fcat1 like line of it_fcat1.
data:cl_tab type ref to cl_alv_table_create,
wa_ref type ref to data.
field-symbols:<itab> type table,
<wa> type any,
<comp>.
create object cl_tab.
refresh:it_fcat.
wa_fcat-fieldname = 'NAME'.
wa_fcat-inttype = 'C'.
wa_fcat-intlen = '10'.
wa_fcat1-fieldname = 'NAME'.
wa_fcat1-inttype = 'C'.
wa_fcat1-intlen = '10'.
append wa_fcat to it_fcat.
append wa_fcat1 to it_fcat1.
wa_fcat-fieldname = 'NAME2'.
wa_fcat-datatype = 'CHAR10'.
wa_fcat1-fieldname = 'NAME2'.
wa_fcat1-datatype = 'CHAR10'.
append wa_fcat to it_fcat.
append wa_fcat1 to it_fcat1.
cl_alv_table_create=>create_dynamic_table(
exporting
I_STYLE_TABLE = I_STYLE_TABLE
it_fieldcatalog = it_fcat
I_LENGTH_IN_BYTE = I_LENGTH_IN_BYTE
importing
ep_table = itab
E_STYLE_FNAME = E_STYLE_FNAME
EXCEPTIONS
GENERATE_SUBPOOL_DIR_FULL = 1
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
assign itab->* to <itab>.
create data wa_ref like line of <itab>.
assign wa_ref->* to <wa>.
do.
assign component 'NAME' of structure <wa> to <comp>.
<comp> = 'AA'.
unassign <comp>.
assign component 'NAME2' of structure <wa> to <comp>.
<comp> = 'AB'.
insert <wa> into table <itab>.
exit.
enddo.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = I_STRUCTURE_NAME
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_GRID_TITLE
I_GRID_SETTINGS = I_GRID_SETTINGS
IS_LAYOUT = IS_LAYOUT
it_fieldcat = it_fcat1
IT_EXCLUDING = IT_EXCLUDING
IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS
IT_SORT = IT_SORT
IT_FILTER = IT_FILTER
IS_SEL_HIDE = IS_SEL_HIDE
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = IS_VARIANT
IT_EVENTS = IT_EVENTS
IT_EVENT_EXIT = IT_EVENT_EXIT
IS_PRINT = IS_PRINT
IS_REPREP_ID = IS_REPREP_ID
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS = IT_ALV_GRAPHICS
IT_HYPERLINK = IT_HYPERLINK
IT_ADD_FIELDCAT = IT_ADD_FIELDCAT
IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
IR_SALV_FULLSCREEN_ADAPTER = IR_SALV_FULLSCREEN_ADAPTER
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
tables
t_outtab = <itab>
EXCEPTIONS
PROGRAM_ERROR = 1
Regards -
How to pass Dynamic Table(s) to FM
Hello All i hv an requirement in which i need to process a block of code recursively. right now i am trying to do the same with Subroutine but its hard i know. I have an option to use FM instead but i am not sure if we can pass dynamic tables to FM, so is there anybody who had solution for the same. otherwise i can use it using TOP include to declare dynamic table in comon arae as im calling it from another FM(RFC) but i dont want to use that as it will consume more memory.
So i have 2 question
1. should i use FM instead of subroutine for recursive operation if yes how can know if i reached the maximum alloted size of memory for a program. is there any FM which can tell me about the memory used or somethign like that so that i can avoid any ABAP dump.
2.how can i pass dynamic tables as input to parameters.
Note : i allready seen https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f50dcd4e-0501-0010-3596-b686a7b51492Hello Mani
Perhaps the sample report ZUS_SDN_TABLE_READ_VIA_RFC_XML in thread
How to return back a structure of dynamic tables in a Function Module
might be a useful approach for you.
Regards
Uwe -
Hi,
Tables in function module are only export parameters or import parameter also?
THANKSHello,
Tables in function module are both import and export parameters.
That means you can pass data to Function module through internal table (import parameter) and after
some calculation in the function module you can update the same internal table and this internal table can also be passed to your calling program( export parameter).
Regards
Arindam -
Passing Select-option to Function Module
Hi ,
I want to pass a select-option directly to the function Module tables parameter . Can anyone highlight on how i can declare the table in Function module side .
Thanks & Regards,
RajHi.
In the TABLES tab of the specific FM ,
give the parameter name ( which u have defined as Select options ). Since select options is like an Internal Table with values sign,option,low and high , u can give it here.
Also give the ref. type and type specification.
Pl try this.
Thanks,
Maheshwari.V -
Table for Function modules - Changed date & Changed by.
Hi Experts,
Help me to get Function module changed date & changed by.
For programs we can get the mentained information in TABLE : TADIR.Function Modules change history can be retrieved from table TRDIR.
Function Module stores a program Include in table TRDIR.
The details of the Function Module can be found in Attributes-->general data tab in the Function Module.
You need to pass the Include which correponds the FM.
Hence you can find the Log changes.
Hope this helps.
Regards
Vinayak -
Dynamic Actions with Function Module
Hai all,
I got a problem while doing Dynamic Actions. I want to delete a record from 0105 infotype and it is through dynamic actions using function module. All things going correct but in the database table the entry was not deleted. While debugging it was giving as deleted but actually it is not deleting in database table. I hope u help me out.
Thanks,
Tara.Hai Srimantra,
Thanks for ur response and here iam sending the code where i used the function module. and i called the subroutine from sm30.
I should not use any sql statements or commands to delete the records from database tabels. hope u will help me out.
Thank u,
Tara.
TABLES p0105.
*data: lw_0105 type p0105.
TABLES: pspar.
*& Form HR_INFOTYPE_OPERATION
text
FORM hr_infotype_operation.
DATA: l_it_pa0105 TYPE STANDARD TABLE OF pa0105.
DATA: l_it_p0105 TYPE STANDARD TABLE OF p0105.
DATA: l_p0105 TYPE p0105.
DATA: wa_pa0105 TYPE pa0105.
DATA: l_return TYPE bapireturn1.
break developer.
SELECT SINGLE * FROM pa0105 INTO CORRESPONDING FIELDS OF l_p0105
WHERE pernr EQ p0105-pernr AND
subty EQ p0105-subty AND
begda EQ p0105-begda AND
endda EQ p0105-endda AND
seqnr EQ p0105-seqnr AND
objps EQ p0105-objps AND
sprps EQ p0105-sprps.
CHECK sy-subrc EQ 0.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0105'
number = l_p0105-pernr
subtype = l_p0105-subty
objectid = l_p0105-objps
lockindicator = l_p0105-sprps
validityend = l_p0105-endda
validitybegin = l_p0105-begda
recordnumber = l_p0105-seqnr
record = l_p0105
operation = 'DEL'
TCLAS = 'A'
NOCOMMIT =
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
return = l_return.
KEY =
MESSAGE l_return-message TYPE 'S'.
ENDFORM. "HR_INFOTYPE_OPERATION -
Table or Function module to get Internal order planning and Cost element pl
Dear All,
Table or Function module to get Internal order planning and Cost element planning.
Internal order planning from T-code KO13.
Thanks in advance.
Regards,
Ravi
Edited by: Ravi Chandra on Sep 13, 2011 8:08 AMBPEJ, BPEG, BPEP
-
Vendor-Customer balances in group currency-table/structure/function module?
Hi All,
Which table/structure/function module can be used to get balances for vendors and customers in group currency? We just wnat to extract balances in group currency so FBL1N and FBL5N are not options. Is there any SAP report which can provide these balances for both vendors and customers?
Thanks and regards,
PinkyHi Pinky,
I came across one report S_ALR_87012079 - Transaction Figures: Account Balance, Program RFSRRCUA, which extracts Account Balances of Vendor. Once the report is executed, you can do Currency Translation from one currency to different currencies. In the output screen, in the Top Menu, select 'Settings -> Currency' and you can convert to another currency. I am not sure, if this helps you. If this helps, kindly update your comments here.
Thank you.
Suresh Jayanthi. -
Passing dynamic table name in ADO. net destination
I am new to SSIS and I have a requirement where i need to pass dynamic table name in ADO .net destination .
My package contains an "Execute Sql task" in the control flow which computes the destination table name to be provided at run time and stores it in a variable expression
"@[User::Table_name]"(which has a scope of full package).
Now, the problem I'm facing right now is that , I am unable to use this variable expression in the ADO .Net Destination .
I need to pass this variable expression as the table name in ado .net destination.
But, whenever I use this variable in place as the table name I keep on getting this error and my package fails:-
[ADO NET Destination [403]] Error: The Table or View name is not expected. \n\t If you are quoting the table name, please use the prefix " and the suffix " of your selected data provider for quotation. \n\t If you are using multipart name,
please use at most three parts for the table name.
Although ,I am able to run my package when i am providing the existing(static) table name.So there is nothing wrong with the package.
Tried a lot of things still not working..Please help...I am having the result stored in the variable expression . I just need a way to be able to use it as the Destination table in ADO .net Destination.
I am not sure if this will work for you, but I am able to store the table name in variable and use it dynamically (via data flow task expression property ) as shown.
Thanks, hsbal
Hi Adeep,
Based on my further research, just as hsbal said, we can set a variable as ADO.NET Destination table via Expressions property in Data Flow Task.
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Which table contains function module program name
Hi,
Which table contains function module program name.
Regards,
rajHi,
We have one function module called 'FUNCTION_INCLUDE_INFO'.
Where u ll get the program name to which it belongs to, function group and the include number. (e.g if the function group program name contains 9 function modules and ur function module is in 3rd include then it will return the include name to which it belongs ) -
CRM Tables or Function Module in SAP CRM related Contract Account ot MPAN no.
Hi Team,
Could you please tell me Any table or Function Module in CRM which is related to Contract Accont or MPAN Number( ISU).
My Query is- Just I want to confirm that Data are exist in CRM system on the basis of Contract Account or MPAN Number.
Regards,
ArifHi Mohd,
Table for Contract Account in CRM is Business Agreement Table CRMM_BUAG & CRMM_BUAG_H
To get the BP linkage CRMV_BUAG_ATTR
Regards,
Naresh -
Populate final table in Function module
hi,
please tell me the way to populate the final intenal table in function module, form four of the other tables with the corresponding data. i'd like to know how to move fileds of one table to other with maximum performance, can i user move-corresponding for the same.........hi,
There are two ways to move the data ....
1. You can loop through the table data and move the corresponding field on to your final internal table .
2. You can directly assign the table value ...but remember the stucture of both the tables should be same.
i.e,
itab1[] = itab[].
Regards,
Santosh -
Any docs regarding Table/View,Function Module for Generic Extraction
Hello All
I need to do Generic Extraction,for that if anyone has docs., I need docs on how to create table,view,Function module and infoset query ,on that pl forward to my id
[email protected]
Many Thanks
balajihi Amit
Thanks for your docs,but this docs i have already,do u have any thing different one,if so please forward?
Facing a Problem
Iam trying to create view(database view)for <b>vbak</b> and <b>vbap</b> and given in Tables in <b>Table/Join Conditions</b> tab and clicked in <b>Relationship</b> and the relantionship has been generated automatically,now when i tried to activate this view its saying like "<b>No tables and/or fields are defined for view xxxxx</b>(xxxx-> name of a view)
what will be the problem?pl let me know how to create a view?
And also I need to know the diffference between database view,Manintenance view,Projection view and help view?
Pl let me know on this?
Many Thanks
balaji
Maybe you are looking for
-
Create Personal Documents Folder and iView to display
Hi, I would like to 1. Create an KM Navigation iView to point to a users Fersonal Folder 2. Create an KM Upload iView to upload documents to a users Personal Folder These iviews should point to a users personal folder dynamically based on who is logg
-
How to read a file containing bitmap message in binary format
Dear all, Can anybody tell me how to read bitmap message which stored data in binary format? The messages are stores like this : A file contain some messages along with these bitmaps in square zeroes. I want to again convert it into ASCII.
-
I have a master computer setup as a datasocket server with several vi's that publish. I have about 5 other computers each with a vi that reads the data socket publisher. The interval at which the 5 vi's read is every 15 minutes, concurrently. It seem
-
Where is the best place to see videos and other information about the features in the ipad
I keep hearing about the 200 new features in the IPad 2 where can i find all 200
-
Re:Need link for supported XML elements
Can someone post the official sap link for supported and unsupported elements in xml schema. BP.